Skip to content

Commit 0d5e731

Browse files
committed
fix: Headline.8d passing. All tests passing!
1 parent 9a595e5 commit 0d5e731

File tree

3 files changed

+12625
-12601
lines changed

3 files changed

+12625
-12601
lines changed

grammar.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ org_grammar = {
3636
// Should we start the tag?
3737
[$.item],
3838

39+
[$._tag_expr_start, $.expr],
40+
3941
// _multiline_text • ':' …
4042
// Is the ':' continued multiline text or is it a drawer?
4143
[$.paragraph],
@@ -112,13 +114,16 @@ org_grammar = {
112114
item: $ => repeat1($.expr),
113115

114116
tag_list: $ => prec.dynamic(1, seq(
115-
token(prec('non-immediate', ':')),
117+
$._tag_expr_start,
116118
repeat1(seq(
117119
field('tag', alias($._noc_expr, $.tag)),
118120
token.immediate(prec('special', ':')),
119121
)),
120122
)),
121123

124+
// This is in another node to ensure a conflict with headline (item)
125+
_tag_expr_start: _ => token(prec('non-immediate', ':')),
126+
122127
property_drawer: $ => seq(
123128
caseInsensitive(':properties:'),
124129
repeat1($._nl),

src/grammar.json

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,8 @@
330330
"type": "SEQ",
331331
"members": [
332332
{
333-
"type": "TOKEN",
334-
"content": {
335-
"type": "PREC",
336-
"value": "non-immediate",
337-
"content": {
338-
"type": "STRING",
339-
"value": ":"
340-
}
341-
}
333+
"type": "SYMBOL",
334+
"name": "_tag_expr_start"
342335
},
343336
{
344337
"type": "REPEAT1",
@@ -375,6 +368,17 @@
375368
]
376369
}
377370
},
371+
"_tag_expr_start": {
372+
"type": "TOKEN",
373+
"content": {
374+
"type": "PREC",
375+
"value": "non-immediate",
376+
"content": {
377+
"type": "STRING",
378+
"value": ":"
379+
}
380+
}
381+
},
378382
"property_drawer": {
379383
"type": "SEQ",
380384
"members": [
@@ -4171,6 +4175,10 @@
41714175
[
41724176
"item"
41734177
],
4178+
[
4179+
"_tag_expr_start",
4180+
"expr"
4181+
],
41744182
[
41754183
"paragraph"
41764184
],

0 commit comments

Comments
 (0)