From c89477d615fb0ce4d89786ef848ffe6aca1da088 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sat, 17 Oct 2026 06:50:29 +0000 Subject: feat(classes): support explicit NEW constructor method calls Co-Authored-By: Claude Opus 5.5 --- lib/Parser/ParserExpression.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Parser/ParserExpression.cc') diff --git a/lib/Parser/ParserExpression.cc b/lib/Parser/ParserExpression.cc index e9b0dcc..f4e074e 100644 --- a/lib/Parser/ParserExpression.cc +++ b/lib/Parser/ParserExpression.cc @@ -109,13 +109,13 @@ bool Parser::ParseDesignatorSuffix(std::vector &Out) { Out.push_back(std::move(A)); } else if (CurTok == '.') { getNextToken(); - if (CurTok != tok_identifier) { + if (CurTok != tok_identifier && CurTok != tok_new) { fprintf(stderr, "error: Expected field name after '.' at line %d\n", Lex.getLine()); return false; } DesignatorAccess A; A.Kind = AccessKind::Field; - A.FieldName = Lex.IdentifierStr; + A.FieldName = CurTok == tok_new ? "NEW" : Lex.IdentifierStr; Out.push_back(std::move(A)); getNextToken(); } else if (CurTok == '^') { -- cgit v1.3.1-4-g156e