Skip to content

fixed #807 - #811

Merged
paf31 merged 3 commits into
purescript:masterfrom
philopon:fix/#807
Jan 13, 2015
Merged

fixed #807#811
paf31 merged 3 commits into
purescript:masterfrom
philopon:fix/#807

Conversation

@philopon

Copy link
Copy Markdown
Contributor

Hi!

I fixed #807.

@michaelficarra

Copy link
Copy Markdown
Contributor

Well this should fix it, but now all negations will have a space in them.

@philopon

Copy link
Copy Markdown
Contributor Author

Sorry, I underestimated its problem.

I'll fix it soon!

@paf31

paf31 commented Jan 13, 2015

Copy link
Copy Markdown
Contributor

This might even be an issue in my pattern-arrows library. I'll have a look as well.

@michaelficarra

Copy link
Copy Markdown
Contributor

I think the way to solve this is much like the way you've done now, except also disallow negative numbers in JSNumericLiteral and require those to be unary negation operations (which is how JavaScript actually works anyway). This will have the added benefit of handling negate (negate -1) properly, which this current patch does not do.

@philopon

Copy link
Copy Markdown
Contributor Author

I agree. so I rewrote. but I think It can fix easily even if JSNumericLiteral has sign.
Moreover, I think that independent negate can optimize easily. negate (negate a) to a.

Maybe, removeSignedLiterals should be renamed.

@paf31

paf31 commented Jan 13, 2015

Copy link
Copy Markdown
Contributor

Looks good to me. @michaelficarra ?

@paf31 paf31 closed this Jan 13, 2015
@paf31 paf31 reopened this Jan 13, 2015
@michaelficarra

Copy link
Copy Markdown
Contributor

Very nice. 👍

paf31 added a commit that referenced this pull request Jan 13, 2015
@paf31
paf31 merged commit 4d2c9cf into purescript:master Jan 13, 2015
@philopon
philopon deleted the fix/#807 branch January 13, 2015 18:49
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.

negate (-42) compiles to invalid JavaScript

3 participants