Restructure as following

This commit is contained in:
Florian Schroedl
2022-08-28 14:55:43 +02:00
parent e876a487f5
commit 4991c72cec

View File

@@ -28,8 +28,15 @@ import ../utils/fp
# -- Parsers
let linkStartParser* = ignore(str("[[")) + anyUntil(choice(@[str("]["), str("]]")])) + optional(ignore(str("][")))
let linkEndParser* = anyUntil(str("]]")) + ignore(str("]]"))
let linkStartParser* = following(@[
ignore(str("[[")),
anyUntil(choice(@[str("]["), str("]]")])),
optional(ignore(str("][")))
])
let linkEndParser* = following(@[
anyUntil(str("]]")),
ignore(str("]]")),
])
let linkParser* = proc(parser: Parser): ParserResult {.closure.} =
# Parse an an org link in the `parser` state.