]> git.r.bdr.sh - rbdr/tree-sitter-api-notation/blobdiff - src/grammar.json
Reduce query
[rbdr/tree-sitter-api-notation] / src / grammar.json
index 1d2d121d4fb51a72c6441010308d9c69b0c1cdd2..097ee8559d72421dcc7af233549cb0cb5865cc36 100644 (file)
@@ -1,5 +1,5 @@
 {
 {
-  "name": "apinotation",
+  "name": "api_notation",
   "rules": {
     "source_file": {
       "type": "REPEAT",
   "rules": {
     "source_file": {
       "type": "REPEAT",
         "type": "SEQ",
         "members": [
           {
         "type": "SEQ",
         "members": [
           {
-            "type": "SYMBOL",
-            "name": "_label"
+            "type": "CHOICE",
+            "members": [
+              {
+                "type": "SYMBOL",
+                "name": "optional_value"
+              },
+              {
+                "type": "SYMBOL",
+                "name": "_label"
+              }
+            ]
           },
           {
             "type": "CHOICE",
           },
           {
             "type": "CHOICE",
         ]
       }
     },
         ]
       }
     },
+    "optional_value": {
+      "type": "SEQ",
+      "members": [
+        {
+          "type": "STRING",
+          "value": "["
+        },
+        {
+          "type": "SYMBOL",
+          "name": "_label"
+        },
+        {
+          "type": "STRING",
+          "value": "]"
+        }
+      ]
+    },
     "type_annotation": {
       "type": "SEQ",
       "members": [
     "type_annotation": {
       "type": "SEQ",
       "members": [