diff --git a/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/redundant-parentheses.yaml b/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/redundant-parentheses.yaml new file mode 100644 index 0000000000..b78b3b97d3 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/redundant-parentheses.yaml @@ -0,0 +1,27 @@ +xsls: [] +tests: + - /program/errors[count(*)=0] +eo: | + 1.add (a.add 5) 4 > x + add. 1 (a.add 5) > x + add. 1 2 3 4 > x + add. 1 2 3 4 + add 1 2 3 4 + 1.add 4 > x + (add 1).add 2 + 1.add (1.add (1.add (1.add 1))) > x + (1.add 1).add (1.add 1) > x + add > x + 1 + 1 + 1.with-text "(text) with parentheses a(n)..." > x + "=(" > x + "=)" > x + ")" > x + "(-_-)" > x + "Hello".<.eq ("Hello".<) > a + """ + (-_-) + """ > x + # Comment(). + [] > obj diff --git a/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-1.yaml b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-1.yaml new file mode 100644 index 0000000000..97bbfdeee0 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-1.yaml @@ -0,0 +1,3 @@ +line: 1 +eo: | + (1.add (a.add 5) (4)) > x \ No newline at end of file diff --git a/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-2.yaml b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-2.yaml new file mode 100644 index 0000000000..b367c2eaeb --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-2.yaml @@ -0,0 +1,3 @@ +line: 1 +eo: | + (1.add (a.add 5) 4) > x \ No newline at end of file diff --git a/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-3.yaml b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-3.yaml new file mode 100644 index 0000000000..7b4bb80a60 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-3.yaml @@ -0,0 +1,3 @@ +line: 1 +eo: | + (1.add (a.add 5) 4) \ No newline at end of file diff --git a/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-4.yaml b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-4.yaml new file mode 100644 index 0000000000..b3a4ba8dcc --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-4.yaml @@ -0,0 +1,3 @@ +line: 1 +eo: | + (1.add 4) > x \ No newline at end of file diff --git a/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-5.yaml b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-5.yaml new file mode 100644 index 0000000000..fa1eee4f82 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-5.yaml @@ -0,0 +1,3 @@ +line: 1 +eo: | + (1.add 4) \ No newline at end of file diff --git a/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-6.yaml b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-6.yaml new file mode 100644 index 0000000000..37f2faa137 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/extra-braces-6.yaml @@ -0,0 +1,3 @@ +line: 1 +eo: | + ((1.add 1)) > x \ No newline at end of file diff --git a/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/just-number.yaml b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/just-number.yaml new file mode 100644 index 0000000000..2ab9f917ef --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/just-number.yaml @@ -0,0 +1,3 @@ +line: 1 +eo: | + 1.add (5) > x \ No newline at end of file diff --git a/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/negative-numbers.yaml b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/negative-numbers.yaml new file mode 100644 index 0000000000..3c4afdd4f8 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/negative-numbers.yaml @@ -0,0 +1,3 @@ +line: 1 +eo: | + add (-4) (-5) > x \ No newline at end of file diff --git a/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/numbers.yaml b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/numbers.yaml new file mode 100644 index 0000000000..4d0a6bbe95 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/numbers.yaml @@ -0,0 +1,5 @@ +line: 2 +eo: | + add > x + (1) + (1) diff --git a/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/simple-application-named.yaml b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/simple-application-named.yaml new file mode 100644 index 0000000000..6f4fa2cb33 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/simple-application-named.yaml @@ -0,0 +1,4 @@ +line: 3 +eo: | + 1.add 1 > x + (1.add 1) > y diff --git a/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/simple-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/simple-application.yaml new file mode 100644 index 0000000000..9178b2fe29 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/typos/redundant-parentheses/simple-application.yaml @@ -0,0 +1,4 @@ +line: 3 +eo: | + 1.add 1 > x + (1.add 1)