diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 04:00:38 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 04:05:51 +0000 |
| commit | 0b763257ed1e230767171234971cc8f660d59087 (patch) | |
| tree | 61287515873b94ab4eeccf608447c39019d7ba25 /lib/Parser/ParserControlFlow.cc | |
| parent | 56e97d0ddd3fff2bee160bae04e8f659671f398d (diff) | |
refactor(parser): share call-argument, result-access and type-token checks
Add ParseOptionalCallArgs() for member calls and NEW, diagnoseResultAccess()
for the duplicated "access on a function result" diagnostic, and
isBuiltinTypeToken() for the builtin type keyword list used by template-call
lookahead, cast detection and CASE label scanning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib/Parser/ParserControlFlow.cc')
| -rw-r--r-- | lib/Parser/ParserControlFlow.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Parser/ParserControlFlow.cc b/lib/Parser/ParserControlFlow.cc index ba038d3..feedf44 100644 --- a/lib/Parser/ParserControlFlow.cc +++ b/lib/Parser/ParserControlFlow.cc @@ -156,14 +156,13 @@ bool Parser::isCaseLabel() { case ')': case ']': if (--Depth < 0) return false; break; case tok_identifier: case tok_number_int: case tok_number_real: case tok_string_literal: case tok_c_string_literal: case tok_char_literal: case tok_true: case tok_false: - case tok_integer_kw: case tok_real_kw: case tok_boolean_kw: - case tok_string_kw: case tok_char_kw: case tok_c_int: case tok_c_char: - case tok_c_string: case tok_c_double: case tok_to: case tok_otherwise: case tok_and: case tok_or: case tok_not: case tok_eq: case tok_ne: case tok_le: case tok_ge: case tok_div: case tok_mod: case '+': case '-': case '*': case '/': case '&': case '^': case '<': case '>': case '.': case ',': break; - default: return false; + default: + if (!isBuiltinTypeToken(T)) return false; + break; } } } |
