aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing
diff options
context:
space:
mode:
authorRJ Catalano <catalanor0220@gmail.com>2015-12-16 02:22:52 +0800
committerRJ Catalano <catalanor0220@gmail.com>2015-12-16 02:22:52 +0800
commitaebce8a1d5aa8bf06719341432f487acd347d297 (patch)
treeba8ff62d24864cff6510470f0acf5023f3bfadf0 /libsolidity/parsing
parent5a462afd03dc425ab77e718e430f19512740c6b1 (diff)
downloaddexon-solidity-aebce8a1d5aa8bf06719341432f487acd347d297.tar.gz
dexon-solidity-aebce8a1d5aa8bf06719341432f487acd347d297.tar.zst
dexon-solidity-aebce8a1d5aa8bf06719341432f487acd347d297.zip
now is compiling and passing soltest...but I think there may be a few more things to do
Diffstat (limited to 'libsolidity/parsing')
-rw-r--r--libsolidity/parsing/Parser.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp
index 149948f7..cb5968e9 100644
--- a/libsolidity/parsing/Parser.cpp
+++ b/libsolidity/parsing/Parser.cpp
@@ -1037,11 +1037,13 @@ ASTPointer<Expression> Parser::parsePrimaryExpression()
case Token::LParen:
case Token::LBrack:
{
- // Tuple or parenthesized expression.
- // Special cases: () is empty tuple type, (x) is not a real tuple, (x,) is one-dimensional tuple
+ // Tuple/parenthesized expression or inline array/bracketed expression.
+ // Special cases: ()/[] is empty tuple/array type, (x)/[] is not a real tuple/array,
+ // (x,) is one-dimensional tuple
m_scanner->next();
vector<ASTPointer<Expression>> components;
- Token::Value oppositeToken = (token == LParen ? Token::RParen : Token::RBrack);
+ Token::Value oppositeToken = (token == Token::LParen ? Token::RParen : Token::RBrack);
+ bool isArray = (token == Token::LParen ? false : true);
if (m_scanner->currentToken() != Token::RParen)
while (true)
@@ -1057,7 +1059,7 @@ ASTPointer<Expression> Parser::parsePrimaryExpression()
}
nodeFactory.markEndPosition();
expectToken(oppositeToken);
- return nodeFactory.createNode<TupleExpression>(components);
+ return nodeFactory.createNode<TupleExpression>(components, isArray);
}
default: