diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-09-13 23:33:14 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-09-13 23:33:14 +0200 |
| commit | 8cc075c6a736fdde56ca2da03a868821695765f4 (patch) | |
| tree | 2dd14d3bc47e5bf00e612a0d792f5e33f2c7a81b /boot/parser.yy | |
| parent | 38a24d57067b657cde572f92210c5719091c88ff (diff) | |
| download | elna-8cc075c6a736fdde56ca2da03a868821695765f4.tar.gz | |
Add threadvar section for thread-local variables
Diffstat (limited to 'boot/parser.yy')
| -rw-r--r-- | boot/parser.yy | 11 |
1 files changed, 11 insertions, 0 deletions
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" @@ -191,6 +192,16 @@ module_declaration: $$.insert($$.end(), variables.begin(), variables.end()); } + | "threadvar" variable_declarations + { + std::vector<boot::variable_declaration *> 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); } module_declarations: %empty {} |
