diff --git a/eo-parser/src/main/antlr4/org/eolang/parser/Eo.g4 b/eo-parser/src/main/antlr4/org/eolang/parser/Eo.g4 index b6059e31ee..d20f84d6c7 100644 --- a/eo-parser/src/main/antlr4/org/eolang/parser/Eo.g4 +++ b/eo-parser/src/main/antlr4/org/eolang/parser/Eo.g4 @@ -420,22 +420,13 @@ vmethodOptional // So in order to avoid it this block was described in more detail // Head of vertical method can be: // 1. vertical method -// 2. horizontal method -// 3. vertical application -// 4. horizontal application. The same logic as with a vertical application -// 5. just an object reference +// 2. vertical application +// 3. just an object reference // Ends on the next line vmethodHead : vmethodHead methodTailOptional vmethodHeadApplicationTail | vmethodHeadVapplication - | vmethodHeadCurrent EOL - ; - -// Head of vertical method that ends on the current line -vmethodHeadCurrent - : vmethodHeadHapplication - | vmethodHeadHmethodExtended - | justNamed + | justNamed EOL ; methodTailOptional @@ -448,10 +439,6 @@ vmethodHeadApplicationTail | happlicationTail oname? EOL ; -vmethodHeadHmethodExtended - : hmethodOptional oname? - ; - // Vertical application as head of vertical method // Ends on the next line vmethodHeadVapplication @@ -459,11 +446,6 @@ vmethodHeadVapplication | reversed oname? vapplicationArgsReversed ; -vmethodHeadHapplication - : (applicable | hmethodExtended) happlicationTail oname? - | happlicationReversed oname? - ; - // Tail of method methodTail : DOT finisherCopied diff --git a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java index 321e2cbe76..21a0f0fe12 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java @@ -963,16 +963,6 @@ public void exitVmethodHead(final EoParser.VmethodHeadContext ctx) { // Nothing here } - @Override - public void enterVmethodHeadCurrent(final EoParser.VmethodHeadCurrentContext ctx) { - // Nothing here - } - - @Override - public void exitVmethodHeadCurrent(final EoParser.VmethodHeadCurrentContext ctx) { - // Nothing here - } - @Override public void enterMethodTailOptional(final EoParser.MethodTailOptionalContext ctx) { // Nothing here @@ -993,16 +983,6 @@ public void exitVmethodHeadApplicationTail(final EoParser.VmethodHeadApplication // Nothing here } - @Override - public void enterVmethodHeadHmethodExtended(final EoParser.VmethodHeadHmethodExtendedContext ctx) { - // Nothing here - } - - @Override - public void exitVmethodHeadHmethodExtended(final EoParser.VmethodHeadHmethodExtendedContext ctx) { - // Nothing here - } - @Override public void enterVmethodHeadVapplication(final EoParser.VmethodHeadVapplicationContext ctx) { // Nothing here @@ -1013,16 +993,6 @@ public void exitVmethodHeadVapplication(final EoParser.VmethodHeadVapplicationCo // Nothing here } - @Override - public void enterVmethodHeadHapplication(final EoParser.VmethodHeadHapplicationContext ctx) { - // Nothing here - } - - @Override - public void exitVmethodHeadHapplication(final EoParser.VmethodHeadHapplicationContext ctx) { - // Nothing here - } - @Override public void enterMethodTail(final EoParser.MethodTailContext ctx) { // Nothing here diff --git a/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/hmethod-after-vmethod.yaml b/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/hmethod-after-vmethod.yaml deleted file mode 100644 index 6149ab3eba..0000000000 --- a/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/hmethod-after-vmethod.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# @todo #2736:30min Enable the test when it's possible. Such syntax is invalid - we can't use -# horizontal method after vertical method. If we decide that we allow such syntax we should add -# "vmethod" to "hmethodHeadExtended" rule and resolve left recursion violation. Don't forget -# to remove the puzzle -xsls: [] -skip: true -tests: - - //errors[count(error)=0] -eo: | - a - .b.c \ No newline at end of file diff --git a/eo-parser/src/test/resources/org/eolang/parser/typos/hmethod-after-vmethod.yaml b/eo-parser/src/test/resources/org/eolang/parser/typos/hmethod-after-vmethod.yaml new file mode 100644 index 0000000000..7e5c03d58a --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/typos/hmethod-after-vmethod.yaml @@ -0,0 +1,4 @@ +line: 2 +eo: | + a + .b.c \ No newline at end of file diff --git a/eo-parser/src/test/resources/org/eolang/parser/typos/vmethod-after-happlication.yaml b/eo-parser/src/test/resources/org/eolang/parser/typos/vmethod-after-happlication.yaml new file mode 100644 index 0000000000..5082580001 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/typos/vmethod-after-happlication.yaml @@ -0,0 +1,4 @@ +line: 2 +eo: | + x y + .z \ No newline at end of file diff --git a/eo-parser/src/test/resources/org/eolang/parser/typos/vmethod-after-hmethod.yaml b/eo-parser/src/test/resources/org/eolang/parser/typos/vmethod-after-hmethod.yaml new file mode 100644 index 0000000000..0c6250bad7 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/typos/vmethod-after-hmethod.yaml @@ -0,0 +1,4 @@ +line: 2 +eo: | + x.y + .z \ No newline at end of file diff --git a/eo-runtime/src/test/eo/org/eolang/ram-tests.eo b/eo-runtime/src/test/eo/org/eolang/ram-tests.eo index 0208d3bf13..1ef671185b 100644 --- a/eo-runtime/src/test/eo/org/eolang/ram-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/ram-tests.eo @@ -92,7 +92,8 @@ write. r.slice 200 13 > s "Hello, world!".as-bytes - s.slice 0 5 + s + .slice 0 5 .slice 0 4 .slice 0 1 eq. > @