biome_js_parser 0.5.7

Biome's JavaScript parser
Documentation
JsModule {
    bom_token: missing (optional),
    interpreter_token: missing (optional),
    directives: JsDirectiveList [],
    items: JsModuleItemList [
        JsFunctionDeclaration {
            async_token: missing (optional),
            function_token: FUNCTION_KW@0..9 "function" [] [Whitespace(" ")],
            star_token: missing (optional),
            id: missing (required),
            type_parameters: missing (optional),
            parameters: JsParameters {
                l_paren_token: L_PAREN@9..10 "(" [] [],
                items: JsParameterList [
                    JsFormalParameter {
                        decorators: JsDecoratorList [],
                        binding: JsIdentifierBinding {
                            name_token: IDENT@10..11 "a" [] [],
                        },
                        question_mark_token: missing (optional),
                        type_annotation: missing (optional),
                        initializer: missing (optional),
                    },
                    missing separator,
                    JsBogusParameter {
                        items: [
                            PLUS2@11..13 "++" [] [],
                        ],
                    },
                    COMMA@13..15 "," [] [Whitespace(" ")],
                    JsFormalParameter {
                        decorators: JsDecoratorList [],
                        binding: JsIdentifierBinding {
                            name_token: IDENT@15..16 "c" [] [],
                        },
                        question_mark_token: missing (optional),
                        type_annotation: missing (optional),
                        initializer: missing (optional),
                    },
                ],
                r_paren_token: R_PAREN@16..18 ")" [] [Whitespace(" ")],
            },
            return_type_annotation: missing (optional),
            body: JsFunctionBody {
                l_curly_token: L_CURLY@18..19 "{" [] [],
                directives: JsDirectiveList [],
                statements: JsStatementList [],
                r_curly_token: R_CURLY@19..20 "}" [] [],
            },
        },
    ],
    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_FUNCTION_DECLARATION@0..20
      0: (empty)
      1: FUNCTION_KW@0..9 "function" [] [Whitespace(" ")]
      2: (empty)
      3: (empty)
      4: (empty)
      5: JS_PARAMETERS@9..18
        0: L_PAREN@9..10 "(" [] []
        1: JS_PARAMETER_LIST@10..16
          0: JS_FORMAL_PARAMETER@10..11
            0: JS_DECORATOR_LIST@10..10
            1: JS_IDENTIFIER_BINDING@10..11
              0: IDENT@10..11 "a" [] []
            2: (empty)
            3: (empty)
            4: (empty)
          1: (empty)
          2: JS_BOGUS_PARAMETER@11..13
            0: PLUS2@11..13 "++" [] []
          3: COMMA@13..15 "," [] [Whitespace(" ")]
          4: JS_FORMAL_PARAMETER@15..16
            0: JS_DECORATOR_LIST@15..15
            1: JS_IDENTIFIER_BINDING@15..16
              0: IDENT@15..16 "c" [] []
            2: (empty)
            3: (empty)
            4: (empty)
        2: R_PAREN@16..18 ")" [] [Whitespace(" ")]
      6: (empty)
      7: JS_FUNCTION_BODY@18..20
        0: L_CURLY@18..19 "{" [] []
        1: JS_DIRECTIVE_LIST@19..19
        2: JS_STATEMENT_LIST@19..19
        3: R_CURLY@19..20 "}" [] []
  4: EOF@20..21 "" [Newline("\n")] []
--
formal_params_invalid.js:1:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  × expected a name for the function in a function declaration, but found none
  
  > 1 │ function (a++, c) {}
      │          ^
    2 │ 
  
--
formal_params_invalid.js:1:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  × expected `,` but instead found `++`
  
  > 1 │ function (a++, c) {}
      │            ^^
    2 │ 
  
  i Remove ++
  
--
function (a++, c) {}