biome_js_parser 0.5.7

Biome's JavaScript parser
Documentation
JsModule {
    bom_token: missing (optional),
    interpreter_token: missing (optional),
    directives: JsDirectiveList [],
    items: JsModuleItemList [
        JsVariableStatement {
            declaration: JsVariableDeclaration {
                await_token: missing (optional),
                kind: LET_KW@0..4 "let" [] [Whitespace(" ")],
                declarators: JsVariableDeclaratorList [
                    JsVariableDeclarator {
                        id: JsIdentifierBinding {
                            name_token: IDENT@4..8 "foo" [] [Whitespace(" ")],
                        },
                        variable_annotation: missing (optional),
                        initializer: JsInitializerClause {
                            eq_token: EQ@8..10 "=" [] [Whitespace(" ")],
                            expression: JsIdentifierExpression {
                                name: JsReferenceIdentifier {
                                    value_token: IDENT@10..14 "bar" [] [Whitespace(" ")],
                                },
                            },
                        },
                    },
                ],
            },
            semicolon_token: missing (optional),
        },
        JsThrowStatement {
            throw_token: THROW_KW@14..20 "throw" [] [Whitespace(" ")],
            argument: JsIdentifierExpression {
                name: JsReferenceIdentifier {
                    value_token: IDENT@20..23 "foo" [] [],
                },
            },
            semicolon_token: missing (optional),
        },
    ],
    eof_token: EOF@23..24 "" [Newline("\n")] [],
}

0: JS_MODULE@0..24
  0: (empty)
  1: (empty)
  2: JS_DIRECTIVE_LIST@0..0
  3: JS_MODULE_ITEM_LIST@0..23
    0: JS_VARIABLE_STATEMENT@0..14
      0: JS_VARIABLE_DECLARATION@0..14
        0: (empty)
        1: LET_KW@0..4 "let" [] [Whitespace(" ")]
        2: JS_VARIABLE_DECLARATOR_LIST@4..14
          0: JS_VARIABLE_DECLARATOR@4..14
            0: JS_IDENTIFIER_BINDING@4..8
              0: IDENT@4..8 "foo" [] [Whitespace(" ")]
            1: (empty)
            2: JS_INITIALIZER_CLAUSE@8..14
              0: EQ@8..10 "=" [] [Whitespace(" ")]
              1: JS_IDENTIFIER_EXPRESSION@10..14
                0: JS_REFERENCE_IDENTIFIER@10..14
                  0: IDENT@10..14 "bar" [] [Whitespace(" ")]
      1: (empty)
    1: JS_THROW_STATEMENT@14..23
      0: THROW_KW@14..20 "throw" [] [Whitespace(" ")]
      1: JS_IDENTIFIER_EXPRESSION@20..23
        0: JS_REFERENCE_IDENTIFIER@20..23
          0: IDENT@20..23 "foo" [] []
      2: (empty)
  4: EOF@23..24 "" [Newline("\n")] []
--
semicolons_err.js:1:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  × Expected a semicolon or an implicit semicolon after a statement, but found none
  
  > 1 │ let foo = bar throw foo
      │               ^^^^^
    2 │ 
  
  i An explicit or implicit semicolon is expected here...
  
  > 1 │ let foo = bar throw foo
      │               ^^^^^
    2 │ 
  
  i ...Which is required to end this statement
  
  > 1 │ let foo = bar throw foo
      │ ^^^^^^^^^^^^^^
    2 │ 
  
--
let foo = bar throw foo