Skip to content

Commit

Permalink
Added (bad) instruction support
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinKennedy committed Oct 21, 2023
1 parent 39fcc08 commit f002f63
Show file tree
Hide file tree
Showing 7 changed files with 601 additions and 485 deletions.
7 changes: 6 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ module.exports = grammar(
$._whitespace_no_newline,
seq(
/\s*/,
choice($._instruction_and_comment, $._instruction_and_location),
choice(
$._instruction_and_comment,
$._instruction_and_location,
$.bad_instruction,
),
)
),
),
Expand All @@ -91,6 +95,7 @@ module.exports = grammar(
)
),
instruction: $ => /[^\n#<]+/,
bad_instruction: $ => "(bad)",

comment: $ => seq(
"#",
Expand Down
1 change: 1 addition & 0 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

(file_path) @string.special
(instruction) @function
(bad_instruction) @text.warning
(label) @label

["<" ">"] @punctuation.special
Expand Down
8 changes: 8 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@
{
"type": "SYMBOL",
"name": "_instruction_and_location"
},
{
"type": "SYMBOL",
"name": "bad_instruction"
}
]
}
Expand Down Expand Up @@ -273,6 +277,10 @@
"type": "PATTERN",
"value": "[^\\n#<]+"
},
"bad_instruction": {
"type": "STRING",
"value": "(bad)"
},
"comment": {
"type": "SEQ",
"members": [
Expand Down
8 changes: 8 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@
"type": "address",
"named": true
},
{
"type": "bad_instruction",
"named": true
},
{
"type": "code_location",
"named": true
Expand Down Expand Up @@ -315,6 +319,10 @@
"type": "address",
"named": true
},
{
"type": "bad_instruction",
"named": true
},
{
"type": "byte",
"named": true
Expand Down
Loading

0 comments on commit f002f63

Please sign in to comment.