Update parsers
This commit is contained in:
@@ -11,9 +11,8 @@ import ../parser/utils
|
||||
|
||||
{.experimental: "caseStmtMacros".}
|
||||
|
||||
|
||||
let propertiesKeyParser* = ignore(ch(':')) + anyUntil(choice(@[str(": "), newline]))
|
||||
let propertiesValueParser* = ignore(str(": ")) + anyUntil(newline) + ignore(newline)
|
||||
let propertiesValueParser* = ignore(str(":") + optional(ch(' '))) + optional(anyUntil(newline)) + ignore(newline)
|
||||
|
||||
let propertiesParser* = proc(parser: Parser): ParserResult {.closure.} =
|
||||
let tokens = parser.tokens
|
||||
@@ -48,15 +47,15 @@ let parseProperties* = @[
|
||||
propertiesParser,
|
||||
propertiesEndParser,
|
||||
),
|
||||
ignore(propertiesEndParser),
|
||||
# ignore(propertiesEndParser),
|
||||
]
|
||||
|
||||
when isMainModule:
|
||||
let example = initParserResult(""":PROPERTIES:
|
||||
:PROP_NAME: Value
|
||||
:PROP_NAME: Value
|
||||
:PROP_NAME: Value
|
||||
:PROP_NAME: Value
|
||||
:PROP_NAME: VALUE
|
||||
:PROP_NAME: VAL
|
||||
:PROP_NAME: 3
|
||||
:PROP_NAME: 2
|
||||
:PROPERTIES_END:""").parseSeq(parseProperties)
|
||||
|
||||
echo example
|
||||
|
||||
Reference in New Issue
Block a user