cppfront
cppfront copied to clipboard
A personal experimental C++ Syntax 2 -> Syntax 1 compiler
On the stdio example there is a call to c-function: ```cpp myfile := fopen("xyzzy", "w"); myfile.fprintf( "Hello with UFCS!" ); myfile.fclose(); ``` This is great but we can do better...
Parens disappear when used inside function call to calculate value of argument. Given cpp2 code: ```cpp f: (x:_) = {} main: () -> int = { i := 2; f((i+(i+1)*2)/2);...
I have been playing with UFCS. I found that it doesn't support method chaining yet. So I have added it. Former implementation was not supporting the method chaining - the...
I am sure the code in https://github.com/hsutter/cppfront/blob/fd0c99d253da3f11dab3027af88cd32b4f27f608/include/cpp2util.h#L539-L543 should cast to a pointer rather than to a reference: ```cpp return dynamic_cast(x) != nullptr; ```
I want to use namespaces in the cpp2. Do you have any plan for syntax that will be used for it? I know that the code is identified as cpp2...
Raw pointers are fundamentally problematic if we have to do pointer arithmetic or offset based access. A major source for pointers, that we inherited from C, are strings. There are...
I know that namespaces are not supported yet by cppfront. Unfortunately, it can be added following the l-to-r approach, it compiles by cppfront but fails to compile by cpp1 compiler....
Cppfront recognized a line as a cpp2 line but it is in the middle of a raw string literal. Cpp2 code: ```cpp auto a = R"( i:int = 42; )";...
The initialization safety guarantee informs that the global variable is a local variable and that it needs to be initialized before the local variable in the function. ```cpp i :...
The local variables can be initialized by external functions that take `out` argument. `cpp2::deferred_init` treat it as violation of initialization safety and reports error: ``` error: local variable i is...