You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a case where it might be useful to add a parser combinator which returns two things:
a value built with what is meant to recognize
a parser or a value useful for continuing parsing after that string
This can happen when you have a clause in SQL like SELECT column0, … column_N (FROM | ORDER BY), where you might have a function for parsing the column list, and then different functions for parsing what comes after FROM or ORDER BY.
typeEither<'a,'b>=| Left of'a| Right of'bletsepCont=
parse {do! symbol S.Comma
return Left ()}<|> parse {do! keyword K.From
return Right From
}<|> parse {do! keyword K.Order
do! keyword K.By
return Right OrderBy
}let!xs,next = sepBy1Cont identifier sepCont
The text was updated successfully, but these errors were encountered:
I found a case where it might be useful to add a parser combinator which returns two things:
This can happen when you have a clause in SQL like
SELECT column0, … column_N (FROM | ORDER BY)
, where you might have a function for parsing the column list, and then different functions for parsing what comes afterFROM
orORDER BY
.I explain that situation with more detail here
sepBy1Cont
could be used the following wayThe text was updated successfully, but these errors were encountered: