Skip to content

Commit

Permalink
Fixed PASM instructions marker
Browse files Browse the repository at this point in the history
  • Loading branch information
maccasoft committed Jun 18, 2023
1 parent 806e6a8 commit c5aa5cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,9 @@ public void visitDataLine(DataLineNode node) {
tokens.add(new TokenMarker(node.condition, TokenId.PASM_CONDITION));
}
if (node.instruction != null) {
TokenId id = keywords.get(node.instruction.getText());
if (id == null || id != TokenId.TYPE) {
if (Spin1Model.isPAsmInstruction(node.instruction.getText())) {
id = TokenId.PASM_INSTRUCTION;
}
if (Spin1Model.isPAsmInstruction(node.instruction.getText())) {
tokens.add(new TokenMarker(node.instruction, TokenId.PASM_INSTRUCTION));
}
tokens.add(new TokenMarker(node.instruction, id));
}
if (node.modifier != null) {
tokens.add(new TokenMarker(node.modifier, TokenId.PASM_MODIFIER));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -849,31 +849,22 @@ public void visitDataLine(DataLineNode node) {
tokens.add(new TokenMarker(node.label, TokenId.PASM_LOCAL_LABEL));
}
else {
TokenId id = symbols.get(s);
if (id == null) {
symbols.put(s, TokenId.PASM_LABEL);
symbols.put("@" + s, TokenId.PASM_LABEL);
symbols.put("@@" + s, TokenId.PASM_LABEL);
tokens.add(new TokenMarker(node.label, TokenId.PASM_LABEL));
}
symbols.put(s, TokenId.PASM_LABEL);
symbols.put("@" + s, TokenId.PASM_LABEL);
symbols.put("@@" + s, TokenId.PASM_LABEL);
tokens.add(new TokenMarker(node.label, TokenId.PASM_LABEL));
lastLabel = s;
}
}
if (node.condition != null) {
tokens.add(new TokenMarker(node.condition, TokenId.PASM_CONDITION));
}
if (node.instruction != null) {
TokenId id = keywords.get(node.instruction.getText().toUpperCase());
if (id == null || id != TokenId.TYPE) {
if (Spin2Model.isPAsmInstruction(node.instruction.getText())) {
id = TokenId.PASM_INSTRUCTION;
}
}
if ("debug".equalsIgnoreCase(node.instruction.getText())) {
id = TokenId.KEYWORD;
if (Spin2Model.isPAsmInstruction(node.instruction.getText())) {
tokens.add(new TokenMarker(node.instruction, TokenId.PASM_INSTRUCTION));
}
tokens.add(new TokenMarker(node.instruction, id));
if ("debug".equalsIgnoreCase(node.instruction.getText())) {
else if ("debug".equalsIgnoreCase(node.instruction.getText())) {
tokens.add(new TokenMarker(node.instruction, TokenId.KEYWORD));
for (int i = 1; i < node.getTokens().size(); i++) {
Token token = node.getToken(i);
if (token.type == Token.NUMBER) {
Expand All @@ -886,7 +877,7 @@ else if (token.type == Token.STRING) {
tokens.add(new TokenMarker(token, TokenId.STRING));
}
else {
id = debugKeywords.get(token.getText().toUpperCase());
TokenId id = debugKeywords.get(token.getText().toUpperCase());
if (id != null) {
tokens.add(new TokenMarker(token, id));
}
Expand Down

0 comments on commit c5aa5cf

Please sign in to comment.