diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-20 11:57:16 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-20 11:57:16 +0000 |
| commit | 62b605c6c0ea13e9763c0a0115464007b13a8831 (patch) | |
| tree | 53c27965f5a365682e0d79fd96e25b228ecb9dca /lib/Parser | |
| parent | bfe2e75d7e3b372e55369677028429990c49bc54 (diff) | |
refactor(strings): replace compiler builtins with the STRING library
Construct literals as STRING values and route string operations through
ordinary library functions and operators. Preserve value ownership in
records, arrays, constants and file I/O.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib/Parser')
| -rw-r--r-- | lib/Parser/ParserType.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Parser/ParserType.cc b/lib/Parser/ParserType.cc index e3adc5b..64330e4 100644 --- a/lib/Parser/ParserType.cc +++ b/lib/Parser/ParserType.cc @@ -22,12 +22,12 @@ std::unique_ptr<StmtAST> Parser::ParseTypeDecl() { int Line = Lex.getLine(); getNextToken(); // eat TYPE or CLASS - if (CurTok != tok_identifier) { + if (CurTok != tok_identifier && !(IsClass && CurTok == tok_string_kw)) { cps::sourceDiagnostic(Lex.getLine(), "error: Expected type name after %s at line %d\n", Keyword, Lex.getLine()); if (IsClass) ParseRecordBody("<unnamed>", Line, tok_endclass); return nullptr; } - std::string Name = Lex.IdentifierStr; + std::string Name = CurTok == tok_string_kw ? "STRING" : Lex.IdentifierStr; getNextToken(); std::unique_ptr<StmtAST> Decl; |
