(context)
| 33010 | return false; |
| 33011 | } |
| 33012 | function parsingContextErrors(context) { |
| 33013 | switch (context) { |
| 33014 | case 0 /* ParsingContext.SourceElements */: |
| 33015 | return token() === 88 /* SyntaxKind.DefaultKeyword */ |
| 33016 | ? parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(93 /* SyntaxKind.ExportKeyword */)) |
| 33017 | : parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected); |
| 33018 | case 1 /* ParsingContext.BlockStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected); |
| 33019 | case 2 /* ParsingContext.SwitchClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.case_or_default_expected); |
| 33020 | case 3 /* ParsingContext.SwitchClauseStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Statement_expected); |
| 33021 | case 18 /* ParsingContext.RestProperties */: // fallthrough |
| 33022 | case 4 /* ParsingContext.TypeMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_or_signature_expected); |
| 33023 | case 5 /* ParsingContext.ClassMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); |
| 33024 | case 6 /* ParsingContext.EnumMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Enum_member_expected); |
| 33025 | case 7 /* ParsingContext.HeritageClauseElement */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_expected); |
| 33026 | case 8 /* ParsingContext.VariableDeclarations */: |
| 33027 | return ts.isKeyword(token()) |
| 33028 | ? parseErrorAtCurrentToken(ts.Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, ts.tokenToString(token())) |
| 33029 | : parseErrorAtCurrentToken(ts.Diagnostics.Variable_declaration_expected); |
| 33030 | case 9 /* ParsingContext.ObjectBindingElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_destructuring_pattern_expected); |
| 33031 | case 10 /* ParsingContext.ArrayBindingElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Array_element_destructuring_pattern_expected); |
| 33032 | case 11 /* ParsingContext.ArgumentExpressions */: return parseErrorAtCurrentToken(ts.Diagnostics.Argument_expression_expected); |
| 33033 | case 12 /* ParsingContext.ObjectLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_assignment_expected); |
| 33034 | case 15 /* ParsingContext.ArrayLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_or_comma_expected); |
| 33035 | case 17 /* ParsingContext.JSDocParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected); |
| 33036 | case 16 /* ParsingContext.Parameters */: |
| 33037 | return ts.isKeyword(token()) |
| 33038 | ? parseErrorAtCurrentToken(ts.Diagnostics._0_is_not_allowed_as_a_parameter_name, ts.tokenToString(token())) |
| 33039 | : parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected); |
| 33040 | case 19 /* ParsingContext.TypeParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_parameter_declaration_expected); |
| 33041 | case 20 /* ParsingContext.TypeArguments */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_argument_expected); |
| 33042 | case 21 /* ParsingContext.TupleElementTypes */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_expected); |
| 33043 | case 22 /* ParsingContext.HeritageClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_expected); |
| 33044 | case 23 /* ParsingContext.ImportOrExportSpecifiers */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); |
| 33045 | case 13 /* ParsingContext.JsxAttributes */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); |
| 33046 | case 14 /* ParsingContext.JsxChildren */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); |
| 33047 | default: return [undefined]; // TODO: GH#18217 `default: Debug.assertNever(context);` |
| 33048 | } |
| 33049 | } |
| 33050 | function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) { |
| 33051 | var saveParsingContext = parsingContext; |
| 33052 | parsingContext |= 1 << kind; |
no test coverage detected
searching dependent graphs…