Rename Arrow to DoubleArrow

This commit is contained in:
Alex Beregszaszi 2020-08-27 11:42:00 +01:00
parent 4e5b403c37
commit 662f7d8fac
6 changed files with 6 additions and 6 deletions

View File

@ -433,7 +433,7 @@ variableDeclarationTuple:
variableDeclarationStatement: ((variableDeclaration (Assign expression)?) | (variableDeclarationTuple Assign expression)) Semicolon;
expressionStatement: expression Semicolon;
mappingType: Mapping LParen key=mappingKeyType Arrow value=typeName RParen;
mappingType: Mapping LParen key=mappingKeyType DoubleArrow value=typeName RParen;
/**
* Only elementary types or user defined types are viable as mapping keys.
*/

View File

@ -111,7 +111,7 @@ Colon: ':';
Semicolon: ';';
Period: '.';
Conditional: '?';
Arrow: '=>';
DoubleArrow: '=>';
RightArrow: '->';
Assign: '=';

View File

@ -540,7 +540,7 @@ void Scanner::scanToken()
if (m_char == '=')
token = selectToken(Token::Equal);
else if (m_char == '>')
token = selectToken(Token::Arrow);
token = selectToken(Token::DoubleArrow);
else
token = Token::Assign;
break;

View File

@ -83,7 +83,7 @@ namespace solidity::langutil
T(Semicolon, ";", 0) \
T(Period, ".", 0) \
T(Conditional, "?", 3) \
T(Arrow, "=>", 0) \
T(DoubleArrow, "=>", 0) \
T(RightArrow, "->", 0) \
\
/* Assignment operators. */ \

View File

@ -1050,7 +1050,7 @@ ASTPointer<Mapping> Parser::parseMapping()
}
else
fatalParserError(1005_error, "Expected elementary type name or identifier for mapping key type");
expectToken(Token::Arrow);
expectToken(Token::DoubleArrow);
ASTPointer<TypeName> valueType = parseTypeName();
nodeFactory.markEndPosition();
expectToken(Token::RParen);

View File

@ -406,7 +406,7 @@ BOOST_AUTO_TEST_CASE(ambiguities)
BOOST_CHECK_EQUAL(scanner.next(), Token::AssignAdd);
BOOST_CHECK_EQUAL(scanner.next(), Token::Identifier);
BOOST_CHECK_EQUAL(scanner.next(), Token::Inc);
BOOST_CHECK_EQUAL(scanner.next(), Token::Arrow);
BOOST_CHECK_EQUAL(scanner.next(), Token::DoubleArrow);
BOOST_CHECK_EQUAL(scanner.next(), Token::SHL);
BOOST_CHECK_EQUAL(scanner.next(), Token::SAR);
BOOST_CHECK_EQUAL(scanner.next(), Token::AssignSar);