From 8b53f85e28d5d1a68663672e1f8e614b9b29ea6b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 3 Jul 2020 15:31:06 +0100 Subject: [PATCH] Add Yul syntax tests for dots in identifiers --- test/libyul/yulSyntaxTests/are_we_perl_yet.yul | 6 ++++++ test/libyul/yulSyntaxTests/dot_consecutive_function.yul | 4 ++++ test/libyul/yulSyntaxTests/dot_consecutive_function_arg.yul | 4 ++++ test/libyul/yulSyntaxTests/dot_consecutive_function_ret.yul | 4 ++++ .../yulSyntaxTests/dot_consecutive_variabledeclaration.yul | 4 ++++ test/libyul/yulSyntaxTests/dot_ellipse_function.yul | 4 ++++ test/libyul/yulSyntaxTests/dot_ellipse_function_arg.yul | 4 ++++ test/libyul/yulSyntaxTests/dot_ellipse_function_ret.yul | 4 ++++ .../yulSyntaxTests/dot_ellipse_variabledeclaration.yul | 4 ++++ test/libyul/yulSyntaxTests/dot_leading_function.yul | 5 +++++ test/libyul/yulSyntaxTests/dot_leading_function_arg.yul | 5 +++++ test/libyul/yulSyntaxTests/dot_leading_function_ret.yul | 5 +++++ .../yulSyntaxTests/dot_leading_variabledeclaration.yul | 5 +++++ test/libyul/yulSyntaxTests/dot_middle_function.yul | 4 ++++ test/libyul/yulSyntaxTests/dot_middle_function_arg.yul | 4 ++++ test/libyul/yulSyntaxTests/dot_middle_function_ret.yul | 4 ++++ .../yulSyntaxTests/dot_middle_variabledeclaration.yul | 4 ++++ test/libyul/yulSyntaxTests/dot_trailing_function.yul | 4 ++++ test/libyul/yulSyntaxTests/dot_trailing_function_arg.yul | 4 ++++ test/libyul/yulSyntaxTests/dot_trailing_function_ret.yul | 4 ++++ .../yulSyntaxTests/dot_trailing_variabledeclaration.yul | 4 ++++ 21 files changed, 90 insertions(+) create mode 100644 test/libyul/yulSyntaxTests/are_we_perl_yet.yul create mode 100644 test/libyul/yulSyntaxTests/dot_consecutive_function.yul create mode 100644 test/libyul/yulSyntaxTests/dot_consecutive_function_arg.yul create mode 100644 test/libyul/yulSyntaxTests/dot_consecutive_function_ret.yul create mode 100644 test/libyul/yulSyntaxTests/dot_consecutive_variabledeclaration.yul create mode 100644 test/libyul/yulSyntaxTests/dot_ellipse_function.yul create mode 100644 test/libyul/yulSyntaxTests/dot_ellipse_function_arg.yul create mode 100644 test/libyul/yulSyntaxTests/dot_ellipse_function_ret.yul create mode 100644 test/libyul/yulSyntaxTests/dot_ellipse_variabledeclaration.yul create mode 100644 test/libyul/yulSyntaxTests/dot_leading_function.yul create mode 100644 test/libyul/yulSyntaxTests/dot_leading_function_arg.yul create mode 100644 test/libyul/yulSyntaxTests/dot_leading_function_ret.yul create mode 100644 test/libyul/yulSyntaxTests/dot_leading_variabledeclaration.yul create mode 100644 test/libyul/yulSyntaxTests/dot_middle_function.yul create mode 100644 test/libyul/yulSyntaxTests/dot_middle_function_arg.yul create mode 100644 test/libyul/yulSyntaxTests/dot_middle_function_ret.yul create mode 100644 test/libyul/yulSyntaxTests/dot_middle_variabledeclaration.yul create mode 100644 test/libyul/yulSyntaxTests/dot_trailing_function.yul create mode 100644 test/libyul/yulSyntaxTests/dot_trailing_function_arg.yul create mode 100644 test/libyul/yulSyntaxTests/dot_trailing_function_ret.yul create mode 100644 test/libyul/yulSyntaxTests/dot_trailing_variabledeclaration.yul diff --git a/test/libyul/yulSyntaxTests/are_we_perl_yet.yul b/test/libyul/yulSyntaxTests/are_we_perl_yet.yul new file mode 100644 index 000000000..ffe8da407 --- /dev/null +++ b/test/libyul/yulSyntaxTests/are_we_perl_yet.yul @@ -0,0 +1,6 @@ +{ + function _...($..) {} + let a... + _...(a...) +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_consecutive_function.yul b/test/libyul/yulSyntaxTests/dot_consecutive_function.yul new file mode 100644 index 000000000..6b8c0db08 --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_consecutive_function.yul @@ -0,0 +1,4 @@ +{ + function x..y() {} +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_consecutive_function_arg.yul b/test/libyul/yulSyntaxTests/dot_consecutive_function_arg.yul new file mode 100644 index 000000000..1af439328 --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_consecutive_function_arg.yul @@ -0,0 +1,4 @@ +{ + function x(a..b) {} +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_consecutive_function_ret.yul b/test/libyul/yulSyntaxTests/dot_consecutive_function_ret.yul new file mode 100644 index 000000000..1fc66a18a --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_consecutive_function_ret.yul @@ -0,0 +1,4 @@ +{ + function x() -> a..b {} +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_consecutive_variabledeclaration.yul b/test/libyul/yulSyntaxTests/dot_consecutive_variabledeclaration.yul new file mode 100644 index 000000000..0f2b4c336 --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_consecutive_variabledeclaration.yul @@ -0,0 +1,4 @@ +{ + let a..b := 1 +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_ellipse_function.yul b/test/libyul/yulSyntaxTests/dot_ellipse_function.yul new file mode 100644 index 000000000..fbb8f32a3 --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_ellipse_function.yul @@ -0,0 +1,4 @@ +{ + function x...y() {} +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_ellipse_function_arg.yul b/test/libyul/yulSyntaxTests/dot_ellipse_function_arg.yul new file mode 100644 index 000000000..47dd7b2bb --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_ellipse_function_arg.yul @@ -0,0 +1,4 @@ +{ + function x(a...b) {} +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_ellipse_function_ret.yul b/test/libyul/yulSyntaxTests/dot_ellipse_function_ret.yul new file mode 100644 index 000000000..70ba65069 --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_ellipse_function_ret.yul @@ -0,0 +1,4 @@ +{ + function x() -> a...b {} +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_ellipse_variabledeclaration.yul b/test/libyul/yulSyntaxTests/dot_ellipse_variabledeclaration.yul new file mode 100644 index 000000000..47870bfb2 --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_ellipse_variabledeclaration.yul @@ -0,0 +1,4 @@ +{ + let a...b := 1 +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_leading_function.yul b/test/libyul/yulSyntaxTests/dot_leading_function.yul new file mode 100644 index 000000000..0c9581ec4 --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_leading_function.yul @@ -0,0 +1,5 @@ +{ + function .x() {} +} +// ---- +// ParserError 2314: (15-16): Expected identifier but got '.' diff --git a/test/libyul/yulSyntaxTests/dot_leading_function_arg.yul b/test/libyul/yulSyntaxTests/dot_leading_function_arg.yul new file mode 100644 index 000000000..93c8afa6f --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_leading_function_arg.yul @@ -0,0 +1,5 @@ +{ + function x(.a) {} +} +// ---- +// ParserError 2314: (17-18): Expected identifier but got '.' diff --git a/test/libyul/yulSyntaxTests/dot_leading_function_ret.yul b/test/libyul/yulSyntaxTests/dot_leading_function_ret.yul new file mode 100644 index 000000000..c516fd647 --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_leading_function_ret.yul @@ -0,0 +1,5 @@ +{ + function x() -> .a {} +} +// ---- +// ParserError 2314: (22-23): Expected identifier but got '.' diff --git a/test/libyul/yulSyntaxTests/dot_leading_variabledeclaration.yul b/test/libyul/yulSyntaxTests/dot_leading_variabledeclaration.yul new file mode 100644 index 000000000..b0f86d36d --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_leading_variabledeclaration.yul @@ -0,0 +1,5 @@ +{ + let .a := 1 +} +// ---- +// ParserError 2314: (10-11): Expected identifier but got '.' diff --git a/test/libyul/yulSyntaxTests/dot_middle_function.yul b/test/libyul/yulSyntaxTests/dot_middle_function.yul new file mode 100644 index 000000000..5d5fa15ff --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_middle_function.yul @@ -0,0 +1,4 @@ +{ + function x.y() {} +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_middle_function_arg.yul b/test/libyul/yulSyntaxTests/dot_middle_function_arg.yul new file mode 100644 index 000000000..61ecfcb2c --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_middle_function_arg.yul @@ -0,0 +1,4 @@ +{ + function x(a.b) {} +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_middle_function_ret.yul b/test/libyul/yulSyntaxTests/dot_middle_function_ret.yul new file mode 100644 index 000000000..06c41be62 --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_middle_function_ret.yul @@ -0,0 +1,4 @@ +{ + function x() -> a.b {} +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_middle_variabledeclaration.yul b/test/libyul/yulSyntaxTests/dot_middle_variabledeclaration.yul new file mode 100644 index 000000000..d7235badc --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_middle_variabledeclaration.yul @@ -0,0 +1,4 @@ +{ + let a.b := 1 +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_trailing_function.yul b/test/libyul/yulSyntaxTests/dot_trailing_function.yul new file mode 100644 index 000000000..4348149d3 --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_trailing_function.yul @@ -0,0 +1,4 @@ +{ + function x.() {} +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_trailing_function_arg.yul b/test/libyul/yulSyntaxTests/dot_trailing_function_arg.yul new file mode 100644 index 000000000..d8fc0336d --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_trailing_function_arg.yul @@ -0,0 +1,4 @@ +{ + function x(a.) {} +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_trailing_function_ret.yul b/test/libyul/yulSyntaxTests/dot_trailing_function_ret.yul new file mode 100644 index 000000000..92b9daf16 --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_trailing_function_ret.yul @@ -0,0 +1,4 @@ +{ + function x() -> a. {} +} +// ---- diff --git a/test/libyul/yulSyntaxTests/dot_trailing_variabledeclaration.yul b/test/libyul/yulSyntaxTests/dot_trailing_variabledeclaration.yul new file mode 100644 index 000000000..b71a3d583 --- /dev/null +++ b/test/libyul/yulSyntaxTests/dot_trailing_variabledeclaration.yul @@ -0,0 +1,4 @@ +{ + let a. := 1 +} +// ----