-
-
Notifications
You must be signed in to change notification settings - Fork 92
Add BNF / META II / TREE-META and update J syntax #5091
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c97e4c6
syntax: update syntax highlighting definition for J
jip 6f0603f
syntax: add syntax highlighting definition for BNF/EBNF/ABNF/WBNF
jip a5ff4c1
syntax: add syntax highlighting definition for META II
jip 735e6a4
syntax: add syntax highlighting definition for TREE-META
jip 60ad3ed
syntax: fix syntax highlighting definition for BNF/EBNF/ABNF/WBNF
jip File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| # BNF family (BNF, EBNF, ABNF, WBNF etc.) Syntax Highlighting Definition | ||
| # Version 3.0.1 2026-03-25 | ||
| # See updates and changelog at https://github.com/jip/syntax-highlighting | ||
| # | ||
| # Backus-Naur form (BNF) is a notation technique for context-free grammars | ||
| # | ||
| # This file is part of GNU Midnight Commander | ||
| # https://midnight-commander.org/ | ||
| # | ||
| # SPDX-FileCopyrightText: 2026 Igor Zhuravlov <zhuravlov.ip@ya.ru> | ||
| # SPDX-License-Identifier: GPL-3.0-or-later | ||
|
|
||
| # for the default (lightgray on blue) | ||
| define _alerthi lightgray red | ||
| define _alertmi gray yellow | ||
| define _alertlo gray cyan | ||
| define _assign white | ||
| define _comb yellow | ||
| define _comment brown | ||
| define _esc brightgreen | ||
| define _group brightcyan | ||
| define _lbl lightgray blue underline | ||
| define _num brightgreen | ||
| define _oper yellow | ||
| define _sep brightmagenta | ||
| define _special gray | ||
| define _str green | ||
| define _var lightgray | ||
|
|
||
| context default | ||
| # labels | ||
| keyword \{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_\}\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._\]: _lbl | ||
| # nonterminals | ||
| keyword <\{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_\}\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._\]> _var | ||
| keyword \{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_\}\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._\] _var | ||
| # decimal integer numbers | ||
| keyword wholeleft 0 _num | ||
| keyword wholeleft \{123456789_\}\[0123456789_\] _num | ||
| keyword wholeleft -\{123456789_\}\[0123456789_\] _num | ||
| # repeaters (EBNF) | ||
| keyword (/ _group | ||
| keyword /) _group | ||
| keyword (: _group | ||
| keyword :) _group | ||
| # exclude from highlighting | ||
| keyword ::== lightgray blue | ||
| # assignments | ||
| keyword :≡ _assign | ||
| keyword :== _assign | ||
| keyword := _assign | ||
| keyword ::= _assign | ||
| keyword :: _assign | ||
| keyword : _assign | ||
| keyword => _assign | ||
| keyword = _assign | ||
| keyword <- _assign | ||
| keyword -> _assign | ||
| keyword <= _assign | ||
| keyword ← _assign | ||
| keyword → _assign | ||
| keyword ⇐ _assign | ||
| keyword ⇒ _assign | ||
| keyword ≜ _assign | ||
| # combinators | ||
| keyword | _comb | ||
| keyword / _comb | ||
| keyword \\ _comb | ||
| keyword - _comb | ||
| keyword , _comb | ||
| # operators | ||
| keyword ! _oper | ||
| keyword # _oper | ||
| keyword $ _oper | ||
| # keyword % _oper | ||
| keyword & _oper | ||
| keyword \* _oper | ||
| keyword \+ _oper | ||
| keyword ? _oper | ||
| keyword @ _oper | ||
| keyword ^ _oper | ||
| keyword ~ _oper | ||
| # grouping | ||
| keyword ( _group | ||
| keyword ) _group | ||
| keyword < _group | ||
| keyword > _group | ||
| keyword [ _group | ||
| keyword ] _group | ||
| keyword { _group | ||
| keyword } _group | ||
| # concatenator,separator,terminator | ||
| keyword \{.;\} _sep | ||
|
|
||
| # strings | ||
|
|
||
| context ' ' _str | ||
| keyword \\' _esc | ||
| keyword \\\\ _esc | ||
| keyword \\\{abtnvfr\} _esc | ||
| keyword \\x\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\} _esc | ||
| keyword \\u\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\} _esc | ||
| keyword \\U\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\} _esc | ||
|
|
||
| context " " _str | ||
| keyword \\" _esc | ||
| keyword \\\\ _esc | ||
| keyword \\\{abtnvfr\} _esc | ||
| keyword \\x\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\} _esc | ||
| keyword \\u\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\} _esc | ||
| keyword \\U\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\}\{0123456789abcdefABCDEF\} _esc | ||
|
|
||
| # special sequence | ||
|
|
||
| context ` ` _special | ||
| keyword \\` _special | ||
|
|
||
| # comments | ||
|
|
||
| context % % _comment | ||
| keyword \\% _comment | ||
| keyword whole BUG _alerthi | ||
| keyword whole DEPRECATED _alertmi | ||
| keyword whole FIXME _alerthi | ||
| keyword whole NOTE _alertlo | ||
| keyword whole TEST _alertlo | ||
| keyword whole TODO _alertmi | ||
| keyword whole WARN _alertmi | ||
| spellcheck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,42 +1,120 @@ | ||
| # J syntax highlighting | ||
| # J language Syntax highlighting Definition | ||
| # Version 3.0.0 2026-03-18 | ||
| # See updates and changelog at https://github.com/jip/syntax-highlighting | ||
| # | ||
| # J is a high-level, general-purpose programming language | ||
| # https://www.jsoftware.com | ||
| # | ||
| # This file is part of GNU Midnight Commander | ||
| # https://midnight-commander.org/ | ||
| # | ||
| # SPDX-FileCopyrightText: 2009,2026 Igor Zhuravlov <zhuravlov.ip@ya.ru> | ||
| # SPDX-License-Identifier: GPL-3.0-or-later | ||
|
|
||
| # for the default (lightgray on blue) | ||
| define _adverb green blue bold | ||
| define _alerthi lightgray red | ||
| define _alertmi gray yellow | ||
| define _alertlo gray cyan | ||
| define _copulag white | ||
| define _copulal brown | ||
| define _comment gray | ||
| define _conj yellow blue bold | ||
| define _control brightred | ||
| define _noun cyan blue bold | ||
| define _nounblk lightgray brightblue | ||
| define _num green | ||
| define _paren brightgreen | ||
| define _str brightcyan | ||
| define _verb magenta blue bold | ||
|
|
||
| context default | ||
| # controls | ||
| wholechars {} | ||
| keyword {{ _control | ||
| keyword }} _control | ||
| wholechars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._ | ||
| keyword wholeleft assert. _control | ||
| keyword wholeleft break. _control | ||
| keyword wholeleft case. _control | ||
| keyword wholeleft catch. _control | ||
| keyword wholeleft catch\{dt\}. _control | ||
| keyword wholeleft continue. _control | ||
| keyword wholeleft do. _control | ||
| keyword wholeleft else. _control | ||
| keyword wholeleft elseif. _control | ||
| keyword wholeleft end. _control | ||
| keyword wholeleft fcase. _control | ||
| keyword wholeleft for. _control | ||
| keyword wholeleft for_\{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\}\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_\]. _control | ||
| keyword wholeleft goto_\{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\}\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_\]. _control | ||
| keyword wholeleft if. _control | ||
| keyword wholeleft label_\{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\}\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_\]. _control | ||
| keyword wholeleft return. _control | ||
| keyword wholeleft select. _control | ||
| keyword wholeleft throw. _control | ||
| keyword wholeleft try. _control | ||
| keyword wholeleft while. _control | ||
| keyword wholeleft whilst. _control | ||
| # comments | ||
| keyword wholeleft NB. _comment | ||
| # copula | ||
| keyword =: _copulag | ||
| keyword =. _copulal | ||
| # parenthesis | ||
| keyword \{()\} _paren | ||
| # actors | ||
| keyword {:: _verb | ||
| keyword &.: _conj | ||
| keyword __: _verb | ||
| keyword /.. _adverb | ||
| keyword \{<>\+\*-%$~|,#{}"\}\{.:\} _verb | ||
| keyword \{_;/\\[\}: _verb | ||
| keyword \{^?\}. _verb | ||
| keyword \{^`\}: _conj | ||
| keyword \{;[]\}. _conj | ||
| keyword \{!:@&\}\{.:\} _conj | ||
| keyword \{/\\\}. _adverb | ||
| keyword ]: _adverb | ||
| keyword \{=<>\+\*-%^$|,;#![]{?\} _verb | ||
| keyword \{~/\\}\} _adverb | ||
| keyword \{".:`@&\} _conj | ||
| keyword wholeleft \{AcCeEIjLorv\}. _verb | ||
| keyword wholeleft \{bfM\}. _adverb | ||
| keyword wholeleft \{Hmt\}. _conj | ||
| keyword wholeleft p.. _verb | ||
| keyword wholeleft \{ipu\}\{.:\} _verb | ||
| keyword wholeleft \{LS\}: _conj | ||
| keyword wholeleft \{qsxZ\}: _verb | ||
| keyword whole \{uv\} _verb | ||
| keyword wholeleft _\{123456789\}: _verb | ||
| keyword wholeleft \{0123456789\}: _verb | ||
| # numbers | ||
| keyword whole \{0123456789_\}\[abcdefghijklmnopqrstuvwxyz0123456789_.\] _num | ||
| # nouns | ||
| keyword whole a\{.:\} _noun | ||
| keyword whole \{mnxy\} _noun | ||
|
|
||
| # strings | ||
|
|
||
| context ' ' _str | ||
|
|
||
| # block nouns | ||
|
|
||
| context exclusive 0\s\[\s\t\]:\[\s\t\]0\[)\s\t\]\n linestart ) _nounblk | ||
|
|
||
| context exclusive whole Note linestart ) _nounblk | ||
|
|
||
| # comments | ||
|
|
||
| context exclusive linestart NB.\s\*\s \n _comment blue underline | ||
|
|
||
| keyword assert. brightred | ||
| keyword break. brightred | ||
| keyword case. brightred | ||
| keyword catch. brightred | ||
| keyword catchd. brightred | ||
| keyword catcht. brightred | ||
| keyword continue. brightred | ||
| keyword do. brightred | ||
| keyword else. brightred | ||
| keyword elseif. brightred | ||
| keyword end. brightred | ||
| keyword fcase. brightred | ||
| keyword for. brightred | ||
| keyword for_\{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\}\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_\]. brightred | ||
| keyword goto_\{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\}\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_\]. brightred | ||
| keyword if. brightred | ||
| keyword label_\{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\}\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_\]. brightred | ||
| keyword return. brightred | ||
| keyword select. brightred | ||
| keyword throw. brightred | ||
| keyword trap. brightred | ||
| keyword try. brightred | ||
| keyword while. brightred | ||
| keyword whilst. brightred | ||
|
|
||
| keyword NB. green | ||
|
|
||
| keyword \{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\}\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_\]\[\s\]=: white | ||
| keyword '\{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\}\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_\s\]'\[\s\]=: white | ||
|
|
||
| context ' ' brightcyan | ||
| # spellcheck | ||
|
|
||
| context exclusive linestart NB.\s\*\s \n brightgreen | ||
| # spellcheck | ||
|
|
||
| context exclusive NB. \n green | ||
| # spellcheck | ||
| context exclusive NB. \n _comment | ||
| keyword whole BUG _alerthi | ||
| keyword whole DEPRECATED _alertmi | ||
| keyword whole FIXME _alerthi | ||
| keyword whole NOTE _alertlo | ||
| keyword whole TEST _alertlo | ||
| keyword whole TODO _alertmi | ||
| keyword whole WARN _alertmi | ||
| spellcheck |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list is not sorted alphabetically.
ebnfmust be afterdiff.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have missed this, sorry. Fixed in f03e97f.