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

Function ParseVariableDefineSub

NULLC/Parser.cpp:1329–1343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1327}
1328
1329bool ParseVariableDefineSub(Lexeme** str)
1330{
1331 TypeInfo* currType = GetSelectedType();
1332 if(!ParseAddVariable(str))
1333 ThrowError((*str)->pos, "ERROR: unexpected symbol '%.*s' after type name. Variable name is expected at this point", (*str)->length, (*str)->pos);
1334
1335 while(ParseLexem(str, lex_comma))
1336 {
1337 SelectTypeByPointer(currType);
1338 if(!ParseAddVariable(str))
1339 ThrowError((*str)->pos, "ERROR: next variable definition excepted after ','");
1340 AddTwoExpressionNode();
1341 }
1342 return true;
1343}
1344
1345bool ParseAlignment(Lexeme** str)
1346{

Callers 2

ParseVariableDefineFunction · 0.85
ParseExpressionFunction · 0.85

Calls 6

GetSelectedTypeFunction · 0.85
ParseAddVariableFunction · 0.85
ThrowErrorFunction · 0.85
ParseLexemFunction · 0.85
SelectTypeByPointerFunction · 0.85
AddTwoExpressionNodeFunction · 0.85

Tested by

no test coverage detected