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

Add YANG lexer #348

Merged
merged 2 commits into from
Apr 14, 2020
Merged

Add YANG lexer #348

merged 2 commits into from
Apr 14, 2020

Conversation

gribok
Copy link
Contributor

@gribok gribok commented Apr 13, 2020

Based on #347, I created the lexer in golang.

Features

  • Keywords based on RFC7950
  • Seperating keywords in groups, based on BNF definition of RFC7950 for maintenance
  • Highlighting of constants, like true, false or deprecated with special token
  • Highlighting of namespace-prefix, like type namespace-prefix:counter64;. namespace-prefix will have special token.
    For example namespace urn:ieee:std:802.1AX:yang:ieee802-dot1ax; will have no special token
  • Prefix-highlighting should be the complex regex pattern of all pattern. Due to that, I created test cases to validate prefix-highlighting
  • Add some test cases for testing of another complex scenarios, like revision-date
  • Create example yang file for testing

@alecthomas
Copy link
Owner

Hi, thanks! CI failed but it looks minor.

@gribok
Copy link
Contributor Author

gribok commented Apr 14, 2020

Hi, thanks! CI failed but it looks minor.

Fixed it. Used the fix, to alphabetise the keywords lists as well.

@alecthomas alecthomas merged commit 28041a8 into alecthomas:master Apr 14, 2020
mrsdizzie pushed a commit to mrsdizzie/chroma that referenced this pull request Jul 15, 2020
* add yang lexer. See alecthomas#347

* Alphabetise all keywords in yang lexer
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.

2 participants