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

Function ParseAlignment

NULLC/Parser.cpp:1345–1365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1343}
1344
1345bool ParseAlignment(Lexeme** str)
1346{
1347 if(ParseLexem(str, lex_noalign))
1348 {
1349 SetCurrentAlignment(0);
1350 return true;
1351 }else if(ParseLexem(str, lex_align))
1352 {
1353 if(!ParseLexem(str, lex_oparen))
1354 ThrowError((*str)->pos, "ERROR: '(' expected after align");
1355
1356 const char *start = (*str)->pos;
1357 if(!ParseLexem(str, lex_number))
1358 ThrowError((*str)->pos, "ERROR: alignment value not found after align(");
1359 SetCurrentAlignment(atoi(start));
1360 if(!ParseLexem(str, lex_cparen))
1361 ThrowError((*str)->pos, "ERROR: ')' expected after alignment value");
1362 return true;
1363 }
1364 return false;
1365}
1366
1367bool ParseVariableDefine(Lexeme** str)
1368{

Callers 2

ParseClassDefinitionFunction · 0.85
ParseVariableDefineFunction · 0.85

Calls 3

ParseLexemFunction · 0.85
SetCurrentAlignmentFunction · 0.85
ThrowErrorFunction · 0.85

Tested by

no test coverage detected