feat(furc): add compound statement

This one: { [statement]... }
This commit is contained in:
2026-06-01 17:23:00 +02:00
parent 55f4435670
commit 7caaaac4a0
10 changed files with 63 additions and 6 deletions
+16 -2
View File
@@ -6,7 +6,21 @@
#include <iostream>
int main(void) {
furc::front::parser parser("<TEMP>", "func main() {\n if (1) return 7 + 6 * 10; else return 0;\n}");
std::string programStr = R"(
func main() {
x = 5;
x -= 3;
if (x < 3) {
y = x * 2;
w = y;
} else {
y = x - 3;
}
w = x - y;
z = x + y;
}
)";
furc::front::parser parser("<TEMP>", programStr);
furc::front::ir_generator generator;
auto program = parser.parse();
@@ -31,4 +45,4 @@ int main(void) {
return 0;
}
#endif // LIBFURC
#endif // LIBFURC