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

Fixed and improved lex.vim (second update) #14

Closed
wants to merge 2 commits into from

Conversation

genivia-inc
Copy link
Contributor

This update fixes highlighting of start condition scope with pattern starting with {. A regex pattern that starts with a { should not open a start condition scope.

With this update and the previous, fixes were applied to correct the following issues:

  • Start condition states with a scope of the form <state>{ ... } are not recognized correctly, leading to highlighting errors below it such as %% not being highlighted.
  • Action code is highlighted when enclosed in braces {...} but otherwise its is not, which is inconsistent.
  • Indented initial code blocks (instead of placed in %{...%}) are not recognized and are not highlighted.
  • Indented initial action code blocks are not recognized and not highlighted correctly, which appear right after the first %% and in start condition scopes
  • initial action code blocks in %{...%} are not recognized in start condition scopes <state>{ ... }.
  • The start condition state <*> is not recognized and not highlighted.
  • //-comments are not always recognized and highlighted.
  • Rule actions after patterns are not always highlighted, such as ECHO, which is inconsistent.
  • Final code block is not always highlighted correctly when start condition states with scopes are used.
  • Literal string quotes “...” are not highlighted in abbreviation definitions, whereas in patterns they are highlighted.
  • %option are highlighted inconsistently when used before or after initial code blocks (both places are valid).
  • Also highlighting of state declarations %s and %x are inconsistent or not highlighted at all when placed before initial code blocks.
  • %top{ is not recognized, which should be the same as a %{ block, in principle any %name{ should be recognized.

@genivia-inc
Copy link
Contributor Author

genivia-inc commented Mar 22, 2020

For clarification: the updated file causes a branch conflict with the previous update (I was a bit lazy not forking again). If you want, please go ahead to resolve the conflict to accept this update.

Also, I've uploaded an improved lex.vim file with our RE/flex repo (a more advanced Flex++ version) and opened a Vim issue for the Vim maintainers.

It would be wonderful if you could include a link to RE/flex on your page if possible. But it's up to you.

@justinmk justinmk reopened this Apr 26, 2020
justinmk pushed a commit that referenced this pull request Apr 26, 2020
fixed highlighting of start condition scope with pattern starting with
'{' and other improvements
@justinmk
Copy link
Owner

merged 5906eea

@justinmk justinmk closed this Apr 26, 2020
@genivia-inc
Copy link
Contributor Author

genivia-inc commented May 11, 2020

Thanks for helping the Vim, Flex, and Bison communities!

Please note that lex.vim is now officially integrated and released with Vim. A few more improvements were added to the final version. This final copy is located in the Vim syntax repo.

Thanks for referencing RE/Flex. It is a major overhaul of Flex++ with more advanced features and contributions.

@justinmk
Copy link
Owner

it's mentioned in the readme:
https://github.com/justinmk/vim-syntax-extra#bison-flex

@genivia-inc
Copy link
Contributor Author

Thanks!! I hadn't seen it last time but noticed it just now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants