[TMP] Denominations vs suffixes

This commit is contained in:
Kamil Śliwak 2022-06-06 14:35:30 +02:00
parent 15fa973569
commit 7b06fba8fb
4 changed files with 78 additions and 8 deletions

View File

@ -1,7 +1,7 @@
contract C { contract C {
function f() { function f() public {
uint x = 1 finney; uint x = 1 finney;
} }
} }
// ---- // ----
// ParserError 2314: (45-51): Expected ';' but got identifier // DeclarationError 7920: (58-64): Identifier not found or not unique.

View File

@ -1,7 +1,7 @@
contract C { contract C {
function f() { function f() public {
uint x = 1 szabo; uint x = 1 szabo;
} }
} }
// ---- // ----
// ParserError 2314: (45-50): Expected ';' but got identifier // DeclarationError 7920: (58-63): Identifier not found or not unique.

View File

@ -0,0 +1,9 @@
function szabo(uint x) pure returns (uint) { return x; }
function finney(uint x) pure returns (uint) { return x; }
contract C {
function f() public pure {
1 szabo;
1 finney;
}
}

View File

@ -0,0 +1,61 @@
==== Source: A ====
function gwei(uint x) pure returns (uint) { return x; }
==== Source: B ====
function wei(uint x) pure returns (uint) { return x; }
==== Source: C ====
function ether(uint x) pure returns (uint) { return x; }
==== Source: D ====
function seconds(uint x) pure returns (uint) { return x; }
==== Source: E ====
function minutes(uint x) pure returns (uint) { return x; }
==== Source: F ====
function hours(uint x) pure returns (uint) { return x; }
==== Source: G ====
function days(uint x) pure returns (uint) { return x; }
==== Source: H ====
function weeks(uint x) pure returns (uint) { return x; }
==== Source: I ====
function years(uint x) pure returns (uint) { return x; }
==== Source: test.sol ====
import "A";
import "B";
import "C";
import "D";
import "E";
import "F";
import "G";
import "H";
import "I";
contract C {
function f() public pure {
1 wei;
1 gwei;
1 ether;
1 seconds;
1 minutes;
1 hours;
1 days;
1 weeks;
1 years;
}
}
// ----
// ParserError 2314: (A:9-13): Expected identifier but got 'gwei'
// ParserError 2314: (B:9-12): Expected identifier but got 'wei'
// ParserError 2314: (C:9-14): Expected identifier but got 'ether'
// ParserError 2314: (D:9-16): Expected identifier but got 'seconds'
// ParserError 2314: (E:9-16): Expected identifier but got 'minutes'
// ParserError 2314: (F:9-14): Expected identifier but got 'hours'
// ParserError 2314: (G:9-13): Expected identifier but got 'days'
// ParserError 2314: (H:9-14): Expected identifier but got 'weeks'
// ParserError 2314: (I:9-14): Expected identifier but got 'years'