diff options
Diffstat (limited to 'lib/Parser/ParserFunction.cc')
| -rw-r--r-- | lib/Parser/ParserFunction.cc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/Parser/ParserFunction.cc b/lib/Parser/ParserFunction.cc index 81db2c7..f4e39de 100644 --- a/lib/Parser/ParserFunction.cc +++ b/lib/Parser/ParserFunction.cc @@ -13,7 +13,7 @@ bool Parser::ParseSignedIntBound(int64_t &Out) { getNextToken(); } if (CurTok != tok_number_int) { - fprintf(stderr, "Error: Array parameter bounds must be integer literals at line %d\n", + fprintf(stderr, "error: Array parameter bounds must be integer literals at line %d\n", Lex.getLine()); return false; } @@ -37,7 +37,7 @@ std::optional<std::vector<ParamDecl>> Parser::ParsePrototypeArgs(bool AllowByRef while (CurTok != ')') { if (CurTok == tok_byref) { if (!AllowByRef) { - fprintf(stderr, "Error: BYREF parameters are not allowed in a FUNCTION (procedures only) at line %d\n", + fprintf(stderr, "error: BYREF parameters are not allowed in a FUNCTION (procedures only) at line %d\n", Lex.getLine()); return std::nullopt; } @@ -49,7 +49,7 @@ std::optional<std::vector<ParamDecl>> Parser::ParsePrototypeArgs(bool AllowByRef } if (CurTok != tok_identifier) { - fprintf(stderr, "Error: Expected argument name at line %d\n", Lex.getLine()); + fprintf(stderr, "error: Expected argument name at line %d\n", Lex.getLine()); return std::nullopt; } ParamDecl P; @@ -58,7 +58,7 @@ std::optional<std::vector<ParamDecl>> Parser::ParsePrototypeArgs(bool AllowByRef getNextToken(); if (CurTok != tok_colon) { - fprintf(stderr, "Error: Expected ':' after argument name at line %d\n", Lex.getLine()); + fprintf(stderr, "error: Expected ':' after argument name at line %d\n", Lex.getLine()); return std::nullopt; } getNextToken(); @@ -72,7 +72,7 @@ std::optional<std::vector<ParamDecl>> Parser::ParsePrototypeArgs(bool AllowByRef int64_t Lo = 0, Hi = 0; if (!ParseSignedIntBound(Lo)) return std::nullopt; if (CurTok != tok_colon) { - fprintf(stderr, "Error: Expected ':' between array parameter bounds at line %d\n", + fprintf(stderr, "error: Expected ':' between array parameter bounds at line %d\n", Lex.getLine()); return std::nullopt; } @@ -81,7 +81,7 @@ std::optional<std::vector<ParamDecl>> Parser::ParsePrototypeArgs(bool AllowByRef P.DeclaredBounds.emplace_back(Lo, Hi); if (CurTok == ']') break; if (CurTok != ',') { - fprintf(stderr, "Error: Expected ',' or ']' in array parameter bounds at line %d\n", + fprintf(stderr, "error: Expected ',' or ']' in array parameter bounds at line %d\n", Lex.getLine()); return std::nullopt; } @@ -93,7 +93,7 @@ std::optional<std::vector<ParamDecl>> Parser::ParsePrototypeArgs(bool AllowByRef P.Rank = 1; // ARRAY OF T: bounds travel with the argument } if (CurTok != tok_of) { - fprintf(stderr, "Error: Expected OF after ARRAY in parameter '%s' at line %d\n", + fprintf(stderr, "error: Expected OF after ARRAY in parameter '%s' at line %d\n", P.Name.c_str(), Lex.getLine()); return std::nullopt; } @@ -102,13 +102,13 @@ std::optional<std::vector<ParamDecl>> Parser::ParsePrototypeArgs(bool AllowByRef P.TypeName = ParseTypeName(false); if (P.TypeName.empty()) { - fprintf(stderr, "Error: Expected argument type for '%s'\n", P.Name.c_str()); + fprintf(stderr, "error: Expected argument type for '%s'\n", P.Name.c_str()); return std::nullopt; } for (const ParamDecl &Prev : Params) { if (Prev.Name == P.Name) { - fprintf(stderr, "Error: Duplicate parameter name '%s' at line %d\n", + fprintf(stderr, "error: Duplicate parameter name '%s' at line %d\n", P.Name.c_str(), Lex.getLine()); return std::nullopt; } @@ -117,12 +117,12 @@ std::optional<std::vector<ParamDecl>> Parser::ParsePrototypeArgs(bool AllowByRef if (CurTok == ')') break; if (CurTok != ',') { - fprintf(stderr, "Error: Expected ',' or ')'\n"); + fprintf(stderr, "error: Expected ',' or ')'\n"); return std::nullopt; } getNextToken(); if (CurTok == ')') { - fprintf(stderr, "Error: Expected another parameter after ',' at line %d\n", Lex.getLine()); + fprintf(stderr, "error: Expected another parameter after ',' at line %d\n", Lex.getLine()); return std::nullopt; } } @@ -133,7 +133,7 @@ std::optional<std::vector<ParamDecl>> Parser::ParsePrototypeArgs(bool AllowByRef std::unique_ptr<StmtAST> Parser::ParseFunction() { getNextToken(); if (CurTok != tok_identifier) { - fprintf(stderr, "Error: Expected function name\n"); + fprintf(stderr, "error: Expected function name\n"); return nullptr; } @@ -147,13 +147,13 @@ std::unique_ptr<StmtAST> Parser::ParseFunction() { if (CurTok == tok_returns) { getNextToken(); if (CurTok == tok_array) { - fprintf(stderr, "Error: A FUNCTION cannot RETURN an array; use a BYREF PROCEDURE parameter instead at line %d\n", + fprintf(stderr, "error: A FUNCTION cannot RETURN an array; use a BYREF PROCEDURE parameter instead at line %d\n", Lex.getLine()); return nullptr; } RetType = ParseTypeName(true); if (RetType.empty()) { - fprintf(stderr, "Error: Expected return type for function '%s'\n", Name.c_str()); + fprintf(stderr, "error: Expected return type for function '%s'\n", Name.c_str()); return nullptr; } } @@ -163,7 +163,7 @@ std::unique_ptr<StmtAST> Parser::ParseFunction() { std::vector<std::unique_ptr<StmtAST>> Body = ParseBlock({tok_endfunction}); if (CurTok != tok_endfunction) { - fprintf(stderr, "Error: expected ENDFUNCTION\n"); + fprintf(stderr, "error: expected ENDFUNCTION\n"); return nullptr; } getNextToken(); @@ -174,7 +174,7 @@ std::unique_ptr<StmtAST> Parser::ParseFunction() { std::unique_ptr<StmtAST> Parser::ParseProcedure() { getNextToken(); if (CurTok != tok_identifier) { - fprintf(stderr, "Error: Expected procedure name\n"); + fprintf(stderr, "error: Expected procedure name\n"); return nullptr; } @@ -188,7 +188,7 @@ std::unique_ptr<StmtAST> Parser::ParseProcedure() { std::vector<std::unique_ptr<StmtAST>> Body = ParseBlock({tok_endprocedure}); if (CurTok != tok_endprocedure) { - fprintf(stderr, "Error: expected ENDPROCEDURE\n"); + fprintf(stderr, "error: expected ENDPROCEDURE\n"); return nullptr; } getNextToken(); @@ -200,7 +200,7 @@ std::unique_ptr<StmtAST> Parser::ParseCallStmt() { int Line = Lex.getLine(); getNextToken(); if (CurTok != tok_identifier) { - fprintf(stderr, "Error: Expected callee name after CALL\n"); + fprintf(stderr, "error: Expected callee name after CALL\n"); return nullptr; } |
