JetBrains / JetBrains/Grammar-Kit

Inconsistent regex between Live Preview and JFlex Generator

Open
#385 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
771
Forks
137
Avg merge
11h 14m
Merged PRs (30d)
1

Description

Regular expressions are incosistent between Live Preview and JFlex Generator.
Especially some Unicode character classes are not supported in Live Preview.

For example:

```
IDENT = 'regexp:[$_\p{ID_Start}][$\p{ID_Continue}]*'
```

IDE says it's an unknown character category.

image

It's not recognised on Live Preview, annotating there's a syntax error.

image

However, generating lexer (from generated flex file from the bnf) completes successfully.

image

The regex works in the plugin as well!

image

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing how the Live Preview and JFlex Generator process the example regex `[$_\p{ID_Start}][$\p{ID_Continue}]*`, especially Unicode character classes. Reproduce the Live Preview annotation and the successful lexer generation; done means both paths accept the same expression without a syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.