Skip to content

Add source spans for literals#3277

Merged
garyb merged 2 commits intopurescript:masterfrom
garyb:literal-positions
Mar 11, 2018
Merged

Add source spans for literals#3277
garyb merged 2 commits intopurescript:masterfrom
garyb:literal-positions

Conversation

@garyb
Copy link
Copy Markdown
Member

@garyb garyb commented Mar 11, 2018

This fixes the IntOutOfRange error (again 😄)

As it happens, I think it was probably unnecessary to add these, since the real problem was literalToValueJS putting Nothing as the span for literals constantly in the JS AST... but including the spans will at least ensure the positions are accurate, and it's another step to ensuring we always have good position information.

This fixes the IntOutOfRange error (again 😄)
parseObjectBinder =
LiteralBinder <$> parseObjectLiteral (indented *> parseEntry)
parseObjectBinder = withSourceSpanF $
(flip LiteralBinder) <$> parseObjectLiteral (indented *> parseEntry)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could drop the parens around flip LiteralBinder

@garyb garyb merged commit 9a4992a into purescript:master Mar 11, 2018
@garyb garyb deleted the literal-positions branch March 11, 2018 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants