Releases: BenchR267/Parsel
Operator fixing
Added pattern matching
This release adds support for using Parser
s with Swifts internal pattern matching (switch - case). That means you can write something like
switch "a" {
case L.char: print("it's a char :)")
case L.digit: print("it's a digit!")
default: print("it's something unexpected :/")
}
It will try to parse the value ("a"
in the example) with each parser and checks as well if the rest is empty. So only if the complete input matches, the case matches.
Added documentation URL to podspec
Beside that only some documentation was added/changed - no production code changes.
Precedence!
2.1.0 fixes precedence groups, so operators are better usable. Check out the test cases here if you would like to see them in action.
The release also contains some changed regular expression parsers in RegexParser.swift and changes the shortcut for RegexParser to R. So now you can get a parser for mails with R.mail
e.g.
Lexical parsing!
2.0.0 Adds support for pre-defined parsers for lexical parsing. Lexical parsing is destructuring of String based input.
First official release
This release includes the core functionality for build parsers with Parsel. Also on board is the RegexParser, a parser that makes it an ease to create parsers with regular expressions.