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

Compiler: Add symbol literals support equal sign = as last char #5969

Merged

Conversation

straight-shoota
Copy link
Member

Fixes #5965

Copy link
Member

@oprypin oprypin left a comment

Choose a reason for hiding this comment

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

Needs spec for :a==:a

@straight-shoota
Copy link
Member Author

@oprypin You mean like assert_syntax_error ":foo==", "unexpected token: ="?

@oprypin
Copy link
Member

oprypin commented Apr 19, 2018

Would be much better if it worked, but if you're gonna introduce a breaking change, make it explicit

@oprypin
Copy link
Member

oprypin commented Apr 19, 2018

And when I wrote :a==:a, I meant :a==:a, not :foo==

@straight-shoota
Copy link
Member Author

straight-shoota commented Apr 19, 2018

Ah, sry, I didn't catch your drift.

That's probably the reason why this wasn't implemented before. And now I'm not even sure if it should change...

It the change is still welcome, I guess :a==:a should raise a syntax error because it is ambiguous.

@asterite
Copy link
Member

For = and ! we should "abort" (just use the plain identifier) if a = follows (I think this can be checked with peek)

token.value.should eq ("a")
end

it "lexes symbol wfollowed by ==" do
Copy link
Member

Choose a reason for hiding this comment

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

typo w

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks!

@RX14 RX14 added this to the Next milestone Apr 22, 2018
@RX14 RX14 merged commit d6de698 into crystal-lang:master Apr 22, 2018
@straight-shoota straight-shoota deleted the jm/fix/symbol-literal-equals branch April 22, 2018 19:28
chris-huxtable pushed a commit to chris-huxtable/crystal that referenced this pull request Jun 6, 2018
…ystal-lang#5969)

* Compiler: Add symbol literals support equal sign `=` as last char

* fixup! Compiler: Add symbol literals support equal sign `=` as last char
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.

None yet

6 participants