|
@ -180,7 +180,7 @@ ASTPointer<InheritanceSpecifier> Parser::parseInheritanceSpecifier() |
|
|
|
|
|
|
|
|
Declaration::Visibility Parser::parseVisibilitySpecifier(Token::Value _token) |
|
|
Declaration::Visibility Parser::parseVisibilitySpecifier(Token::Value _token) |
|
|
{ |
|
|
{ |
|
|
Declaration::Visibility visibility; |
|
|
Declaration::Visibility visibility = Declaration::Visibility::DEFAULT; |
|
|
if (_token == Token::PUBLIC) |
|
|
if (_token == Token::PUBLIC) |
|
|
visibility = Declaration::Visibility::PUBLIC; |
|
|
visibility = Declaration::Visibility::PUBLIC; |
|
|
else if (_token == Token::PROTECTED) |
|
|
else if (_token == Token::PROTECTED) |
|
@ -684,6 +684,7 @@ ASTPointer<Expression> Parser::parsePrimaryExpression() |
|
|
ASTNodeFactory nodeFactory(*this); |
|
|
ASTNodeFactory nodeFactory(*this); |
|
|
Token::Value token = m_scanner->getCurrentToken(); |
|
|
Token::Value token = m_scanner->getCurrentToken(); |
|
|
ASTPointer<Expression> expression; |
|
|
ASTPointer<Expression> expression; |
|
|
|
|
|
Token::Value nextToken = Token::ILLEGAL; |
|
|
switch (token) |
|
|
switch (token) |
|
|
{ |
|
|
{ |
|
|
case Token::TRUE_LITERAL: |
|
|
case Token::TRUE_LITERAL: |
|
@ -691,9 +692,10 @@ ASTPointer<Expression> Parser::parsePrimaryExpression() |
|
|
expression = nodeFactory.createNode<Literal>(token, getLiteralAndAdvance()); |
|
|
expression = nodeFactory.createNode<Literal>(token, getLiteralAndAdvance()); |
|
|
break; |
|
|
break; |
|
|
case Token::NUMBER: |
|
|
case Token::NUMBER: |
|
|
|
|
|
nextToken = m_scanner->peekNextToken(); |
|
|
case Token::STRING_LITERAL: |
|
|
case Token::STRING_LITERAL: |
|
|
nodeFactory.markEndPosition(); |
|
|
nodeFactory.markEndPosition(); |
|
|
expression = nodeFactory.createNode<Literal>(token, getLiteralAndAdvance()); |
|
|
expression = nodeFactory.createNode<Literal>(token, getLiteralAndAdvance(), nextToken); |
|
|
break; |
|
|
break; |
|
|
case Token::IDENTIFIER: |
|
|
case Token::IDENTIFIER: |
|
|
nodeFactory.markEndPosition(); |
|
|
nodeFactory.markEndPosition(); |
|
|