| 376 | } |
| 377 | |
| 378 | ASTPointer<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 | |
| 403 | ASTPointer<ContractDefinition> Parser::parseContractDefinition() |
| 404 | { |
nothing calls this directly
no test coverage detected