Skip to content

Pipe "|" action does not work for <<EOF>> rules #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
collinsmith opened this issue Jun 8, 2016 · 1 comment · Fixed by #706
Closed

Pipe "|" action does not work for <<EOF>> rules #201

collinsmith opened this issue Jun 8, 2016 · 1 comment · Fixed by #706
Assignees
Labels
bug Not working as intended
Milestone

Comments

@collinsmith
Copy link

collinsmith commented Jun 8, 2016

According to the JFlex manual, the grammar for a Rule is

Rule         ::= [StateList] ['^'] RegExp [LookAhead] Action 
               | [StateList] '<<EOF>>' Action
               | StateGroup 
Action       ::= '{' JavaCode '}' | '|'

However, if the action for an <<EOF>> rule is a pipe, then the generator fails. Below is a snippet which should reproduce the behavior.

Error

Unexpected character
<<EOF>>               |
 ^
1 error, 0 warnings.

Reproduction

<<EOF>>               |
...                   |
...                   {  }

Workaround

...                   |
...                   |
<<EOF>>               {  }
@lsf37
Copy link
Member

lsf37 commented Jun 9, 2016

Thanks for spotting that and posting the workaround. Will have a look.

@regisd regisd added the bug Not working as intended label Nov 4, 2017
@lsf37 lsf37 added this to the 1.7.0 milestone Nov 7, 2017
@lsf37 lsf37 modified the milestones: 1.7.0, 1.7.1 Sep 16, 2018
@regisd regisd modified the milestones: 1.7.1, 1.8.0 Sep 16, 2018
regisd added a commit to regisd/jflex that referenced this issue Oct 5, 2018
regisd added a commit that referenced this issue Oct 7, 2018
* Add test case for #201 (Pipe `|` action doesn't work for `<<EOF>>`)

Also, add README that explains how to run a single regression test case on command line
@regisd regisd removed this from the 1.8.0 milestone Nov 27, 2019
@lsf37 lsf37 added this to the 1.8.0 milestone Jan 3, 2020
@lsf37 lsf37 self-assigned this Jan 3, 2020
lsf37 added a commit that referenced this issue Jan 3, 2020
Previously "<<EOF>> |" did not compile unless it was the last in a series of
pipe actions (i.e. <<EOF>> always expected "{}").

Fixes #201
@lsf37 lsf37 closed this as completed in #706 Jan 3, 2020
lsf37 added a commit that referenced this issue Jan 3, 2020
Previously "<<EOF>> |" did not compile unless it was the last in a series of
pipe actions (i.e. <<EOF>> always expected "{}").

Fixes #201
regisd pushed a commit that referenced this issue Jan 3, 2020
commit 82b9a5e
Author:     Gerwin Klein <lsf@jflex.de>
AuthorDate: Fri Jan 3 18:58:24 2020 +0800
Commit:     GitHub <noreply@github.com>
CommitDate: Fri Jan 3 18:58:24 2020 +0800

    Enable pipe action for <<EOF>> rules. (#706)

    Previously "<<EOF>> |" did not compile unless it was the last in a series of
    pipe actions (i.e. <<EOF>> always expected "{}").

    Fixes #201

Updated from target/jflex-parent-1.8.0-SNAPSHOT-sources.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants