init: this is the inital commit

This commit is contained in:
2026-04-23 18:52:34 +02:00
commit b809c1db8d
7 changed files with 86 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
grammars/
+2
View File
@@ -0,0 +1,2 @@
expr = term { ( "+" | "-" ) term } ;
term = number { ( "*" | "/" ) number } ;
+13
View File
@@ -0,0 +1,13 @@
id = "ebnf"
name = "EBNF"
version = "0.0.1"
schema_version = 1
authors = ["Jooris Hadeler <jooris@hadeler.me>"]
description = "Syntax highlighting for Extended Backus-Naur Form (EBNF)"
[grammars.ebnf]
repository = "https://git.hadeler.me/jooris/tree-sitter-ebnf"
commit = "main"
[lib]
version = "0.1.0"
+15
View File
@@ -0,0 +1,15 @@
; Standard brackets
("[" @open "]" @close)
("{" @open "}" @close)
("(" @open ")" @close)
; EBNF specific sequence brackets
("(/" @open "/)" @close)
("(:" @open ":)" @close)
; Strings
("\"" @open "\"" @close)
("'" @open "'" @close)
; Special sequence
("?" @open "?" @close)
+15
View File
@@ -0,0 +1,15 @@
name = "EBNF"
grammar = "ebnf"
path_suffixes = ["ebnf"]
brackets = [
{ start = "{", end = "}", close = true, newline = true },
{ start = "[", end = "]", close = true, newline = true },
{ start = "(", end = ")", close = true, newline = false },
{ start = "(/", end = "/)", close = true, newline = false },
{ start = "(:", end = ":)", close = true, newline = false },
{ start = "\"", end = "\"", close = true, newline = false },
{ start = "'", end = "'", close = true, newline = false }
]
[language_server]
# Leave empty
+37
View File
@@ -0,0 +1,37 @@
; variables and identifiers
; We match the left-hand side of a rule as a function/type definition for better visual hierarchy
(syntax_rule
(meta_identifier) @type)
(meta_identifier) @property
; Literals
(terminal_string) @string
(integer) @number
; Comments and special sequences
(comment) @comment
(special_sequence) @string.special
; Operators
"=" @operator
"|" @operator
"-" @operator
"*" @operator
; Delimiters
"," @punctuation.delimiter
";" @punctuation.delimiter
; Brackets
"[" @punctuation.bracket
"]" @punctuation.bracket
"{" @punctuation.bracket
"}" @punctuation.bracket
"(" @punctuation.bracket
")" @punctuation.bracket
"(/" @punctuation.bracket
"/)" @punctuation.bracket
"(:" @punctuation.bracket
":)" @punctuation.bracket
"?" @punctuation.bracket
+3
View File
@@ -0,0 +1,3 @@
(syntax_rule
(meta_identifier) @name
) @item