Skip to content

Commit

Permalink
fix: allow preproc define without value to preceed a line with whites…
Browse files Browse the repository at this point in the history
…pace at start
  • Loading branch information
benjaminBrownlee committed Jul 10, 2023
1 parent 84bdf40 commit bb74560
Show file tree
Hide file tree
Showing 4 changed files with 4,273 additions and 4,385 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ module.exports = grammar({
...preprocIf('_in_field_declaration_list', $ => $._field_declaration_list_item),

preproc_directive: _ => /#[ \t]*[a-zA-Z]\w*/,
preproc_arg: _ => token(prec(-1, repeat1(/.|\\\r?\n/))),
preproc_arg: _ => token(prec(-1, /\S(.|\\\r?\n)*/)),

_preproc_expression: $ => choice(
$.identifier,
Expand Down
7 changes: 2 additions & 5 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -792,11 +792,8 @@
"type": "PREC",
"value": -1,
"content": {
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": ".|\\\\\\r?\\n"
}
"type": "PATTERN",
"value": "\\S(.|\\\\\\r?\\n)*"
}
}
},
Expand Down
Loading

0 comments on commit bb74560

Please sign in to comment.