No API change, but a major change. The internal implementation how locations (line/columns) are working has changed. Lines were previously 1-based, and columns sometimes had negative values. This is changed into zero-based lines and columns can never have negative values anymore.
If your application/library did not rely on parse locations, the update is seamless.
- Transfer from
Bogdanp/elm-combine
.
This repository is transferred from Bogdanp/elm-combine. The following changelog statements originate from that repository.
- Brought back
app
- The
Combine.Infix
module has been merged intoCombine
- The
Parser
type has changed fromParser res
toParser state res
- The signature of
andThen
has changed to(a -> Parser s b) -> Parser s a -> Parser s b
- The signature of
andMap
has changed toParser s a -> Parser s (a -> b) -> Parser s b
- The signature of
chainl
has changed toParser s (a -> a -> a) -> Parser s a -> Parser s a
- The signature of
chainr
has changed toParser s (a -> a -> a) -> Parser s a -> Parser s a
- The signature of
parse
has changed toParser () res -> String -> Result (ParseErr ()) (ParseOk () res)
- The signature of
fail
has changed toString -> Parser s a
rec
has been renamed tolazy
app
has been removed, useprimitive
,parse
orrunParser
insteadbimap
has been removed, usemap
andmapError
instead
- Added
InputStream
,ParseLocation
,ParseContext
,ParseResult
,ParseErr
andParseOk
types - Added
runParser
,withState
,putState
,modifyState
- Added
withLocation
,withLine
,withColumn
,currentLocation
,currentSourceLine
,currentLine
,currentColumn
- Added
lookAhead
andwhitespace
parsers
- Replace all occurrences of
Parser *
withParser s *
- Replace all infix occurrences of andThen with
a |> andThen b
- Replace all imports of
Combine.Infix
withCombine
- Replace all pattern matches on
Combine.parse
like so:
case Combine.parse someParser inputData of
(Ok result, context) ->
Just result
(Err errors, context) ->
Nothing
becomes
case Combine.parse someParser inputData of
Ok (state, stream, result) ->
Just result
Err (state, stream, errors) ->
Nothing
- Added support for Elm 0.17
- Added
sequence
- Added
sepEndBy
andsepEndBy1
(contributed by @prt2121)
- Fixed issue 10.
- Fixed an issue with
mapError
where the incorrect context was returned.
- Fixed issue 8.
- Replaced custom
Result
ADT withResult.Result
fromcore
- Renamed
brackets
tobraces
- Renamed
squareBrackets
tobrackets
- Removed
Parser
andRecursiveParser
constructors - Added
primitive
function for construcing customParser
instances - Added basic test suite
- Added Travis CI
- Updated documentation
- Replace all occurrences of
Done
withOk
- Replace all occurrences of
Fail
withErr
- Replace all occurrences of
Result a
withResult (List String) a
- Replace all occurrences of
ParseFn a
withContext -> (Result a, Context)
- Replace all calls to the
Parser
constructor withprimitive