This commit is contained in:
mhoffm
2021-06-08 00:12:25 +02:00
parent fdb45d9ddd
commit 06cff26e7a
3 changed files with 250 additions and 250 deletions

View File

@@ -41,6 +41,12 @@ module.exports = grammar({
'}',
),
// TODO: not to spec, but maybe good enough
identifier: $ => token(seq(
unicodeLetter,
repeat(choice(unicodeLetter, unicodeDigit, unicodePunctuation))
)),
expression: $ => choice(
$.expr_term,
//$.operation,
@@ -113,12 +119,6 @@ module.exports = grammar({
// TODO: string_literals are special template literals
string_lit: $ => seq('"', /\w+/, '"'),
// TODO: not to spec, but maybe good enough
identifier: $ => token(seq(
unicodeLetter,
repeat(choice(unicodeLetter, unicodeDigit, unicodePunctuation))
)),
// http://stackoverflow.com/questions/13014947/regex-to-match-a-c-style-multiline-comment/36328890#36328890
comment: $ => token(choice(
seq('#', /.*/),