You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- element contains: `(directive)* choose(paragraph, drawer, comment, footnote def, list, block, dynamic block, table)` or a bare `(directive)`
19
+
- paragraph contains: `(expr)+`
20
+
-expr contains: anonymous nodes for 'str', 'num', 'sym', and any ascii symbol that is not letters or numbers. (See top of grammar.js and queries for details)
22
21
23
22
Like in many regex systems, `*/+` is read as "0/1 or more", and `?` is 0 or 1.
24
23
@@ -46,54 +45,86 @@ Text
46
45
Parses as:
47
46
```
48
47
(document [0, 0] - [16, 0]
49
-
(directive [0, 0] - [1, 0]
50
-
name: (name [0, 2] - [0, 7])
51
-
value: (value [0, 9] - [0, 16]))
52
-
(body [2, 0] - [3, 0]
48
+
(body [0, 0] - [4, 0]
49
+
directive: (directive [0, 0] - [1, 0]
50
+
name: (expr [0, 2] - [0, 7])
51
+
value: (value [0, 9] - [0, 16]
52
+
(expr [0, 9] - [0, 16])))
53
53
(paragraph [2, 0] - [3, 0]
54
-
(markup [2, 5] - [2, 16])))
54
+
(expr [2, 0] - [2, 4])
55
+
(expr [2, 5] - [2, 12])
56
+
(expr [2, 13] - [2, 16])
57
+
(expr [2, 17] - [2, 22])))
55
58
(section [4, 0] - [16, 0]
56
-
(headline [4, 0] - [4, 12]
57
-
(stars [4, 0] - [4, 1])
58
-
(item [4, 2] - [4, 12]))
59
+
(headline [4, 0] - [5, 0]
60
+
stars: (stars [4, 0] - [4, 1])
61
+
item: (item [4, 2] - [4, 12]
62
+
(expr [4, 2] - [4, 6])
63
+
(expr [4, 7] - [4, 12])))
59
64
(plan [5, 0] - [6, 0]
60
-
(timestamp [5, 0] - [5, 16]
61
-
(date [5, 1] - [5, 15])))
62
-
(body [7, 0] - [11, 10]
63
-
(list [7, 0] - [11, 10]
64
-
(listitem [7, 3] - [7, 10])
65
-
(listitem [8, 3] - [10, 16]
66
-
(list [9, 0] - [10, 16]
67
-
(listitem [9, 5] - [9, 16])
68
-
(listitem [10, 5] - [10, 16])))
69
-
(listitem [11, 3] - [11, 10])))
65
+
(entry [5, 0] - [5, 16]
66
+
timestamp: (timestamp [5, 0] - [5, 16]
67
+
(date [5, 1] - [5, 11])
68
+
(day [5, 12] - [5, 15]))))
69
+
(body [6, 0] - [13, 0]
70
+
(list [7, 0] - [12, 0]
71
+
(listitem [7, 2] - [8, 0]
72
+
bullet: (bullet [7, 2] - [7, 3])
73
+
contents: (paragraph [7, 4] - [8, 0]
74
+
(expr [7, 4] - [7, 8])
75
+
(expr [7, 9] - [7, 10])))
76
+
(listitem [8, 2] - [11, 0]
77
+
bullet: (bullet [8, 2] - [8, 3])
78
+
contents: (paragraph [8, 4] - [9, 0]
79
+
(expr [8, 4] - [8, 5])
80
+
(expr [8, 6] - [8, 7])
81
+
(expr [8, 8] - [8, 12])
82
+
(expr [8, 13] - [8, 14]))
83
+
contents: (list [9, 0] - [11, 0]
84
+
(listitem [9, 4] - [10, 0]
85
+
bullet: (bullet [9, 4] - [9, 5])
86
+
contents: (paragraph [9, 6] - [10, 0]
87
+
(expr [9, 6] - [9, 7])
88
+
(expr [9, 8] - [9, 9])
89
+
(expr [9, 10] - [9, 14])
90
+
(expr [9, 15] - [9, 16])))
91
+
(listitem [10, 4] - [11, 0]
92
+
bullet: (bullet [10, 4] - [10, 5])
93
+
contents: (paragraph [10, 6] - [11, 0]
94
+
(expr [10, 6] - [10, 7])
95
+
(expr [10, 8] - [10, 9])
96
+
(expr [10, 10] - [10, 14])
97
+
(expr [10, 15] - [10, 16])))))
98
+
(listitem [11, 2] - [12, 0]
99
+
bullet: (bullet [11, 2] - [11, 3])
100
+
contents: (paragraph [11, 4] - [12, 0]
101
+
(expr [11, 4] - [11, 8])
102
+
(expr [11, 9] - [11, 10])))))
70
103
(section [13, 0] - [16, 0]
71
-
(headline [13, 0] - [13, 19]
72
-
(stars [13, 0] - [13, 2])
73
-
(item [13, 3] - [13, 13])
74
-
tags: (tag [13, 15] - [13, 18]))
75
-
(body [15, 0] - [16, 0]
76
-
(paragraph [15, 0] - [16, 0])))))
104
+
(headline [13, 0] - [14, 0]
105
+
stars: (stars [13, 0] - [13, 2])
106
+
item: (item [13, 3] - [13, 13]
107
+
(expr [13, 3] - [13, 13]))
108
+
tags: (tag_list [13, 14] - [13, 19]
109
+
tag: (tag [13, 15] - [13, 18])))
110
+
(body [14, 0] - [16, 0]
111
+
(paragraph [15, 0] - [16, 0]
112
+
(expr [15, 0] - [15, 4]))))))
77
113
```
78
114
79
115
## Install
80
116
81
-
To compile the parser library for use in neovim & others:
0 commit comments