Disallow dot in inline assembly identifiers.

This commit is contained in:
chriseth
2020-07-08 19:29:58 +02:00
parent 64b6524bdb
commit 8eb459c825
11 changed files with 80 additions and 3 deletions
@@ -0,0 +1,12 @@
contract C {
function f() public pure {
assembly {
function f(a., x.b) -> t.b, b.. {}
}
}
}
// ----
// DeclarationError 3927: (74-76): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (78-81): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (86-89): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (91-94): User-defined identifiers in inline assembly cannot contain '.'.
@@ -0,0 +1,11 @@
contract C {
function f() public pure {
assembly {
function f.() {}
function g.f() {}
}
}
}
// ----
// DeclarationError 3927: (63-79): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (86-103): User-defined identifiers in inline assembly cannot contain '.'.
@@ -0,0 +1,11 @@
contract C {
function f() public pure {
assembly {
function f() -> x, y, z {}
let a., aa.b := f()
}
}
}
// ----
// DeclarationError 3927: (100-102): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (104-108): User-defined identifiers in inline assembly cannot contain '.'.
@@ -0,0 +1,15 @@
contract C {
function f() public pure {
assembly {
let a. := 2
let a.. := 2
let a.b := 2
let a..b := 2
}
}
}
// ----
// DeclarationError 3927: (67-69): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (85-88): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (104-107): User-defined identifiers in inline assembly cannot contain '.'.
// DeclarationError 3927: (123-127): User-defined identifiers in inline assembly cannot contain '.'.
@@ -0,0 +1,9 @@
contract C {
function f() public pure {
assembly {
let a, .a, aa.b := f()
}
}
}
// ----
// ParserError 2314: (70-71): Expected identifier but got '.'