MCPcopy Create free account
hub / github.com/argotorg/solidity / parseStorageLayoutSpecifier

Method parseStorageLayoutSpecifier

libsolidity/parsing/Parser.cpp:378–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378ASTPointer<StorageLayoutSpecifier> Parser::parseStorageLayoutSpecifier()
379{
380 RecursionGuard recursionGuard(*this);
381 ASTNodeFactory nodeFactory(*this);
382 ASTPointer<ASTString> layoutIdentifier = expectIdentifierToken();
383 solAssert(layoutIdentifier && *layoutIdentifier == "layout");
384 if (
385 m_scanner->currentToken() != Token::Identifier ||
386 m_scanner->currentLiteral() != "at"
387 )
388 m_errorReporter.parserError(
389 1994_error,
390 m_scanner->currentLocation(),
391 "Expected \'at\' but got " + tokenName(m_scanner->currentToken())
392 );
393
394 advance();
395 ASTPointer<Expression> baseSlotExpression = parseExpression();
396 solAssert(baseSlotExpression);
397 nodeFactory.setEndPositionFromNode(baseSlotExpression);
398 return nodeFactory.createNode<StorageLayoutSpecifier>(
399 baseSlotExpression
400 );
401}
402
403ASTPointer<ContractDefinition> Parser::parseContractDefinition()
404{

Callers

nothing calls this directly

Calls 6

parseExpressionFunction · 0.85
currentTokenMethod · 0.45
currentLiteralMethod · 0.45
parserErrorMethod · 0.45
currentLocationMethod · 0.45

Tested by

no test coverage detected