Update precedence rules to match design. (#3081)

- Only allow assignment at the top level in an expression statement.
- Allow both negation and complement as subexpressions of both bitwise
  and numeric operators.
- Remove parsing support for postincrement and postdecrement.
- Add parsing support for `as` operator.
- Use the same ambient precedence for types and non-type expressions.

---------

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
Richard Smith
2023-08-10 18:39:37 +00:00
committed by GitHub
co-authored by Chandler Carruth
parent 3cca175a57
commit fc5a9541ce
18 changed files with 634 additions and 99 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ auto ParserHandleStatement(ParserContext& context) -> void {
}
default: {
context.PushState(ParserState::ExpressionStatementFinish);
context.PushState(ParserState::Expression);
context.PushStateForExpression(PrecedenceGroup::ForExpressionStatement());
break;
}
}