Add ebnf parser

This commit is contained in:
RubixDev 2022-10-02 18:12:30 +02:00 committed by Stephan Seitz
parent cffe9c28b8
commit 41a59591a5
2 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1,43 @@
;;;; Simple tokens ;;;;
(terminal) @string.grammar
(special_sequence) @string.special.grammar
(integer) @number
(comment) @comment
;;;; Identifiers ;;;;
; Allow different highlighting for specific casings
((identifier) @type
(#match? @type "^[A-Z]"))
((identifier) @symbol
(#match? @symbol "^[a-z]"))
((identifier) @constant
(#match? @constant "^[A-Z][A-Z0-9_]+$"))
;;; Punctuation ;;;;
[
";"
","
] @punctuation.delimiter
[
"|"
"*"
"-"
] @operator
"=" @keyword.operator
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket