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.
Implement code more introducer #529
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
Implement code more introducer #529
Changes from all commits
94b7859
915cbb7
1b79024
84ed2f1
9e1d775
2220367
49bb6e5
2340a17
ecc9711
e4f3c36
c73e72d
80722d4
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.
the
[
/]
is super-subtle and may be worth a comment. These are there to make the empty string a valid message.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 agree, let's make sure this is called out in
syntax.md
.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.
It may prove valuable to establish a greater separation between
selectors
andreserved-statement
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.
Could you say why? The two expressions are wholly synonymous, and I don't really see why we should prefer one over the other.
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.
Because I expect the latter to diverge—I don't think we should treat
.match {…}…
and.<reserved> …
as interchangeable prefixes before a list of variants, but rather.match {…}… <variant>…
as one thing complete in itself and.<reserved> …
as something independent.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.
What's the motiviation for putting
reserved-statement
insidecomplex-body
? Do we expect other multivariant constructs thanmatch
? I think this may be building too much flexibility into the spec. Could we instead agree that any future keywords would go with other declarations?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.
Ah, I now see that @gibson042 mentions this as one of the issues to work on as follow-ups in his review. How about we land this PR without
reserved-statement
incomplex-body
and then consider adding it, rather than landing it with doubts?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.
Tbh, I would find it easier to include it, show what impact it has across the stack, and then evaluate whether to drop it.
We have already agreed on having two follow up PRs to this that will both re-tread this ground. Could we agree that this will be considered more in both of those, and accept having it in the ABNF for now?
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.
We should do things exactly the other way.
I also don't appreciate pushing hard for merging. We should merge when things look good to merge.
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.
Nit: it looks like we don't append
-char
to other-start
productions in our grammar.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.
Note that there already is another rule that's called
simple-start
. If necessary, could we take care of any such editorial rule renames in a separate follow-up PR?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.
Ah, I see. I'll open a new PR 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.
Replying to @gibson042 from #529 (comment):
Could we merge this PR with this note in the ABNF, in expectation of getting a PR from @gibson042 that could update all reserved content holistically?
ps. I had not considered statements like
.strict true
. That does sound like something we ought to reserve space for.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 reason statements end with
expression
is that the closing}
of the expression is how we know the statement ended. Otherwise we're inreserved-body
... forever. It is a hidden detail of our syntax that statements end with a close bracket.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.
While that's true with the current state of this PR, I believe @gibson042 would like us to drop
.
as a valid character inreserved-body
, which would allow determining its end by encountering it at the start of the next keyword.My request here is for us to find a way to not block this PR on that discussion, and to have it instead separately so that the syntax of both reserved statements and annotations could be considered in one package.
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 agree with finalizing this PR. I don't think the reserved-statement discussion (were we to change something) needs to be in the way of that. It should be a separate conversation. If we want to pursue a change, it should be at least an issue if not a design document.
That said, I would not include the proposed note in this comment thread. Any changes we consider or make will be done in the near future. If we include text about it, put it in syntax.md.
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.
There should be separate productions for reserved statement bodies and reserved annotation bodies, so the body of reserved/private-use annotations better aligns with that of function annotations.
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.
reserved-char
should omit.
so e.g..new {$a} .hotness {$b}
is recognized as two distinct reserved statements and.prefix {$foo} .local $var = {|val|}
is recognized as a reserved statement followed by a local declaration, while still allowing reserved statements to include non-consecutive expressions(like.local-declaration = local s variable [s] "=" [s] expression
already does)And accordingly,
reserved-escape
should be generalized to e.g.reserved-statement-escape = backslash ( %x00-D7FF / %xE000-10FFFF )
.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.
Note that this precludes syntax like that used now in
local-declaration
, where we have avariable
name
at the top level, andname
can include a.
. Is that intentional?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.
No, it will need further tweaking to match
.
only aftername-start
orname-char
, as insidename
.