]> git.r.bdr.sh - rbdr/tree-sitter-api-notation/blobdiff - src/grammar.json
Add optionals
[rbdr/tree-sitter-api-notation] / src / grammar.json
index 1d2d121d4fb51a72c6441010308d9c69b0c1cdd2..e25308a296ce52970bf8f652d8afe4d2320180de 100644 (file)
         "type": "SEQ",
         "members": [
           {
-            "type": "SYMBOL",
-            "name": "_label"
+            "type": "CHOICE",
+            "members": [
+              {
+                "type": "SYMBOL",
+                "name": "optional_value"
+              },
+              {
+                "type": "SYMBOL",
+                "name": "_label"
+              }
+            ]
           },
           {
             "type": "CHOICE",
         ]
       }
     },
+    "optional_value": {
+      "type": "SEQ",
+      "members": [
+        {
+          "type": "STRING",
+          "value": "["
+        },
+        {
+          "type": "SYMBOL",
+          "name": "_label"
+        },
+        {
+          "type": "STRING",
+          "value": "]"
+        }
+      ]
+    },
     "type_annotation": {
       "type": "SEQ",
       "members": [