Skip to content

Parser combinators for Clojure(Script).

License

Notifications You must be signed in to change notification settings

borkdude/parsesso

 
 

Repository files navigation

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

Parsesso Parsec1,2,3 Kern4 Parsatron5
p/result return return always
p/fail fail fail never
p/fail-unexpected unexpected unexpected
p/expecting <?>, label <?>, expect
p/bind >>= >>= bind
p/for do bind let->>
p/after >> >> >>, nxt
p/value fmap <$>
p/maybe try <:> attempt
p/look-ahead lookAhead look-ahead lookahead
p/not-followed-by notFollowedBy not-followed-by
p/*many many many many
p/+many many1 many1 many1
p/*skip skipMany skip-many
p/+skip skipMany1 skip-many1
p/token token, satisfy satisfy token
p/token-not
p/word tokens, string token* string
p/any-token anyToken,anyChar any-char any-char
p/eof eof eof eof
p/group <*> <*>
p/alt <|>, choice <|> choice
p/option option, optional option, optional
p/between between between between
p/times count times times
p/*many-till manyTill many-till
p/*sep-by sepBy sep-by
p/+sep-by sepBy1 sep-by1
p/*sep-end-by endBy end-by
p/+sep-end-by endBy1 end-by1
p/*sep-opt-by sepEndBy sep-end-by
p/+sep-opt-by sepEndBy1 sep-end-by1
p/get-state getParserState... input, pos, user state
p/set-state setParserState... input, pos, user state
p/update-state updateParserState... user state
p/trace parserTrace, parserTraced
expr/*chain-left chainl chainl
expr/+chain-left chainl1 chainl1
expr/*chain-right chainr chainr
expr/+chain-right chainr1 chainr1
char/is char, oneOf sym*, one-of* char
char/is-not noneOf none-of*
char/regex
char/upper? upper upper (unicode)
char/lower? lower lower (unicode)
char/letter? letter letter (unicode) letter (unicode)
char/number? digit digit (unicode) digit (unicode)
char/letter-or-number? alphaNum alpha-num (unicode)
char/white? space white-space (unicode)
char/newline endOfLine new-line*
char/str* <+>

Examples

Performance

See some benchmarks here.

About

Parser combinators for Clojure(Script).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages

  • Clojure 100.0%