Skip to content

Commit 755b801

Browse files
authored
Merge #97 only "-", "•" listitem, constrain (argument)
2 parents e9b4d2b + 1d04fb1 commit 755b801

11 files changed

+5298
-5008
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Overview
2020
- contains headings (`h1`, `h2`, `h3`, `column_heading`) because `codeblock`
2121
terminated by "implicit stop" (no terminating `<`) consumes blank lines, so
2222
`block` has no way to end.
23-
- `line_li` ("list item")
23+
- `line_li` ("listitem")
24+
- lines starting with `-`/`` (_not_ `+`/`*`) are listitems.
2425
- consumes lines until blank line, codeblock, or next listitem.
2526
- nesting is ignored: indented listitems are parsed as siblings.
2627
- `codeblock`:
@@ -48,7 +49,7 @@ Known issues
4849
- `url` doesn't handle _nested_ parens. E.g. `(https://example.com/(foo)#yay)`
4950
- `column_heading` currently only recognizes tilde `~` preceded by space (i.e.
5051
`foo ~` not `foo~`). This covers 99% of :help files.
51-
- `column_heading` children should be plaintext. Currently its children are parsed as `$._atom`.
52+
- `column_heading` children should be plaintext, but currently are parsed as `$._atom`.
5253

5354
TODO
5455
----

corpus/arguments.txt

+21-8
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
argument
33
================================================================================
44
argument: {arg}
5-
argument: {arg arg}
6-
CTRL-R CTRL-R {register CTRL-F}
5+
tuple: {arg,arg}
6+
keycode: CTRL-R {CTRL-R} {register CTRL-F}
77
list of { uri:string, name: string } tables
88

99

@@ -23,7 +23,12 @@ list of { uri:string, name: string } tables
2323
(word)
2424
(keycode)
2525
(argument
26-
(word)))
26+
(word))
27+
(word)
28+
(ERROR
29+
(word))
30+
(keycode)
31+
(word))
2732
(line
2833
(word)
2934
(word)
@@ -71,6 +76,7 @@ argument in parentheses
7176
================================================================================
7277
NOT an argument
7378
================================================================================
79+
a '{' '}' block
7480
{foo "{bar}" `{baz}` |{baz| } {}
7581
foo { bar
7682
{ {} foo{{ foo{{{
@@ -92,11 +98,18 @@ EXTERNAL *netrw-externapp* {{{2
9298
(help_file
9399
(block
94100
(line
95-
(argument
96-
(word)
97-
(ERROR
98-
(word)
99-
(word)))
101+
(word)
102+
(word)
103+
(word)
104+
(word)
105+
(word)
106+
(word)
107+
(word)
108+
(word))
109+
(line
110+
(word)
111+
(ERROR
112+
(word))
100113
(word)
101114
(codespan
102115
(word))

corpus/heading3-column_heading.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,13 @@ buffer-diagram
271271
(word))
272272
(line
273273
(word)
274-
(word)
274+
(ERROR
275+
(word))
275276
(word))
276277
(line
277278
(word)
278-
(word)
279+
(ERROR
280+
(word))
279281
(word))
280282
(line
281283
(taglink

corpus/line_block.txt

+58-13
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,19 @@ block2 text text
8080
================================================================================
8181
listitems
8282
================================================================================
83-
* list1.a item1
84-
* - •
83+
- list1.a item1
84+
- - •
8585
• word,
8686
!foo! ~bar. word word
8787
'item' line3 |foo|
88-
* x 'list1.a' ~/foo/bar.txt
88+
- x 'list1.a' ~/foo/bar.txt
8989
li continues
90-
* {nested} here
90+
- {nested} here
9191

92-
* 'list2' item w3
93-
* *nested_li* word *tag2*
94-
* list2 item w3
95-
* nested_li-2
92+
'list2' item w3
93+
- *nested_li* word *tag2*
94+
list2 item w3
95+
- nested_li-2
9696
foo
9797
foo
9898

@@ -178,16 +178,16 @@ li continues
178178
listitem with codeblock
179179
================================================================================
180180

181-
* list1.a item1 >
181+
list1.a item1 >
182182
foo
183-
< * list1.b item1
184-
* w1 w2
183+
< list1.b item1
184+
w1 w2
185185
w3 >
186186
code1 {
187187
code2
188188
}
189-
<* w1
190-
* w2 w3
189+
< w1
190+
w2 w3
191191
`item2` line2
192192
{item2} line3
193193

@@ -291,3 +291,48 @@ listitems + lines without blank lines
291291
(argument
292292
(word))
293293
(word)))))
294+
295+
================================================================================
296+
listitem tricky
297+
================================================================================
298+
299+
- x - x
300+
301+
-x -x
302+
303+
- - x -x
304+
- -x - x
305+
- -
306+
307+
308+
--------------------------------------------------------------------------------
309+
310+
(help_file
311+
(block
312+
(line_li
313+
(line
314+
(word)
315+
(word)
316+
(word))
317+
(line)))
318+
(block
319+
(line
320+
(word)
321+
(word)))
322+
(block
323+
(line_li
324+
(line
325+
(word)
326+
(word)
327+
(word))
328+
(line))
329+
(line_li
330+
(line
331+
(word)
332+
(word)
333+
(word))
334+
(line))
335+
(line_li
336+
(line
337+
(word))
338+
(line))))

corpus/optionlink.txt

+7-18
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ NOT optionlink: ' or 'x
3333
================================================================================
3434
'fillchars'
3535
stl ' ' or '^' statusline
36-
wbr ' ' windowbar
3736
tricky: ' 'yes' 's foo
3837

3938

@@ -51,11 +50,6 @@ tricky: ' 'yes' 's foo
5150
(word)
5251
(word)
5352
(word))
54-
(line
55-
(word)
56-
(word)
57-
(word)
58-
(word))
5953
(line
6054
(word)
6155
(word)
@@ -72,9 +66,8 @@ no! ','sqlKeyword'
7266
single-char '-' 'g' '보'
7367
non-ascii: '\"' '%)' '-bang' '.*\\.log' '.gitignore' '@{${\"foo\"}}'
7468
number: '04' 'ISO-10646-1' 'python3'
75-
76-
Option ' :help 'textwidth'
77-
Regular / :help /[
69+
Option ' :help 'textwidth'
70+
Regular / :help /[
7871

7972

8073
--------------------------------------------------------------------------------
@@ -101,16 +94,13 @@ number: '04' 'ISO-10646-1' 'python3'
10194
(word)
10295
(word)
10396
(word)
104-
(tag
105-
(word)
106-
(MISSING "*"))
97+
(word)
98+
(ERROR
99+
(word))
107100
(word)
108101
(word)
109102
(argument
110-
(word)
111-
(ERROR
112-
(word)
113-
(word)))
103+
(word))
114104
(word)
115105
(word))
116106
(line
@@ -119,8 +109,7 @@ number: '04' 'ISO-10646-1' 'python3'
119109
(word)
120110
(word)
121111
(word)
122-
(word)))
123-
(block
112+
(word))
124113
(line
125114
(word)
126115
(word)

corpus/taglink.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ Note: ":autocmd" can...
150150
(line
151151
(word)
152152
(word)
153-
(word)
153+
(ERROR
154+
(word))
154155
(word))
155156
(line
156157
(word)

corpus/tags.txt

+27-30
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,9 @@ NOT a tag
7878
================================================================================
7979
* bullet1
8080
* bullet2 bullet2
81-
* bullet3
82-
bullet3 bullet3
83-
* bullet4
8481

82+
0 \* escaped
83+
0 (paren *)
8584
1 "*" not
8685
2 * not
8786
3this *not no
@@ -93,47 +92,45 @@ NOT a tag
9392

9493
(help_file
9594
(block
96-
(line_li
97-
(line
98-
(word))
99-
(line))
100-
(line_li
101-
(line
102-
(word)
103-
(word))
104-
(line))
105-
(line_li
106-
(line
107-
(word))
108-
(line)
109-
(line
110-
(word)
111-
(word)))
112-
(line_li
113-
(line
114-
(word))
115-
(line)))
95+
(line
96+
(word)
97+
(word))
98+
(line
99+
(word)
100+
(word)
101+
(word)))
116102
(block
117103
(line
118104
(word)
119105
(word)
120106
(word))
121107
(line
122108
(word)
123-
(ERROR)
109+
(word)
110+
(word)
111+
(word)
112+
(ERROR
113+
(word)))
114+
(line
115+
(word)
116+
(word)
124117
(word))
125118
(line
126119
(word)
127-
(tag
128-
(word)
129-
(MISSING "*"))
120+
(word)
121+
(word))
122+
(line
123+
(word)
124+
(word)
125+
(ERROR
126+
(word))
130127
(word)))
131128
(block
132129
(line
133130
(word)
134-
(tag
135-
(word)
136-
(MISSING "*"))
131+
(word)
132+
(ERROR
133+
(word))
137134
(word)
138135
(word)
139136
(word))))

0 commit comments

Comments
 (0)