Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make tokens for << >> >>>
For example, disallow

    a < < b

from being recognized as a left-shift.
  • Loading branch information
dneto0 committed May 19, 2020
commit 1d42e44d3ec943db73671d21b0377ebb379a03b1
9 changes: 6 additions & 3 deletions wgsl/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,11 @@ The following is a list of keywords which are reserved for future expansion.
<tr><td>`NOT_EQUAL`<td>!==
<tr><td>`GREATER_THAN`<td>>
<tr><td>`GREATER_THAN_EQUAL`<td>>=
<tr><td>`GREATER_GREATER`<td>>>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would be nice to make these names consistent. I.e. why ARROW and not MINUS_GREATER? Similarly, there is ATTR_LEFT and not BRACKET_LEFT_LEFT.

If GREATER_GREATER is in fact the desired level at which the naming is done, then this would be something to follow-up. I wanted to raise it here in case GREATER_GREATER should be replaced by something like ARITHMETIC_SHIFT_RIGHT.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, a more semantic name would be a better choice.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in a1f03bd

<tr><td>`GREATER_GREATER_GREATER`<td>>>>
<tr><td>`LESS_THAN`<td><
Copy link
Copy Markdown

@johnkslang johnkslang May 21, 2020

Choose a reason for hiding this comment

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

Might want to consider call this ANGLE_BRACKET_LEFT and ANGLE_BRACKET_RIGHT to separate terminology between lexing and parsing.

That would be more consistent with BRACE_LEFT instead of BEGIN_SCOPE, BANG instead of NOT, BRACKET_LEFT instead of BEING_ARRAY_INDEX, etc.

<tr><td>`LESS_THAN_EQUAL`<td><=
<tr><td>`LESS_LESS`<td><<
<tr><td>`MOD`<td>%
<tr><td>`MINUS`<td>-
<tr><td>`NAMESPACE`<td>::
Expand Down Expand Up @@ -1340,11 +1343,11 @@ additive_expression

shift_expression
: additive_expression
| shift_expression LESS_THAN LESS_THAN additive_expression
| shift_expression LESS_LESS additive_expression
OpShiftLeftLogical
| shift_expression GREATER_THAN GREATER_THAN additive_expression
| shift_expression GREATER_GREATER additive_expression
OpShiftRightLogical
| shift_expression GREATER_THAN GREATER_THAN GREATER_THAN additive_expression
| shift_expression GREATER_GREATER_GREATER additive_expression
OpShiftRightArithmetic

relational_expression
Expand Down