biome_js_parser 0.5.7

Biome's JavaScript parser
Documentation
JsModule {
    bom_token: missing (optional),
    interpreter_token: missing (optional),
    directives: JsDirectiveList [],
    items: JsModuleItemList [
        JsClassDeclaration {
            decorators: JsDecoratorList [],
            abstract_token: missing (optional),
            class_token: CLASS_KW@0..6 "class" [] [Whitespace(" ")],
            id: JsIdentifierBinding {
                name_token: IDENT@6..8 "B" [] [Whitespace(" ")],
            },
            type_parameters: missing (optional),
            extends_clause: missing (optional),
            implements_clause: missing (optional),
            l_curly_token: L_CURLY@8..10 "{" [] [Whitespace(" ")],
            members: JsClassMemberList [
                JsMethodClassMember {
                    modifiers: JsMethodModifierList [],
                    async_token: missing (optional),
                    star_token: missing (optional),
                    name: JsLiteralMemberName {
                        value: IDENT@10..13 "foo" [] [],
                    },
                    question_mark_token: missing (optional),
                    type_parameters: missing (optional),
                    parameters: JsParameters {
                        l_paren_token: L_PAREN@13..14 "(" [] [],
                        items: JsParameterList [
                            JsFormalParameter {
                                decorators: JsDecoratorList [],
                                binding: JsIdentifierBinding {
                                    name_token: IDENT@14..16 "a" [] [Whitespace(" ")],
                                },
                                question_mark_token: missing (optional),
                                type_annotation: missing (optional),
                                initializer: missing (optional),
                            },
                            missing separator,
                            JsFormalParameter {
                                decorators: JsDecoratorList [],
                                binding: JsObjectBindingPattern {
                                    l_curly_token: L_CURLY@16..17 "{" [] [],
                                    properties: JsObjectBindingPatternPropertyList [],
                                    r_curly_token: R_CURLY@17..19 "}" [] [Whitespace(" ")],
                                },
                                question_mark_token: missing (optional),
                                type_annotation: missing (optional),
                                initializer: missing (optional),
                            },
                            missing separator,
                            JsBogusParameter {
                                items: [
                                    R_CURLY@19..20 "}" [] [],
                                ],
                            },
                        ],
                        r_paren_token: missing (required),
                    },
                    return_type_annotation: missing (optional),
                    body: missing (required),
                },
            ],
            r_curly_token: missing (required),
        },
    ],
    eof_token: EOF@20..21 "" [Newline("\n")] [],
}

0: JS_MODULE@0..21
  0: (empty)
  1: (empty)
  2: JS_DIRECTIVE_LIST@0..0
  3: JS_MODULE_ITEM_LIST@0..20
    0: JS_CLASS_DECLARATION@0..20
      0: JS_DECORATOR_LIST@0..0
      1: (empty)
      2: CLASS_KW@0..6 "class" [] [Whitespace(" ")]
      3: JS_IDENTIFIER_BINDING@6..8
        0: IDENT@6..8 "B" [] [Whitespace(" ")]
      4: (empty)
      5: (empty)
      6: (empty)
      7: L_CURLY@8..10 "{" [] [Whitespace(" ")]
      8: JS_CLASS_MEMBER_LIST@10..20
        0: JS_METHOD_CLASS_MEMBER@10..20
          0: JS_METHOD_MODIFIER_LIST@10..10
          1: (empty)
          2: (empty)
          3: JS_LITERAL_MEMBER_NAME@10..13
            0: IDENT@10..13 "foo" [] []
          4: (empty)
          5: (empty)
          6: JS_PARAMETERS@13..20
            0: L_PAREN@13..14 "(" [] []
            1: JS_PARAMETER_LIST@14..20
              0: JS_FORMAL_PARAMETER@14..16
                0: JS_DECORATOR_LIST@14..14
                1: JS_IDENTIFIER_BINDING@14..16
                  0: IDENT@14..16 "a" [] [Whitespace(" ")]
                2: (empty)
                3: (empty)
                4: (empty)
              1: (empty)
              2: JS_FORMAL_PARAMETER@16..19
                0: JS_DECORATOR_LIST@16..16
                1: JS_OBJECT_BINDING_PATTERN@16..19
                  0: L_CURLY@16..17 "{" [] []
                  1: JS_OBJECT_BINDING_PATTERN_PROPERTY_LIST@17..17
                  2: R_CURLY@17..19 "}" [] [Whitespace(" ")]
                2: (empty)
                3: (empty)
                4: (empty)
              3: (empty)
              4: JS_BOGUS_PARAMETER@19..20
                0: R_CURLY@19..20 "}" [] []
            2: (empty)
          7: (empty)
          8: (empty)
      9: (empty)
  4: EOF@20..21 "" [Newline("\n")] []
--
class_member_method_parameters.js:1:17 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  × expected `,` but instead found `{`
  
  > 1 │ class B { foo(a {} }
      │                 ^
    2 │ 
  
  i Remove {
  
--
class_member_method_parameters.js:1:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  × expected `,` but instead found `}`
  
  > 1 │ class B { foo(a {} }
      │                    ^
    2 │ 
  
  i Remove }
  
--
class_member_method_parameters.js:2:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  × expected `)` but instead the file ends
  
    1 │ class B { foo(a {} }
  > 2 │ 
      │ 
  
  i the file ends here
  
    1 │ class B { foo(a {} }
  > 2 │ 
      │ 
  
--
class B { foo(a {} }