mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
inline assembly supports %= syntax
it outputs a number that is unique to each instance of the asm statement in the entire compilation. useful when creating local labels and referring to them multiple times in a single template that generates multiple assembler instructions
This commit is contained in:
1 parent
b840184bb0
commit
64a0510205
3 files changed
+18
-3
No files matched your search
@@ -136,6 +136,10 @@ static void parse_asm_template(ParseContext *pc, AstNode *node) {
|
||||
} else if (c == '[') {
|
||||
cur_tok->id = AsmTokenIdVar;
|
||||
state = StateVar;
|
||||
} else if (c == '=') {
|
||||
cur_tok->id = AsmTokenIdUniqueId;
|
||||
cur_tok->end = i;
|
||||
state = StateStart;
|
||||
} else {
|
||||
ast_asm_error(pc, node, i, "expected a '%%' or '['");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user