[parsing] Code cleanup
This commit is contained in:
parent
37707a0712
commit
5889f3cd26
1 changed files with 7 additions and 3 deletions
|
@ -302,9 +302,13 @@ module private MfmParser =
|
||||||
|
|
||||||
let quoteNode =
|
let quoteNode =
|
||||||
previousCharSatisfiesNot isNotNewline
|
previousCharSatisfiesNot isNotNewline
|
||||||
>>. many1 (pchar '>' >>. (opt (pchar ' ')) >>. (many1Till inlineNode (skipNewline <|> eof)))
|
>>. many1 (
|
||||||
.>> opt (attempt (skipNewline >>. (notFollowedBy <| pchar '>')))
|
pchar '>'
|
||||||
.>>. ((opt (attempt (skipNewline >>. (followedBy <| pchar '>')))) .>>. opt eof)
|
>>. (opt <| pchar ' ')
|
||||||
|
>>. (many1Till inlineNode (skipNewline <|> eof))
|
||||||
|
)
|
||||||
|
.>> (opt <| attempt (skipNewline >>. (notFollowedBy <| pchar '>')))
|
||||||
|
.>>. (opt <| attempt (skipNewline >>. (followedBy <| pchar '>')) .>>. opt eof)
|
||||||
|>> fun (q, (followedByQuote, followedByEof)) ->
|
|>> fun (q, (followedByQuote, followedByEof)) ->
|
||||||
MfmQuoteNode(
|
MfmQuoteNode(
|
||||||
List.collect (fun e -> e @ [ (MfmCharNode('\n') :> MfmInlineNode) ]) q
|
List.collect (fun e -> e @ [ (MfmCharNode('\n') :> MfmInlineNode) ]) q
|
||||||
|
|
Loading…
Add table
Reference in a new issue