Skip to content

Commit

Permalink
parser: allow constants inside include
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbz64 committed Apr 15, 2024
1 parent 5d4edc3 commit 8e6ad7b
Show file tree
Hide file tree
Showing 4 changed files with 73,398 additions and 73,147 deletions.
8 changes: 7 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,13 @@ module.exports = grammar({
$.constant
),
include: ($) =>
seq("{", $.file_name, optional(repeat($.include_argument)), "}"),
seq(
"{",
repeat($.constant),
$.file_name,
optional(repeat($.include_argument)),
"}"
),

/// Primitives
primitive_type: ($) =>
Expand Down
7 changes: 7 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,13 @@
"type": "STRING",
"value": "{"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "constant"
}
},
{
"type": "SYMBOL",
"name": "file_name"
Expand Down
4 changes: 4 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,10 @@
"multiple": true,
"required": true,
"types": [
{
"type": "constant",
"named": true
},
{
"type": "file_name",
"named": true
Expand Down
Loading

0 comments on commit 8e6ad7b

Please sign in to comment.