Liking cljdoc? Tell your friends :D

parsesso

Parser combinators for Clojure(Script).

cljdoc badge Clojars Project

Motivation

  • Idiomatic and convenient API for parser combinators in Clojure and ClojureScript.

Inspiration

Cheat sheet

ParsessoParsec1,2,3Kern4Parsatron5
resultreturnreturnalways
failfailfailnever
fail-unexpectedunexpectedunexpected
expecting<?>, label<?>, expect
bind>>=>>=bind
bind-letdobindlet->>
after>>>>>>, nxt
valuefmap<$>
maybetry<:>attempt
look-aheadlookAheadlook-aheadlookahead
not-followed-bynotFollowedBynot-followed-by
many0manymanymany
many1many1many1many1
skip0skipManyskip-many
skip1skipMany1skip-many1
tokentoken, satisfysatisfytoken
token-not
wordtokens, stringtoken*string
any-tokenanyToken,anyCharany-charany-char
eofeofeofeof
group<*><*>
choice<|>, choice<|>choice
optionoption, optionaloption, optional
betweenbetweenbetweenbetween
timescounttimestimes
many-tillmanyTillmany-till
sep0sepBysep-by
sep1sepBy1sep-by1
sep0-endendByend-by
sep1-endendBy1end-by1
sep0-optsepEndBysep-end-by
sep1-optsepEndBy1sep-end-by1
chain0-leftchainlchainl
chain1-leftchainl1chainl1
chain0-rightchainrchainr
chain1-rightchainr1chainr1
get-stategetParserState...input, pos, user state
set-statesetParserState...input, pos, user state
update-stateupdateParserState...user state
traceparserTrace, parserTraced
char/ischar, oneOfsym*, one-of*char
char/is-notnoneOfnone-of*
char/regex
char/upper?upperupper (unicode)
char/lower?lowerlower (unicode)
char/letter?letterletter (unicode)letter (unicode)
char/number?digitdigit (unicode)digit (unicode)
char/letter-or-number?alphaNumalpha-num (unicode)
char/white?spacewhite-space (unicode)
char/newlineendOfLinenew-line*
char/str* <+>

Examples

Performance

See some benchmarks here.

Can you improve this documentation? These fine people already did:
Sergey Trofimov & serioga
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close