From a9a4ba60a37eb351d3ed872f1cfcf53e673be9ef Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 14 Dec 2024 12:29:47 +0100 Subject: feat(tree-sitter-yts): Update to new tree-sitter version & improve parsing --- tree-sitter-yts/src/grammar.json | 45 +++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) (limited to 'tree-sitter-yts/src/grammar.json') diff --git a/tree-sitter-yts/src/grammar.json b/tree-sitter-yts/src/grammar.json index 65e8122..f2f337c 100644 --- a/tree-sitter-yts/src/grammar.json +++ b/tree-sitter-yts/src/grammar.json @@ -1,4 +1,5 @@ { + "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json", "name": "yts", "rules": { "source_file": { @@ -80,6 +81,22 @@ "type": "STRING", "value": "w" }, + { + "type": "STRING", + "value": "watched" + }, + { + "type": "STRING", + "value": "wd" + }, + { + "type": "STRING", + "value": "add" + }, + { + "type": "STRING", + "value": "a" + }, { "type": "STRING", "value": "drop" @@ -180,8 +197,17 @@ "name": "_q" }, { - "type": "PATTERN", - "value": "\\d{4}-\\d{2}-\\d{2}" + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "[No release date]" + }, + { + "type": "PATTERN", + "value": "\\d{4}-\\d{2}-\\d{2}" + } + ] }, { "type": "SYMBOL", @@ -197,8 +223,17 @@ "name": "_q" }, { - "type": "PATTERN", - "value": "[^\"]+" + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "[No author]" + }, + { + "type": "PATTERN", + "value": "[^\"]+" + } + ] }, { "type": "SYMBOL", @@ -221,7 +256,7 @@ "members": [ { "type": "STRING", - "value": "[No Duration]" + "value": "[No duration]" }, { "type": "PATTERN", -- cgit 1.4.1