cppfront
cppfront copied to clipboard
A personal experimental C++ Syntax 2 -> Syntax 1 compiler
How do you forward a non-last-use argument? It has to be done when destructuring aggregates. std::apply does this variadically. ```cpp #include void g(auto&& x); struct pair_t { std::string x, y;...
Hi, I am very interested in this project's future! Cppfront fails to compile this code ```cpp main: () -> int = { a: int = 2; pa: *int = a&;...
The current implementation does not have an overload for the `is` function to handle `enums`. The below code compiles by cppfront but the result code fails to compile with the...
Out of curiosity I have an implemented an [alternative parser](https://github.com/neumannt/cppfront-exp) for cppfront / cpp2, which uses a [PEG grammar](https://github.com/neumannt/cppfront-exp/blob/master/src/parser/cpp2.peg) as input for a parser generator. During that experiment, I noticed...
On slide 74 in https://github.com/CppCon/CppCon2022/blob/main/Presentations/CppCon-2022-Sutter.pdf we have the example of initialization safety by naming the return values already in the definition ``` f:() -> (i: int, s: std::string) = {...
While implementing semantic analysis I noticed a conceptual problem with the order-independence approach of cpp2. Consider this code here: ``` foo: (x : int = bar()) -> int = {...
The current implementation is not supporting enums in inspect expressions. This cpp2 code ```cpp enum class lexeme : std::uint8_t { hash, }; to_string: (e:lexeme) -> auto = { return inspect...
Using capture and if failed if done in some order. In this cpp2 code cppfront fail on `if i$ + n < std::ssize(line$)`: ```cpp lex_process_line: (line: std::string) = { i...
Current implementation in mixed mode is not parsing raw string literals well. Cpp2 source code ```cpp auto r = R"( this is raw string literal \n /* */ // i:...
The current implementation removes parentheses used in expression that calculates the value of arguments for a function. cpp2 code: ```cpp f: (x:_) = {} main: () -> int = {...