Skip to content
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

Macros in character classes are not supported #216

Closed
dscorbett opened this issue Jun 15, 2017 · 7 comments · Fixed by #654
Closed

Macros in character classes are not supported #216

dscorbett opened this issue Jun 15, 2017 · 7 comments · Fixed by #654
Assignees
Labels
bug
Milestone

Comments

@dscorbett
Copy link

dscorbett commented Jun 15, 2017

Using a macro in a character class produces the error message “Macros in character classes are not supported.” This contradicts the documentation:

CharClassContent    ::= CharClass | Character |
                        Character'-'Character | 
                        MacroUsage | PredefinedClass

a character class [...] matches any character in that class. A Character is considered an element of a class if it is listed in the class or if its code lies within a listed character range Character’-’Character or Macro or predefined character class.

@lsf37 lsf37 self-assigned this Oct 28, 2017
@lsf37 lsf37 added the bug label Oct 28, 2017
@lsf37 lsf37 added this to the release 1.7.0 milestone Oct 28, 2017
@lsf37 lsf37 added this to To do in Macros in char classes Nov 22, 2017
@regisd regisd added this to Open bugs in JFlex core Sep 10, 2018
@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
@Jezza
Copy link

Jezza commented Jan 25, 2019

Bump.

Is there any chance of this getting fixed anytime soon?
Right now, I basically have to manually expand all of my macros, which leads to some really bad code.

I'm honestly debating whether or not I should just drop this and write a topdown lexer by hand...
I would have been done by now...

@lsf37
Copy link
Member

lsf37 commented Jan 25, 2019

I've been looking at it and it will need a refactor of a whole bunch of code. Nothing too hard, just a lot of work. Still planning to do that, but it's definitely going to be more than 1-2 months, given that I won't have much time to actually work on it.

@Jezza
Copy link

Jezza commented Jan 25, 2019

Ah, that's good to hear.

I thought it was just dead.
There's no rush, I've actually just spent the last hour or two restructuring the lexer so I don't have to manually expand them.
It makes it nicer in the end, so I guess it worked out in the end.

@lsf37
Copy link
Member

lsf37 commented Jan 25, 2019

Excellent, good to hear that you're not blocked on it any more. Still planning to work on it anyway, of course.

@wdanilo
Copy link

wdanilo commented Jun 1, 2019

Is there any progress with this issue? It's really bad thing right now. Even allowing macros which point to simple character classes would help design the lex input much much nicer.

@lsf37 lsf37 mentioned this issue Nov 27, 2019
@lsf37 lsf37 moved this from To do to In progress in Macros in char classes Dec 3, 2019
@lsf37
Copy link
Member

lsf37 commented Dec 3, 2019

Main refactor is done and first rough implementation of the feature is there. Currently in debugging.

lsf37 added a commit that referenced this issue Dec 3, 2019
lsf37 added a commit that referenced this issue Dec 3, 2019
lsf37 added a commit that referenced this issue Dec 4, 2019
lsf37 added a commit that referenced this issue Dec 4, 2019
lsf37 added a commit that referenced this issue Dec 4, 2019
@regisd
Copy link
Member

regisd commented Dec 4, 2019

Let me know when you need a code review.

lsf37 added a commit that referenced this issue Dec 7, 2019
@lsf37 lsf37 closed this as completed in #654 Dec 7, 2019
Macros in char classes automation moved this from In progress to Done Dec 7, 2019
JFlex core automation moved this from Open bugs to Done Dec 7, 2019
lsf37 added a commit that referenced this issue Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug
Projects
JFlex core
  
Done
Development

Successfully merging a pull request may close this issue.

5 participants