tagset-parser 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/readme.md ADDED
@@ -0,0 +1,44 @@
1
+ # tagset-parser
2
+
3
+ > TagSet DSL parser
4
+
5
+ ## Install
6
+
7
+ ```
8
+ $ npm install tagset-parser
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ import { parse } from 'tagset-parser'
15
+
16
+ // Classic syntax
17
+ const ast = parse(`set A 赤
18
+ set B 青
19
+ item A&B x,c`)
20
+
21
+ // Sugar syntax (colon)
22
+ const ast2 = parse(`A, B: x, y`)
23
+
24
+ // Auto-detect sets (no set declarations needed)
25
+ const ast3 = parse(`item A&B x`)
26
+ // ast3.sets → [{ id: 'A', label: 'A', index: 0 }, { id: 'B', label: 'B', index: 1 }]
27
+ ```
28
+
29
+ ## Syntax
30
+
31
+ ```
32
+ set <id> <label> # Declare a set (optional)
33
+ item <pattern> <values> # Declare an item with & pattern
34
+ <ids>: <values> # Sugar syntax (comma-separated IDs)
35
+ ```
36
+
37
+ - `set` declarations are optional; sets are auto-detected from patterns
38
+ - Patterns use `&` between set IDs: `A&B`, `A&_&C`
39
+ - `_` is a placeholder (ignored in bitmask)
40
+ - Values are comma-separated: `x,y` or `x, y`
41
+
42
+ ## License
43
+
44
+ MIT