Closed stustd closed 1 month ago
Could you please share a minimal example of a problematic .lf file so we can reproduce the problem?
Could you please share a minimal example of a problematic .lf file so we can reproduce the problem?
A minimal example (lf_CCpp_parsing.lf):
target CCpp
preamble {=
// comment this out and `lfc` will compile
const char* a = R"(
Hello
)";
=}
main reactor lf_CCpp_parsing {}
Hope this helps.
I fixed it in https://github.com/lf-lang/lingua-franca/pull/2385. I expect there are more corner cases that we're not handling correctly, but the root of the problem is that we're parsing what's in between {=
=}
delimiters at all. We shouldn't, but Xtext isn't quite flexible enough for our needs, and our workaround has its limitations...
"We shouldn't, but ..." Indeed, there's no reason for it. Thanks for the fix. And let me use the occasion to express my respect and gratitude for the impressive LF technology!
Thanks, @stustd. And please keep the bug reports coming!
I might have a potential problem with
lfc
parsing C++ code in the CCpp target. In a method I have the following C++ snippet using raw string syntax:Compiling with
lfc
returns the error:A stripped problem version, i.e.
makes me believe that
lfc
has problems parsing multiline raw strings .... So I'm not sure if this anlfc
parser orc++
compiler error (I'm using gnu g++-12)?