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

Make use of -- operator a syntax error #9561

Closed
wants to merge 1 commit into from
Closed

Conversation

jakebolewski
Copy link
Member

Pending decision on issue #9532

@ivarne
Copy link
Member

ivarne commented Jan 2, 2015

+1, but if we go with this, we should have an answer to why this is a change that doesn't need a depreciation period.

@ivarne ivarne added the needs decision A decision on this change is needed label Jan 2, 2015
@@ -8,7 +8,7 @@
(define prec-conditional '(?))
(define prec-lazy-or '(|\|\||))
(define prec-lazy-and '(&&))
(define prec-arrow '(-- --> ← → ↔ ↚ ↛ ↠ ↣ ↦ ↮ ⇎ ⇏ ⇒ ⇔ ⇴ ⇶ ⇷ ⇸ ⇹ ⇺ ⇻ ⇼ ⇽ ⇾ ⇿ ⟵ ⟶ ⟷ ⟷ ⟹ ⟺ ⟻ ⟼ ⟽ ⟾ ⟿ ⤀ ⤁ ⤂ ⤃ ⤄ ⤅ ⤆ ⤇ ⤌ ⤍ ⤎ ⤏ ⤐ ⤑ ⤔ ⤕ ⤖ ⤗ ⤘ ⤝ ⤞ ⤟ ⤠ ⥄ ⥅ ⥆ ⥇ ⥈ ⥊ ⥋ ⥎ ⥐ ⥒ ⥓ ⥖ ⥗ ⥚ ⥛ ⥞ ⥟ ⥢ ⥤ ⥦ ⥧ ⥨ ⥩ ⥪ ⥫ ⥬ ⥭ ⥰ ⧴ ⬱ ⬰ ⬲ ⬳ ⬴ ⬵ ⬶ ⬷ ⬸ ⬹ ⬺ ⬻ ⬼ ⬽ ⬾ ⬿ ⭀ ⭁ ⭂ ⭃ ⭄ ⭇ ⭈ ⭉ ⭊ ⭋ ⭌ ← →))
(define prec-arrow '(--> ← → ↔ ↚ ↛ ↠ ↣ ↦ ↮ ⇎ ⇏ ⇒ ⇔ ⇴ ⇶ ⇷ ⇸ ⇹ ⇺ ⇻ ⇼ ⇽ ⇾ ⇿ ⟵ ⟶ ⟷ ⟷ ⟹ ⟺ ⟻ ⟼ ⟽ ⟾ ⟿ ⤀ ⤁ ⤂ ⤃ ⤄ ⤅ ⤆ ⤇ ⤌ ⤍ ⤎ ⤏ ⤐ ⤑ ⤔ ⤕ ⤖ ⤗ ⤘ ⤝ ⤞ ⤟ ⤠ ⥄ ⥅ ⥆ ⥇ ⥈ ⥊ ⥋ ⥎ ⥐ ⥒ ⥓ ⥖ ⥗ ⥚ ⥛ ⥞ ⥟ ⥢ ⥤ ⥦ ⥧ ⥨ ⥩ ⥪ ⥫ ⥬ ⥭ ⥰ ⧴ ⬱ ⬰ ⬲ ⬳ ⬴ ⬵ ⬶ ⬷ ⬸ ⬹ ⬺ ⬻ ⬼ ⬽ ⬾ ⬿ ⭀ ⭁ ⭂ ⭃ ⭄ ⭇ ⭈ ⭉ ⭊ ⭋ ⭌ ← →))
Copy link
Contributor

Choose a reason for hiding this comment

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

was it a typo in the first place, should it maybe have been <-- to start with?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nevermind. Tracing this through the history it goes way back - 6e515e7#diff-1
-> and <- were once parsed as operators, but <-- never was. Does the comment

note: there are some strange-looking things in here because
the way the lexer works, every prefix of an operator must also
be an operator.

mean this change would break parsing of --> as an operator? That is likely not tested...

Copy link
Member Author

Choose a reason for hiding this comment

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

This does break --> but only because you can't peek ahead 2-characters. Making this work would be a bit hacky, maybe we should just allow them and go with @StefanKarpinski's suggestion which I think is a good one.

@JeffBezanson
Copy link
Member

There is another way to make this a syntax error. We can leave it in the operator tables, but raise an error if it actually occurs not as part of -->.

@JeffBezanson
Copy link
Member

Also, nobody has used this as an operator as far as I know, but it would be fine to deprecate it.

@tkelman
Copy link
Contributor

tkelman commented Jan 4, 2015

I think the unicode replacements are probably satisfactory in place of --> making parsing more complicated

@jakebolewski
Copy link
Member Author

Leaving it in the operator table but raising an error anyway seemed a bit hacky to me. Could we just remove --> completely?

@jakebolewski jakebolewski deleted the jcb/decsyntaxerr branch February 25, 2015 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs decision A decision on this change is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants