File tree Expand file tree Collapse file tree 8 files changed +4729
-5109
lines changed Expand file tree Collapse file tree 8 files changed +4729
-5109
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "targets" : [
3
+ {
4
+ "target_name" : "tree_sitter_help_binding" ,
5
+ "include_dirs" : [
6
+ "<!(node -e \" require('nan')\" )" ,
7
+ "src"
8
+ ],
9
+ "sources" : [
10
+ "bindings/node/binding.cc" ,
11
+ "src/parser.c" ,
12
+ # If your language uses an external scanner, add it here.
13
+ ],
14
+ "cflags_c" : [
15
+ "-std=c99" ,
16
+ ]
17
+ }
18
+ ]
19
+ }
Original file line number Diff line number Diff line change @@ -151,4 +151,4 @@ EXTERNAL *netrw-externapp* {{{2
151
151
(uppercase_name)
152
152
(tag
153
153
(word))
154
- (ERROR )))))
154
+ (word )))))
Original file line number Diff line number Diff line change @@ -352,3 +352,30 @@ codeblock stop and start on same line
352
352
(codeblock
353
353
(line)
354
354
(line)))))
355
+
356
+ ================================================================================
357
+ NOT codeblock: whitespace after ">"
358
+ ================================================================================
359
+ x >
360
+ line
361
+
362
+ x x>
363
+ line
364
+
365
+
366
+
367
+ --------------------------------------------------------------------------------
368
+
369
+ (help_file
370
+ (block
371
+ (line
372
+ (word)
373
+ (word))
374
+ (line
375
+ (word)))
376
+ (block
377
+ (line
378
+ (word)
379
+ (word))
380
+ (line
381
+ (word))))
Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ module.exports = grammar({
82
82
'(' ,
83
83
/ \w + \( / ,
84
84
'~' ,
85
+ // NOT codeblock: random ">" in middle of the motherflippin text.
86
+ '>' ,
85
87
) ,
86
88
87
89
keycode : ( ) => choice (
@@ -121,7 +123,8 @@ module.exports = grammar({
121
123
122
124
// Codeblock: preformatted block of lines starting with ">".
123
125
codeblock : ( $ ) => prec . right ( seq (
124
- / > [ \t ] * \n / ,
126
+ '>' ,
127
+ token . immediate ( '\n' ) ,
125
128
repeat1 ( alias ( $ . line_code , $ . line ) ) ,
126
129
// Codeblock ends if a line starts with non-whitespace.
127
130
// Terminating "<" is consumed in other rules.
@@ -182,7 +185,7 @@ module.exports = grammar({
182
185
h3 : ( $ ) =>
183
186
seq (
184
187
field ( 'name' , $ . uppercase_name ) ,
185
- repeat ( $ . tag ) ,
188
+ optional ( seq ( $ . tag , repeat ( $ . _atom ) ) ) ,
186
189
'\n' ,
187
190
) ,
188
191
Original file line number Diff line number Diff line change 14
14
"`" @conceal (#set! conceal "")
15
15
text: (_) @text.literal )
16
16
(codeblock) @text.literal
17
+ (codeblock
18
+ ">" @conceal (#set! conceal ""))
19
+ (block
20
+ "<" @conceal (#set! conceal ""))
17
21
(argument) @parameter
18
22
(keycode) @string.special
19
23
(url) @text.uri
Original file line number Diff line number Diff line change 280
280
{
281
281
"type" : " STRING" ,
282
282
"value" : " ~"
283
+ },
284
+ {
285
+ "type" : " STRING" ,
286
+ "value" : " >"
283
287
}
284
288
]
285
289
},
445
449
"type" : " SEQ" ,
446
450
"members" : [
447
451
{
448
- "type" : " PATTERN" ,
449
- "value" : " >[\\ t ]*\\ n"
452
+ "type" : " STRING" ,
453
+ "value" : " >"
454
+ },
455
+ {
456
+ "type" : " IMMEDIATE_TOKEN" ,
457
+ "content" : {
458
+ "type" : " STRING" ,
459
+ "value" : " \n "
460
+ }
450
461
},
451
462
{
452
463
"type" : " REPEAT1" ,
742
753
}
743
754
},
744
755
{
745
- "type" : " REPEAT" ,
746
- "content" : {
747
- "type" : " SYMBOL" ,
748
- "name" : " tag"
749
- }
756
+ "type" : " CHOICE" ,
757
+ "members" : [
758
+ {
759
+ "type" : " SEQ" ,
760
+ "members" : [
761
+ {
762
+ "type" : " SYMBOL" ,
763
+ "name" : " tag"
764
+ },
765
+ {
766
+ "type" : " REPEAT" ,
767
+ "content" : {
768
+ "type" : " SYMBOL" ,
769
+ "name" : " _atom"
770
+ }
771
+ }
772
+ ]
773
+ },
774
+ {
775
+ "type" : " BLANK"
776
+ }
777
+ ]
750
778
},
751
779
{
752
780
"type" : " STRING" ,
Original file line number Diff line number Diff line change 225
225
"multiple" : true ,
226
226
"required" : false ,
227
227
"types" : [
228
+ {
229
+ "type" : " argument" ,
230
+ "named" : true
231
+ },
232
+ {
233
+ "type" : " codespan" ,
234
+ "named" : true
235
+ },
236
+ {
237
+ "type" : " keycode" ,
238
+ "named" : true
239
+ },
240
+ {
241
+ "type" : " optionlink" ,
242
+ "named" : true
243
+ },
228
244
{
229
245
"type" : " tag" ,
230
246
"named" : true
247
+ },
248
+ {
249
+ "type" : " taglink" ,
250
+ "named" : true
251
+ },
252
+ {
253
+ "type" : " url" ,
254
+ "named" : true
255
+ },
256
+ {
257
+ "type" : " word" ,
258
+ "named" : true
231
259
}
232
260
]
233
261
}
439
467
"type" : " <" ,
440
468
"named" : false
441
469
},
470
+ {
471
+ "type" : " >" ,
472
+ "named" : false
473
+ },
442
474
{
443
475
"type" : " `" ,
444
476
"named" : false
You can’t perform that action at this time.
0 commit comments