coridoc-markdown 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/grammar/coridoc-markdown.artifact.json +1 -0
- data/grammar/coridoc-markdown.bindings.yml +13 -0
- data/grammar/coridoc-markdown.parg +159 -0
- data/lib/coridoc/markdown/bindings/captures.rb +6 -0
- data/lib/coridoc/markdown/bindings.rb +20 -0
- data/lib/coridoc/markdown/parser/ast_processor.rb +32 -8
- data/lib/coridoc/markdown/parser/inline_parser.rb +19 -1
- data/lib/coridoc/markdown/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 198fc73147f58e50acc456edb239c25f7afe8d6d18e561ad2c8b8c32a2b3c2ac
|
|
4
|
+
data.tar.gz: efd9236da65f9ae255601e0709c9bc3b0bf54f53fd512b4725bb4e1756ce4d3f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac6313c079579482a98c1811a99aa879fba554a05c0dfe26cb1f2bc2c9dfaf9cc53926a51e86a9239bce2ab171acdc70cc0f2ddacbfd7e7356df2c21f76827db
|
|
7
|
+
data.tar.gz: 0375ee4a7781f1cc215658a3d75f0ac926e1d5186aed3197148c83c89a17d06e44d6aaa7cada56106795351d635f171f1474ecac4e99426efba516478ac11d04
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"bindings":null,"version":"0.1.0","grammar":"CoridocMarkdown","shape":"parsanol-tree/v2","binding_version":1,"entries":{"document":{"root":"document","grammar":{"atoms":[{"Entity":{"atom":730}},{"CustomRef":{"name":"blank_line"}},{"Entity":{"atom":17}},{"Entity":{"atom":6}},{"Str":{"pattern":" "}},{"Re":{"pattern":"[\\x09]"}},{"Alternative":{"atoms":[4,5]}},{"Repetition":{"atom":3,"min":0,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"^"}},{"Entity":{"atom":6}},{"Repetition":{"atom":9,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":16}},{"CustomRef":{"name":"line_ending"}},{"Entity":{"atom":14}},{"Re":{"pattern":"[\\x00-\\u{10ffff}]"}},{"Lookahead":{"atom":13,"positive":false}},{"Alternative":{"atoms":[12,15]}},{"Sequence":{"atoms":[7,8,10,11]}},{"Entity":{"atom":62}},{"Entity":{"atom":21}},{"Str":{"pattern":" "}},{"Repetition":{"atom":20,"min":0,"max":3,"tag":"Repetition"}},{"Entity":{"atom":25}},{"Str":{"pattern":"\\"}},{"Str":{"pattern":"#"}},{"Sequence":{"atoms":[23,24]}},{"Lookahead":{"atom":22,"positive":false}},{"Str":{"pattern":"#"}},{"Repetition":{"atom":27,"min":1,"max":6,"tag":"Repetition"}},{"Named":{"name":"heading","atom":28}},{"Str":{"pattern":"#"}},{"Lookahead":{"atom":30,"positive":false}},{"Entity":{"atom":47}},{"Entity":{"atom":6}},{"Repetition":{"atom":33,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"#"}},{"Repetition":{"atom":35,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":6}},{"Repetition":{"atom":37,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":45}},{"Str":{"pattern":"\r"}},{"Str":{"pattern":"\n"}},{"Alternative":{"atoms":[40,41]}},{"Lookahead":{"atom":42,"positive":false}},{"Entity":{"atom":14}},{"Sequence":{"atoms":[43,44]}},{"Lookahead":{"atom":39,"positive":false}},{"Sequence":{"atoms":[34,36,38,46]}},{"Lookahead":{"atom":32,"positive":false}},{"Str":{"pattern":" "}},{"Repetition":{"atom":49,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":47}},{"Lookahead":{"atom":51,"positive":false}},{"Entity":{"atom":45}},{"Sequence":{"atoms":[52,53]}},{"Repetition":{"atom":54,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"text","atom":55}},{"Sequence":{"atoms":[48,50,56]}},{"Repetition":{"atom":57,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":47}},{"Repetition":{"atom":59,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":16}},{"Sequence":{"atoms":[19,26,29,31,58,60,61]}},{"Entity":{"atom":68}},{"Entity":{"atom":21}},{"CustomRef":{"name":"ign_thematic_chars"}},{"CustomRef":{"name":"const_hr"}},{"Entity":{"atom":16}},{"Sequence":{"atoms":[64,65,66,67]}},{"Entity":{"atom":107}},{"Entity":{"atom":78}},{"Str":{"pattern":" "}},{"Entity":{"atom":77}},{"Entity":{"atom":45}},{"Repetition":{"atom":73,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"ln","atom":74}},{"Entity":{"atom":16}},{"Sequence":{"atoms":[75,76]}},{"Sequence":{"atoms":[71,72]}},{"CustomRef":{"name":"continuation"}},{"Entity":{"atom":78}},{"Entity":{"atom":102}},{"CustomRef":{"name":"ign_blank_line_verbatim"}},{"CustomRef":{"name":"const_ln_empty"}},{"CustomRef":{"name":"continuation"}},{"Str":{"pattern":" "}},{"Entity":{"atom":98}},{"Entity":{"atom":6}},{"Repetition":{"atom":87,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"ln","atom":88}},{"Entity":{"atom":14}},{"Lookahead":{"atom":90,"positive":false}},{"Sequence":{"atoms":[89,91]}},{"Entity":{"atom":6}},{"Repetition":{"atom":93,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"ln","atom":94}},{"CustomRef":{"name":"line_ending"}},{"Sequence":{"atoms":[95,96]}},{"Alternative":{"atoms":[92,97]}},{"Alternative":{"atoms":[85,86]}},{"Sequence":{"atoms":[84,99]}},{"Lookahead":{"atom":100,"positive":true}},{"Sequence":{"atoms":[82,83,101]}},{"Alternative":{"atoms":[80,81]}},{"Sequence":{"atoms":[79,103]}},{"Repetition":{"atom":104,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[70,105]}},{"Named":{"name":"code_block","atom":106}},{"Entity":{"atom":145}},{"Entity":{"atom":120}},{"Entity":{"atom":21}},{"StateSet":{"slot":"fence_indent","expr":110}},{"Str":{"pattern":"`"}},{"Repetition":{"atom":112,"min":3,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"~"}},{"Repetition":{"atom":114,"min":3,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[113,115]}},{"StateSet":{"slot":"fence","expr":116}},{"CustomRef":{"name":"fence_info"}},{"Entity":{"atom":16}},{"Sequence":{"atoms":[111,117,118,119]}},{"CustomRef":{"name":"continuation"}},{"Entity":{"atom":126}},{"Entity":{"atom":21}},{"CustomRef":{"name":"fence_close_marker"}},{"Entity":{"atom":16}},{"Sequence":{"atoms":[123,124,125]}},{"Lookahead":{"atom":122,"positive":false}},{"CustomRef":{"name":"consume_fenced_indent"}},{"Entity":{"atom":77}},{"CustomRef":{"name":"ign_blank_line_verbatim"}},{"CustomRef":{"name":"const_ln_empty"}},{"Sequence":{"atoms":[130,131]}},{"Alternative":{"atoms":[129,132]}},{"Sequence":{"atoms":[121,127,128,133]}},{"Repetition":{"atom":134,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"code_block","atom":135}},{"CustomRef":{"name":"continuation"}},{"Entity":{"atom":126}},{"Sequence":{"atoms":[137,138]}},{"CustomRef":{"name":"continuation"}},{"Entity":{"atom":14}},{"Sequence":{"atoms":[140,141]}},{"Lookahead":{"atom":142,"positive":false}},{"Alternative":{"atoms":[139,143]}},{"Sequence":{"atoms":[109,136,144]}},{"Entity":{"atom":154}},{"Entity":{"atom":152}},{"Entity":{"atom":21}},{"Str":{"pattern":">"}},{"Str":{"pattern":" "}},{"Repetition":{"atom":150,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[148,149,151]}},{"CustomRef":{"name":"bq_scope"}},{"Sequence":{"atoms":[147,153]}},{"Entity":{"atom":375}},{"Entity":{"atom":348}},{"Entity":{"atom":334}},{"CustomRef":{"name":"blank_line"}},{"Entity":{"atom":62}},{"Entity":{"atom":68}},{"Entity":{"atom":120}},{"Entity":{"atom":154}},{"Entity":{"atom":243}},{"Entity":{"atom":6}},{"Repetition":{"atom":164,"min":0,"max":3,"tag":"Repetition"}},{"Entity":{"atom":226}},{"Str":{"pattern":"{:"}},{"Entity":{"atom":223}},{"Entity":{"atom":6}},{"Repetition":{"atom":169,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":183}},{"Str":{"pattern":"."}},{"Entity":{"atom":181}},{"Entity":{"atom":179}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Str":{"pattern":"_"}},{"Alternative":{"atoms":[175,176,177,178]}},{"Str":{"pattern":"-"}},{"Alternative":{"atoms":[174,180]}},{"Repetition":{"atom":173,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[172,182]}},{"Entity":{"atom":188}},{"Str":{"pattern":"#"}},{"Entity":{"atom":181}},{"Repetition":{"atom":186,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[185,187]}},{"Entity":{"atom":220}},{"Entity":{"atom":181}},{"Repetition":{"atom":190,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"="}},{"Str":{"pattern":"\""}},{"Str":{"pattern":"\""}},{"Lookahead":{"atom":194,"positive":false}},{"Entity":{"atom":14}},{"Sequence":{"atoms":[195,196]}},{"Repetition":{"atom":197,"min":0,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"\""}},{"Sequence":{"atoms":[193,198,199]}},{"Str":{"pattern":"'"}},{"Str":{"pattern":"'"}},{"Lookahead":{"atom":202,"positive":false}},{"Entity":{"atom":14}},{"Sequence":{"atoms":[203,204]}},{"Repetition":{"atom":205,"min":0,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"'"}},{"Sequence":{"atoms":[201,206,207]}},{"Entity":{"atom":212}},{"Re":{"pattern":"[ ]"}},{"Re":{"pattern":"[\\x09-\\x0d]"}},{"Alternative":{"atoms":[210,211]}},{"Str":{"pattern":"}"}},{"Alternative":{"atoms":[209,213]}},{"Lookahead":{"atom":214,"positive":false}},{"Entity":{"atom":14}},{"Sequence":{"atoms":[215,216]}},{"Repetition":{"atom":217,"min":1,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[200,208,218]}},{"Sequence":{"atoms":[191,192,219]}},{"Alternative":{"atoms":[171,184,189]}},{"Sequence":{"atoms":[170,221]}},{"Repetition":{"atom":222,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"ial","atom":168}},{"Str":{"pattern":"}"}},{"Sequence":{"atoms":[167,224,225]}},{"Entity":{"atom":240}},{"Str":{"pattern":"{:"}},{"Entity":{"atom":233}},{"Entity":{"atom":179}},{"Repetition":{"atom":230,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":":"}},{"Sequence":{"atoms":[231,232]}},{"Named":{"name":"ald_name","atom":229}},{"Entity":{"atom":6}},{"Repetition":{"atom":235,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":223}},{"Named":{"name":"ial","atom":237}},{"Str":{"pattern":"}"}},{"Sequence":{"atoms":[228,234,236,238,239]}},{"Alternative":{"atoms":[166,227]}},{"Entity":{"atom":16}},{"Sequence":{"atoms":[165,241,242]}},{"Entity":{"atom":307}},{"Entity":{"atom":290}},{"Str":{"pattern":"{::"}},{"Entity":{"atom":249}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Repetition":{"atom":248,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"ext_name","atom":247}},{"Entity":{"atom":285}},{"Entity":{"atom":6}},{"Repetition":{"atom":252,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":283}},{"Entity":{"atom":181}},{"Repetition":{"atom":255,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"="}},{"Str":{"pattern":"\""}},{"Str":{"pattern":"\""}},{"Lookahead":{"atom":259,"positive":false}},{"Entity":{"atom":14}},{"Sequence":{"atoms":[260,261]}},{"Repetition":{"atom":262,"min":0,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"\""}},{"Sequence":{"atoms":[258,263,264]}},{"Str":{"pattern":"'"}},{"Str":{"pattern":"'"}},{"Lookahead":{"atom":267,"positive":false}},{"Entity":{"atom":14}},{"Sequence":{"atoms":[268,269]}},{"Repetition":{"atom":270,"min":0,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"'"}},{"Sequence":{"atoms":[266,271,272]}},{"Entity":{"atom":212}},{"Str":{"pattern":"/"}},{"Str":{"pattern":"}"}},{"Alternative":{"atoms":[274,275,276]}},{"Lookahead":{"atom":277,"positive":false}},{"Entity":{"atom":14}},{"Sequence":{"atoms":[278,279]}},{"Repetition":{"atom":280,"min":1,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[265,273,281]}},{"Sequence":{"atoms":[256,257,282]}},{"Sequence":{"atoms":[253,254]}},{"Repetition":{"atom":284,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"ext_options","atom":251}},{"Entity":{"atom":6}},{"Repetition":{"atom":287,"min":0,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"/}"}},{"Sequence":{"atoms":[246,250,286,288,289]}},{"Entity":{"atom":305}},{"Str":{"pattern":"{::"}},{"Entity":{"atom":249}},{"Named":{"name":"ext_name","atom":293}},{"Entity":{"atom":285}},{"Named":{"name":"ext_options","atom":295}},{"Str":{"pattern":"}"}},{"Str":{"pattern":"{:/"}},{"Lookahead":{"atom":298,"positive":false}},{"Entity":{"atom":14}},{"Sequence":{"atoms":[299,300]}},{"Repetition":{"atom":301,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"ext_body","atom":302}},{"Str":{"pattern":"{:/}"}},{"Sequence":{"atoms":[292,294,296,297,303,304]}},{"Alternative":{"atoms":[245,291]}},{"Named":{"name":"extension","atom":306}},{"Entity":{"atom":316}},{"Entity":{"atom":21}},{"Str":{"pattern":"-"}},{"Str":{"pattern":"*"}},{"Str":{"pattern":"+"}},{"Alternative":{"atoms":[310,311,312]}},{"Str":{"pattern":" "}},{"Repetition":{"atom":314,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[309,313,315]}},{"Entity":{"atom":327}},{"Entity":{"atom":21}},{"Re":{"pattern":"[\\x31-\\x39]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":320,"min":0,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"."}},{"Str":{"pattern":")"}},{"Alternative":{"atoms":[322,323]}},{"Str":{"pattern":" "}},{"Repetition":{"atom":325,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[318,319,321,324,326]}},{"Entity":{"atom":333}},{"Entity":{"atom":21}},{"Str":{"pattern":":"}},{"Str":{"pattern":" "}},{"Repetition":{"atom":331,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[329,330,332]}},{"Alternative":{"atoms":[158,159,160,161,162,163,244,308,317,328]}},{"Lookahead":{"atom":157,"positive":false}},{"Entity":{"atom":346}},{"Entity":{"atom":21}},{"Str":{"pattern":"-"}},{"Repetition":{"atom":338,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"="}},{"Repetition":{"atom":340,"min":1,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[339,341]}},{"Named":{"name":"heading","atom":342}},{"CustomRef":{"name":"ign_ws_rep"}},{"Entity":{"atom":16}},{"Sequence":{"atoms":[337,343,344,345]}},{"Lookahead":{"atom":336,"positive":false}},{"Sequence":{"atoms":[335,347]}},{"Entity":{"atom":21}},{"Entity":{"atom":362}},{"Entity":{"atom":45}},{"Repetition":{"atom":351,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"ln","atom":352}},{"Entity":{"atom":14}},{"Lookahead":{"atom":354,"positive":false}},{"Sequence":{"atoms":[353,355]}},{"Entity":{"atom":45}},{"Repetition":{"atom":357,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"ln","atom":358}},{"CustomRef":{"name":"line_ending"}},{"Sequence":{"atoms":[359,360]}},{"Alternative":{"atoms":[356,361]}},{"CustomRef":{"name":"continuation"}},{"Entity":{"atom":348}},{"Entity":{"atom":368}},{"CustomRef":{"name":"ign_ws_rep"}},{"Entity":{"atom":362}},{"Sequence":{"atoms":[366,367]}},{"Sequence":{"atoms":[363,364,365]}},{"Repetition":{"atom":369,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[350,370]}},{"Named":{"name":"text","atom":371}},{"CustomRef":{"name":"continuation"}},{"Entity":{"atom":346}},{"Sequence":{"atoms":[156,349,372,373,374]}},{"Entity":{"atom":501}},{"Entity":{"atom":491}},{"Entity":{"atom":316}},{"StateSet":{"slot":"list_marker","expr":378}},{"CustomRef":{"name":"ign_thematic_in_list"}},{"CustomRef":{"name":"const_hr"}},{"Sequence":{"atoms":[380,381]}},{"Named":{"name":"li","atom":382}},{"Entity":{"atom":488}},{"Entity":{"atom":438}},{"Entity":{"atom":77}},{"CustomRef":{"name":"continuation"}},{"Entity":{"atom":397}},{"CustomRef":{"name":"blank_line"}},{"Repetition":{"atom":389,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":62}},{"Entity":{"atom":68}},{"Entity":{"atom":120}},{"Entity":{"atom":154}},{"Entity":{"atom":316}},{"Entity":{"atom":327}},{"Alternative":{"atoms":[390,391,392,393,394,395,396]}},{"Lookahead":{"atom":388,"positive":false}},{"Entity":{"atom":420}},{"Str":{"pattern":" "}},{"Str":{"pattern":"\t"}},{"Alternative":{"atoms":[400,401]}},{"Str":{"pattern":"-"}},{"Str":{"pattern":"*"}},{"Str":{"pattern":"+"}},{"Alternative":{"atoms":[403,404,405]}},{"Str":{"pattern":" "}},{"Repetition":{"atom":407,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[406,408]}},{"Re":{"pattern":"[\\x31-\\x39]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":411,"min":0,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"."}},{"Str":{"pattern":")"}},{"Alternative":{"atoms":[413,414]}},{"Str":{"pattern":" "}},{"Repetition":{"atom":416,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[410,412,415,417]}},{"Alternative":{"atoms":[409,418]}},{"Sequence":{"atoms":[402,419]}},{"Lookahead":{"atom":399,"positive":false}},{"Entity":{"atom":434}},{"Str":{"pattern":" "}},{"Str":{"pattern":"\t"}},{"Alternative":{"atoms":[423,424]}},{"Entity":{"atom":420}},{"Lookahead":{"atom":426,"positive":false}},{"Entity":{"atom":77}},{"Sequence":{"atoms":[425,427,428]}},{"Entity":{"atom":420}},{"Lookahead":{"atom":430,"positive":false}},{"Entity":{"atom":77}},{"Sequence":{"atoms":[431,432]}},{"Alternative":{"atoms":[429,433]}},{"Sequence":{"atoms":[387,398,421,422]}},{"Repetition":{"atom":435,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[386,436]}},{"Named":{"name":"p","atom":437}},{"CustomRef":{"name":"continuation"}},{"Entity":{"atom":397}},{"Lookahead":{"atom":440,"positive":false}},{"Entity":{"atom":485}},{"Str":{"pattern":" "}},{"Str":{"pattern":"\t"}},{"Alternative":{"atoms":[443,444]}},{"Entity":{"atom":464}},{"Entity":{"atom":455}},{"Entity":{"atom":316}},{"Entity":{"atom":453}},{"Entity":{"atom":45}},{"Repetition":{"atom":450,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":16}},{"Sequence":{"atoms":[451,452]}},{"Named":{"name":"li","atom":449}},{"Sequence":{"atoms":[448,454]}},{"CustomRef":{"name":"continuation"}},{"Str":{"pattern":" "}},{"Str":{"pattern":"\t"}},{"Alternative":{"atoms":[457,458]}},{"Entity":{"atom":455}},{"Sequence":{"atoms":[456,459,460]}},{"Repetition":{"atom":461,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[447,462]}},{"Named":{"name":"ul","atom":463}},{"Sequence":{"atoms":[445,446]}},{"Str":{"pattern":" "}},{"Str":{"pattern":"\t"}},{"Alternative":{"atoms":[466,467]}},{"Entity":{"atom":483}},{"Entity":{"atom":474}},{"Entity":{"atom":327}},{"Entity":{"atom":453}},{"Named":{"name":"li","atom":472}},{"Sequence":{"atoms":[471,473]}},{"CustomRef":{"name":"continuation"}},{"Str":{"pattern":" "}},{"Str":{"pattern":"\t"}},{"Alternative":{"atoms":[476,477]}},{"Entity":{"atom":474}},{"Sequence":{"atoms":[475,478,479]}},{"Repetition":{"atom":480,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[470,481]}},{"Named":{"name":"ol","atom":482}},{"Sequence":{"atoms":[468,469]}},{"Alternative":{"atoms":[465,484]}},{"Sequence":{"atoms":[439,441,442]}},{"Repetition":{"atom":486,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[385,487]}},{"Named":{"name":"li","atom":384}},{"Alternative":{"atoms":[383,489]}},{"Sequence":{"atoms":[379,490]}},{"CustomRef":{"name":"continuation"}},{"Entity":{"atom":68}},{"Lookahead":{"atom":493,"positive":false}},{"CustomRef":{"name":"blank_line"}},{"Repetition":{"atom":495,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":491}},{"Sequence":{"atoms":[492,494,496,497]}},{"Repetition":{"atom":498,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[377,499]}},{"Named":{"name":"ul","atom":500}},{"Entity":{"atom":517}},{"Entity":{"atom":507}},{"Entity":{"atom":327}},{"Entity":{"atom":488}},{"Named":{"name":"li","atom":505}},{"Sequence":{"atoms":[504,506]}},{"CustomRef":{"name":"continuation"}},{"Entity":{"atom":68}},{"Lookahead":{"atom":509,"positive":false}},{"CustomRef":{"name":"blank_line"}},{"Repetition":{"atom":511,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":507}},{"Sequence":{"atoms":[508,510,512,513]}},{"Repetition":{"atom":514,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[503,515]}},{"Named":{"name":"ol","atom":516}},{"Entity":{"atom":567}},{"Entity":{"atom":559}},{"Entity":{"atom":536}},{"Entity":{"atom":526}},{"Entity":{"atom":21}},{"Str":{"pattern":":"}},{"Lookahead":{"atom":523,"positive":false}},{"Entity":{"atom":77}},{"Sequence":{"atoms":[522,524,525]}},{"CustomRef":{"name":"continuation"}},{"Entity":{"atom":333}},{"Lookahead":{"atom":528,"positive":false}},{"CustomRef":{"name":"blank_line"}},{"Lookahead":{"atom":530,"positive":false}},{"Entity":{"atom":526}},{"Sequence":{"atoms":[527,529,531,532]}},{"Repetition":{"atom":533,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[521,534]}},{"Named":{"name":"def_term","atom":535}},{"CustomRef":{"name":"continuation"}},{"Entity":{"atom":556}},{"Entity":{"atom":333}},{"Entity":{"atom":555}},{"Entity":{"atom":77}},{"CustomRef":{"name":"continuation"}},{"Entity":{"atom":333}},{"Lookahead":{"atom":543,"positive":false}},{"CustomRef":{"name":"blank_line"}},{"Lookahead":{"atom":545,"positive":false}},{"Str":{"pattern":" "}},{"Str":{"pattern":"\t"}},{"Alternative":{"atoms":[547,548]}},{"Repetition":{"atom":549,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":77}},{"Sequence":{"atoms":[542,544,546,550,551]}},{"Repetition":{"atom":552,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[541,553]}},{"Named":{"name":"def_content","atom":554}},{"Sequence":{"atoms":[539,540]}},{"Sequence":{"atoms":[537,538]}},{"Repetition":{"atom":557,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[520,558]}},{"CustomRef":{"name":"continuation"}},{"CustomRef":{"name":"blank_line"}},{"Repetition":{"atom":561,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":559}},{"Sequence":{"atoms":[560,562,563]}},{"Repetition":{"atom":564,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[519,565]}},{"Named":{"name":"dl","atom":566}},{"Entity":{"atom":594}},{"Entity":{"atom":21}},{"Entity":{"atom":579}},{"Str":{"pattern":"[^"}},{"Str":{"pattern":"]"}},{"Lookahead":{"atom":572,"positive":false}},{"Entity":{"atom":14}},{"Sequence":{"atoms":[573,574]}},{"Repetition":{"atom":575,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"fn_id","atom":576}},{"Str":{"pattern":"]"}},{"Sequence":{"atoms":[571,577,578]}},{"Str":{"pattern":":"}},{"Entity":{"atom":6}},{"Repetition":{"atom":581,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":77}},{"Named":{"name":"fn_content","atom":583}},{"CustomRef":{"name":"continuation"}},{"Str":{"pattern":" "}},{"Str":{"pattern":"\t"}},{"Alternative":{"atoms":[586,587]}},{"Repetition":{"atom":588,"min":1,"max":4,"tag":"Repetition"}},{"Entity":{"atom":77}},{"Sequence":{"atoms":[585,589,590]}},{"Repetition":{"atom":591,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"fn_content_continued","atom":592}},{"Sequence":{"atoms":[569,570,580,582,584,593]}},{"Entity":{"atom":614}},{"Entity":{"atom":21}},{"Entity":{"atom":606}},{"Str":{"pattern":"*["}},{"Str":{"pattern":"]"}},{"Lookahead":{"atom":599,"positive":false}},{"Entity":{"atom":14}},{"Sequence":{"atoms":[600,601]}},{"Repetition":{"atom":602,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"abbr_term","atom":603}},{"Str":{"pattern":"]"}},{"Sequence":{"atoms":[598,604,605]}},{"Str":{"pattern":":"}},{"Entity":{"atom":6}},{"Repetition":{"atom":608,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":45}},{"Repetition":{"atom":610,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"abbr_def","atom":611}},{"Entity":{"atom":16}},{"Sequence":{"atoms":[596,597,607,609,612,613]}},{"Entity":{"atom":243}},{"Entity":{"atom":307}},{"Entity":{"atom":627}},{"Str":{"pattern":"$$"}},{"CustomRef":{"name":"line_ending"}},{"Str":{"pattern":"$$"}},{"Lookahead":{"atom":620,"positive":false}},{"Entity":{"atom":14}},{"Sequence":{"atoms":[621,622]}},{"Repetition":{"atom":623,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"math_content","atom":624}},{"Str":{"pattern":"$$"}},{"Sequence":{"atoms":[618,619,625,626]}},{"Entity":{"atom":725}},{"Entity":{"atom":669}},{"Str":{"pattern":"|"}},{"Entity":{"atom":6}},{"Repetition":{"atom":631,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":639}},{"Str":{"pattern":"|"}},{"Lookahead":{"atom":634,"positive":false}},{"Entity":{"atom":45}},{"Sequence":{"atoms":[635,636]}},{"Repetition":{"atom":637,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"cell","atom":638}},{"Entity":{"atom":6}},{"Repetition":{"atom":640,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"|"}},{"Entity":{"atom":6}},{"Repetition":{"atom":643,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[633,641,642,644]}},{"Repetition":{"atom":645,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"row","atom":646}},{"Sequence":{"atoms":[630,632,647]}},{"Entity":{"atom":639}},{"Entity":{"atom":6}},{"Repetition":{"atom":650,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"|"}},{"Entity":{"atom":6}},{"Repetition":{"atom":653,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":639}},{"Entity":{"atom":6}},{"Repetition":{"atom":656,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"|"}},{"Entity":{"atom":6}},{"Repetition":{"atom":659,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[655,657,658,660]}},{"Repetition":{"atom":661,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"row_rest","atom":662}},{"Entity":{"atom":639}},{"Repetition":{"atom":664,"min":0,"max":1,"tag":"Maybe"}},{"Named":{"name":"last_cell","atom":665}},{"Sequence":{"atoms":[649,651,652,654,663,666]}},{"Named":{"name":"row","atom":667}},{"Alternative":{"atoms":[648,668]}},{"Named":{"name":"table_header","atom":629}},{"CustomRef":{"name":"line_ending"}},{"Entity":{"atom":713}},{"Str":{"pattern":"|"}},{"Entity":{"atom":6}},{"Repetition":{"atom":674,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":683}},{"Str":{"pattern":":"}},{"Repetition":{"atom":677,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"-"}},{"Repetition":{"atom":679,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":":"}},{"Repetition":{"atom":681,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[678,680,682]}},{"Named":{"name":"sep","atom":676}},{"Entity":{"atom":6}},{"Repetition":{"atom":685,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"|"}},{"Entity":{"atom":6}},{"Repetition":{"atom":688,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[684,686,687,689]}},{"Repetition":{"atom":690,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[673,675,691]}},{"Entity":{"atom":683}},{"Named":{"name":"sep","atom":693}},{"Entity":{"atom":6}},{"Repetition":{"atom":695,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"|"}},{"Entity":{"atom":6}},{"Repetition":{"atom":698,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":683}},{"Named":{"name":"sep","atom":700}},{"Entity":{"atom":6}},{"Repetition":{"atom":702,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"|"}},{"Entity":{"atom":6}},{"Repetition":{"atom":705,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[701,703,704,706]}},{"Repetition":{"atom":707,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":683}},{"Named":{"name":"sep","atom":709}},{"Repetition":{"atom":710,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[694,696,697,699,708,711]}},{"Alternative":{"atoms":[692,712]}},{"Named":{"name":"table_separator","atom":672}},{"CustomRef":{"name":"line_ending"}},{"Entity":{"atom":669}},{"Named":{"name":"table_body_row","atom":716}},{"CustomRef":{"name":"line_ending"}},{"Entity":{"atom":14}},{"Lookahead":{"atom":719,"positive":false}},{"Alternative":{"atoms":[718,720]}},{"Sequence":{"atoms":[717,721]}},{"Repetition":{"atom":722,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"table_body","atom":723}},{"Sequence":{"atoms":[670,671,714,715,724]}},{"Entity":{"atom":729}},{"Entity":{"atom":21}},{"CustomRef":{"name":"p_scope"}},{"Sequence":{"atoms":[727,728]}},{"Alternative":{"atoms":[1,2,18,63,69,108,146,155,376,502,518,568,595,615,616,617,628,726]}},{"Repetition":{"atom":0,"min":0,"max":null,"tag":"Repetition"}}],"root":731},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule line_ending_raw: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule line_ending_or_eof: branches 1 and 2 are order-dependent (first set not statically known)","rule blank_line_raw: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule blank_line_verbatim: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule block_quote_item: branches 1 and 2 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 1 and 2 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 1 and 4 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 2 and 3 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 2 and 4 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 2 and 5 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 2 and 6 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 2 and 7 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 2 and 8 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 2 and 9 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 2 and 10 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 3 and 4 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 3 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 3 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 3 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 3 and 10 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 4 and 5 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 4 and 6 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 4 and 7 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 4 and 8 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 4 and 9 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 4 and 10 are order-dependent (first set not statically known)","rule paragraph_interrupt: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 5 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 5 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 5 and 10 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 6 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 6 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 6 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 6 and 10 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 8 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 8 and 10 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_interrupt: branches 9 and 10 are order-dependent (shared first bytes; ordered choice is decisive)","rule paragraph_line: branches 1 and 2 are order-dependent (first set not statically known)","rule table_row: branches 1 and 2 are order-dependent (first set not statically known)","rule block: branches 1 and 3 are order-dependent (first set not statically known)","rule block: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 1 and 6 are order-dependent (first set not statically known)","rule block: branches 1 and 8 are order-dependent (first set not statically known)","rule block: branches 1 and 9 are order-dependent (first set not statically known)","rule block: branches 1 and 11 are order-dependent (first set not statically known)","rule block: branches 1 and 17 are order-dependent (first set not statically known)","rule block: branches 1 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 2 and 3 are order-dependent (first set not statically known)","rule block: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 2 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 2 and 6 are order-dependent (first set not statically known)","rule block: branches 2 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 2 and 8 are order-dependent (first set not statically known)","rule block: branches 2 and 9 are order-dependent (first set not statically known)","rule block: branches 2 and 10 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 2 and 11 are order-dependent (first set not statically known)","rule block: branches 2 and 12 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 2 and 13 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 2 and 14 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 2 and 17 are order-dependent (first set not statically known)","rule block: branches 2 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 3 and 4 are order-dependent (first set not statically known)","rule block: branches 3 and 5 are order-dependent (first set not statically known)","rule block: branches 3 and 6 are order-dependent (first set not statically known)","rule block: branches 3 and 7 are order-dependent (first set not statically known)","rule block: branches 3 and 8 are order-dependent (first set not statically known)","rule block: branches 3 and 9 are order-dependent (first set not statically known)","rule block: branches 3 and 10 are order-dependent (first set not statically known)","rule block: branches 3 and 11 are order-dependent (first set not statically known)","rule block: branches 3 and 12 are order-dependent (first set not statically known)","rule block: branches 3 and 13 are order-dependent (first set not statically known)","rule block: branches 3 and 14 are order-dependent (first set not statically known)","rule block: branches 3 and 15 are order-dependent (first set not statically known)","rule block: branches 3 and 16 are order-dependent (first set not statically known)","rule block: branches 3 and 17 are order-dependent (first set not statically known)","rule block: branches 3 and 18 are order-dependent (first set not statically known)","rule block: branches 4 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 4 and 6 are order-dependent (first set not statically known)","rule block: branches 4 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 4 and 8 are order-dependent (first set not statically known)","rule block: branches 4 and 9 are order-dependent (first set not statically known)","rule block: branches 4 and 10 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 4 and 11 are order-dependent (first set not statically known)","rule block: branches 4 and 12 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 4 and 13 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 4 and 14 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 4 and 17 are order-dependent (first set not statically known)","rule block: branches 4 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 5 and 6 are order-dependent (first set not statically known)","rule block: branches 5 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 5 and 8 are order-dependent (first set not statically known)","rule block: branches 5 and 9 are order-dependent (first set not statically known)","rule block: branches 5 and 10 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 5 and 11 are order-dependent (first set not statically known)","rule block: branches 5 and 12 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 5 and 13 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 5 and 14 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 5 and 17 are order-dependent (first set not statically known)","rule block: branches 5 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 6 and 7 are order-dependent (first set not statically known)","rule block: branches 6 and 8 are order-dependent (first set not statically known)","rule block: branches 6 and 9 are order-dependent (first set not statically known)","rule block: branches 6 and 10 are order-dependent (first set not statically known)","rule block: branches 6 and 11 are order-dependent (first set not statically known)","rule block: branches 6 and 12 are order-dependent (first set not statically known)","rule block: branches 6 and 13 are order-dependent (first set not statically known)","rule block: branches 6 and 14 are order-dependent (first set not statically known)","rule block: branches 6 and 15 are order-dependent (first set not statically known)","rule block: branches 6 and 16 are order-dependent (first set not statically known)","rule block: branches 6 and 17 are order-dependent (first set not statically known)","rule block: branches 6 and 18 are order-dependent (first set not statically known)","rule block: branches 7 and 8 are order-dependent (first set not statically known)","rule block: branches 7 and 9 are order-dependent (first set not statically known)","rule block: branches 7 and 10 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 7 and 11 are order-dependent (first set not statically known)","rule block: branches 7 and 12 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 7 and 13 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 7 and 14 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 7 and 17 are order-dependent (first set not statically known)","rule block: branches 7 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 8 and 9 are order-dependent (first set not statically known)","rule block: branches 8 and 10 are order-dependent (first set not statically known)","rule block: branches 8 and 11 are order-dependent (first set not statically known)","rule block: branches 8 and 12 are order-dependent (first set not statically known)","rule block: branches 8 and 13 are order-dependent (first set not statically known)","rule block: branches 8 and 14 are order-dependent (first set not statically known)","rule block: branches 8 and 15 are order-dependent (first set not statically known)","rule block: branches 8 and 16 are order-dependent (first set not statically known)","rule block: branches 8 and 17 are order-dependent (first set not statically known)","rule block: branches 8 and 18 are order-dependent (first set not statically known)","rule block: branches 9 and 10 are order-dependent (first set not statically known)","rule block: branches 9 and 11 are order-dependent (first set not statically known)","rule block: branches 9 and 12 are order-dependent (first set not statically known)","rule block: branches 9 and 13 are order-dependent (first set not statically known)","rule block: branches 9 and 14 are order-dependent (first set not statically known)","rule block: branches 9 and 15 are order-dependent (first set not statically known)","rule block: branches 9 and 16 are order-dependent (first set not statically known)","rule block: branches 9 and 17 are order-dependent (first set not statically known)","rule block: branches 9 and 18 are order-dependent (first set not statically known)","rule block: branches 10 and 11 are order-dependent (first set not statically known)","rule block: branches 10 and 12 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 10 and 13 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 10 and 14 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 10 and 17 are order-dependent (first set not statically known)","rule block: branches 10 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 11 and 12 are order-dependent (first set not statically known)","rule block: branches 11 and 13 are order-dependent (first set not statically known)","rule block: branches 11 and 14 are order-dependent (first set not statically known)","rule block: branches 11 and 15 are order-dependent (first set not statically known)","rule block: branches 11 and 16 are order-dependent (first set not statically known)","rule block: branches 11 and 17 are order-dependent (first set not statically known)","rule block: branches 11 and 18 are order-dependent (first set not statically known)","rule block: branches 12 and 13 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 12 and 14 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 12 and 17 are order-dependent (first set not statically known)","rule block: branches 12 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 13 and 14 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 13 and 17 are order-dependent (first set not statically known)","rule block: branches 13 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 14 and 15 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 14 and 17 are order-dependent (first set not statically known)","rule block: branches 14 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule block: branches 15 and 17 are order-dependent (first set not statically known)","rule block: branches 16 and 17 are order-dependent (first set not statically known)","rule block: branches 17 and 18 are order-dependent (first set not statically known)","rule list_interrupt: branches 1 and 2 are order-dependent (first set not statically known)","rule list_interrupt: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule list_interrupt: branches 1 and 4 are order-dependent (first set not statically known)","rule list_interrupt: branches 2 and 3 are order-dependent (first set not statically known)","rule list_interrupt: branches 2 and 4 are order-dependent (first set not statically known)","rule list_interrupt: branches 2 and 5 are order-dependent (first set not statically known)","rule list_interrupt: branches 2 and 6 are order-dependent (first set not statically known)","rule list_interrupt: branches 2 and 7 are order-dependent (first set not statically known)","rule list_interrupt: branches 3 and 4 are order-dependent (first set not statically known)","rule list_interrupt: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule list_interrupt: branches 3 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule list_interrupt: branches 3 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule list_interrupt: branches 4 and 5 are order-dependent (first set not statically known)","rule list_interrupt: branches 4 and 6 are order-dependent (first set not statically known)","rule list_interrupt: branches 4 and 7 are order-dependent (first set not statically known)","rule list_interrupt: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule list_interrupt: branches 5 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule list_interrupt: branches 6 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule list_continuation_line: branches 1 and 2 are order-dependent (first set not statically known)","rule nested_block: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"document","render":{},"derive":{},"tests":[],"docs":{},"source":"# Coridoc Markdown block grammar — PARG single source of truth (M2).\n#\n# Port of lib/coridoc/markdown/parser/block_parser.rb (the Ruby DSL\n# grammar stays as the parity reference; grammar_parity_spec asserts\n# identical trees over the markdown corpus). Compile with\n# `rake grammar:compile`; `rake grammar:check` fails on a stale artifact.\n#\n# Context-sensitive machinery that PARG cannot express as data lives in\n# Ruby-tier custom atoms (parser/grammar_runtime.rb), the same escape\n# hatch the PARG state vocabulary provides:\n# continuation / bq_scope / p_scope block-nesting stack\n# (scope + continuation)\n# fence_info / fence_close / fence_indent_consume fence-aware rules\n# ign_* / const_* Parslet `.ignore` and\n# `.output(value)`\n# Everything else is plain PEG.\n\ngrammar CoridocMarkdown version \"0.1.0\" {\n\n any_char = %x00-10FFFF\n\n # ---- terminals ----\n line_ending_raw = (\"\\n\" / \"\\r\\n\" / \"\\r\")\n custom line_ending = \"Coridoc::Markdown::Parser::Ign::LineEnding\"\n line_ending_or_eof = (line_ending / !any_char)\n whitespace = (\" \" / %x09)\n blank_line_raw = ((1*whitespace !any_char) / (*whitespace line_ending_raw))\n custom blank_line = \"Coridoc::Markdown::Parser::Ign::BlankLine\"\n blank_line_verbatim = (((1*whitespace) as ln !any_char) / ((*whitespace) as ln line_ending))\n line_char = (!(\"\\r\" / \"\\n\") any_char)\n line_verbatim = ((1*line_char) as ln line_ending_or_eof)\n non_indent_space = *3\" \"\n whitespace_repeat = *whitespace\n any_char_present = &any_char\n space_char = (%x20 / %x09-0D)\n word_char = (%x41-5A / %x61-7A / %x30-39 / \"_\")\n word_dash_char = (word_char / \"-\")\n\n custom ign_ws_rep = \"Coridoc::Markdown::Parser::Ign::WhitespaceRepeat\"\n custom ign_thematic_chars = \"Coridoc::Markdown::Parser::Ign::ThematicChars\"\n custom ign_thematic_in_list = \"Coridoc::Markdown::Parser::Ign::ThematicInList\"\n custom ign_blank_line_verbatim = \"Coridoc::Markdown::Parser::Ign::BlankLineVerbatim\"\n custom const_hr = \"Coridoc::Markdown::Parser::Const::Hr\"\n custom const_ln_empty = \"Coridoc::Markdown::Parser::Const::LnEmpty\"\n custom const_empty = \"Coridoc::Markdown::Parser::Const::Empty\"\n\n # ---- block nesting (scope + continuation) ----\n custom continuation = \"Coridoc::Markdown::Parser::Nesting::Continuation\"\n custom bq_scope = \"Coridoc::Markdown::Parser::Nesting::BlockQuoteScope\"\n custom p_scope = \"Coridoc::Markdown::Parser::Nesting::ParagraphScope\"\n\n # ---- ATX heading / thematic break ----\n atx_ending_seq = (1*whitespace *\"#\" *whitespace !line_char)\n escaped_hash = (\"\\\\\" \"#\")\n atx_heading = (non_indent_space !escaped_hash ((1*6\"#\") as heading) !\"#\" [(!atx_ending_seq 1*\" \" ((1*(!atx_ending_seq line_char)) as text))] [atx_ending_seq] line_ending_or_eof)\n thematic_break_chars = (3*(\"-\" *whitespace) / 3*(\"_\" *whitespace) / 3*(\"*\" *whitespace))\n thematic_break = (non_indent_space ign_thematic_chars const_hr line_ending_or_eof)\n\n # ---- code blocks ----\n indented_code_line = (\" \" line_verbatim)\n indented_code_blank_line = (ign_blank_line_verbatim const_ln_empty &(continuation (\" \" / blank_line_verbatim)))\n indented_code_block = ((indented_code_line *(continuation (indented_code_line / indented_code_blank_line))) as code_block)\n\n state fence: string\n state fence_indent: string\n fence_info_backtick = [((1*(!\"`\" line_char)) as info)]\n fence_info_tilde = [((1*line_char) as info)]\n custom fence_info = \"Coridoc::Markdown::Parser::Nesting::FenceInfo\"\n custom fence_close_marker = \"Coridoc::Markdown::Parser::Nesting::FenceClose\"\n custom consume_fenced_indent = \"Coridoc::Markdown::Parser::Nesting::ConsumeFencedIndent\"\n code_fence_open = ((set fence_indent = (non_indent_space)) (set fence = ((3*\"`\") / (3*\"~\"))) fence_info line_ending_or_eof)\n code_fence_close = (non_indent_space fence_close_marker line_ending_or_eof)\n fenced_code_block = (code_fence_open ((*(continuation !code_fence_close consume_fenced_indent (line_verbatim / (ign_blank_line_verbatim const_ln_empty)))) as code_block) ((continuation code_fence_close) / !(continuation any_char)))\n\n # ---- block quote / paragraph / setext ----\n block_quote_marker = (non_indent_space \">\" [\" \"])\n block_quote_item = (block / (!any_char const_empty))\n block_quote_body = (((block_quote_item *(continuation block_quote_item))) as block_quote)\n block_quote = (block_quote_marker bq_scope)\n\n ial_block = (*3whitespace (ial / ald) line_ending_or_eof)\n paragraph_interrupt = (blank_line / atx_heading / thematic_break / code_fence_open / block_quote / ial_block / extension / unordered_list_marker / ordered_list_marker / definition_marker)\n paragraph_line = (((1*line_char) as ln !any_char) / ((*line_char) as ln line_ending))\n paragraph_continued_line = (ign_ws_rep paragraph_line)\n paragraph_cont = !paragraph_interrupt\n lazy_continuation = (!paragraph_interrupt ¶graph_continued_line)\n paragraph_body = ((paragraph_line *(continuation paragraph_continued_line)) as p)\n paragraph = (non_indent_space p_scope)\n\n setext_underline = (non_indent_space (((1*\"-\") / (1*\"=\")) as heading) ign_ws_rep line_ending_or_eof)\n setext_check = (!paragraph_interrupt !setext_underline)\n setext_heading = (setext_check non_indent_space ((paragraph_line *(continuation setext_check paragraph_continued_line)) as text) continuation setext_underline)\n\n # ---- kramdown attribute lists ----\n ial_class = (\".\" 1*word_dash_char)\n ial_id = (\"#\" 1*word_dash_char)\n ial_key_value = (1*word_dash_char \"=\" ((\"\\\"\" *(!\"\\\"\" any_char) \"\\\"\") / (\"'\" *(!\"'\" any_char) \"'\") / 1*(!(space_char / \"}\") any_char)))\n ial_content = 1*(*whitespace (ial_class / ial_id / ial_key_value))\n ial = (\"{:\" (ial_content as ial) \"}\")\n ald_name = (1*word_char \":\")\n ald = (\"{:\" (ald_name as ald_name) 1*whitespace (ial_content as ial) \"}\")\n\n # ---- kramdown extensions / math ----\n extension_name = 1*%x61-7A\n extension_option = (1*word_dash_char \"=\" ((\"\\\"\" *(!\"\\\"\" any_char) \"\\\"\") / (\"'\" *(!\"'\" any_char) \"'\") / 1*(!(space_char / \"/\" / \"}\") any_char)))\n extension_options = *(1*whitespace extension_option)\n extension_self_closing = (\"{::\" (extension_name as ext_name) (extension_options as ext_options) *whitespace \"/}\")\n extension_with_body = (\"{::\" (extension_name as ext_name) (extension_options as ext_options) \"}\" ((*(!\"{:/\" any_char)) as ext_body) \"{:/}\")\n extension = ((extension_self_closing / extension_with_body) as extension)\n block_math = (\"$$\" line_ending ((*(!\"$$\" any_char)) as math_content) \"$$\")\n\n # ---- GFM tables ----\n table_cell = ((*(!\"|\" line_char)) as cell)\n table_row = ((\"|\" [whitespace] ((1*(table_cell [whitespace] \"|\" [whitespace])) as row)) / ((table_cell [whitespace] \"|\" [whitespace] ((*(table_cell [whitespace] \"|\" [whitespace])) as row_rest) ([table_cell] as last_cell)) as row))\n table_separator_cell = ([\":\"] 1*\"-\" [\":\"])\n table_separator_row = ((\"|\" [whitespace] 1*((table_separator_cell as sep) [whitespace] \"|\" [whitespace])) / ((table_separator_cell as sep) [whitespace] \"|\" [whitespace] *((table_separator_cell as sep) [whitespace] \"|\" [whitespace]) [(table_separator_cell as sep)]))\n table = ((table_row as table_header) line_ending (table_separator_row as table_separator) line_ending ((1*((table_row as table_body_row) (line_ending / !any_char))) as table_body))\n\n block = (blank_line / eob_marker / atx_heading / thematic_break / indented_code_block / fenced_code_block / block_quote / setext_heading / unordered_list / ordered_list / definition_list / footnote_definition / abbreviation_definition / ial_block / extension / block_math / table / paragraph)\n\n # ---- lists ----\n list_interrupt = (1*blank_line / atx_heading / thematic_break / code_fence_open / block_quote / unordered_list_marker / ordered_list_marker)\n unordered_list_marker = (non_indent_space (\"-\" / \"*\" / \"+\") 1*\" \")\n ordered_list_marker = (non_indent_space %x31-39 *%x30-39 (\".\" / \")\") 1*\" \")\n nested_list_marker = ((\" \" / \"\\t\") (((\"-\" / \"*\" / \"+\") 1*\" \") / (%x31-39 *%x30-39 (\".\" / \")\") 1*\" \")))\n list_continuation_line = (((\" \" / \"\\t\") !nested_list_marker line_verbatim) / (!nested_list_marker line_verbatim))\n thematic_break_in_list = (((\"*\" *whitespace \"*\" *whitespace \"*\") / (\"-\" *whitespace \"-\" *whitespace \"-\") / (\"_\" *whitespace \"_\" *whitespace \"_\")) *whitespace line_ending_or_eof)\n unordered_list_item = ((set list_marker = (unordered_list_marker)) ((ign_thematic_in_list const_hr) as li / (list_item_content as li)))\n list_item_content = (list_item_paragraph *(continuation !list_interrupt nested_block))\n nested_block = (((\" \" / \"\\t\") nested_unordered_list) / ((\" \" / \"\\t\") nested_ordered_list))\n nested_unordered_list = ((nested_unordered_list_item *(continuation (\" \" / \"\\t\") nested_unordered_list_item)) as ul)\n nested_ordered_list = ((nested_ordered_list_item *(continuation (\" \" / \"\\t\") nested_ordered_list_item)) as ol)\n line_text = (1*line_char line_ending_or_eof)\n nested_unordered_list_item = (unordered_list_marker (line_text as li))\n nested_ordered_list_item = (ordered_list_marker (line_text as li))\n list_item_paragraph = ((line_verbatim *(continuation !list_interrupt !nested_list_marker list_continuation_line)) as p)\n ordered_list_item = (ordered_list_marker (list_item_content as li))\n unordered_list = ((unordered_list_item *(continuation !thematic_break [blank_line] unordered_list_item)) as ul)\n ordered_list = ((ordered_list_item *(continuation !thematic_break [blank_line] ordered_list_item)) as ol)\n\n # ---- kramdown definition lists ----\n definition_marker = (non_indent_space \":\" 1*\" \")\n definition_term_line = (non_indent_space !\":\" line_verbatim)\n definition_term = ((definition_term_line *(continuation !definition_marker !blank_line definition_term_line)) as def_term)\n definition_content = ((line_verbatim *(continuation !definition_marker !blank_line [(\" \" / \"\\t\")] line_verbatim)) as def_content)\n definition_item = (definition_marker definition_content)\n definition_list_item = (definition_term 1*(continuation definition_item))\n definition_list = ((definition_list_item *(continuation [blank_line] definition_list_item)) as dl)\n\n # ---- kramdown footnotes / abbreviations / EOB ----\n footnote_id = (\"[^\" ((1*(!\"]\" any_char)) as fn_id) \"]\")\n footnote_definition = (non_indent_space footnote_id \":\" *whitespace (line_verbatim as fn_content) ((*(continuation 1*4(\" \" / \"\\t\") line_verbatim)) as fn_content_continued))\n abbreviation_term = (\"*[\" ((1*(!\"]\" any_char)) as abbr_term) \"]\")\n abbreviation_definition = (non_indent_space abbreviation_term \":\" *whitespace ((*line_char) as abbr_def) line_ending_or_eof)\n eob_marker = (*whitespace \"^\" *whitespace line_ending_or_eof)\n\n document = *block\n entry document: document\n}\n","source_hash":"86fe3e2a612d838a8ee4dbaf162b4ec839837bd6b09fb589ea9d4a28056e4ff0","unicode_tables":"onigmo (Ruby 4.0.7)","compiler_version":"1.3.151","edition":2,"customs":{"line_ending":"Coridoc::Markdown::Parser::Ign::LineEnding","blank_line":"Coridoc::Markdown::Parser::Ign::BlankLine","ign_ws_rep":"Coridoc::Markdown::Parser::Ign::WhitespaceRepeat","ign_thematic_chars":"Coridoc::Markdown::Parser::Ign::ThematicChars","ign_thematic_in_list":"Coridoc::Markdown::Parser::Ign::ThematicInList","ign_blank_line_verbatim":"Coridoc::Markdown::Parser::Ign::BlankLineVerbatim","const_hr":"Coridoc::Markdown::Parser::Const::Hr","const_ln_empty":"Coridoc::Markdown::Parser::Const::LnEmpty","const_empty":"Coridoc::Markdown::Parser::Const::Empty","continuation":"Coridoc::Markdown::Parser::Nesting::Continuation","bq_scope":"Coridoc::Markdown::Parser::Nesting::BlockQuoteScope","p_scope":"Coridoc::Markdown::Parser::Nesting::ParagraphScope","fence_info":"Coridoc::Markdown::Parser::Nesting::FenceInfo","fence_close_marker":"Coridoc::Markdown::Parser::Nesting::FenceClose","consume_fenced_indent":"Coridoc::Markdown::Parser::Nesting::ConsumeFencedIndent"},"states":{"fence":"string","fence_indent":"string"},"dynamic":true,"semantics_hash":"sha256:3ae61bac112ad58a182c560deafd4f584f65834596aa8fadbfbecc90f3259045","checksum":"sha256:26925298123f94a0c6ac621e5a8e8de351a672ec6bf0ad8fd9077d06f41b8b5e","validated":{"lint_errors":0,"lint_warnings":187,"tests_total":0,"tests_failures":0,"self_test":true},"model_bindings":{"version":1,"rules":{"thematic_break":{"keys":["hr"],"model":"HorizontalRule","captures":{},"children":{},"defaults":{"style":"---"}}}},"byte_checksum":"sha256:21eae86900aec2462c695a8e053a47dda778519d48943e3af07e43169b5dd47b"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Rule -> model bindings for the Markdown block grammar (coridoc#307 M4).
|
|
2
|
+
# `rake grammar:compile` embeds this table in the artifact under
|
|
3
|
+
# `model_bindings`; Coridoc::BindingInflater reads it from there.
|
|
4
|
+
# Thematic break: `{hr: true}` -> HorizontalRule(style: '---').
|
|
5
|
+
version: 1
|
|
6
|
+
rules:
|
|
7
|
+
thematic_break:
|
|
8
|
+
keys: [hr]
|
|
9
|
+
model: HorizontalRule
|
|
10
|
+
captures: {}
|
|
11
|
+
children: {}
|
|
12
|
+
defaults:
|
|
13
|
+
style: '---'
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Coridoc Markdown block grammar — PARG single source of truth (M2).
|
|
2
|
+
#
|
|
3
|
+
# Port of lib/coridoc/markdown/parser/block_parser.rb (the Ruby DSL
|
|
4
|
+
# grammar stays as the parity reference; grammar_parity_spec asserts
|
|
5
|
+
# identical trees over the markdown corpus). Compile with
|
|
6
|
+
# `rake grammar:compile`; `rake grammar:check` fails on a stale artifact.
|
|
7
|
+
#
|
|
8
|
+
# Context-sensitive machinery that PARG cannot express as data lives in
|
|
9
|
+
# Ruby-tier custom atoms (parser/grammar_runtime.rb), the same escape
|
|
10
|
+
# hatch the PARG state vocabulary provides:
|
|
11
|
+
# continuation / bq_scope / p_scope block-nesting stack
|
|
12
|
+
# (scope + continuation)
|
|
13
|
+
# fence_info / fence_close / fence_indent_consume fence-aware rules
|
|
14
|
+
# ign_* / const_* Parslet `.ignore` and
|
|
15
|
+
# `.output(value)`
|
|
16
|
+
# Everything else is plain PEG.
|
|
17
|
+
|
|
18
|
+
grammar CoridocMarkdown version "0.1.0" {
|
|
19
|
+
|
|
20
|
+
any_char = %x00-10FFFF
|
|
21
|
+
|
|
22
|
+
# ---- terminals ----
|
|
23
|
+
line_ending_raw = ("\n" / "\r\n" / "\r")
|
|
24
|
+
custom line_ending = "Coridoc::Markdown::Parser::Ign::LineEnding"
|
|
25
|
+
line_ending_or_eof = (line_ending / !any_char)
|
|
26
|
+
whitespace = (" " / %x09)
|
|
27
|
+
blank_line_raw = ((1*whitespace !any_char) / (*whitespace line_ending_raw))
|
|
28
|
+
custom blank_line = "Coridoc::Markdown::Parser::Ign::BlankLine"
|
|
29
|
+
blank_line_verbatim = (((1*whitespace) as ln !any_char) / ((*whitespace) as ln line_ending))
|
|
30
|
+
line_char = (!("\r" / "\n") any_char)
|
|
31
|
+
line_verbatim = ((1*line_char) as ln line_ending_or_eof)
|
|
32
|
+
non_indent_space = *3" "
|
|
33
|
+
whitespace_repeat = *whitespace
|
|
34
|
+
any_char_present = &any_char
|
|
35
|
+
space_char = (%x20 / %x09-0D)
|
|
36
|
+
word_char = (%x41-5A / %x61-7A / %x30-39 / "_")
|
|
37
|
+
word_dash_char = (word_char / "-")
|
|
38
|
+
|
|
39
|
+
custom ign_ws_rep = "Coridoc::Markdown::Parser::Ign::WhitespaceRepeat"
|
|
40
|
+
custom ign_thematic_chars = "Coridoc::Markdown::Parser::Ign::ThematicChars"
|
|
41
|
+
custom ign_thematic_in_list = "Coridoc::Markdown::Parser::Ign::ThematicInList"
|
|
42
|
+
custom ign_blank_line_verbatim = "Coridoc::Markdown::Parser::Ign::BlankLineVerbatim"
|
|
43
|
+
custom const_hr = "Coridoc::Markdown::Parser::Const::Hr"
|
|
44
|
+
custom const_ln_empty = "Coridoc::Markdown::Parser::Const::LnEmpty"
|
|
45
|
+
custom const_empty = "Coridoc::Markdown::Parser::Const::Empty"
|
|
46
|
+
|
|
47
|
+
# ---- block nesting (scope + continuation) ----
|
|
48
|
+
custom continuation = "Coridoc::Markdown::Parser::Nesting::Continuation"
|
|
49
|
+
custom bq_scope = "Coridoc::Markdown::Parser::Nesting::BlockQuoteScope"
|
|
50
|
+
custom p_scope = "Coridoc::Markdown::Parser::Nesting::ParagraphScope"
|
|
51
|
+
|
|
52
|
+
# ---- ATX heading / thematic break ----
|
|
53
|
+
atx_ending_seq = (1*whitespace *"#" *whitespace !line_char)
|
|
54
|
+
escaped_hash = ("\\" "#")
|
|
55
|
+
atx_heading = (non_indent_space !escaped_hash ((1*6"#") as heading) !"#" [(!atx_ending_seq 1*" " ((1*(!atx_ending_seq line_char)) as text))] [atx_ending_seq] line_ending_or_eof)
|
|
56
|
+
thematic_break_chars = (3*("-" *whitespace) / 3*("_" *whitespace) / 3*("*" *whitespace))
|
|
57
|
+
thematic_break = (non_indent_space ign_thematic_chars const_hr line_ending_or_eof)
|
|
58
|
+
|
|
59
|
+
# ---- code blocks ----
|
|
60
|
+
indented_code_line = (" " line_verbatim)
|
|
61
|
+
indented_code_blank_line = (ign_blank_line_verbatim const_ln_empty &(continuation (" " / blank_line_verbatim)))
|
|
62
|
+
indented_code_block = ((indented_code_line *(continuation (indented_code_line / indented_code_blank_line))) as code_block)
|
|
63
|
+
|
|
64
|
+
state fence: string
|
|
65
|
+
state fence_indent: string
|
|
66
|
+
fence_info_backtick = [((1*(!"`" line_char)) as info)]
|
|
67
|
+
fence_info_tilde = [((1*line_char) as info)]
|
|
68
|
+
custom fence_info = "Coridoc::Markdown::Parser::Nesting::FenceInfo"
|
|
69
|
+
custom fence_close_marker = "Coridoc::Markdown::Parser::Nesting::FenceClose"
|
|
70
|
+
custom consume_fenced_indent = "Coridoc::Markdown::Parser::Nesting::ConsumeFencedIndent"
|
|
71
|
+
code_fence_open = ((set fence_indent = (non_indent_space)) (set fence = ((3*"`") / (3*"~"))) fence_info line_ending_or_eof)
|
|
72
|
+
code_fence_close = (non_indent_space fence_close_marker line_ending_or_eof)
|
|
73
|
+
fenced_code_block = (code_fence_open ((*(continuation !code_fence_close consume_fenced_indent (line_verbatim / (ign_blank_line_verbatim const_ln_empty)))) as code_block) ((continuation code_fence_close) / !(continuation any_char)))
|
|
74
|
+
|
|
75
|
+
# ---- block quote / paragraph / setext ----
|
|
76
|
+
block_quote_marker = (non_indent_space ">" [" "])
|
|
77
|
+
block_quote_item = (block / (!any_char const_empty))
|
|
78
|
+
block_quote_body = (((block_quote_item *(continuation block_quote_item))) as block_quote)
|
|
79
|
+
block_quote = (block_quote_marker bq_scope)
|
|
80
|
+
|
|
81
|
+
ial_block = (*3whitespace (ial / ald) line_ending_or_eof)
|
|
82
|
+
paragraph_interrupt = (blank_line / atx_heading / thematic_break / code_fence_open / block_quote / ial_block / extension / unordered_list_marker / ordered_list_marker / definition_marker)
|
|
83
|
+
paragraph_line = (((1*line_char) as ln !any_char) / ((*line_char) as ln line_ending))
|
|
84
|
+
paragraph_continued_line = (ign_ws_rep paragraph_line)
|
|
85
|
+
paragraph_cont = !paragraph_interrupt
|
|
86
|
+
lazy_continuation = (!paragraph_interrupt ¶graph_continued_line)
|
|
87
|
+
paragraph_body = ((paragraph_line *(continuation paragraph_continued_line)) as p)
|
|
88
|
+
paragraph = (non_indent_space p_scope)
|
|
89
|
+
|
|
90
|
+
setext_underline = (non_indent_space (((1*"-") / (1*"=")) as heading) ign_ws_rep line_ending_or_eof)
|
|
91
|
+
setext_check = (!paragraph_interrupt !setext_underline)
|
|
92
|
+
setext_heading = (setext_check non_indent_space ((paragraph_line *(continuation setext_check paragraph_continued_line)) as text) continuation setext_underline)
|
|
93
|
+
|
|
94
|
+
# ---- kramdown attribute lists ----
|
|
95
|
+
ial_class = ("." 1*word_dash_char)
|
|
96
|
+
ial_id = ("#" 1*word_dash_char)
|
|
97
|
+
ial_key_value = (1*word_dash_char "=" (("\"" *(!"\"" any_char) "\"") / ("'" *(!"'" any_char) "'") / 1*(!(space_char / "}") any_char)))
|
|
98
|
+
ial_content = 1*(*whitespace (ial_class / ial_id / ial_key_value))
|
|
99
|
+
ial = ("{:" (ial_content as ial) "}")
|
|
100
|
+
ald_name = (1*word_char ":")
|
|
101
|
+
ald = ("{:" (ald_name as ald_name) 1*whitespace (ial_content as ial) "}")
|
|
102
|
+
|
|
103
|
+
# ---- kramdown extensions / math ----
|
|
104
|
+
extension_name = 1*%x61-7A
|
|
105
|
+
extension_option = (1*word_dash_char "=" (("\"" *(!"\"" any_char) "\"") / ("'" *(!"'" any_char) "'") / 1*(!(space_char / "/" / "}") any_char)))
|
|
106
|
+
extension_options = *(1*whitespace extension_option)
|
|
107
|
+
extension_self_closing = ("{::" (extension_name as ext_name) (extension_options as ext_options) *whitespace "/}")
|
|
108
|
+
extension_with_body = ("{::" (extension_name as ext_name) (extension_options as ext_options) "}" ((*(!"{:/" any_char)) as ext_body) "{:/}")
|
|
109
|
+
extension = ((extension_self_closing / extension_with_body) as extension)
|
|
110
|
+
block_math = ("$$" line_ending ((*(!"$$" any_char)) as math_content) "$$")
|
|
111
|
+
|
|
112
|
+
# ---- GFM tables ----
|
|
113
|
+
table_cell = ((*(!"|" line_char)) as cell)
|
|
114
|
+
table_row = (("|" [whitespace] ((1*(table_cell [whitespace] "|" [whitespace])) as row)) / ((table_cell [whitespace] "|" [whitespace] ((*(table_cell [whitespace] "|" [whitespace])) as row_rest) ([table_cell] as last_cell)) as row))
|
|
115
|
+
table_separator_cell = ([":"] 1*"-" [":"])
|
|
116
|
+
table_separator_row = (("|" [whitespace] 1*((table_separator_cell as sep) [whitespace] "|" [whitespace])) / ((table_separator_cell as sep) [whitespace] "|" [whitespace] *((table_separator_cell as sep) [whitespace] "|" [whitespace]) [(table_separator_cell as sep)]))
|
|
117
|
+
table = ((table_row as table_header) line_ending (table_separator_row as table_separator) line_ending ((1*((table_row as table_body_row) (line_ending / !any_char))) as table_body))
|
|
118
|
+
|
|
119
|
+
block = (blank_line / eob_marker / atx_heading / thematic_break / indented_code_block / fenced_code_block / block_quote / setext_heading / unordered_list / ordered_list / definition_list / footnote_definition / abbreviation_definition / ial_block / extension / block_math / table / paragraph)
|
|
120
|
+
|
|
121
|
+
# ---- lists ----
|
|
122
|
+
list_interrupt = (1*blank_line / atx_heading / thematic_break / code_fence_open / block_quote / unordered_list_marker / ordered_list_marker)
|
|
123
|
+
unordered_list_marker = (non_indent_space ("-" / "*" / "+") 1*" ")
|
|
124
|
+
ordered_list_marker = (non_indent_space %x31-39 *%x30-39 ("." / ")") 1*" ")
|
|
125
|
+
nested_list_marker = ((" " / "\t") ((("-" / "*" / "+") 1*" ") / (%x31-39 *%x30-39 ("." / ")") 1*" ")))
|
|
126
|
+
list_continuation_line = (((" " / "\t") !nested_list_marker line_verbatim) / (!nested_list_marker line_verbatim))
|
|
127
|
+
thematic_break_in_list = ((("*" *whitespace "*" *whitespace "*") / ("-" *whitespace "-" *whitespace "-") / ("_" *whitespace "_" *whitespace "_")) *whitespace line_ending_or_eof)
|
|
128
|
+
unordered_list_item = ((set list_marker = (unordered_list_marker)) ((ign_thematic_in_list const_hr) as li / (list_item_content as li)))
|
|
129
|
+
list_item_content = (list_item_paragraph *(continuation !list_interrupt nested_block))
|
|
130
|
+
nested_block = (((" " / "\t") nested_unordered_list) / ((" " / "\t") nested_ordered_list))
|
|
131
|
+
nested_unordered_list = ((nested_unordered_list_item *(continuation (" " / "\t") nested_unordered_list_item)) as ul)
|
|
132
|
+
nested_ordered_list = ((nested_ordered_list_item *(continuation (" " / "\t") nested_ordered_list_item)) as ol)
|
|
133
|
+
line_text = (1*line_char line_ending_or_eof)
|
|
134
|
+
nested_unordered_list_item = (unordered_list_marker (line_text as li))
|
|
135
|
+
nested_ordered_list_item = (ordered_list_marker (line_text as li))
|
|
136
|
+
list_item_paragraph = ((line_verbatim *(continuation !list_interrupt !nested_list_marker list_continuation_line)) as p)
|
|
137
|
+
ordered_list_item = (ordered_list_marker (list_item_content as li))
|
|
138
|
+
unordered_list = ((unordered_list_item *(continuation !thematic_break [blank_line] unordered_list_item)) as ul)
|
|
139
|
+
ordered_list = ((ordered_list_item *(continuation !thematic_break [blank_line] ordered_list_item)) as ol)
|
|
140
|
+
|
|
141
|
+
# ---- kramdown definition lists ----
|
|
142
|
+
definition_marker = (non_indent_space ":" 1*" ")
|
|
143
|
+
definition_term_line = (non_indent_space !":" line_verbatim)
|
|
144
|
+
definition_term = ((definition_term_line *(continuation !definition_marker !blank_line definition_term_line)) as def_term)
|
|
145
|
+
definition_content = ((line_verbatim *(continuation !definition_marker !blank_line [(" " / "\t")] line_verbatim)) as def_content)
|
|
146
|
+
definition_item = (definition_marker definition_content)
|
|
147
|
+
definition_list_item = (definition_term 1*(continuation definition_item))
|
|
148
|
+
definition_list = ((definition_list_item *(continuation [blank_line] definition_list_item)) as dl)
|
|
149
|
+
|
|
150
|
+
# ---- kramdown footnotes / abbreviations / EOB ----
|
|
151
|
+
footnote_id = ("[^" ((1*(!"]" any_char)) as fn_id) "]")
|
|
152
|
+
footnote_definition = (non_indent_space footnote_id ":" *whitespace (line_verbatim as fn_content) ((*(continuation 1*4(" " / "\t") line_verbatim)) as fn_content_continued))
|
|
153
|
+
abbreviation_term = ("*[" ((1*(!"]" any_char)) as abbr_term) "]")
|
|
154
|
+
abbreviation_definition = (non_indent_space abbreviation_term ":" *whitespace ((*line_char) as abbr_def) line_ending_or_eof)
|
|
155
|
+
eob_marker = (*whitespace "^" *whitespace line_ending_or_eof)
|
|
156
|
+
|
|
157
|
+
document = *block
|
|
158
|
+
entry document: document
|
|
159
|
+
}
|
|
@@ -102,6 +102,12 @@ module Coridoc
|
|
|
102
102
|
subtree[:text].to_s
|
|
103
103
|
elsif subtree.key?(:code)
|
|
104
104
|
"`#{subtree[:code]}`"
|
|
105
|
+
elsif subtree.key?(:link) && subtree[:link].is_a?(Hash)
|
|
106
|
+
link = subtree[:link]
|
|
107
|
+
"[#{flatten_inline_text(link[:link_text])}](#{flatten_inline_text(link[:link_url])})"
|
|
108
|
+
elsif subtree.key?(:image) && subtree[:image].is_a?(Hash)
|
|
109
|
+
image = subtree[:image]
|
|
110
|
+
"![#{flatten_inline_text(image[:link_text])}](#{flatten_inline_text(image[:link_url])})"
|
|
105
111
|
else
|
|
106
112
|
subtree.values.map { |v| flatten_inline_text(v) }.join
|
|
107
113
|
end
|
|
@@ -181,6 +181,24 @@ module Coridoc
|
|
|
181
181
|
{ text: attrs[:code].to_s }
|
|
182
182
|
end
|
|
183
183
|
|
|
184
|
+
def link(attrs)
|
|
185
|
+
node = attrs[:link]
|
|
186
|
+
if node.is_a?(Hash)
|
|
187
|
+
model('Link').new(text: node[:link_text].to_s, url: node[:link_url].to_s)
|
|
188
|
+
else
|
|
189
|
+
{ content: node.to_s }
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
def image(attrs)
|
|
194
|
+
node = attrs[:image]
|
|
195
|
+
if node.is_a?(Hash)
|
|
196
|
+
model('Image').new(alt: node[:link_text].to_s, src: node[:link_url].to_s)
|
|
197
|
+
else
|
|
198
|
+
{ content: node.to_s }
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
|
|
184
202
|
def text(attrs)
|
|
185
203
|
{ content: attrs[:text].to_s }
|
|
186
204
|
end
|
|
@@ -239,6 +257,8 @@ module Coridoc
|
|
|
239
257
|
{ model: 'Strong', via: :strong, raw: %i[strong] },
|
|
240
258
|
{ model: 'Emphasis', via: :emphasis, raw: %i[emph] },
|
|
241
259
|
{ model: 'Code', via: :code, raw: %i[code] },
|
|
260
|
+
{ model: 'Link', via: :link, raw: %i[link] },
|
|
261
|
+
{ model: 'Image', via: :image, raw: %i[image] },
|
|
242
262
|
{ model: 'Text', via: :text, raw: %i[text] }
|
|
243
263
|
].freeze
|
|
244
264
|
|
|
@@ -359,16 +359,11 @@ module Coridoc
|
|
|
359
359
|
# Convert parsed result to expected format
|
|
360
360
|
result = convert_inline_result(parsed)
|
|
361
361
|
|
|
362
|
-
#
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
if has_emphasis
|
|
366
|
-
# Return emphasis wrapped in :ln to match expected structure
|
|
367
|
-
if result.is_a?(Hash) && (result.key?(:em) || result.key?(:strong))
|
|
368
|
-
end
|
|
362
|
+
# Keep the parse tree when it carries structured inline nodes
|
|
363
|
+
# (emphasis or links); otherwise join the text back together.
|
|
364
|
+
if contains_emphasis?(result) || contains_link?(result)
|
|
369
365
|
{ ln: result }
|
|
370
366
|
else
|
|
371
|
-
# No emphasis found - join all text content back together
|
|
372
367
|
joined = extract_text_content(result)
|
|
373
368
|
{ ln: joined }
|
|
374
369
|
end
|
|
@@ -486,6 +481,21 @@ module Coridoc
|
|
|
486
481
|
end
|
|
487
482
|
end
|
|
488
483
|
|
|
484
|
+
# Check if result contains structured inline nodes (links or
|
|
485
|
+
# images) — these must survive into the model tree rather than
|
|
486
|
+
# being flattened back to text.
|
|
487
|
+
def contains_link?(result)
|
|
488
|
+
case result
|
|
489
|
+
when Hash
|
|
490
|
+
result.key?(:link) || result.key?(:image) ||
|
|
491
|
+
result.values.any? { |v| contains_link?(v) }
|
|
492
|
+
when Array
|
|
493
|
+
result.any? { |item| contains_link?(item) }
|
|
494
|
+
else
|
|
495
|
+
false
|
|
496
|
+
end
|
|
497
|
+
end
|
|
498
|
+
|
|
489
499
|
# Extract all text content from result, joining strings
|
|
490
500
|
def extract_text_content(result)
|
|
491
501
|
case result
|
|
@@ -494,6 +504,20 @@ module Coridoc
|
|
|
494
504
|
extract_text_content(result[:em])
|
|
495
505
|
elsif result.key?(:strong)
|
|
496
506
|
extract_text_content(result[:strong])
|
|
507
|
+
elsif result.key?(:link)
|
|
508
|
+
link = result[:link]
|
|
509
|
+
if link.is_a?(Hash)
|
|
510
|
+
"[#{extract_text_content(link[:link_text])}](#{extract_text_content(link[:link_url])})"
|
|
511
|
+
else
|
|
512
|
+
link.to_s
|
|
513
|
+
end
|
|
514
|
+
elsif result.key?(:image)
|
|
515
|
+
image = result[:image]
|
|
516
|
+
if image.is_a?(Hash)
|
|
517
|
+
"![#{extract_text_content(image[:link_text])}](#{extract_text_content(image[:link_url])})"
|
|
518
|
+
else
|
|
519
|
+
image.to_s
|
|
520
|
+
end
|
|
497
521
|
elsif result.key?(:ln)
|
|
498
522
|
result[:ln].to_s
|
|
499
523
|
elsif result.key?(:text)
|
|
@@ -74,6 +74,24 @@ module Coridoc
|
|
|
74
74
|
str('*').repeat(1) | str('_').repeat(1)
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
+
# Inline link: [text](url). The text span stops at the first `]`,
|
|
78
|
+
# the URL span at the first `)` — balanced brackets and parenthesised
|
|
79
|
+
# URL segments are not modelled (CommonMark's nested-inline link
|
|
80
|
+
# text is beyond the flat inline node shape this parser produces).
|
|
81
|
+
# Inline image:  — matched before link so the `!` bang
|
|
82
|
+
# attaches to the image rather than becoming stray text.
|
|
83
|
+
rule(:link_body) do
|
|
84
|
+
str('[') >>
|
|
85
|
+
(str(']').absent? >> any).repeat(1).as(:link_text) >>
|
|
86
|
+
str(']') >> str('(') >>
|
|
87
|
+
(str(')').absent? >> any).repeat(1).as(:link_url) >>
|
|
88
|
+
str(')')
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
rule(:link) { link_body.as(:link) }
|
|
92
|
+
|
|
93
|
+
rule(:image) { (str('!') >> link_body).as(:image) }
|
|
94
|
+
|
|
77
95
|
rule(:both_flanking_delimiter_run) do
|
|
78
96
|
Parsanol::Atoms::Lookbehind.regex('[\\s\\S]') >>
|
|
79
97
|
Parsanol::Atoms::Lookbehind.regex('[\\p{Zs}\\t\\r\\n\\f]', positive: false) >> (
|
|
@@ -139,7 +157,7 @@ module Coridoc
|
|
|
139
157
|
run_surrounded_by_punctuation | run_preceded_by_punctuation | run_followed_by_punctuation | flanking_delimiter_run
|
|
140
158
|
end
|
|
141
159
|
|
|
142
|
-
rule(:element) { code_span | checked_delimiter_run }
|
|
160
|
+
rule(:element) { code_span | image | link | checked_delimiter_run }
|
|
143
161
|
|
|
144
162
|
rule(:inline) { (text | element).repeat }
|
|
145
163
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: coridoc-markdown
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.17
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -103,6 +103,9 @@ extensions: []
|
|
|
103
103
|
extra_rdoc_files: []
|
|
104
104
|
files:
|
|
105
105
|
- LICENSE.txt
|
|
106
|
+
- grammar/coridoc-markdown.artifact.json
|
|
107
|
+
- grammar/coridoc-markdown.bindings.yml
|
|
108
|
+
- grammar/coridoc-markdown.parg
|
|
106
109
|
- lib/coridoc/markdown.rb
|
|
107
110
|
- lib/coridoc/markdown/behaviors.rb
|
|
108
111
|
- lib/coridoc/markdown/behaviors/admonition.rb
|
|
@@ -273,7 +276,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
273
276
|
- !ruby/object:Gem::Version
|
|
274
277
|
version: '0'
|
|
275
278
|
requirements: []
|
|
276
|
-
rubygems_version:
|
|
279
|
+
rubygems_version: 3.6.9
|
|
277
280
|
specification_version: 4
|
|
278
281
|
summary: Markdown document model, parser, and serializer for Coridoc
|
|
279
282
|
test_files: []
|