add ellipsis token

This commit is contained in:
mhoffm
2021-06-11 23:57:34 +02:00
parent 1b32606141
commit 94b188039a
6 changed files with 210 additions and 114 deletions

View File

@@ -136,7 +136,7 @@ module.exports = grammar({
$.expression,
'=>',
$.expression,
optional('...'),
optional($.ellipsis),
optional($.for_cond),
'}',
),
@@ -164,9 +164,11 @@ module.exports = grammar({
function_arguments: $ => seq(
$.expression,
repeat(seq(',', $.expression)),
optional(choice(',', '...'))
optional(choice(',', $.ellipsis))
),
ellipsis: $ => token('...'),
// http://stackoverflow.com/questions/13014947/regex-to-match-a-c-style-multiline-comment/36328890#36328890
comment: $ => token(choice(
seq('#', /.*/),