|
|
|
|
@ -103,8 +103,10 @@ module.exports = grammar({
|
|
|
|
|
|
|
|
|
|
rules: {
|
|
|
|
|
// TopStats ::= TopStat {semi TopStat}
|
|
|
|
|
compilation_unit: $ =>
|
|
|
|
|
compilation_unit: $ => seq(
|
|
|
|
|
optional($._shebang),
|
|
|
|
|
optional(trailingSep1($._semicolon, $._top_level_definition)),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
_top_level_definition: $ =>
|
|
|
|
|
choice(
|
|
|
|
|
@ -1712,6 +1714,8 @@ module.exports = grammar({
|
|
|
|
|
repeat1($.guard),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
_shebang: $ => alias(token(seq("#!", /.*/)), $.comment),
|
|
|
|
|
|
|
|
|
|
comment: $ => seq(token("//"), choice($.using_directive, $._comment_text)),
|
|
|
|
|
_comment_text: $ => token(prec(PREC.comment, /.*/)),
|
|
|
|
|
|
|
|
|
|
|