Skip to content

Commit

Permalink
fix use of names in expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoohey31 committed Apr 12, 2024
1 parent 81978cd commit 0e9695a
Show file tree
Hide file tree
Showing 6 changed files with 19,825 additions and 13,549 deletions.
9 changes: 5 additions & 4 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ module.exports = grammar({
$.exp,
),
seq($.exp, "?", $.exp, ":", $.exp),
seq(choice("DEFINED", "CONSTANT"), "(", $.NAME, ")"),
seq(choice("DEFINED", "CONSTANT"), "(", $.SYMBOLNAME, ")"),
$.INT,
"SIZEOF_HEADERS",
seq(
Expand All @@ -273,9 +273,9 @@ module.exports = grammar({
$.exp,
")",
),
seq("SEGMENT_START", "(", $.NAME, ",", $.exp, ")"),
$.NAME,
seq("ASSERT", "(", $.exp, ",", $.NAME, ")"),
seq("SEGMENT_START", "(", $.SYMBOLNAME, ",", $.exp, ")"),
$.SYMBOLNAME,
seq("ASSERT", "(", $.exp, ",", $.SYMBOLNAME, ")"),
),
),
memspec_at: ($) => seq("AT", ">", $.NAME),
Expand Down Expand Up @@ -416,6 +416,7 @@ module.exports = grammar({
),
NAME: (_) =>
/=?[_a-zA-Z/.\\$~][_a-zA-Z0-9/.\\$~\-+:\[\],=]*|[_a-zA-Z.\\$][_a-zA-Z0-9/.\\$~]*|\/DISCARD\/|"[^"]*"/,
SYMBOLNAME: (_) => /[_a-zA-Z.\\$][_a-zA-Z0-9/.\\$~]*|\/DISCARD\/|"[^"]*"/,
LNAME: (_) => /-l[_a-zA-Z0-9/.\\$~\-+:\[\],=]+/,
wildcard_name: (_) => /[_a-zA-Z0-9/.\\$~\-+:\[\],=?*^!]+/,
INT: (_) =>
Expand Down
2 changes: 1 addition & 1 deletion queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.
(NAME) @namespace)

(NAME) @variable
[(NAME) (SYMBOLNAME)] @variable

; Operators

Expand Down
12 changes: 8 additions & 4 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0e9695a

Please sign in to comment.