lectures.alex.balgavy.eu

Lecture notes from university.
git clone git://git.alex.balgavy.eu/lectures.alex.balgavy.eu.git
Log | Files | Refs | Submodules

JavaScript.sublime-syntax (69443B)


      1 %YAML 1.2
      2 ---
      3 # Derived from JavaScript Next: https://github.com/Benvie/JavaScriptNext.tmLanguage
      4 version: 2
      5 name: JavaScript
      6 file_extensions:
      7   - js
      8   - mjs
      9   - htc
     10 first_line_match: ^#!\s*/.*\b(node|js)\b
     11 scope: source.js
     12 variables:
     13   bin_digit: '[01_]'
     14   oct_digit: '[0-7_]'
     15   dec_digit: '[0-9_]'
     16   hex_digit: '[\h_]'
     17   dec_integer: (?:0|[1-9]{{dec_digit}}*)
     18   dec_exponent: '[Ee](?:[-+]|(?![-+])){{dec_digit}}*'
     19 
     20   identifier_escape: (?:\\u(?:\h{4}|\{\h+\}))
     21   identifier_start: (?:[_$\p{L}\p{Nl}]|{{identifier_escape}})
     22   identifier_part: (?:[_$\p{L}\p{Nl}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]|{{identifier_escape}})
     23   identifier_break: (?!{{identifier_part}})
     24 
     25   identifier_name: (?:{{identifier_start}}{{identifier_part}}*{{identifier_break}})
     26   constant_identifier: (?:[[:upper:]]{{identifier_part}}*{{identifier_break}})
     27   dollar_only_identifier: (?:\${{identifier_break}})
     28   dollar_identifier: '(?:(\$){{identifier_part}}*{{identifier_break}})'
     29 
     30   block_comment_contents: (?:(?:[^*]|\*(?!/))*)
     31   block_comment: (?:/\*{{block_comment_contents}}\*/)
     32   nothing: (?x:(?:\s+|{{block_comment}})*)
     33   line_ending_ahead: (?={{nothing}}(?:/\*{{block_comment_contents}})?$)
     34 
     35   # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar
     36   reserved_word: |-
     37     (?x:
     38       break|case|catch|class|const|continue|debugger|default|delete|do|else|
     39       export|extends|finally|for|function|if|import|in|instanceof|new|return|
     40       super|switch|this|throw|try|typeof|var|void|while|with|yield|
     41       enum|
     42       null|true|false
     43     ){{identifier_break}}
     44 
     45   non_reserved_identifier: (?:(?!{{reserved_word}}){{identifier_name}})
     46 
     47   either_func_lookahead: (?:{{func_lookahead}}|{{arrow_func_lookahead}})
     48   binding_pattern_lookahead: (?:{{identifier_name}}|\[|\{)
     49   left_expression_end_lookahead: (?!\s*[.\[\(])
     50 
     51   dot_accessor: (?:\??\.)
     52 
     53   property_name: >-
     54     (?x:
     55       {{identifier_name}}
     56       | [0-9]+
     57       | '(?:[^\\']|\\.)*'
     58       | "(?:[^\\"]|\\.)*"
     59       | \[ .* \]
     60     )
     61 
     62   class_element_name: |-
     63     (?x:
     64       {{property_name}}
     65       | \#{{identifier_name}}
     66     )
     67 
     68   modifier: (?:static{{identifier_break}})
     69 
     70   # Newline not permitted between `async` and `function`.
     71   func_lookahead: |-
     72     (?x:
     73       (?:async{{identifier_break}}{{nothing}})?
     74       function{{identifier_break}}
     75     )
     76 
     77   arrow_func_lookahead: |-
     78     (?x:
     79       (?:async\s*)?
     80       (?:
     81         {{identifier_name}}
     82         | \( ( [^()] | \( [^()]* \) )* \)
     83       )
     84       \s*
     85       =>
     86     )
     87 
     88   line_continuation_lookahead: >-
     89     (?x:(?=
     90       (?! \+\+ | -- )
     91       (?=
     92         != |
     93         [-+*/%><=&|^\[(;,.:?] |
     94         (?:in|instanceof){{identifier_break}}
     95       )
     96     ))
     97 
     98   function_call_lookahead: (?={{identifier_name}}\s*(?:{{dot_accessor}})?\()
     99 
    100   function_assignment_lookahead: |-
    101     (?x:(?=
    102       \s* = \s*
    103       {{either_func_lookahead}}
    104     ))
    105 
    106   # '@' followed by a pattern like \S but excluding literal '*' and '@'.
    107   jsdoc_block_tag: \@[^\n\t\f\v *@]+
    108 
    109 contexts:
    110   main:
    111     - include: comments-top-level
    112 
    113     - match: '\)|\}|\]'
    114       scope: invalid.illegal.stray-bracket-end.js
    115       # Don't pop or embedding could break.
    116 
    117     - include: statements
    118 
    119   prototype:
    120     - include: comments
    121 
    122   comments:
    123     - match: /\*\*(?!/)
    124       scope: punctuation.definition.comment.begin.js
    125       push:
    126         - jsdoc-comment
    127         - jsdoc-block-tag
    128     - match: /\*
    129       scope: punctuation.definition.comment.begin.js
    130       push:
    131         - meta_include_prototype: false
    132         - meta_scope: comment.block.js
    133         - match: \*/
    134           scope: punctuation.definition.comment.end.js
    135           pop: true
    136     - match: //
    137       scope: punctuation.definition.comment.js
    138       push:
    139         - meta_include_prototype: false
    140         - meta_scope: comment.line.double-slash.js
    141         - match: \n
    142           pop: true
    143 
    144   jsdoc-comment:
    145     - meta_include_prototype: false
    146     - meta_scope: comment.block.documentation.js
    147     - match: \*/
    148       scope: punctuation.definition.comment.end.js
    149       pop: 1
    150     # JSDoc "block" tags (i.e. @param) are only accepted at the beginning of the documentation
    151     # line so directly after the '/**' or after the '*' marker on the next lines.
    152     - match: ^\s*(\*)(?!/)
    153       captures:
    154         1: punctuation.definition.comment.js
    155       push: jsdoc-block-tag
    156 
    157   jsdoc-block-tag:
    158     - match: '{{jsdoc_block_tag}}'
    159       scope: entity.other.attribute-name.documentation.js
    160       pop: 1
    161     - match: (?=\S)|$
    162       pop: 1
    163 
    164   comments-top-level:
    165     - match: ^(#!).*$\n?
    166       scope: comment.line.shebang.js
    167       captures:
    168         1: punctuation.definition.comment.js
    169 
    170   else-pop:
    171     - match: (?=\S)
    172       pop: true
    173 
    174   immediately-pop:
    175     - match: ''
    176       pop: true
    177 
    178   immediately-pop-2:
    179     - meta_include_prototype: false
    180     - match: ''
    181       pop: 2
    182 
    183   comma-separator:
    184     - match: ','
    185       scope: punctuation.separator.comma.js
    186 
    187   import-statement-or-import-meta:
    188     - match: (?=import{{identifier_break}})
    189       branch_point: import-statement
    190       branch:
    191         - import-statement
    192         - expression-statement
    193 
    194   import-statement:
    195     - match: import{{identifier_break}}
    196       scope: keyword.control.import-export.js
    197       set:
    198         - import-meta
    199         - expect-semicolon
    200         - import-string-or-items
    201         - import-check-branch
    202 
    203   import-check-branch:
    204     - match: (?=[.(]) # Recovery for import expressions
    205       fail: import-statement
    206     - include: else-pop
    207 
    208   export-statement:
    209     - match: export{{identifier_break}}
    210       scope: keyword.control.import-export.js
    211       set:
    212         - export-meta
    213         - export-extended
    214 
    215   import-meta:
    216     - meta_include_prototype: false
    217     - meta_scope: meta.import.js
    218     - include: immediately-pop
    219 
    220   import-export-alias:
    221     - match: as{{identifier_break}}
    222       scope: keyword.control.import-export.js
    223       set:
    224         - match: default{{identifier_break}}
    225           scope: keyword.control.import-export.js
    226           pop: true
    227         - match: '{{identifier_name}}'
    228           scope: variable.other.readwrite.js
    229           pop: true
    230         - include: else-pop
    231     - include: else-pop
    232 
    233   import-export-from:
    234     - match: 'from{{identifier_break}}'
    235       scope: keyword.control.import-export.js
    236       set: literal-string
    237     - include: else-pop
    238 
    239   import-string-or-items:
    240     - include: literal-string
    241     - match: (?=\S)
    242       set:
    243         - import-export-from
    244         - import-list
    245         - import-export-alias
    246         - import-item
    247 
    248   import-list:
    249     - match: ','
    250       scope: punctuation.separator.comma.js
    251       push:
    252         - import-export-alias
    253         - import-item
    254     - include: else-pop
    255 
    256   import-item:
    257     - match: '\{'
    258       scope: punctuation.section.block.begin.js
    259       set: import-brace
    260     - match: '{{non_reserved_identifier}}'
    261       scope: variable.other.readwrite.js
    262       pop: true
    263     - match: '\*'
    264       scope: constant.other.js
    265       pop: true
    266     - include: else-pop
    267 
    268   import-brace:
    269     - meta_scope: meta.block.js
    270     - include: comma-separator
    271     - match: '\}'
    272       scope: punctuation.section.block.end.js
    273       pop: true
    274     - match: '{{identifier_name}}'
    275       scope: variable.other.readwrite.js
    276       push: import-export-alias
    277     - match: '\*'
    278       scope: constant.other.js
    279       push: import-export-alias
    280     - include: else-pop
    281 
    282   export-meta:
    283     - meta_include_prototype: false
    284     - meta_scope: meta.export.js
    285     - include: immediately-pop
    286 
    287   export-extended:
    288     - include: variable-declaration
    289     - include: class
    290     - include: regular-function
    291 
    292     - match: 'default{{identifier_break}}'
    293       scope: keyword.control.import-export.js
    294       set:
    295         - include: class
    296         - include: regular-function
    297         - match: (?=\S)
    298           set: expression-statement
    299 
    300     - match: (?=\S)
    301       set:
    302         - expect-semicolon
    303         - import-export-from
    304         - export-list
    305         - import-export-alias
    306         - export-item
    307 
    308   export-list:
    309     - match: ','
    310       scope: punctuation.separator.comma.js
    311       push:
    312         - import-export-alias
    313         - export-item
    314     - include: else-pop
    315 
    316   export-item:
    317     - match: '\{'
    318       scope: punctuation.section.block.begin.js
    319       set: export-brace
    320     - match: '{{non_reserved_identifier}}'
    321       scope: variable.other.readwrite.js
    322       pop: true
    323     - match: '\*'
    324       scope: constant.other.js
    325       pop: true
    326     - include: else-pop
    327 
    328   export-brace:
    329     - meta_scope: meta.block.js
    330     - include: comma-separator
    331     - match: '\}'
    332       scope: punctuation.section.block.end.js
    333       pop: true
    334     - match: '{{identifier_name}}'
    335       scope: variable.other.readwrite.js
    336       push: import-export-alias
    337     - match: '\*'
    338       scope: constant.other.js
    339       push: import-export-alias
    340     - include: else-pop
    341 
    342   statements:
    343     - match: '\)|\}|\]'
    344       scope: invalid.illegal.stray-bracket-end.js
    345       pop: true
    346 
    347     - match: (?=\S)
    348       push: statement
    349 
    350   statement:
    351     - match: \;
    352       scope: punctuation.terminator.statement.empty.js
    353       pop: true
    354 
    355     - include: import-statement-or-import-meta
    356     - include: export-statement
    357     - include: conditional
    358     - include: block
    359     - include: label
    360     - include: variable-declaration
    361 
    362     - match: break{{identifier_break}}
    363       scope: keyword.control.flow.break.js
    364       set:
    365         - expect-semicolon
    366         - expect-label
    367 
    368     - match: continue{{identifier_break}}
    369       scope: keyword.control.flow.continue.js
    370       set:
    371         - expect-semicolon
    372         - expect-label
    373 
    374     - match: debugger{{identifier_break}}
    375       scope: keyword.control.flow.debugger.js
    376       set: expect-semicolon
    377 
    378     - match: return{{identifier_break}}
    379       scope: keyword.control.flow.return.js
    380       set: restricted-production
    381 
    382     - match: throw{{identifier_break}}
    383       scope: keyword.control.flow.throw.js
    384       set: restricted-production
    385 
    386     - include: class
    387     - include: regular-function
    388 
    389     - include: decorator
    390 
    391     - include: expression-statement
    392 
    393   expect-semicolon:
    394     - match: \;
    395       scope: punctuation.terminator.statement.js
    396       pop: true
    397     - include: else-pop
    398 
    399   expect-label:
    400     - meta_include_prototype: false
    401     - match: '(?={{nothing}}{{identifier_name}})'
    402       set:
    403         - match: '{{non_reserved_identifier}}'
    404           scope: variable.label.js
    405           pop: true
    406         - match: '{{identifier_name}}'
    407           scope: invalid.illegal.identifier.js variable.label.js
    408           pop: true
    409         - include: else-pop
    410     - include: immediately-pop
    411 
    412   block:
    413     - match: '\{'
    414       scope: punctuation.section.block.begin.js
    415       set:
    416         - meta_scope: meta.block.js
    417         - match: '\}'
    418           scope: punctuation.section.block.end.js
    419           pop: true
    420         - include: statements
    421 
    422   variable-binding-pattern:
    423     - include: variable-binding-name
    424     - include: variable-binding-array-destructuring
    425     - include: variable-binding-object-destructuring
    426     - include: else-pop
    427 
    428   variable-binding-name:
    429     - match: (?={{non_reserved_identifier}})
    430       set:
    431         - - meta_scope: meta.binding.name.js
    432           - include: immediately-pop
    433         - literal-variable
    434 
    435   variable-binding-array-destructuring:
    436     - match: '\['
    437       scope: punctuation.section.brackets.begin.js
    438       set:
    439         - meta_scope: meta.binding.destructuring.sequence.js
    440         - match: '\]'
    441           scope: punctuation.section.brackets.end.js
    442           pop: true
    443         - include: variable-binding-spread
    444         - include: variable-binding-list
    445 
    446   variable-binding-object-destructuring:
    447     - match: '\{'
    448       scope: punctuation.section.block.begin.js
    449       set:
    450         - meta_scope: meta.binding.destructuring.mapping.js
    451         - match: '\}'
    452           scope: punctuation.section.block.end.js
    453           pop: true
    454         - include: variable-binding-spread
    455         - match: (?={{identifier_start}}|\[|'|")
    456           push:
    457             - initializer
    458             - variable-binding-object-alias
    459             - object-literal-meta-key
    460             - variable-binding-object-key
    461         - include: comma-separator
    462 
    463   variable-binding-object-alias:
    464     - match: ':'
    465       scope: punctuation.separator.key-value.js
    466       set: variable-binding-pattern
    467     - include: else-pop
    468 
    469   variable-binding-object-key:
    470     - match: '{{identifier_name}}(?=\s*:)'
    471       pop: true
    472     - include: literal-string
    473     - include: computed-property-name
    474     - include: variable-binding-name
    475     - include: else-pop
    476 
    477   variable-binding-spread:
    478     - match: '\.\.\.'
    479       scope: keyword.operator.spread.js
    480       push: variable-binding-pattern
    481 
    482   variable-binding-list:
    483     - include: comma-separator
    484     - match: (?={{binding_pattern_lookahead}})
    485       push:
    486         - initializer
    487         - variable-binding-pattern
    488     - include: else-pop
    489 
    490   variable-binding-top:
    491     - match: (?={{binding_pattern_lookahead}})
    492       set:
    493         - initializer
    494         - variable-binding-pattern
    495     - include: else-pop
    496 
    497   variable-binding-list-top:
    498     - match: '{{line_ending_ahead}}'
    499       set:
    500         - match: '{{line_continuation_lookahead}}'
    501           set: variable-binding-top
    502         - include: else-pop
    503     - match: ','
    504       scope: punctuation.separator.comma.js
    505       push: variable-binding-top
    506     - include: else-pop
    507 
    508   variable-declaration:
    509     - match: (?:const|let|var){{identifier_break}}
    510       scope: keyword.declaration.js
    511       set:
    512         - expect-semicolon
    513         - variable-binding-list-top
    514         - variable-binding-top
    515 
    516   function-parameter-binding-pattern:
    517     - include: function-parameter-binding-name
    518     - include: function-parameter-binding-array-destructuring
    519     - include: function-parameter-binding-object-destructuring
    520     - include: else-pop
    521 
    522   function-parameter-binding-name:
    523     - match: '{{non_reserved_identifier}}'
    524       scope: meta.binding.name.js variable.parameter.function.js
    525     - match: '{{identifier_name}}'
    526       scope: invalid.illegal.identifier.js meta.binding.name.js variable.parameter.function.js
    527 
    528   function-parameter-binding-array-destructuring:
    529     - match: '\['
    530       scope: punctuation.section.brackets.begin.js
    531       set:
    532         - meta_scope: meta.binding.destructuring.sequence.js
    533         - match: '\]'
    534           scope: punctuation.section.brackets.end.js
    535           pop: true
    536         - include: function-parameter-binding-list
    537 
    538   function-parameter-binding-object-destructuring:
    539     - match: '\{'
    540       scope: punctuation.section.block.begin.js
    541       set:
    542         - meta_scope: meta.binding.destructuring.mapping.js
    543         - match: ','
    544           scope: punctuation.separator.parameter.function.js
    545         - match: '\}'
    546           scope: punctuation.section.block.end.js
    547           pop: true
    548         - include: function-parameter-binding-spread
    549         - match: (?={{identifier_start}}|\[|'|")
    550           push:
    551             - initializer
    552             - function-parameter-binding-object-alias
    553             - object-literal-meta-key
    554             - function-parameter-binding-object-key
    555 
    556   function-parameter-binding-object-alias:
    557     - match: ':'
    558       scope: punctuation.separator.key-value.js
    559       set: function-parameter-binding-pattern
    560     - include: else-pop
    561 
    562   function-parameter-binding-object-key:
    563     - match: '{{identifier_name}}(?=\s*:)'
    564       pop: true
    565     - include: literal-string
    566     - include: computed-property-name
    567     - include: function-parameter-binding-name
    568     - include: else-pop
    569 
    570   function-parameter-binding-spread:
    571     - match: '\.\.\.'
    572       scope: keyword.operator.spread.js
    573       push: function-parameter
    574 
    575   function-parameter-binding-list:
    576     - match: ','
    577       scope: punctuation.separator.parameter.function.js
    578     - include: function-parameter-binding-spread
    579     - match: (?={{binding_pattern_lookahead}})
    580       push: function-parameter
    581     - include: else-pop
    582 
    583   function-parameter:
    584     - match: ''
    585       set:
    586         - initializer
    587         - function-parameter-binding-pattern
    588 
    589   initializer:
    590     - match: '='
    591       scope: keyword.operator.assignment.js
    592       set: expression-no-comma
    593     - include: else-pop
    594 
    595   expression-statement:
    596     - match: (?=\S)
    597       set:
    598         - expect-semicolon
    599         - expression-statement-end
    600         - expression-begin
    601 
    602   expression-statement-end:
    603     - match: '{{line_ending_ahead}}'
    604       set:
    605         - match: '{{line_continuation_lookahead}}'
    606           set: expression-statement-end
    607         - include: else-pop
    608     - include: expression-end
    609 
    610   restricted-production:
    611     - meta_include_prototype: false
    612     - match: '{{line_ending_ahead}}'
    613       pop: true
    614     - match: ''
    615       set: expression-statement
    616 
    617   expect-case-colon:
    618     - match: ':'
    619       scope: punctuation.separator.js
    620       pop: true
    621     - include: else-pop
    622 
    623   conditional:
    624     - match: switch{{identifier_break}}
    625       scope: keyword.control.conditional.switch.js
    626       set:
    627         - switch-meta
    628         - switch-block
    629         - expect-parenthesized-expression
    630 
    631     - match: do{{identifier_break}}
    632       scope: keyword.control.loop.do-while.js
    633       set:
    634         - do-while-meta
    635         - do-while-condition
    636         - statement
    637 
    638     - match: for{{identifier_break}}
    639       scope: keyword.control.loop.for.js
    640       set:
    641         - for-meta
    642         - block-scope
    643         - for-condition
    644         - for-await
    645 
    646     - match: while{{identifier_break}}
    647       scope: keyword.control.loop.while.js
    648       set:
    649         - while-meta
    650         - block-scope
    651         - expect-parenthesized-expression
    652 
    653     - match: with{{identifier_break}}
    654       scope: keyword.control.import.with.js
    655       set:
    656         - with-meta
    657         - block-scope
    658         - expect-parenthesized-expression
    659 
    660     - match: if{{identifier_break}}
    661       scope: keyword.control.conditional.if.js
    662       set:
    663         - conditional-meta
    664         - statement
    665         - expect-parenthesized-expression
    666 
    667     - match: else\s+if{{identifier_break}}
    668       scope: keyword.control.conditional.elseif.js
    669       set:
    670         - conditional-meta
    671         - statement
    672         - expect-parenthesized-expression
    673 
    674     - match: else{{identifier_break}}
    675       scope: keyword.control.conditional.else.js
    676       set:
    677         - conditional-meta
    678         - statement
    679 
    680     - match: try{{identifier_break}}
    681       scope: keyword.control.exception.try.js
    682       set:
    683         - try-meta
    684         - block-scope
    685 
    686     - match: finally{{identifier_break}}
    687       scope: keyword.control.exception.finally.js
    688       set:
    689         - finally-meta
    690         - block-scope
    691 
    692     - match: catch{{identifier_break}}
    693       scope: keyword.control.exception.catch.js
    694       set:
    695         - catch-meta
    696         - block-scope
    697         - expect-parenthesized-expression
    698 
    699   expect-parenthesized-expression:
    700     - include: parenthesized-expression
    701     - include: else-pop
    702 
    703   switch-meta:
    704     - meta_include_prototype: false
    705     - meta_scope: meta.switch.js
    706     - include: immediately-pop
    707 
    708   do-while-meta:
    709     - meta_include_prototype: false
    710     - meta_scope: meta.do-while.js
    711     - include: immediately-pop
    712 
    713   for-meta:
    714     - meta_include_prototype: false
    715     - meta_scope: meta.for.js
    716     - include: immediately-pop
    717 
    718   while-meta:
    719     - meta_include_prototype: false
    720     - meta_scope: meta.while.js
    721     - include: immediately-pop
    722 
    723   with-meta:
    724     - meta_include_prototype: false
    725     - meta_scope: meta.with.js
    726     - include: immediately-pop
    727 
    728   conditional-meta:
    729     - meta_include_prototype: false
    730     - meta_scope: meta.conditional.js
    731     - include: immediately-pop
    732 
    733   try-meta:
    734     - meta_include_prototype: false
    735     - meta_scope: meta.try.js
    736     - include: immediately-pop
    737 
    738   finally-meta:
    739     - meta_include_prototype: false
    740     - meta_scope: meta.finally.js
    741     - include: immediately-pop
    742 
    743   catch-meta:
    744     - meta_include_prototype: false
    745     - meta_scope: meta.catch.js
    746     - include: immediately-pop
    747 
    748   for-await:
    749     - match: await{{identifier_break}}
    750       scope: keyword.control.flow.await.js
    751       pop: true
    752     - include: else-pop
    753 
    754   for-condition:
    755     - match: '\('
    756       scope: punctuation.section.group.js
    757       set:
    758         - for-condition-end
    759         - for-condition-contents
    760     - include: else-pop
    761 
    762   for-condition-end:
    763     - meta_scope: meta.group.js
    764 
    765     - match: '\)'
    766       scope: punctuation.section.group.js
    767       pop: true
    768 
    769   for-condition-contents:
    770     # This could be either type of for loop.
    771     - match: (?:const|let|var){{identifier_break}}
    772       scope: storage.type.js
    773       set:
    774         - - include: for-of-rest
    775           - match: (?=\S)
    776             set:
    777               - for-oldstyle-rest
    778               - variable-binding-list
    779               - initializer
    780         - variable-binding-pattern
    781 
    782     - match: (?=\S)
    783       set:
    784         - - include: for-of-rest
    785           - match: (?=\S)
    786             set: for-oldstyle-rest
    787         - expression-end-no-in
    788         - expression-begin
    789 
    790   for-of-rest:
    791     - match: (?:of|in){{identifier_break}}
    792       scope: keyword.operator.word.js
    793       set: expression
    794 
    795   for-oldstyle-rest:
    796     - match: (?=\))
    797       pop: true
    798     - match: ;
    799       scope: punctuation.separator.expression.js
    800     - match: (?=\S)
    801       push: expression
    802 
    803   block-scope:
    804     - include: block
    805     - include: else-pop
    806 
    807   block-meta:
    808     - meta_include_prototype: false
    809     - meta_scope: meta.block.js
    810     - include: immediately-pop
    811 
    812   switch-block:
    813     - match: '\{'
    814       scope: punctuation.section.block.begin.js
    815       set: switch-block-contents
    816     - include: else-pop
    817 
    818   switch-block-contents:
    819     - meta_scope: meta.block.js
    820 
    821     - match: '\}'
    822       scope: punctuation.section.block.end.js
    823       pop: true
    824 
    825     - match: case{{identifier_break}}
    826       scope: keyword.control.conditional.case.js
    827       push:
    828         - expect-case-colon
    829         - expression
    830 
    831     - match: default{{identifier_break}}
    832       scope: keyword.control.conditional.default.js
    833       push:
    834         - expect-case-colon
    835 
    836     - include: statements
    837 
    838   do-while-condition:
    839     - match: while{{identifier_break}}
    840       scope: keyword.control.loop.while.js
    841       set: parenthesized-expression
    842     - include: else-pop
    843 
    844   decorator:
    845     - match: '@'
    846       scope: punctuation.definition.annotation.js
    847       push:
    848         - decorator-meta
    849         - decorator-expression-end
    850         - decorator-expression-begin
    851 
    852   decorator-meta:
    853     - meta_include_prototype: false
    854     - meta_scope: meta.annotation.js
    855     - include: immediately-pop
    856 
    857   decorator-name:
    858     - match: '{{identifier_name}}{{left_expression_end_lookahead}}'
    859       scope: variable.annotation.js
    860       pop: true
    861 
    862   decorator-expression-end:
    863     - match: '{{dot_accessor}}'
    864       scope: punctuation.accessor.js
    865       push:
    866         - include: decorator-name
    867         - include: object-property
    868 
    869     - include: left-expression-end
    870 
    871   decorator-expression-begin:
    872     - include: decorator-name
    873     - include: expression-begin
    874 
    875   expression-break:
    876     - match: (?=[;})\]])
    877       pop: true
    878 
    879   expression:
    880     - meta_include_prototype: false
    881     - match: ''
    882       set: [ expression-end, expression-begin ]
    883 
    884   expression-no-comma:
    885     - meta_include_prototype: false
    886     - match: ''
    887       set: [ expression-end-no-comma, expression-begin ]
    888 
    889   expression-list:
    890     - include: expression-break
    891     - include: comma-separator
    892     - match: (?=\S)
    893       push: expression-no-comma
    894 
    895   left-expression-end:
    896     - include: expression-break
    897 
    898     - match: (?=`)
    899       push: literal-string-template
    900 
    901     - match: (?=(?:{{dot_accessor}})?\()
    902       push: function-call-arguments
    903 
    904     - include: property-access
    905 
    906     - include: else-pop
    907 
    908   expression-end:
    909     - include: postfix-operators
    910     - include: binary-operators
    911     - include: ternary-operator
    912 
    913     - include: left-expression-end
    914 
    915   expression-end-no-comma:
    916     - match: (?=,)
    917       pop: true
    918     - include: expression-end
    919 
    920   expression-end-no-in:
    921     - match: (?=in{{identifier_break}})
    922       pop: true
    923     - include: expression-end
    924 
    925   expression-begin:
    926     - include: expression-break
    927 
    928     - include: yield-expression
    929     - include: await-expression
    930 
    931     - include: regexp-complete
    932     - include: literal-string
    933     - include: tagged-template
    934     - include: literal-string-template
    935     - include: constructor
    936     - include: literal-number
    937     - include: prefix-operators
    938     - include: import-meta-expression
    939 
    940     - include: class
    941     - include: special-name
    942 
    943     - include: regular-function
    944 
    945     - match: (?={{reserved_word}})
    946       pop: true
    947 
    948     - match: (?={{identifier_name}}{{function_assignment_lookahead}})
    949       set:
    950         - function-name-meta
    951         - literal-variable
    952 
    953     - include: object-literal
    954 
    955     # Newline not allowed between `async` and parameters.
    956     - match: (?=async{{identifier_break}}{{nothing}}(?:\(|{{identifier_start}}))
    957       pop: true
    958       branch_point: async-arrow-function
    959       branch:
    960         - async-arrow-function
    961         - literal-variable
    962 
    963     - include: literal-call
    964 
    965     - match: (?={{identifier_start}})
    966       pop: true
    967       branch_point: bare-arrow-function
    968       branch:
    969         - branch-possible-bare-arrow-function
    970         - bare-arrow-function-fallback
    971 
    972     - match: (?=\()
    973       pop: true
    974       branch_point: parenthesized-arrow-function
    975       branch:
    976         - branch-possible-parenthesized-arrow-function
    977         - parenthesized-arrow-function-fallback
    978 
    979     - include: array-literal
    980 
    981     - include: literal-private-variable
    982 
    983     - include: else-pop
    984 
    985   async-arrow-function:
    986     - match: async{{identifier_break}}
    987       scope: keyword.declaration.async.js
    988       set:
    989         - function-meta
    990         - arrow-function-expect-body
    991         - arrow-function-expect-arrow-or-fail-async
    992         - arrow-function-expect-parameters
    993 
    994   arrow-function-expect-arrow-or-fail-async:
    995     - match: '=>'
    996       scope: keyword.declaration.function.arrow.js
    997       pop: true
    998     - match: (?=\S)
    999       fail: async-arrow-function
   1000 
   1001   branch-possible-bare-arrow-function:
   1002     - meta_include_prototype: false
   1003     - match: ''
   1004       push:
   1005         - detect-bare-arrow
   1006         - literal-variable
   1007 
   1008   detect-bare-arrow:
   1009     - match: (?==>)
   1010       fail: bare-arrow-function
   1011     - match: (?=\S)
   1012       pop: 2
   1013 
   1014   bare-arrow-function-fallback:
   1015     - meta_include_prototype: false
   1016     - match: ''
   1017       push:
   1018         - immediately-pop-2
   1019         - arrow-function-declaration
   1020 
   1021   branch-possible-parenthesized-arrow-function:
   1022     - meta_include_prototype: false
   1023     - match: ''
   1024       push:
   1025         - detect-parenthesized-arrow
   1026         - parenthesized-expression
   1027 
   1028   detect-parenthesized-arrow:
   1029     - match: (?==>)
   1030       fail: parenthesized-arrow-function
   1031     - match: (?=\S)
   1032       pop: 2
   1033 
   1034   parenthesized-arrow-function-fallback:
   1035     - meta_include_prototype: false
   1036     - match: ''
   1037       push:
   1038         - immediately-pop-2
   1039         - arrow-function-declaration
   1040 
   1041   literal-string:
   1042     - match: "'"
   1043       scope: punctuation.definition.string.begin.js
   1044       set:
   1045         - meta_include_prototype: false
   1046         - meta_scope: meta.string.js string.quoted.single.js
   1047         - match: \'
   1048           scope: punctuation.definition.string.end.js
   1049           pop: true
   1050         - match: \n
   1051           scope: invalid.illegal.newline.js
   1052           pop: true
   1053         - include: string-content
   1054     - match: '"'
   1055       scope: punctuation.definition.string.begin.js
   1056       set:
   1057         - meta_include_prototype: false
   1058         - meta_scope: meta.string.js string.quoted.double.js
   1059         - match: \"
   1060           scope: punctuation.definition.string.end.js
   1061           pop: true
   1062         - match: \n
   1063           scope: invalid.illegal.newline.js
   1064           pop: true
   1065         - include: string-content
   1066 
   1067   tagged-template:
   1068     - match: '{{identifier_name}}(?=\s*`)'
   1069       scope: variable.function.tagged-template.js
   1070       pop: true
   1071 
   1072   literal-string-template:
   1073     - match: '`'
   1074       scope: punctuation.definition.string.begin.js
   1075       set:
   1076         - meta_include_prototype: false
   1077         - meta_scope: meta.string.js string.quoted.other.js
   1078         - match: "`"
   1079           scope: punctuation.definition.string.end.js
   1080           pop: true
   1081         - match: '\$\{'
   1082           scope: punctuation.section.interpolation.begin.js
   1083           push:
   1084             - clear_scopes: 1
   1085             - meta_scope: meta.interpolation.js
   1086             - meta_content_scope: source.js.embedded
   1087             - match: '\}'
   1088               scope: punctuation.section.interpolation.end.js
   1089               pop: true
   1090             - match: (?=\S)
   1091               push: expression
   1092         - include: string-content
   1093 
   1094   string-content:
   1095     - match: \\\n
   1096       scope: constant.character.escape.newline.js
   1097     - match: \\(?:x\h\h|u\h\h\h\h|.)
   1098       scope: constant.character.escape.js
   1099 
   1100   regexp-complete:
   1101     - match: '/'
   1102       scope: punctuation.definition.string.begin.js
   1103       set: regexp
   1104 
   1105   regexp:
   1106       - meta_include_prototype: false
   1107       - meta_scope: meta.string.js string.regexp.js
   1108       - match: "/"
   1109         scope: punctuation.definition.string.end.js
   1110         set:
   1111           - meta_include_prototype: false
   1112           - meta_content_scope: meta.string.js string.regexp.js
   1113           - match: '[gimyus]'
   1114             scope: keyword.other.js
   1115           - match: '[A-Za-z0-9]' # Ignore unknown flags for future-compatibility
   1116           - include: immediately-pop
   1117       - match: '(?=.|\n)'
   1118         push:
   1119           - meta_include_prototype: false
   1120           - match: '(?=/)'
   1121             pop: true
   1122           - include: scope:source.regexp.js
   1123 
   1124   constructor:
   1125     - match: new{{identifier_break}}
   1126       scope: keyword.operator.word.new.js
   1127       set:
   1128         - match: (?=\s*\.)
   1129           set: new-target
   1130         - match: (?=\s*\S)
   1131           set:
   1132             - constructor-meta
   1133             - constructor-body-expect-arguments
   1134             - constructor-body-expect-class-end
   1135             - constructor-body-expect-class-begin
   1136 
   1137   constructor-meta:
   1138     - meta_include_prototype: false
   1139     - meta_scope: meta.function-call.constructor.js
   1140     - include: immediately-pop
   1141 
   1142   constructor-body-expect-arguments:
   1143     - include: function-call-arguments
   1144     - include: else-pop
   1145 
   1146   constructor-body-expect-class-end:
   1147     - include: property-access
   1148     - include: else-pop
   1149 
   1150   constructor-body-expect-class-begin:
   1151     - match: (?={{non_reserved_identifier}}\s*\()
   1152       set:
   1153         - include: support
   1154         - match: '{{dollar_only_identifier}}'
   1155           scope: variable.type.dollar.only.js punctuation.dollar.js
   1156           pop: true
   1157         - match: '{{dollar_identifier}}'
   1158           scope: variable.type.dollar.js
   1159           captures:
   1160             1: punctuation.dollar.js
   1161           pop: true
   1162         - match: '{{identifier_name}}'
   1163           scope: variable.type.js
   1164           pop: true
   1165         - include: else-pop
   1166 
   1167     - include: expression-begin
   1168 
   1169   new-target:
   1170     - match: \.
   1171       scope: punctuation.accessor.dot.js
   1172       set:
   1173         - match: target{{identifier_break}}
   1174           scope: variable.language.target.js
   1175           pop: true
   1176         - include: else-pop
   1177 
   1178     - include: else-pop
   1179 
   1180   prefix-operators:
   1181     - match: '~'
   1182       scope: keyword.operator.bitwise.js
   1183     - match: '!(?!=)'
   1184       scope: keyword.operator.logical.js
   1185     - match: '--'
   1186       scope: keyword.operator.arithmetic.js
   1187     - match: '\+\+'
   1188       scope: keyword.operator.arithmetic.js
   1189     - match: \.\.\.
   1190       scope: keyword.operator.spread.js
   1191     - match: \+|\-
   1192       scope: keyword.operator.arithmetic.js
   1193     - match: (?:delete|typeof|void){{identifier_break}}
   1194       scope: keyword.operator.js
   1195 
   1196   binary-operators:
   1197     - match: instanceof{{identifier_break}}
   1198       scope: keyword.operator.js
   1199       push: expression-begin
   1200     - match: in{{identifier_break}}
   1201       scope: keyword.operator.js
   1202       push: expression-begin
   1203     - match: '=(?![=>])'
   1204       scope: keyword.operator.assignment.js
   1205       push: expression-begin
   1206     - match: |-
   1207         (?x)
   1208         %=   | # assignment      right-to-left   both
   1209         &=   | # assignment      right-to-left   both
   1210         \*=  | # assignment      right-to-left   both
   1211         \+=  | # assignment      right-to-left   both
   1212         -=   | # assignment      right-to-left   both
   1213         /=   | # assignment      right-to-left   both
   1214         \^=  | # assignment      right-to-left   both
   1215         \|=  | # assignment      right-to-left   both
   1216         <<=  | # assignment      right-to-left   both
   1217         >>=  | # assignment      right-to-left   both
   1218         >>>= | # assignment      right-to-left   both
   1219         &&=   |
   1220         \|\|= |
   1221         \?\?=
   1222       scope: keyword.operator.assignment.augmented.js
   1223       push: expression-begin
   1224     - match: '&&|\|\||\?\?'
   1225       scope: keyword.operator.logical.js
   1226       push: expression-begin
   1227     - match: |-
   1228         (?x)
   1229         <<   | # bitwise-shift   left-to-right   both
   1230         >>>  | # bitwise-shift   left-to-right   both
   1231         >>   | # bitwise-shift   left-to-right   both
   1232         &    | # bitwise-and     left-to-right   both
   1233         \^   | # bitwise-xor     left-to-right   both
   1234         \|     # bitwise-or      left-to-right   both
   1235       scope: keyword.operator.bitwise.js
   1236       push: expression-begin
   1237     - match: |-
   1238         (?x)
   1239         <=   | # comparison      left-to-right   both
   1240         >=   | # comparison      left-to-right   both
   1241         <    | # comparison      left-to-right   both
   1242         >      # comparison      left-to-right   both
   1243       scope: keyword.operator.comparison.js
   1244       push: expression-begin
   1245     - match: |-
   1246         (?x)
   1247         ===  | # equality        left-to-right   both
   1248         !==  | # equality        left-to-right   both
   1249         ==   | # equality        left-to-right   both
   1250         !=     # equality        left-to-right   both
   1251       scope: keyword.operator.comparison.js
   1252       push: expression-begin
   1253     - match: |-
   1254         (?x)
   1255         /    | # division        left-to-right   both
   1256         %    | # modulus         left-to-right   both
   1257         \*   | # multiplication  left-to-right   both
   1258         \+   | # addition        left-to-right   both
   1259         -      # subtraction     left-to-right   both
   1260       scope: keyword.operator.arithmetic.js
   1261       push: expression-begin
   1262     - match: ','
   1263       scope: keyword.operator.comma.js # Comma operator, not punctuation.
   1264       push: expression-begin
   1265 
   1266   ternary-operator:
   1267     - match: '\?(?=[^.]|\.[0-9])'
   1268       scope: keyword.operator.ternary.js
   1269       set:
   1270         - ternary-operator-expect-colon
   1271         - expression-no-comma
   1272 
   1273   ternary-operator-expect-colon:
   1274     - match: ':'
   1275       scope: keyword.operator.ternary.js
   1276       set: expression-no-comma
   1277     - include: else-pop
   1278 
   1279   postfix-operators:
   1280     - match: '--'
   1281       scope: keyword.operator.arithmetic.js
   1282     - match: '\+\+'
   1283       scope: keyword.operator.arithmetic.js
   1284 
   1285   yield-expression:
   1286     - match: yield{{identifier_break}}
   1287       scope: keyword.control.flow.yield.js
   1288       set:
   1289         - match: $
   1290           pop: true
   1291         - match: \*
   1292           scope: keyword.generator.asterisk.js
   1293           set: expression-begin
   1294         - match: (?=\S)
   1295           set: expression-begin
   1296 
   1297   await-expression:
   1298     - match: await{{identifier_break}}
   1299       scope: keyword.control.flow.await.js
   1300 
   1301   class:
   1302     - match: class{{identifier_break}}
   1303       scope: keyword.declaration.class.js
   1304       set:
   1305         - class-meta
   1306         - class-body
   1307         - class-extends
   1308         - class-name
   1309 
   1310   class-meta:
   1311     - meta_include_prototype: false
   1312     - meta_scope: meta.class.js
   1313     - include: immediately-pop
   1314 
   1315   class-body:
   1316     - match: '\{'
   1317       scope: punctuation.section.block.begin.js
   1318       set: class-body-contents
   1319 
   1320     - include: else-pop
   1321 
   1322   class-body-contents:
   1323     - meta_scope: meta.block.js
   1324 
   1325     - match: '\}'
   1326       scope: punctuation.section.block.end.js
   1327       pop: true
   1328 
   1329     - match: \;
   1330       scope: punctuation.terminator.statement.js
   1331 
   1332     - include: decorator
   1333 
   1334     - match: constructor{{identifier_break}}
   1335       scope: entity.name.function.constructor.js
   1336       push:
   1337         - function-meta
   1338         - function-declaration-expect-body
   1339         - function-declaration-expect-parameters
   1340 
   1341     - include: class-element-modifiers
   1342 
   1343     - match: |-
   1344         (?x)(?=
   1345           \#? {{identifier_name}}
   1346           \s* = \s*
   1347           {{either_func_lookahead}}
   1348         )
   1349       push:
   1350         - initializer
   1351         - function-name-meta
   1352         - literal-variable-base
   1353 
   1354     - match: (?=(?:get|set|async){{identifier_break}})
   1355       branch_point: prefixed-method
   1356       branch:
   1357         - prefixed-method
   1358         - class-element
   1359 
   1360     - match: (?=\*)
   1361       push: method-declaration
   1362 
   1363     - match: (?={{class_element_name}})
   1364       push: class-element
   1365 
   1366   class-element-modifiers:
   1367     - match: (?={{modifier}})
   1368       branch_point: class-element-modifier
   1369       branch:
   1370         - class-element-modifier
   1371         - class-element
   1372 
   1373   class-element-modifier:
   1374     - match: '{{modifier}}'
   1375       scope: storage.modifier.js
   1376       set:
   1377         - match: (?={{class_element_name}}|\*)
   1378           pop: true
   1379         - match: (?=\S)
   1380           fail: class-element-modifier
   1381 
   1382   class-extends:
   1383     - match: extends{{identifier_break}}
   1384       scope: storage.modifier.extends.js
   1385       set:
   1386         - inherited-class-expression-end
   1387         - inherited-class-expression-begin
   1388     - include: else-pop
   1389 
   1390   inherited-class-name:
   1391     - match: '{{non_reserved_identifier}}{{left_expression_end_lookahead}}'
   1392       scope: entity.other.inherited-class.js
   1393       pop: true
   1394 
   1395   inherited-class-expression-end:
   1396     - match: '{{dot_accessor}}'
   1397       scope: punctuation.accessor.js
   1398       push:
   1399         - include: inherited-class-name
   1400         - include: object-property
   1401 
   1402     - include: left-expression-end
   1403 
   1404   inherited-class-expression-begin:
   1405     - include: inherited-class-name
   1406     - include: expression-begin
   1407 
   1408   class-name:
   1409     - match: '{{non_reserved_identifier}}'
   1410       scope: entity.name.class.js
   1411       pop: true
   1412     - include: else-pop
   1413 
   1414   class-element:
   1415     - match: ''
   1416       pop: true
   1417       branch_point: class-field
   1418       branch:
   1419         - class-field
   1420         - method-declaration
   1421 
   1422   prefixed-method:
   1423     - match: (?:get|set){{identifier_break}}
   1424       scope: storage.type.accessor.js
   1425       set:
   1426         - meta_scope: meta.function.js
   1427         - match: (?={{class_element_name}})
   1428           set: method-declaration
   1429         - match: (?=\S)
   1430           fail: prefixed-method
   1431     - match: (?:async){{identifier_break}}
   1432       scope: keyword.declaration.async.js
   1433       set:
   1434         - meta_scope: meta.function.js
   1435         - match: (?=\*|{{class_element_name}})
   1436           set: method-declaration
   1437         - match: (?=\S)
   1438           fail: prefixed-method
   1439 
   1440   prefixed-object-literal-method:
   1441     - match: (?:get|set){{identifier_break}}
   1442       scope: storage.type.accessor.js
   1443       set:
   1444         - meta_scope: meta.function.js
   1445         - match: (?={{class_element_name}})
   1446           set: method-declaration
   1447         - match: (?=\S)
   1448           fail: prefixed-object-literal-method
   1449     - match: (?:async){{identifier_break}}
   1450       scope: keyword.declaration.async.js
   1451       set:
   1452         - meta_scope: meta.function.js
   1453         - match: (?=\*|{{class_element_name}})
   1454           set: method-declaration
   1455         - match: (?=\S)
   1456           fail: prefixed-object-literal-method
   1457 
   1458   class-field:
   1459     - match: ''
   1460       set:
   1461         - initializer
   1462         - class-field-check
   1463         - field-name
   1464 
   1465   class-field-check:
   1466     - match: (?=\()
   1467       fail: class-field
   1468     - include: else-pop
   1469 
   1470   special-name:
   1471     - match: true{{identifier_break}}
   1472       scope: constant.language.boolean.true.js
   1473       pop: true
   1474     - match: false{{identifier_break}}
   1475       scope: constant.language.boolean.false.js
   1476       pop: true
   1477     - match: null{{identifier_break}}
   1478       scope: constant.language.null.js
   1479       pop: true
   1480     - match: super{{identifier_break}}
   1481       scope: variable.language.super.js
   1482       pop: true
   1483     - match: this{{identifier_break}}
   1484       scope: variable.language.this.js
   1485       pop: true
   1486 
   1487   function-name-meta:
   1488     - meta_include_prototype: false
   1489     - meta_scope: entity.name.function.js
   1490     - include: immediately-pop
   1491 
   1492   regular-function:
   1493     - match: (?={{func_lookahead}})
   1494       set: function-declaration
   1495 
   1496   function-declaration:
   1497     - meta_include_prototype: false
   1498     - match: ''
   1499       set:
   1500         - function-meta
   1501         - function-declaration-expect-body
   1502         - function-declaration-expect-parameters
   1503         - function-declaration-expect-name
   1504         - function-declaration-expect-generator-star
   1505         - function-declaration-expect-function-keyword
   1506         - function-declaration-expect-async
   1507 
   1508   function-declaration-expect-body:
   1509     - include: function-block
   1510     - include: else-pop
   1511 
   1512   function-meta:
   1513     - meta_include_prototype: false
   1514     - meta_scope: meta.function.js
   1515     - include: immediately-pop
   1516 
   1517   function-declaration-expect-parameters:
   1518     - include: function-declaration-parameters
   1519     - include: else-pop
   1520 
   1521   function-declaration-expect-name:
   1522     - match: '{{non_reserved_identifier}}'
   1523       scope: entity.name.function.js
   1524       pop: true
   1525     - include: else-pop
   1526 
   1527   function-declaration-expect-generator-star:
   1528     - match: \*
   1529       scope: keyword.declaration.generator.js
   1530       pop: true
   1531     - include: else-pop
   1532 
   1533   function-declaration-expect-function-keyword:
   1534     - match: function{{identifier_break}}
   1535       scope: keyword.declaration.function.js
   1536       pop: true
   1537     - include: else-pop
   1538 
   1539   function-declaration-expect-async:
   1540     - match: 'async{{identifier_break}}'
   1541       scope: keyword.declaration.async.js
   1542       pop: true
   1543     - include: else-pop
   1544 
   1545   arrow-function-declaration:
   1546     - meta_include_prototype: false
   1547     - match: ''
   1548       set:
   1549         - function-meta
   1550         - arrow-function-expect-body
   1551         - arrow-function-expect-arrow
   1552         - arrow-function-expect-parameters
   1553 
   1554   arrow-function-expect-body:
   1555     - include: function-block
   1556     - match: (?=\S)
   1557       set:
   1558         - block-meta
   1559         - expression-no-comma
   1560 
   1561   arrow-function-expect-arrow:
   1562     - match: '=>'
   1563       scope: keyword.declaration.function.arrow.js
   1564       pop: true
   1565     - include: else-pop
   1566 
   1567   arrow-function-expect-parameters:
   1568     - match: (?={{identifier_start}})
   1569       set:
   1570         - clear_scopes: 1
   1571         - meta_scope: meta.function.parameters.js
   1572         - match: '{{identifier_name}}'
   1573           scope: variable.parameter.function.js
   1574           pop: true
   1575     - include: function-declaration-parameters
   1576     - include: else-pop
   1577 
   1578   function-block:
   1579     - match: '\{'
   1580       scope: punctuation.section.block.begin.js
   1581       set:
   1582         - meta_scope: meta.block.js
   1583         - match: '\}'
   1584           scope: punctuation.section.block.end.js
   1585           pop: true
   1586         - include: statements
   1587 
   1588   function-declaration-parameters:
   1589     - match: \(
   1590       scope: punctuation.section.group.begin.js
   1591       set:
   1592         - clear_scopes: 1
   1593         - meta_scope: meta.function.parameters.js
   1594         - match: \)
   1595           scope: punctuation.section.group.end.js
   1596           pop: true
   1597         - include: function-parameter-binding-list
   1598 
   1599   label:
   1600     - match: '({{identifier_name}})\s*(:)'
   1601       captures:
   1602         1: entity.name.label.js
   1603         2: punctuation.separator.js
   1604 
   1605   object-literal:
   1606     - match: '\{'
   1607       scope: punctuation.section.block.begin.js
   1608       set: object-literal-contents
   1609 
   1610   object-literal-contents:
   1611     - meta_scope: meta.mapping.js
   1612 
   1613     - match: '\}'
   1614       scope: punctuation.section.block.end.js
   1615       pop: true
   1616 
   1617     - match: \.\.\.
   1618       scope: keyword.operator.spread.js
   1619       push: expression-no-comma
   1620 
   1621     - match: >-
   1622         (?x)(?=
   1623           {{property_name}}\s*:\s*
   1624           {{either_func_lookahead}}
   1625         )
   1626       push:
   1627         - object-literal-meta-key
   1628         - method-name
   1629 
   1630     - match: (?=\*)
   1631       push: method-declaration
   1632 
   1633     - match: (?=(?:get|set|async){{identifier_break}})
   1634       branch_point: prefixed-object-literal-method
   1635       branch:
   1636         - prefixed-object-literal-method
   1637         - object-literal-element
   1638 
   1639     - match: (?={{property_name}})
   1640       push: object-literal-element
   1641 
   1642     - include: comma-separator
   1643 
   1644     - match: ':'
   1645       scope: punctuation.separator.key-value.js
   1646       push: expression-no-comma
   1647 
   1648     # If there's any garbage, parse it as an expression
   1649     # so that close braces won't break things.
   1650     - match: (?=\S)
   1651       push: expression-no-comma
   1652 
   1653   object-literal-element:
   1654     - match: '{{identifier_name}}(?=\s*(?:[},]|$|//|/\*))'
   1655       scope: variable.other.readwrite.js
   1656       pop: true
   1657     - match: (?=\S)
   1658       pop: true
   1659       branch_point: object-literal-property
   1660       branch:
   1661         - object-literal-property
   1662         - method-declaration
   1663 
   1664   object-literal-property:
   1665     - match: ''
   1666       set:
   1667         - object-literal-property-check
   1668         - object-literal-meta-key
   1669         - object-property-name
   1670 
   1671   object-property-name:
   1672     - match: (?=\[)
   1673       set: computed-property-name
   1674 
   1675     - include: literal-string
   1676     - include: literal-number
   1677 
   1678     - match: '{{identifier_name}}'
   1679       pop: true
   1680 
   1681     - include: else-pop
   1682 
   1683   object-literal-property-check:
   1684     - match: (?=\()
   1685       fail: object-literal-property
   1686     - include: else-pop
   1687 
   1688   computed-property-name:
   1689     - match: \[
   1690       scope: punctuation.section.brackets.begin.js
   1691       set:
   1692         - match: \]
   1693           scope: punctuation.section.brackets.end.js
   1694           pop: true
   1695         - match: (?=\S)
   1696           push: expression
   1697 
   1698   object-literal-meta-key:
   1699     - meta_scope: meta.mapping.key.js
   1700     - include: else-pop
   1701 
   1702   method-name:
   1703     - match: '{{dollar_identifier}}'
   1704       scope: meta.mapping.key.dollar.js entity.name.function.js
   1705       captures:
   1706         1: punctuation.dollar.js
   1707       pop: true
   1708     - match: '{{identifier_name}}'
   1709       scope: entity.name.function.js
   1710       pop: true
   1711     - match: '(#){{identifier_name}}'
   1712       scope: entity.name.function.js
   1713       captures:
   1714         1: punctuation.definition.js
   1715       pop: true
   1716     - match: "'"
   1717       scope: punctuation.definition.string.begin.js
   1718       set:
   1719         - meta_include_prototype: false
   1720         - meta_scope: meta.string.js string.quoted.single.js
   1721         - meta_content_scope: entity.name.function.js
   1722         - match: \'
   1723           scope: punctuation.definition.string.end.js
   1724           pop: true
   1725         - match: \n
   1726           scope: invalid.illegal.newline.js
   1727           pop: true
   1728         - include: string-content
   1729     - match: '"'
   1730       scope: punctuation.definition.string.begin.js
   1731       set:
   1732         - meta_include_prototype: false
   1733         - meta_scope: meta.string.js string.quoted.double.js
   1734         - meta_content_scope: entity.name.function.js
   1735         - match: \"
   1736           scope: punctuation.definition.string.end.js
   1737           pop: true
   1738         - match: \n
   1739           scope: invalid.illegal.newline.js
   1740           pop: true
   1741         - include: string-content
   1742 
   1743     - match: (?=\[)
   1744       push: computed-property-name
   1745 
   1746     - include: else-pop
   1747 
   1748   field-name:
   1749     - match: '{{dollar_identifier}}'
   1750       scope: meta.mapping.key.dollar.js variable.other.readwrite.js
   1751       captures:
   1752         1: punctuation.dollar.js
   1753       pop: true
   1754     - match: '{{identifier_name}}'
   1755       scope: variable.other.readwrite.js
   1756       pop: true
   1757     - match: "'"
   1758       scope: punctuation.definition.string.begin.js
   1759       set:
   1760         - meta_include_prototype: false
   1761         - meta_scope: meta.string.js string.quoted.single.js
   1762         - meta_content_scope: variable.other.readwrite.js
   1763         - match: \'
   1764           scope: punctuation.definition.string.end.js
   1765           pop: true
   1766         - match: \n
   1767           scope: invalid.illegal.newline.js
   1768           pop: true
   1769         - include: string-content
   1770     - match: '"'
   1771       scope: punctuation.definition.string.begin.js
   1772       set:
   1773         - meta_include_prototype: false
   1774         - meta_scope: meta.string.js string.quoted.double.js
   1775         - meta_content_scope: variable.other.readwrite.js
   1776         - match: \"
   1777           scope: punctuation.definition.string.end.js
   1778           pop: true
   1779         - match: \n
   1780           scope: invalid.illegal.newline.js
   1781           pop: true
   1782         - include: string-content
   1783     - match: (#)({{identifier_name}})
   1784       captures:
   1785         1: punctuation.definition.variable.js
   1786         2: variable.other.readwrite.js
   1787 
   1788     - match: (?=\[)
   1789       push: computed-property-name
   1790 
   1791     - include: else-pop
   1792 
   1793   method-declaration:
   1794     - meta_include_prototype: false
   1795     - match: ''
   1796       set:
   1797         - function-meta
   1798         - function-declaration-expect-body
   1799         - function-declaration-expect-parameters
   1800         - method-name
   1801         - method-declaration-expect-asterisk
   1802 
   1803   method-declaration-expect-asterisk:
   1804     - match: \*
   1805       scope: keyword.generator.asterisk.js
   1806     - include: else-pop
   1807 
   1808   parenthesized-expression:
   1809     - match: \(
   1810       scope: punctuation.section.group.begin.js
   1811       set:
   1812         - meta_scope: meta.group.js
   1813         - match: \)
   1814           scope: punctuation.section.group.end.js
   1815           pop: true
   1816         - match: (?=\S)
   1817           push: expression
   1818 
   1819   function-call-arguments:
   1820     - match: ({{dot_accessor}})?(\()
   1821       captures:
   1822         1: punctuation.accessor.js
   1823         2: punctuation.section.group.begin.js
   1824       set:
   1825         - meta_scope: meta.group.js
   1826         - match: \)
   1827           scope: punctuation.section.group.end.js
   1828           pop: true
   1829         - include: expression-list
   1830 
   1831   array-literal:
   1832     - match: '\['
   1833       scope: punctuation.section.brackets.begin.js
   1834       set:
   1835         - meta_scope: meta.sequence.js
   1836         - match: '\]'
   1837           scope: punctuation.section.brackets.end.js
   1838           pop: true
   1839         - include: expression-list
   1840 
   1841   property-access:
   1842     - match: ({{dot_accessor}})?(\[)
   1843       captures:
   1844         1: punctuation.accessor.js
   1845         2: punctuation.section.brackets.begin.js
   1846       push:
   1847         - meta_scope: meta.brackets.js
   1848         - match: '\]'
   1849           scope: punctuation.section.brackets.end.js
   1850           pop: true
   1851         - match: (?=\S)
   1852           push: expression
   1853 
   1854     - match: '{{dot_accessor}}'
   1855       scope: punctuation.accessor.js
   1856       push:
   1857         - match: '(?={{identifier_name}}\s*(?:{{dot_accessor}})?\()'
   1858           set:
   1859             - call-method-meta
   1860             - function-call-arguments
   1861             - call-path
   1862             - object-property
   1863         - include: object-property
   1864 
   1865   literal-number:
   1866     # floats
   1867     - match: |-
   1868         (?x:
   1869           # 1., 1.1, 1.1e1, 1.1e-1, 1.e1, 1.e-1 | 1e1, 1e-1
   1870           {{dec_integer}} (?: (\.) {{dec_digit}}* (?:{{dec_exponent}})? | {{dec_exponent}} )
   1871           # .1, .1e1, .1e-1
   1872           | (\.) {{dec_digit}}+ (?:{{dec_exponent}})?
   1873         ){{identifier_break}}
   1874       scope: meta.number.float.decimal.js constant.numeric.value.js
   1875       captures:
   1876         1: punctuation.separator.decimal.js
   1877         2: punctuation.separator.decimal.js
   1878       pop: true
   1879 
   1880     # integers
   1881     - match: (0)({{dec_digit}}+){{identifier_break}}
   1882       scope: meta.number.integer.octal.js
   1883       captures:
   1884         1: constant.numeric.base.js invalid.deprecated.numeric.octal.js
   1885         2: constant.numeric.value.js invalid.deprecated.numeric.octal.js
   1886       pop: true
   1887 
   1888     - match: (0[Xx])({{hex_digit}}*)(n)?{{identifier_break}}
   1889       scope: meta.number.integer.hexadecimal.js
   1890       captures:
   1891         1: constant.numeric.base.js
   1892         2: constant.numeric.value.js
   1893         3: constant.numeric.suffix.js
   1894       pop: true
   1895 
   1896     - match: (0[Oo])({{oct_digit}}*)(n)?{{identifier_break}}
   1897       scope: meta.number.integer.octal.js
   1898       captures:
   1899         1: constant.numeric.base.js
   1900         2: constant.numeric.value.js
   1901         3: constant.numeric.suffix.js
   1902       pop: true
   1903 
   1904     - match: (0[Bb])({{bin_digit}}*)(n)?{{identifier_break}}
   1905       scope: meta.number.integer.binary.js
   1906       captures:
   1907         1: constant.numeric.base.js
   1908         2: constant.numeric.value.js
   1909         3: constant.numeric.suffix.js
   1910       pop: true
   1911 
   1912     - match: ({{dec_integer}})(n|(?!\.)){{identifier_break}}
   1913       scope: meta.number.integer.decimal.js
   1914       captures:
   1915         1: constant.numeric.value.js
   1916         2: constant.numeric.suffix.js
   1917       pop: true
   1918 
   1919     # illegal numbers
   1920     - match: 0[Xx]{{identifier_part}}+
   1921       scope: invalid.illegal.numeric.hexadecimal.js
   1922       pop: true
   1923 
   1924     - match: 0[Bb]{{identifier_part}}+
   1925       scope: invalid.illegal.numeric.binary.js
   1926       pop: true
   1927 
   1928     - match: 0{{identifier_part}}+
   1929       scope: invalid.illegal.numeric.octal.js
   1930       pop: true
   1931 
   1932     - match: '[1-9]{{identifier_part}}+(?:\.{{identifier_part}}*)?'
   1933       scope: invalid.illegal.numeric.decimal.js
   1934       pop: true
   1935 
   1936   literal-call:
   1937     - match: (?={{identifier_name}}\s*(?:{{dot_accessor}})?\()
   1938       set:
   1939         - call-function-meta
   1940         - function-call-arguments
   1941         - literal-variable
   1942 
   1943     - match: (?={{identifier_name}}\s*(?:{{dot_accessor}}\s*#?{{identifier_name}}\s*)+(?:{{dot_accessor}})?\()
   1944       set:
   1945         - call-method-meta
   1946         - function-call-arguments
   1947         - call-path
   1948         - literal-variable
   1949 
   1950   call-path:
   1951     - match: '{{dot_accessor}}'
   1952       scope: punctuation.accessor.js
   1953       push: object-property
   1954     - include: else-pop
   1955 
   1956   call-function-meta:
   1957     - meta_include_prototype: false
   1958     - meta_scope: meta.function-call.js
   1959     - include: else-pop
   1960 
   1961   call-method-meta:
   1962     - meta_include_prototype: false
   1963     - meta_scope: meta.function-call.method.js
   1964     - include: else-pop
   1965 
   1966   call-function-name:
   1967     - match: '{{dollar_only_identifier}}'
   1968       scope: variable.function.js variable.other.dollar.only.js punctuation.dollar.js
   1969       pop: true
   1970     - match: '{{identifier_name}}'
   1971       scope: variable.function.js
   1972       pop: true
   1973     - include: else-pop
   1974 
   1975   call-method-name:
   1976     - include: support-property
   1977     - match: '{{identifier_name}}'
   1978       scope: variable.function.js
   1979       pop: true
   1980     - match: '(#){{identifier_name}}'
   1981       scope: variable.function.js
   1982       captures:
   1983         1: punctuation.definition.js
   1984       pop: true
   1985     - include: else-pop
   1986 
   1987   literal-variable:
   1988     - include: special-identifier
   1989     - include: support
   1990 
   1991     - match: '(?={{identifier_name}}{{function_assignment_lookahead}})'
   1992       set:
   1993         - function-name-meta
   1994         - literal-variable-base
   1995 
   1996     - match: '{{constant_identifier}}(?=\s*(?:{{dot_accessor}}|\[))'
   1997       scope: support.class.js
   1998       pop: true
   1999 
   2000     - match: '{{function_call_lookahead}}'
   2001       set: call-function-name
   2002 
   2003     - include: literal-variable-base
   2004 
   2005   literal-variable-base:
   2006     - match: '{{dollar_only_identifier}}'
   2007       scope: variable.other.dollar.only.js punctuation.dollar.js
   2008       pop: true
   2009     - match: '{{dollar_identifier}}'
   2010       scope: variable.other.dollar.js
   2011       captures:
   2012         1: punctuation.dollar.js
   2013       pop: true
   2014     - match: '{{constant_identifier}}'
   2015       scope: variable.other.constant.js
   2016       pop: true
   2017     - match: '{{identifier_name}}'
   2018       scope: variable.other.readwrite.js
   2019       pop: true
   2020     - include: literal-private-variable
   2021 
   2022   literal-private-variable:
   2023     - match: (#)({{identifier_name}})
   2024       captures:
   2025         1: punctuation.definition.variable.js
   2026         2: variable.other.readwrite.js
   2027       pop: true
   2028 
   2029   special-identifier:
   2030     # These are ordinary identifiers, not reserved words
   2031     - match: arguments{{identifier_break}}
   2032       scope: variable.language.arguments.js
   2033       pop: true
   2034     - match: globalThis{{identifier_break}}
   2035       scope: variable.language.global.js
   2036       pop: true
   2037     - match: undefined{{identifier_break}}
   2038       scope: constant.language.undefined.js
   2039       pop: true
   2040     - match: NaN{{identifier_break}}
   2041       scope: constant.language.nan.js
   2042       pop: true
   2043     - match: Infinity{{identifier_break}}
   2044       scope: constant.language.infinity.js
   2045       pop: true
   2046 
   2047   support:
   2048     - include: support-variable-ecma
   2049     - include: support-variable-console
   2050     - include: support-variable-dom
   2051     - include: support-variable-node
   2052 
   2053   support-variable-ecma:
   2054     - match: Array{{identifier_break}}
   2055       scope: support.class.builtin.js
   2056       set:
   2057         - match: '{{dot_accessor}}'
   2058           scope: punctuation.accessor.js
   2059           set:
   2060             - include: support-property-ecma-array
   2061             - include: object-property
   2062             - include: else-pop
   2063         - include: else-pop
   2064 
   2065     - match: ArrayBuffer{{identifier_break}}
   2066       scope: support.class.builtin.js
   2067       set:
   2068         - match: '{{dot_accessor}}'
   2069           scope: punctuation.accessor.js
   2070           set:
   2071             - include: support-property-ecma-arraybuffer
   2072             - include: object-property
   2073             - include: else-pop
   2074         - include: else-pop
   2075 
   2076     - match: Atomics{{identifier_break}}
   2077       scope: support.constant.builtin.js
   2078       set:
   2079         - match: '{{dot_accessor}}'
   2080           scope: punctuation.accessor.js
   2081           set:
   2082             - include: support-property-ecma-atomics
   2083             - include: object-property
   2084             - include: else-pop
   2085         - include: else-pop
   2086 
   2087     - match: BigInt{{identifier_break}}
   2088       scope: support.class.builtin.js
   2089       set:
   2090         - match: '{{dot_accessor}}'
   2091           scope: punctuation.accessor.js
   2092           set:
   2093             - include: support-property-ecma-bigint
   2094             - include: object-property
   2095             - include: else-pop
   2096         - include: else-pop
   2097 
   2098     - match: Date{{identifier_break}}
   2099       scope: support.class.builtin.js
   2100       set:
   2101         - match: '{{dot_accessor}}'
   2102           scope: punctuation.accessor.js
   2103           set:
   2104             - include: support-property-ecma-date
   2105             - include: object-property
   2106             - include: else-pop
   2107         - include: else-pop
   2108 
   2109     - match: JSON{{identifier_break}}
   2110       scope: support.constant.builtin.js
   2111       set:
   2112         - match: '{{dot_accessor}}'
   2113           scope: punctuation.accessor.js
   2114           set:
   2115             - include: support-property-ecma-json
   2116             - include: object-property
   2117             - include: else-pop
   2118         - include: else-pop
   2119 
   2120     - match: Math{{identifier_break}}
   2121       scope: support.constant.builtin.js
   2122       set:
   2123         - match: '{{dot_accessor}}'
   2124           scope: punctuation.accessor.js
   2125           set:
   2126             - include: support-property-ecma-math
   2127             - include: object-property
   2128             - include: else-pop
   2129         - include: else-pop
   2130 
   2131     - match: Number{{identifier_break}}
   2132       scope: support.class.builtin.js
   2133       set:
   2134         - match: '{{dot_accessor}}'
   2135           scope: punctuation.accessor.js
   2136           set:
   2137             - include: support-property-ecma-number
   2138             - include: object-property
   2139             - include: else-pop
   2140         - include: else-pop
   2141 
   2142     - match: Object{{identifier_break}}
   2143       scope: support.class.builtin.js
   2144       set:
   2145         - match: '{{dot_accessor}}'
   2146           scope: punctuation.accessor.js
   2147           set:
   2148             - include: support-property-ecma-object
   2149             - include: object-property
   2150             - include: else-pop
   2151         - include: else-pop
   2152 
   2153     - match: Promise{{identifier_break}}
   2154       scope: support.class.builtin.js
   2155       set:
   2156         - match: '{{dot_accessor}}'
   2157           scope: punctuation.accessor.js
   2158           set:
   2159             - include: support-property-ecma-promise
   2160             - include: object-property
   2161             - include: else-pop
   2162         - include: else-pop
   2163 
   2164     - match: Proxy{{identifier_break}}
   2165       scope: support.class.builtin.js
   2166       set:
   2167         - match: '{{dot_accessor}}'
   2168           scope: punctuation.accessor.js
   2169           set:
   2170             - include: support-property-ecma-proxy
   2171             - include: object-property
   2172             - include: else-pop
   2173         - include: else-pop
   2174 
   2175     - match: Reflect{{identifier_break}}
   2176       scope: support.constant.builtin.js
   2177       set:
   2178         - match: '{{dot_accessor}}'
   2179           scope: punctuation.accessor.js
   2180           set:
   2181             - include: support-property-ecma-reflect
   2182             - include: object-property
   2183             - include: else-pop
   2184         - include: else-pop
   2185 
   2186     - match: String{{identifier_break}}
   2187       scope: support.class.builtin.js
   2188       set:
   2189         - match: '{{dot_accessor}}'
   2190           scope: punctuation.accessor.js
   2191           set:
   2192             - include: support-property-ecma-string
   2193             - include: object-property
   2194             - include: else-pop
   2195         - include: else-pop
   2196 
   2197     - match: Symbol{{identifier_break}}
   2198       scope: support.class.builtin.js
   2199       set:
   2200         - match: '{{dot_accessor}}'
   2201           scope: punctuation.accessor.js
   2202           set:
   2203             - include: support-property-ecma-symbol
   2204             - include: object-property
   2205             - include: else-pop
   2206         - include: else-pop
   2207 
   2208     - match: |-
   2209         (?x:
   2210           (?:
   2211             BigInt64|
   2212             BigUint64|
   2213             Float(?:32|64)|
   2214             Int(?:8|16|32)|
   2215             Uint(?:8|16|32|32Clamped)
   2216           )
   2217           Array{{identifier_break}}
   2218         )
   2219       scope: support.class.builtin.js
   2220       set:
   2221         - match: '{{dot_accessor}}'
   2222           scope: punctuation.accessor.js
   2223           set:
   2224             - include: support-property-ecma-typedarray
   2225             - include: object-property
   2226             - include: else-pop
   2227         - include: else-pop
   2228 
   2229     # Classes with no constructor properties
   2230     - match: (?:Boolean|DataView|Function|Map|RegExp|Set|WeakMap|WeakSet){{identifier_break}}
   2231       scope: support.class.builtin.js
   2232       pop: true
   2233     - match: (?:Eval|Range|Reference|Syntax|Type|URI)?Error{{identifier_break}}
   2234       scope: support.class.builtin.js
   2235       pop: true
   2236 
   2237     - match: (?:eval|isFinite|isNaN|parseFloat|parseInt|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent){{identifier_break}}
   2238       scope: support.function.js
   2239       pop: true
   2240 
   2241   support-property-ecma-array:
   2242     - match: (?:from|isArray|of){{identifier_break}}
   2243       scope: support.function.builtin.js
   2244       pop: true
   2245 
   2246   support-property-ecma-arraybuffer:
   2247     - match: isView{{identifier_break}}
   2248       scope: support.function.builtin.js
   2249       pop: true
   2250 
   2251   support-property-ecma-atomics:
   2252     - match: (?:and|add|compareExchange|exchange|isLockFree|load|or|store|sub|wait|wake|xor){{identifier_break}}
   2253       scope: support.function.builtin.js
   2254       pop: true
   2255 
   2256   support-property-ecma-bigint:
   2257     - match: (?:asUintN|asIntN){{identifier_break}}
   2258       scope: support.function.builtin.js
   2259       pop: true
   2260 
   2261   support-property-ecma-date:
   2262     - match: (?:now|parse|UTC){{identifier_break}}
   2263       scope: support.function.builtin.js
   2264       pop: true
   2265 
   2266   support-property-ecma-json:
   2267     - match: (?:parse|stringify){{identifier_break}}
   2268       scope: support.function.builtin.js
   2269       pop: true
   2270 
   2271   support-property-ecma-math:
   2272     - match: (?:E|LN10|LN2|LOG10E|LOG2E|PI|SQRT1_2|SQRT2){{identifier_break}}
   2273       scope: support.constant.builtin.js
   2274       pop: true
   2275     - match: (?:abs|acos|acosh|asin|asin|atan|atanh|atan2|cbrt|ceil|clz32|cos|cosh|exp|expm1|floor|fround|hypot|imul|log|log1p|log10|log2|max|min|pow|random|round|sign|sin|sinh|sqrt|tan|tanh|trunc){{identifier_break}}
   2276       scope: support.function.builtin.js
   2277       pop: true
   2278 
   2279   support-property-ecma-number:
   2280     - match: (?:EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY){{identifier_break}}
   2281       scope: support.constant.builtin.js
   2282       pop: true
   2283     - match: (?:isFinite|isInteger|isNaN|isSafeInteger|NaN|parseFloat|parseInt){{identifier_break}}
   2284       scope: support.function.builtin.js
   2285       pop: true
   2286 
   2287   support-property-ecma-object:
   2288     - match: (?:assign|create|defineProperties|defineProperty|entries|freeze|fromEntries|getOwnPropertyDescriptors?|getOwnPropertyNames|getOwnPropertySymbols|getPrototypeOf|is|isExtensible|isFrozen|isSealed|keys|preventExtensions|seal|setPrototypeOf|values){{identifier_break}}
   2289       scope: support.function.builtin.js
   2290       pop: true
   2291 
   2292   support-property-ecma-promise:
   2293     - match: (?:all|race|reject|resolve|allSettled|any){{identifier_break}}
   2294       scope: support.function.builtin.js
   2295       pop: true
   2296 
   2297   support-property-ecma-proxy:
   2298     - match: revocable{{identifier_break}}
   2299       scope: support.function.builtin.js
   2300       pop: true
   2301 
   2302   support-property-ecma-reflect:
   2303     - match: (?:apply|construct|defineProperty|deleteProperty|get|getOwnPropertyDescriptor|getPrototypeOf|has|isExtensible|ownKeys|preventExtensions|set|setPrototypeOf){{identifier_break}}
   2304       scope: support.function.builtin.js
   2305       pop: true
   2306 
   2307   support-property-ecma-string:
   2308     - match: (?:fromCharCode|fromCodePoint|raw){{identifier_break}}
   2309       scope: support.function.builtin.js
   2310       pop: true
   2311 
   2312   support-property-ecma-symbol:
   2313     - match: (?:asyncIterator|hasInstance|isConcatSpreadable|iterator|match|replace|search|species|split|toPrimitive|toStringTag|unscopeables){{identifier_break}}
   2314       scope: support.constant.builtin.js
   2315       pop: true
   2316     - match: (?:for|keyFor){{identifier_break}}
   2317       scope: support.function.builtin.js
   2318       pop: true
   2319 
   2320   support-property-ecma-typedarray:
   2321     - match: (?:BYTES_PER_ELEMENT){{identifier_break}}
   2322       scope: support.constant.builtin.js
   2323       pop: true
   2324 
   2325   support-variable-console:
   2326     # https://console.spec.whatwg.org/
   2327     - match: console{{identifier_break}}
   2328       scope: support.type.object.console.js
   2329       set:
   2330         - match: '{{dot_accessor}}'
   2331           scope: punctuation.accessor.js
   2332           set: builtin-console-properties
   2333         - include: else-pop
   2334 
   2335   support-variable-dom:
   2336     - match: XMLHttpRequest{{identifier_break}}
   2337       scope: support.class.dom.js
   2338       pop: true
   2339     - match: (?:document|window|navigator){{identifier_break}}
   2340       scope: support.type.object.dom.js
   2341       pop: true
   2342     - match: (?:clearTimeout|setTimeout){{identifier_break}}
   2343       scope: support.function.dom.js
   2344       pop: true
   2345 
   2346   support-variable-node:
   2347     - match: global{{identifier_break}}
   2348       scope: support.type.object.node.js
   2349       pop: true
   2350 
   2351     - match: Buffer{{identifier_break}}
   2352       scope: support.class.node.js
   2353       pop: true
   2354 
   2355     - match: process{{identifier_break}}
   2356       scope: support.constant.node.js
   2357       set:
   2358         - match: '{{dot_accessor}}'
   2359           scope: punctuation.accessor.js
   2360           set:
   2361             - include: support-property-node-process
   2362             - include: object-property
   2363             - include: else-pop
   2364         - include: else-pop
   2365 
   2366     # Module-level variables
   2367     - match: (?:__dirname|__filename|exports){{identifier_break}}
   2368       scope: support.constant.node.js
   2369       pop: true
   2370     - match: module{{identifier_break}}
   2371       scope: support.constant.node.js
   2372       set:
   2373         - match: '{{dot_accessor}}'
   2374           scope: punctuation.accessor.js
   2375           set:
   2376             - include: support-property-node-module
   2377             - include: object-property
   2378             - include: else-pop
   2379         - include: else-pop
   2380     - match: require{{identifier_break}}
   2381       scope: support.function.node.js
   2382       pop: true
   2383 
   2384   support-property-node-process:
   2385     - match: (?:arch|argv|argv0|channel|config|connected|debugPort|env|execArgv|execPath|exitCode|mainModule|noDeprecation|pid|platform|ppid|release|stderr|stdin|stdout|throwDeprecation|title|traceDeprecation|version|versions){{identifier_break}}
   2386       scope: support.constant.node.js
   2387       pop: true
   2388     - match: (?:abort|chdir|cpuUsage|cwd|disconnect|dlopen|emitWarning|exit|getegid|geteuid|getgit|getgroups|getuid|hasUncaughtExceptionCaptureCallback|hrtime|initGroups|kill|memoryUsage|nextTick|send|setegid|seteuid|setgid|setgroups|setuid|hasUncaughtExceptionCaptureCallback|umask|uptime){{identifier_break}}
   2389       scope: support.function.node.js
   2390       pop: true
   2391 
   2392   support-property-node-module:
   2393     - match: (?:children|exports|filename|id|loaded|parent|paths){{identifier_break}}
   2394       scope: support.constant.node.js
   2395       pop: true
   2396     - match: require{{identifier_break}}
   2397       scope: support.function.node.js
   2398       pop: true
   2399 
   2400   builtin-console-properties:
   2401     - match: (?:warn|info|log|error|time|timeEnd|assert|count|dir|group|groupCollapsed|groupEnd|profile|profileEnd|table|trace|timeStamp){{identifier_break}}
   2402       scope: support.function.console.js
   2403       pop: true
   2404     - include: object-property
   2405 
   2406   object-property:
   2407     - include: support-property
   2408 
   2409     - match: (?=\#?{{identifier_name}}{{function_assignment_lookahead}})
   2410       set:
   2411         - function-name-meta
   2412         - object-property-base
   2413 
   2414     - match: '(?=#?{{identifier_name}}\s*(?:{{dot_accessor}})?\()'
   2415       set: call-method-name
   2416 
   2417     - include: object-property-base
   2418     - include: else-pop
   2419 
   2420   object-property-base:
   2421     - match: '{{dollar_only_identifier}}'
   2422       scope: meta.property.object.dollar.only.js punctuation.dollar.js
   2423       pop: true
   2424     - match: '{{dollar_identifier}}'
   2425       scope: meta.property.object.dollar.js
   2426       captures:
   2427         1: punctuation.dollar.js
   2428       pop: true
   2429     - match: '{{identifier_name}}'
   2430       scope: meta.property.object.js
   2431       pop: true
   2432     - match: '{{identifier_part}}+{{identifier_break}}'
   2433       scope: invalid.illegal.illegal-identifier.js
   2434       pop: true
   2435     - match: (#)({{identifier_name}})
   2436       captures:
   2437         1: punctuation.definition.variable.js
   2438         2: meta.property.object.js
   2439       pop: true
   2440 
   2441   support-property:
   2442     - include: support-property-ecma
   2443 
   2444   support-property-ecma:
   2445     - match: constructor{{identifier_break}}
   2446       scope: variable.language.constructor.js
   2447       pop: true
   2448     - match: prototype{{identifier_break}}
   2449       scope: support.constant.prototype.js
   2450       pop: true
   2451 
   2452     - match: (?:hasOwnProperty|isPrototypeOf|propertyIsEnumerable|toLocaleString|toString|valueOf){{identifier_break}}
   2453       scope: support.function.js
   2454       pop: true
   2455 
   2456     # Annex B
   2457     - match: __proto__{{identifier_break}}
   2458       scope: invalid.deprecated.js variable.language.prototype.js
   2459       pop: true
   2460     - match: (?:__defineGetter__|__defineSetter__|__lookupGetter__){{identifier_break}}
   2461       scope: invalid.deprecated.js support.function.js
   2462       pop: true
   2463 
   2464   import-meta-expression:
   2465     - match: import{{identifier_break}}
   2466       scope: keyword.import.js
   2467       set: import-expression-end
   2468 
   2469   import-expression-end:
   2470     - match: (?=\()
   2471       set: function-call-arguments
   2472     - match: '{{dot_accessor}}'
   2473       scope: punctuation.accessor.js
   2474       set:
   2475         - match: meta{{identifier_break}}
   2476           scope: variable.language.import.js
   2477           pop: true
   2478         - include: object-property
   2479     - include: else-pop