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:
@@ -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