# Parsey Swift Parser Combinator Framework In addition to simple combinators, **Parsey** supports source location/range tracking, backtracking prevention, and custom error messages. ![Parsey Playground](https://pbs.twimg.com/media/CrVaoBeVYAAWWoj.jpg:large) ## Features - Combinator interface - `|`, `~~`, `~~>`, `<~~`, `^^` combinator operators - Lexer primitives: - `Lexer.whitespace`, `Lexer.signedInteger`, ... - Regex-like combinators: - Postfix `.+` for `.many()`. - Example: `let arrayLiteral = "[" ~~> expression.+ <~~ "]"` - Postfix `.*` for `.manyOrNone()`. - Example: `let classDef = (attribute | method).*` - Postfix `.?` for `.optional()`. - Example: `let declaration = "let" ~~> id ~~ (":" ~~> type).? ~~ ("=" ~~> expression)` - Postfix `+` for `.manyConcatenated()`. - Example: `let skippedSpaces = (Lexer.space | Lexer.tab)+` - Infix `+` for `.concatenatingResult(with:)`. - Example: `let type = Lexer.upperLetter + Lexer.letter*` - `Lexer.regex(_:)` for directly applying regular expressions. - Example: `let id = Lexer.regex("[a-zA-Z][a-zA-Z0-9]*")` - Backtracking prevention - `.!` postfix operator or `.nonbacktracking()` - Parser tagging for error messages - `