Skip to content

Commit

Permalink
#2231 - try to fix syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
maxonfjvipon committed Jul 11, 2023
1 parent 03620bf commit 08ec881
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
26 changes: 16 additions & 10 deletions eo-parser/src/main/antlr4/org/eolang/parser/Program.g4
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,23 @@ objects
(
(COMMENT SINGLE_EOL)*
object
(SINGLE_EOL | DOUBLE_EOL)
)+
;

object
:
(
abstraction
|
application
)
tail?
abstraction
otail?
SINGLE_EOL?
|
application
otail?
(SINGLE_EOL | DOUBLE_EOL)
;

otail
:
tail
(
SINGLE_EOL
method
Expand All @@ -53,9 +58,10 @@ abstraction
(COMMENT SINGLE_EOL)*
attributes
(
(suffix (SPACE SLASH (NAME | QUESTION))?)
| htail
suffix
(SPACE SLASH (NAME | QUESTION))?
)?
SINGLE_EOL
;

attributes
Expand Down Expand Up @@ -91,7 +97,7 @@ tail
:
SINGLE_EOL
TAB
(object (SINGLE_EOL | DOUBLE_EOL))+
object+
UNTAB
;

Expand Down
10 changes: 10 additions & 0 deletions eo-parser/src/main/java/org/eolang/parser/XeListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,16 @@ public void exitObject(final ProgramParser.ObjectContext ctx) {
// This method is created by ANTLR and can't be removed
}

@Override
public void enterOtail(ProgramParser.OtailContext ctx) {
// Nothing here
}

@Override
public void exitOtail(ProgramParser.OtailContext ctx) {
// Nothing here
}

@Override
public void enterAbstraction(final ProgramParser.AbstractionContext ctx) {
this.objects.start(
Expand Down

0 comments on commit 08ec881

Please sign in to comment.