Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/dparse/parser.d
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,8 @@ class Parser
* | $(RULE register : AsmExp)
* | $(RULE identifierChain)
* | $(LITERAL '$')
* | $(LITERAL 'this')
* | $(LITERAL '__LOCAL_SIZE')
* ;)
*/
AsmPrimaryExp parseAsmPrimaryExp()
Expand All @@ -748,6 +750,7 @@ class Parser
foreach (NL; NumberLiterals) {case NL:}
case tok!"stringLiteral":
case tok!"$":
case tok!"this":
node.token = advance();
break;
case tok!"identifier":
Expand All @@ -765,7 +768,7 @@ class Parser
mixin(parseNodeQ!(`node.identifierChain`, `IdentifierChain`));
break;
default:
error("Float literal, integer literal, `$`, or identifier expected.");
error("Float literal, integer literal, `$`, `this` or identifier expected.");
return null;
}
node.tokens = tokens[startIndex .. index];
Expand Down
3 changes: 3 additions & 0 deletions test/pass_files/asm.d
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,8 @@ void doStuff()
align 4 ;
LABEL: ;
;

mov EAX, this;
mov ECX, __LOCAL_SIZE;
}
}