A simple scripting language in C++
Ferenc Szontágh
2025-04-18 df361ede5e694c41095d7be4eabf86d0ee6a1162
src/Parser/Parser.hpp
@@ -166,12 +166,17 @@
        throw Exception(message, expected, token);
    }
    // parseStatement (unchanged)
    // parseStatement (updated to handle return)
    void parseStatement() {
        const auto & token_type = currentToken().type;
        if (token_type == Lexer::Tokens::Type::KEYWORD_FUNCTION_DECLARATION) {
            parseFunctionDefinition();
            return;
        }
        // Return statement
        if (token_type == Lexer::Tokens::Type::KEYWORD_RETURN) {
            parseReturnStatement();
            return;
        }
@@ -194,6 +199,8 @@
    void parseFunctionDefinition();
    // Parse a top-level function call statement (e.g., foo(arg1, arg2);)
    void parseCallStatement();
    // Parse a return statement (e.g., return; or return expr;)
    void parseReturnStatement();
    // --- Parsing helper functions ---