mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4054 from ethereum/token-names
Improve parser error messages
This commit is contained in:
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError: (118-118): Expected token Semicolon got 'Identifier'
|
||||
// ParserError: (118-118): Expected ';' but got identifier
|
||||
|
||||
@@ -2,4 +2,4 @@ contract Foo {
|
||||
uint constant = 4;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (30-30): Expected token Identifier got 'Assign'
|
||||
// ParserError: (30-30): Expected identifier but got '='
|
||||
|
||||
@@ -5,4 +5,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError: (49-49): Expected token LParen got 'Semicolon'
|
||||
// ParserError: (49-49): Expected '(' but got ';'
|
||||
|
||||
@@ -2,4 +2,4 @@ contract c {
|
||||
event e;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (21-21): Expected token LParen got 'Semicolon'
|
||||
// ParserError: (21-21): Expected '(' but got ';'
|
||||
|
||||
@@ -2,4 +2,4 @@ contract c {
|
||||
uint external x;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (19-19): Expected token Identifier got 'External'
|
||||
// ParserError: (19-19): Expected identifier but got 'external'
|
||||
|
||||
@@ -2,4 +2,4 @@ contract A {
|
||||
fixed40x40 pi = 3.14.15;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (34-34): Expected token Semicolon got 'Number'
|
||||
// ParserError: (34-34): Expected ';' but got 'Number'
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@ contract test {
|
||||
function (uint, uint) modifier1() returns (uint) f1;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (66-66): Expected token LBrace got 'Identifier'
|
||||
// ParserError: (66-66): Expected '{' but got identifier
|
||||
|
||||
@@ -6,4 +6,4 @@ contract Foo {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError: (67-67): Expected token Semicolon got 'Constant'
|
||||
// ParserError: (67-67): Expected ';' but got 'constant'
|
||||
|
||||
@@ -2,4 +2,4 @@ contract Foo {
|
||||
uint[] memory x;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (23-23): Expected token Identifier got 'Memory'
|
||||
// ParserError: (23-23): Expected identifier but got 'memory'
|
||||
|
||||
@@ -2,4 +2,4 @@ contract c {
|
||||
enum foo { WARNING,}
|
||||
}
|
||||
// ----
|
||||
// ParserError: (33-33): Expected Identifier after ','
|
||||
// ParserError: (33-33): Expected identifier after ','
|
||||
|
||||
@@ -3,4 +3,4 @@ contract test {
|
||||
function b() returns (uint r) { r = a({: 1, : 2, : 3}); }
|
||||
}
|
||||
// ----
|
||||
// ParserError: (143-143): Expected token Identifier got 'Colon'
|
||||
// ParserError: (143-143): Expected identifier but got ':'
|
||||
|
||||
@@ -2,4 +2,4 @@ contract test {
|
||||
uint256 ;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (28-28): Expected token Identifier got 'Semicolon'
|
||||
// ParserError: (28-28): Expected identifier but got ';'
|
||||
|
||||
@@ -2,4 +2,4 @@ contract c {
|
||||
modifier mod { if (msg.sender == 0) _ }
|
||||
}
|
||||
// ----
|
||||
// ParserError: (52-52): Expected token Semicolon got 'RBrace'
|
||||
// ParserError: (52-52): Expected ';' but got '}'
|
||||
|
||||
@@ -2,4 +2,4 @@ contract test {
|
||||
uint payable x;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (22-22): Expected token Identifier got 'Payable'
|
||||
// ParserError: (22-22): Expected identifier but got 'payable'
|
||||
|
||||
@@ -4,4 +4,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError: (42-42): Expected token Comma got 'Number'
|
||||
// ParserError: (42-42): Expected ',' but got 'Number'
|
||||
|
||||
@@ -2,4 +2,4 @@ contract Foo {
|
||||
function f() { var[] a; }
|
||||
}
|
||||
// ----
|
||||
// ParserError: (34-34): Expected token Identifier got 'LBrack'
|
||||
// ParserError: (34-34): Expected identifier but got '['
|
||||
|
||||
Reference in New Issue
Block a user