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

Remove remains of deriving and decypher large regexp #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Hi-Angel
Copy link
Contributor

@Hi-Angel Hi-Angel commented Dec 10, 2024

First commit removes the remains of deriving keyword. deriving isn't a thing in PureScript. Also, related discussion on PureScript Discourse.

Second commit is just a stylistic change: the large regexp in purescript-indentation-peek-token was converted to rx macro. It bears no functional change and the regexp generated by rx is exactly the same (barring that '_ part was to the right of [:alnum:] and now it's to the left). Hopefully, the resulting code is easier to read and maintain.

`deriving` isn't a thing in PureScript. There's `derive` keyword, but
it has a bit different structure (specifically, it is a top-level
keyword).

Related discussion: https://discourse.purescript.org/t/solved-is-deriving-keyword-a-thing-in-purescript/4787
The 204 characters line full of backslashes and parentheses isn't the
most readable code. Replace it with `rx` expression instead, which
makes author's intentions much clearer.

As can be checked by evaluation, the resulting regexp is exactly the
same, barring the "'_" part was moved to the left of [:alnum:].
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.

1 participant