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

Fix quoted record labels #14

Merged

Conversation

jvliwanag
Copy link
Member

Fixing cases for code generation of:

type Foo = ( "Bar" :: Int )

and

type Foo = { "Bar" :: Int }

I did check the purescript-cst from the compiler that Bar in both instances are read as (Label "Bar") (and not (Label "\"Bar\")) - so we'll need to add in quoting for that.

I'm not too familiar with the purescript cst syntax definition from the cst's Parser.y file though -- so the code for the check whether the label needs quoting though is a guess -- let me know if I should adjust accordingly.

Also, unsure if I placed the code in the correct places -- let me know if I should move them elsewhere.

@jvliwanag jvliwanag requested a review from srghma October 8, 2020 12:22
@srghma
Copy link
Collaborator

srghma commented Oct 8, 2020

I think everything is fine

the same fix can be added for record accessors xxx."Asdf", but we dont have tests, so ok

@srghma srghma merged commit 4fc5bc7 into purescript-codegen:master Oct 8, 2020
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.

None yet

2 participants