Skip to content

Commit

Permalink
fix: variables values (#14)
Browse files Browse the repository at this point in the history
Don't use `_value` for variable values
  • Loading branch information
luckasRanarison committed Mar 25, 2024
1 parent 27af9b7 commit d5b392d
Show file tree
Hide file tree
Showing 5 changed files with 1,495 additions and 1,260 deletions.
10 changes: 9 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ module.exports = grammar({
)
),

declaration: ($) => seq($.variable, "=", $._value, $._linebreak),
declaration: ($) =>
seq(
$.variable,
"=",
choice($.mod, $.number, $.string_literal),
$._linebreak
),

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

Expand Down Expand Up @@ -96,6 +102,8 @@ module.exports = grammar({

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

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

params: ($) =>
prec(-1, seq($._value, repeat(seq(",", optional($._value))))),

Expand Down
28 changes: 26 additions & 2 deletions src/grammar.json

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

26 changes: 5 additions & 21 deletions 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 d5b392d

Please sign in to comment.