Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add the
experimental_keywords
ability #2919Add the
experimental_keywords
ability #2919Changes from 1 commit
60001f5
30a2dce
779b7fe
3b1b9ad
74ce14c
91e0b87
d2b13bd
0c23102
0d9adc6
1f4a3a7
008bebe
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs a justification for
$
in particular. Why isr#$
better thanr#@
, say? (Not that I think that one's necessarily superior, just that it's not clearly worse either.)Historically macros have zealously guarded the use of
$
for themselves, and it's not impossible to imagine someone trying to do($mystring:literal) => { r#$mystring }
...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Speaking as the RFC author: the current text simply reflects the "first thing that came to mind" during the discussion that lead to this proposal, with not much bike-shedding during that discussion.
Speaking as a user: either way is fine and I have no opinion.
So I'll happily put in whatever people want to decide on for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r#$mystring
doesn't work today, and I don't think it will ever work in the future. You can't just stick ar#
next to a lexed token to turn it into a raw string. Macro's use of$
shouldn't really matter here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kennytm Sure, but macro authors use
$
so commonly that it can cause confusion (they might think thatr#$foo
can work). So why not reduce that confusion by choosing a different character?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well for sure there are plenty of alternatives we could choose.
spellings which currently are tokenization error:
r##keyword
r#[keyword]
r#@keyword
/r#!keyword
/ etcr#805209
br#haha_lang_design_go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW,
br#keyword
was also mentioned in #2151.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only question I have while reading this thread is "why?".
Why come up with these contrived monstrosities messing with lexer if pretty much any combination of two existing keywords would work (
do catch
style)?If you want a generic tool for this (which is, again, excessive in my opinion), make
__experimental
a keyword and use__experimental other_keyword
as the combination.