JsModule { bom_token: missing (optional), interpreter_token: missing (optional), directives: JsDirectiveList [], items: JsModuleItemList [ JsSwitchStatement { switch_token: SWITCH_KW@0..7 "switch" [] [Whitespace(" ")], l_paren_token: missing (required), discriminant: JsIdentifierExpression { name: JsReferenceIdentifier { value_token: IDENT@7..11 "foo" [] [Whitespace(" ")], }, }, r_paren_token: missing (required), l_curly_token: L_CURLY@11..12 "{" [] [], cases: JsSwitchCaseList [], r_curly_token: R_CURLY@12..13 "}" [] [], }, JsSwitchStatement { switch_token: SWITCH_KW@13..21 "switch" [Newline("\n")] [Whitespace(" ")], l_paren_token: missing (required), discriminant: missing (required), r_paren_token: missing (required), l_curly_token: L_CURLY@21..22 "{" [] [], cases: JsSwitchCaseList [], r_curly_token: R_CURLY@22..23 "}" [] [], }, JsSwitchStatement { switch_token: SWITCH_KW@23..31 "switch" [Newline("\n")] [Whitespace(" ")], l_paren_token: missing (required), discriminant: missing (required), r_paren_token: missing (required), l_curly_token: L_CURLY@31..33 "{" [] [Whitespace(" ")], cases: JsSwitchCaseList [ JsCaseClause { case_token: missing (required), test: missing (required), colon_token: missing (required), consequent: JsStatementList [ JsBogusStatement { items: [ VAR_KW@33..37 "var" [] [Whitespace(" ")], IDENT@37..39 "i" [] [Whitespace(" ")], EQ@39..41 "=" [] [Whitespace(" ")], JS_NUMBER_LITERAL@41..43 "0" [] [Whitespace(" ")], ], }, ], }, ], r_curly_token: R_CURLY@43..44 "}" [] [], }, JsSwitchStatement { switch_token: SWITCH_KW@44..52 "switch" [Newline("\n")] [Whitespace(" ")], l_paren_token: missing (required), discriminant: missing (required), r_paren_token: missing (required), l_curly_token: L_CURLY@52..54 "{" [] [Whitespace(" ")], cases: JsSwitchCaseList [ JsCaseClause { case_token: missing (required), test: missing (required), colon_token: missing (required), consequent: JsStatementList [ JsBogusStatement { items: [ VAR_KW@54..58 "var" [] [Whitespace(" ")], IDENT@58..60 "i" [] [Whitespace(" ")], EQ@60..62 "=" [] [Whitespace(" ")], JS_NUMBER_LITERAL@62..63 "0" [] [], SEMICOLON@63..65 ";" [] [Whitespace(" ")], ], }, ], }, JsCaseClause { case_token: CASE_KW@65..70 "case" [] [Whitespace(" ")], test: JsStringLiteralExpression { value_token: JS_STRING_LITERAL@70..75 "\"bar\"" [] [], }, colon_token: COLON@75..77 ":" [] [Whitespace(" ")], consequent: JsStatementList [ JsBlockStatement { l_curly_token: L_CURLY@77..78 "{" [] [], statements: JsStatementList [], r_curly_token: R_CURLY@78..80 "}" [] [Whitespace(" ")], }, ], }, ], r_curly_token: R_CURLY@80..81 "}" [] [], }, JsSwitchStatement { switch_token: SWITCH_KW@81..89 "switch" [Newline("\n")] [Whitespace(" ")], l_paren_token: L_PAREN@89..90 "(" [] [], discriminant: JsIdentifierExpression { name: JsReferenceIdentifier { value_token: IDENT@90..93 "foo" [] [], }, }, r_paren_token: R_PAREN@93..95 ")" [] [Whitespace(" ")], l_curly_token: L_CURLY@95..96 "{" [] [], cases: JsSwitchCaseList [ JsDefaultClause { default_token: DEFAULT_KW@96..106 "default" [Newline("\n"), Whitespace(" ")] [], colon_token: COLON@106..108 ":" [] [Whitespace(" ")], consequent: JsStatementList [ JsBlockStatement { l_curly_token: L_CURLY@108..109 "{" [] [], statements: JsStatementList [], r_curly_token: R_CURLY@109..110 "}" [] [], }, ], }, JsCaseClause { case_token: missing (required), test: JsBogusExpression { items: [ DEFAULT_KW@110..120 "default" [Newline("\n"), Whitespace(" ")] [], ], }, colon_token: COLON@120..122 ":" [] [Whitespace(" ")], consequent: JsStatementList [ JsBlockStatement { l_curly_token: L_CURLY@122..123 "{" [] [], statements: JsStatementList [], r_curly_token: R_CURLY@123..124 "}" [] [], }, ], }, ], r_curly_token: R_CURLY@124..126 "}" [Newline("\n")] [], }, JsSwitchStatement { switch_token: SWITCH_KW@126..134 "switch" [Newline("\n")] [Whitespace(" ")], l_paren_token: L_PAREN@134..135 "(" [] [], discriminant: JsIdentifierExpression { name: JsReferenceIdentifier { value_token: IDENT@135..138 "foo" [] [], }, }, r_paren_token: R_PAREN@138..140 ")" [] [Whitespace(" ")], l_curly_token: L_CURLY@140..142 "{" [] [Whitespace(" ")], cases: JsSwitchCaseList [ JsCaseClause { case_token: CASE_KW@142..147 "case" [] [Whitespace(" ")], test: missing (required), colon_token: COLON@147..149 ":" [] [Whitespace(" ")], consequent: JsStatementList [], }, ], r_curly_token: R_CURLY@149..150 "}" [] [], }, ], eof_token: EOF@150..151 "" [Newline("\n")] [], } 0: JS_MODULE@0..151 0: (empty) 1: (empty) 2: JS_DIRECTIVE_LIST@0..0 3: JS_MODULE_ITEM_LIST@0..150 0: JS_SWITCH_STATEMENT@0..13 0: SWITCH_KW@0..7 "switch" [] [Whitespace(" ")] 1: (empty) 2: JS_IDENTIFIER_EXPRESSION@7..11 0: JS_REFERENCE_IDENTIFIER@7..11 0: IDENT@7..11 "foo" [] [Whitespace(" ")] 3: (empty) 4: L_CURLY@11..12 "{" [] [] 5: JS_SWITCH_CASE_LIST@12..12 6: R_CURLY@12..13 "}" [] [] 1: JS_SWITCH_STATEMENT@13..23 0: SWITCH_KW@13..21 "switch" [Newline("\n")] [Whitespace(" ")] 1: (empty) 2: (empty) 3: (empty) 4: L_CURLY@21..22 "{" [] [] 5: JS_SWITCH_CASE_LIST@22..22 6: R_CURLY@22..23 "}" [] [] 2: JS_SWITCH_STATEMENT@23..44 0: SWITCH_KW@23..31 "switch" [Newline("\n")] [Whitespace(" ")] 1: (empty) 2: (empty) 3: (empty) 4: L_CURLY@31..33 "{" [] [Whitespace(" ")] 5: JS_SWITCH_CASE_LIST@33..43 0: JS_CASE_CLAUSE@33..43 0: (empty) 1: (empty) 2: (empty) 3: JS_STATEMENT_LIST@33..43 0: JS_BOGUS_STATEMENT@33..43 0: VAR_KW@33..37 "var" [] [Whitespace(" ")] 1: IDENT@37..39 "i" [] [Whitespace(" ")] 2: EQ@39..41 "=" [] [Whitespace(" ")] 3: JS_NUMBER_LITERAL@41..43 "0" [] [Whitespace(" ")] 6: R_CURLY@43..44 "}" [] [] 3: JS_SWITCH_STATEMENT@44..81 0: SWITCH_KW@44..52 "switch" [Newline("\n")] [Whitespace(" ")] 1: (empty) 2: (empty) 3: (empty) 4: L_CURLY@52..54 "{" [] [Whitespace(" ")] 5: JS_SWITCH_CASE_LIST@54..80 0: JS_CASE_CLAUSE@54..65 0: (empty) 1: (empty) 2: (empty) 3: JS_STATEMENT_LIST@54..65 0: JS_BOGUS_STATEMENT@54..65 0: VAR_KW@54..58 "var" [] [Whitespace(" ")] 1: IDENT@58..60 "i" [] [Whitespace(" ")] 2: EQ@60..62 "=" [] [Whitespace(" ")] 3: JS_NUMBER_LITERAL@62..63 "0" [] [] 4: SEMICOLON@63..65 ";" [] [Whitespace(" ")] 1: JS_CASE_CLAUSE@65..80 0: CASE_KW@65..70 "case" [] [Whitespace(" ")] 1: JS_STRING_LITERAL_EXPRESSION@70..75 0: JS_STRING_LITERAL@70..75 "\"bar\"" [] [] 2: COLON@75..77 ":" [] [Whitespace(" ")] 3: JS_STATEMENT_LIST@77..80 0: JS_BLOCK_STATEMENT@77..80 0: L_CURLY@77..78 "{" [] [] 1: JS_STATEMENT_LIST@78..78 2: R_CURLY@78..80 "}" [] [Whitespace(" ")] 6: R_CURLY@80..81 "}" [] [] 4: JS_SWITCH_STATEMENT@81..126 0: SWITCH_KW@81..89 "switch" [Newline("\n")] [Whitespace(" ")] 1: L_PAREN@89..90 "(" [] [] 2: JS_IDENTIFIER_EXPRESSION@90..93 0: JS_REFERENCE_IDENTIFIER@90..93 0: IDENT@90..93 "foo" [] [] 3: R_PAREN@93..95 ")" [] [Whitespace(" ")] 4: L_CURLY@95..96 "{" [] [] 5: JS_SWITCH_CASE_LIST@96..124 0: JS_DEFAULT_CLAUSE@96..110 0: DEFAULT_KW@96..106 "default" [Newline("\n"), Whitespace(" ")] [] 1: COLON@106..108 ":" [] [Whitespace(" ")] 2: JS_STATEMENT_LIST@108..110 0: JS_BLOCK_STATEMENT@108..110 0: L_CURLY@108..109 "{" [] [] 1: JS_STATEMENT_LIST@109..109 2: R_CURLY@109..110 "}" [] [] 1: JS_CASE_CLAUSE@110..124 0: (empty) 1: JS_BOGUS_EXPRESSION@110..120 0: DEFAULT_KW@110..120 "default" [Newline("\n"), Whitespace(" ")] [] 2: COLON@120..122 ":" [] [Whitespace(" ")] 3: JS_STATEMENT_LIST@122..124 0: JS_BLOCK_STATEMENT@122..124 0: L_CURLY@122..123 "{" [] [] 1: JS_STATEMENT_LIST@123..123 2: R_CURLY@123..124 "}" [] [] 6: R_CURLY@124..126 "}" [Newline("\n")] [] 5: JS_SWITCH_STATEMENT@126..150 0: SWITCH_KW@126..134 "switch" [Newline("\n")] [Whitespace(" ")] 1: L_PAREN@134..135 "(" [] [] 2: JS_IDENTIFIER_EXPRESSION@135..138 0: JS_REFERENCE_IDENTIFIER@135..138 0: IDENT@135..138 "foo" [] [] 3: R_PAREN@138..140 ")" [] [Whitespace(" ")] 4: L_CURLY@140..142 "{" [] [Whitespace(" ")] 5: JS_SWITCH_CASE_LIST@142..149 0: JS_CASE_CLAUSE@142..149 0: CASE_KW@142..147 "case" [] [Whitespace(" ")] 1: (empty) 2: COLON@147..149 ":" [] [Whitespace(" ")] 3: JS_STATEMENT_LIST@149..149 6: R_CURLY@149..150 "}" [] [] 4: EOF@150..151 "" [Newline("\n")] [] -- switch_stmt_err.js:1:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `(` but instead found `foo` > 1 │ switch foo {} │ ^^^ 2 │ switch {} 3 │ switch { var i = 0 } i Remove foo -- switch_stmt_err.js:1:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `)` but instead found `{` > 1 │ switch foo {} │ ^ 2 │ switch {} 3 │ switch { var i = 0 } i Remove { -- switch_stmt_err.js:2:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `(` but instead found `{` 1 │ switch foo {} > 2 │ switch {} │ ^ 3 │ switch { var i = 0 } 4 │ switch { var i = 0; case "bar": {} } i Remove { -- switch_stmt_err.js:3:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `(` but instead found `{` 1 │ switch foo {} 2 │ switch {} > 3 │ switch { var i = 0 } │ ^ 4 │ switch { var i = 0; case "bar": {} } 5 │ switch (foo) { i Remove { -- switch_stmt_err.js:3:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a default, or a case but instead found 'var i = 0'. 1 │ switch foo {} 2 │ switch {} > 3 │ switch { var i = 0 } │ ^^^^^^^^^ 4 │ switch { var i = 0; case "bar": {} } 5 │ switch (foo) { i Expected a default, or a case here. 1 │ switch foo {} 2 │ switch {} > 3 │ switch { var i = 0 } │ ^^^^^^^^^ 4 │ switch { var i = 0; case "bar": {} } 5 │ switch (foo) { -- switch_stmt_err.js:4:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × expected `(` but instead found `{` 2 │ switch {} 3 │ switch { var i = 0 } > 4 │ switch { var i = 0; case "bar": {} } │ ^ 5 │ switch (foo) { 6 │ default: {} i Remove { -- switch_stmt_err.js:4:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected a default, or a case but instead found 'var i = 0;'. 2 │ switch {} 3 │ switch { var i = 0 } > 4 │ switch { var i = 0; case "bar": {} } │ ^^^^^^^^^^ 5 │ switch (foo) { 6 │ default: {} i Expected a default, or a case here. 2 │ switch {} 3 │ switch { var i = 0 } > 4 │ switch { var i = 0; case "bar": {} } │ ^^^^^^^^^^ 5 │ switch (foo) { 6 │ default: {} -- switch_stmt_err.js:7:3 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Multiple default clauses inside of a switch statement are not allowed 5 │ switch (foo) { 6 │ default: {} > 7 │ default: {} │ ^^^^^^^^^^^ 8 │ } 9 │ switch (foo) { case : } i a second clause here is not allowed 5 │ switch (foo) { 6 │ default: {} > 7 │ default: {} │ ^^^^^^^^^^^ 8 │ } 9 │ switch (foo) { case : } i the first default clause is defined here 4 │ switch { var i = 0; case "bar": {} } 5 │ switch (foo) { > 6 │ default: {} │ ^^^^^^^^^^^ 7 │ default: {} 8 │ } -- switch_stmt_err.js:9:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an expression but instead found ':'. 7 │ default: {} 8 │ } > 9 │ switch (foo) { case : } │ ^ 10 │ i Expected an expression here. 7 │ default: {} 8 │ } > 9 │ switch (foo) { case : } │ ^ 10 │ -- switch foo {} switch {} switch { var i = 0 } switch { var i = 0; case "bar": {} } switch (foo) { default: {} default: {} } switch (foo) { case : }