Skip to content

codgician/parsic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parsic

MIT licensed Build Status Doc status

🪄 A naive parser combinator written while learning Rust. Parsing magic tragic.

To-do

  • 💖 Core
    • Parser: wrapper for parser function
    • ParseLogger: logger for parser
    • Parsable: anything that could be parsed
  • 🐣 Primitives
    • CharStream: parse state for &str
    • char: consumes one char at a time from parse stream
    • satisfy: consumes one char if given condition satisifies
    • literal: consumes given literal string
    • regex: consumes literal string that matches given regular expression
    • trim: constructs a parser that consumes whitespaces at both ends
  • 🍡 Combinators
    • map: Maps the result of current parser to another value
    • map_option: map, but automatically unwraps Option<T>
    • map_result: map, but automatically unwraps Result<T, E>
    • pure: injects value into an identity parser
    • compose: compose one parser with another if applicable
    • empty: a parser that always fails
    • fix: fixed-point combinator for recursive syntax
    • and: sequential combinator (pair)
    • bind: monadic bind operator for context sensitive parsing
    • left, right, mid: sequencial combinators (select left / right / middle)
    • or: alternative combinators
    • many, some, optional: replicative combinators
    • info, warn, error: log combinators
    • inspect: returns parser result alongwith current parsing state
    • recover: returns a fallback value is given parser fails
  • Enhancements
    • Overload operators: >>, <<, /, &, *
    • Support returning multiple results
    • Advanced error handling (Planning)
  • 🩺 Tests
    • Tests for laws of Functor, Applicative and Monad.
    • Arthimetic calculator
    • Some more real-world tests (Planning)
  • 📄 Docs
    • Core
    • Primitives
    • Combinators

About

🪄 A naive parser combinator written while learning Rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages