From e1fea0e3b49f3b9b3e8a317ceb1938d3d02bf0a0 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 04:05:31 +0000 Subject: refactor(parser): share the FUNCTION and PROCEDURE body tail ParseFunctionBody() scopes the prototype's pack parameters, parses the body up to ENDFUNCTION/ENDPROCEDURE, reports the same "expected ..." diagnostic and builds the FunctionDefAST for both declaration forms. Co-Authored-By: Claude Opus 5.5 --- include/cps/Parser.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/cps') diff --git a/include/cps/Parser.h b/include/cps/Parser.h index fbccb3c..eff25a5 100644 --- a/include/cps/Parser.h +++ b/include/cps/Parser.h @@ -93,6 +93,8 @@ class Parser { std::unique_ptr ParseFunction(const std::string &OwnerClass = {}, bool IsPublic = true, bool IsOverload = false); std::unique_ptr ParseProcedure(const std::string &OwnerClass = {}, bool IsPublic = true, bool IsOverload = false); + std::unique_ptr ParseFunctionBody( + std::unique_ptr Proto, int EndToken, const char *EndMessage, int Line); std::unique_ptr ParseExternDecl(); std::unique_ptr ParseCallStmt(); std::unique_ptr ParseReturnStmt(); -- cgit v1.3.1-4-g156e