Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes and small improvments to the parsec adapter #742

Merged
merged 7 commits into from
Jul 20, 2021

Conversation

emmabastas
Copy link
Contributor

@emmabastas emmabastas commented Jul 10, 2021

This PR fixes two bugs found in #740 and adds some other improvments.

The three important changes are:

  • The initial indentation level is set to 1 instead of 0. Row and column numbering starts at 1 so initial indentation now matches that. (see 425321d)
  • Text.Parsec.Indent.withPos restores to the previous indentation before calling a continuation. (see 26dc657)
  • Text.Parsec.Pos.updatePos can now handle tabs. (see 06c17f3)

Some less important changes:

  • Text.Parsec.Combinator.eof gets an implementation exactly matching the parsec implementation.
  • Text.Parsec.Combinator.anyToken gets an implementation (eof needs it)
  • Text.Parsec.Prim.(<?>) gets an actual implementation instead of just leaving the parser unchanged, although the implementation might not exactly match the parsec behaviour.

It looks to me like the test suite passes with these additional commits.

@emmabastas emmabastas changed the title Bugfixes and small improvments to the parsec adapter WIP: Bugfixes and small improvments to the parsec adapter Jul 13, 2021
@emmabastas emmabastas changed the title WIP: Bugfixes and small improvments to the parsec adapter Bugfixes and small improvments to the parsec adapter Jul 13, 2021
@emmabastas emmabastas marked this pull request as ready for review July 13, 2021 21:09
@avh4 avh4 self-assigned this Jul 14, 2021
@avh4 avh4 merged commit f9cd7ff into avh4:new-parser-2021 Jul 20, 2021
kutyel pushed a commit to kutyel/elm-format that referenced this pull request Apr 26, 2022
Bugfixes and small improvments to the parsec adapter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants