Skip to content

Conversation

@chtenb
Copy link
Member

@chtenb chtenb commented Mar 5, 2022

Fix #85


Checklist:

  • Added the change to the changelog's "Unreleased" section with a link to this PR and your username
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation in the README and/or documentation directory
  • Added a test for the contribution (if applicable)

@chtenb chtenb requested a review from jamesdbrock March 5, 2022 10:42
Just chr -> pure chr
Nothing -> fail $ "Code point " <> show cp <> " is not a character"
where
toChar = fromCharCode <<< fromEnum
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed and uncommented the test I added for that earlier :)

-- | Match any code point.
anyCodePoint :: Parser CodePoint
anyCodePoint = Parser \{ substring, position } ->
case SCP.codePointAt 0 substring of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's better indeed

@chtenb chtenb merged commit efbe004 into main Mar 7, 2022
@chtenb chtenb deleted the codepointParsers branch March 7, 2022 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add anyCodePoint

3 participants