Skip to content

Commit

Permalink
Made it possible to end a variable name in inline asm with )...
Browse files Browse the repository at this point in the history
  • Loading branch information
FlatAssembler committed Feb 16, 2023
1 parent 5979b14 commit b914a35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,8 @@ AssemblyCode TreeNode::compile(CompilationContext context) const {
not(areWeInsideAComment)) {
variableName = "";
areWeInsideAVariableName = true;
} else if (areWeInsideAVariableName and std::isspace(currentCharacter)) {
} else if (areWeInsideAVariableName and
(std::isspace(currentCharacter) or currentCharacter == ')')) {
areWeInsideAVariableName = false;
TreeNode nodeRepresentingPointer(variableName, lineNumber,
columnNumber);
Expand All @@ -873,6 +874,7 @@ AssemblyCode TreeNode::compile(CompilationContext context) const {
// pointer to an array into inline assembly?
adjustedInlineAssembly +=
nodeRepresentingPointer.compileAPointer(context) + "\n";
adjustedInlineAssembly += currentCharacter;
} else if (areWeInsideAVariableName and currentCharacter == '%') {
adjustedInlineAssembly += "%";
areWeInsideAVariableName = false;
Expand Down

0 comments on commit b914a35

Please sign in to comment.