MCPcopy Create free account
hub / github.com/WheretIB/nullc / ParseReturnExpr

Function ParseReturnExpr

NULLC/Parser.cpp:1680–1693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1678}
1679
1680bool ParseReturnExpr(Lexeme** str, bool yield)
1681{
1682 const char* start = (*str)->pos;
1683 if(!(yield ? ParseLexem(str, lex_yield) : ParseLexem(str, lex_return)))
1684 return false;
1685
1686 if(!ParseVaribleSet(str))
1687 AddVoidNode();
1688
1689 if(!ParseLexem(str, lex_semicolon))
1690 ThrowError((*str)->pos, "ERROR: return statement must be followed by ';'");
1691 AddReturnNode(start, yield);
1692 return true;
1693}
1694
1695bool ParseBreakExpr(Lexeme** str)
1696{

Callers 1

ParseExpressionFunction · 0.85

Calls 5

ParseLexemFunction · 0.85
ParseVaribleSetFunction · 0.85
AddVoidNodeFunction · 0.85
ThrowErrorFunction · 0.85
AddReturnNodeFunction · 0.85

Tested by

no test coverage detected