Skip to content

Commit d5b392d

Browse files
fix: variables values (#14)
Don't use `_value` for variable values
1 parent 27af9b7 commit d5b392d

File tree

5 files changed

+1495
-1260
lines changed

5 files changed

+1495
-1260
lines changed

grammar.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ module.exports = grammar({
2121
)
2222
),
2323

24-
declaration: ($) => seq($.variable, "=", $._value, $._linebreak),
24+
declaration: ($) =>
25+
seq(
26+
$.variable,
27+
"=",
28+
choice($.mod, $.number, $.string_literal),
29+
$._linebreak
30+
),
2531

2632
assignment: ($) => seq($.name, "=", optional($._value), $._linebreak),
2733

@@ -96,6 +102,8 @@ module.exports = grammar({
96102

97103
string: () => token(prec(-1, /[^\n,#]+|.*##.*/)),
98104

105+
string_literal: () => token(prec(-1, /[^\n#]+|.*##.*/)),
106+
99107
params: ($) =>
100108
prec(-1, seq($._value, repeat(seq(",", optional($._value))))),
101109

src/grammar.json

Lines changed: 26 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/node-types.json

Lines changed: 5 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)