Support markup :body patterns

This commit is contained in:
TEC 2022-10-16 16:01:45 +08:00
parent 8e9a3b4bb5
commit be707641f0
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 4 additions and 3 deletions

View File

@ -110,11 +110,12 @@ This must not include any capturing groups."
(length (plist-get pattern :start))))) (length (plist-get pattern :start)))))
patterns))) patterns)))
(body-rx (body-rx
(rx-to-string (or (plist-get pattern :body)
`(seq (not (any space ,@confounding-start-characters)) (rx-to-string
`(seq (not (any space ,@confounding-start-characters))
(optional (optional
(*? not-newline) (*? not-newline)
(not space)))))) (not space)))))))
`((,(rx (regexp simple-comment-markup-pre-rx) `((,(rx (regexp simple-comment-markup-pre-rx)
(group (literal (plist-get pattern :start))) (group (literal (plist-get pattern :start)))
(group (regexp body-rx)) (group (regexp body-rx))