From 8cc075c6a736fdde56ca2da03a868821695765f4 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 13 Sep 2026 23:33:14 +0200 Subject: Add threadvar section for thread-local variables --- boot/parser.yy | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'boot/parser.yy') diff --git a/boot/parser.yy b/boot/parser.yy index 68af60e..ab386fe 100644 --- a/boot/parser.yy +++ b/boot/parser.yy @@ -100,6 +100,7 @@ along with GCC; see the file COPYING3. If not see NIL "nil" CONST "const" VAR "var" + THREADVAR "threadvar" PROCEDURE "proc" TYPE "type" RECORD "record" @@ -189,6 +190,16 @@ module_declaration: { std::vector variables = $2; + $$.insert($$.end(), variables.begin(), variables.end()); + } + | "threadvar" variable_declarations + { + std::vector variables = $2; + + for (boot::variable_declaration *const variable : variables) + { + variable->is_thread_local = true; + } $$.insert($$.end(), variables.begin(), variables.end()); } | procedure_declaration { $$.emplace_back($1); } -- cgit v1.2.3