MCPcopy Create free account
hub / github.com/csyonghe/Spire / ParseBlockStatement

Method ParseBlockStatement

Source/SpireCore/Parser.cpp:1385–1407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1383 }
1384
1385 RefPtr<BlockStatementSyntaxNode> Parser::ParseBlockStatement()
1386 {
1387 RefPtr<ScopeDecl> scopeDecl = new ScopeDecl();
1388 RefPtr<BlockStatementSyntaxNode> blockStatement = new BlockStatementSyntaxNode();
1389 blockStatement->scopeDecl = scopeDecl;
1390 PushScope(scopeDecl.Ptr());
1391 ReadToken(TokenType::LBrace);
1392 if(!tokenReader.IsAtEnd())
1393 {
1394 FillPosition(blockStatement.Ptr());
1395 }
1396 while (!AdvanceIfMatch(this, TokenType::RBrace))
1397 {
1398 auto stmt = ParseStatement();
1399 if(stmt)
1400 {
1401 blockStatement->Statements.Add(stmt);
1402 }
1403 TryRecover(this);
1404 }
1405 PopScope();
1406 return blockStatement;
1407 }
1408
1409 RefPtr<VarDeclrStatementSyntaxNode> Parser::ParseVarDeclrStatement()
1410 {

Callers 2

ParseFuncDeclFunction · 0.80
ParseVarDeclFunction · 0.80

Calls 6

ReadTokenFunction · 0.85
AdvanceIfMatchFunction · 0.85
TryRecoverFunction · 0.85
IsAtEndMethod · 0.80
PtrMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected