Skip to content

Commit 428fd9a

Browse files
committed
fix: add (expr) to dynamic block end (#30)
1 parent 53a61b6 commit 428fd9a

File tree

5 files changed

+31821
-20617
lines changed

5 files changed

+31821
-20617
lines changed

corpus/basic.tst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,19 @@ c
432432
contents: (contents
433433
(expr)))))
434434

435+
================================================================================
436+
DynamicBlock.3 - End name
437+
================================================================================
438+
#+BEGIN: a
439+
#+END: a
440+
--------------------------------------------------------------------------------
441+
442+
(document
443+
body: (body
444+
(dynamic_block
445+
name: (expr)
446+
end_name: (expr))))
447+
435448
================================================================================
436449
Comment.1 - Basic
437450
================================================================================

grammar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ org_grammar = {
234234
$._nl,
235235
optional(field('contents', $.contents)),
236236
caseInsensitive('#+end:'),
237+
optional(field('end_name', $.expr)),
237238
$._eol,
238239
),
239240

src/grammar.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,22 @@
13311331
"named": false,
13321332
"value": "#+end:"
13331333
},
1334+
{
1335+
"type": "CHOICE",
1336+
"members": [
1337+
{
1338+
"type": "FIELD",
1339+
"name": "end_name",
1340+
"content": {
1341+
"type": "SYMBOL",
1342+
"name": "expr"
1343+
}
1344+
},
1345+
{
1346+
"type": "BLANK"
1347+
}
1348+
]
1349+
},
13341350
{
13351351
"type": "SYMBOL",
13361352
"name": "_eol"

src/node-types.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,16 @@
292292
}
293293
]
294294
},
295+
"end_name": {
296+
"multiple": false,
297+
"required": false,
298+
"types": [
299+
{
300+
"type": "expr",
301+
"named": true
302+
}
303+
]
304+
},
295305
"name": {
296306
"multiple": false,
297307
"required": true,

0 commit comments

Comments
 (0)