Skip to content

Commit

Permalink
Handle nested groups with string concatenation
Browse files Browse the repository at this point in the history
Closes #22
  • Loading branch information
Beaglefoot committed Sep 4, 2024
1 parent ba74721 commit 16fd79b
Show file tree
Hide file tree
Showing 6 changed files with 57,902 additions and 57,958 deletions.
1 change: 1 addition & 0 deletions grammar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ declare interface IExternals {
concatenating_space: ($: IExternals) => any;
_if_else_separator: ($: IExternals) => any;
_no_space: ($: IExternals) => any;
_func_call: ($: IExternals) => any;
}

declare interface IRules {
Expand Down
4 changes: 3 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = grammar({

extras: $ => [/[\s\t]/, '\\\n', '\\\r\n'],

externals: $ => [$.concatenating_space, $._if_else_separator, $._no_space],
externals: $ => [$.concatenating_space, $._if_else_separator, $._no_space, $._func_call],

precedences: $ => [
[
Expand Down Expand Up @@ -447,6 +447,8 @@ module.exports = grammar({
func_call: $ =>
seq(
field('name', choice($.identifier, $.ns_qualified_name)),
// Otherwise $.concatenating_space takes precedence
$._func_call,
token.immediate('('),
optional($.args),
')'
Expand Down
8 changes: 8 additions & 0 deletions src/grammar.json

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

Loading

0 comments on commit 16fd79b

Please sign in to comment.