mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-28 08:30:10 +01:00
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:
co-authored by
Chandler Carruth
parent
3cca175a57
commit
fc5a9541ce
@@ -46,7 +46,7 @@ auto ParserHandleStatement(ParserContext& context) -> void {
|
||||
}
|
||||
default: {
|
||||
context.PushState(ParserState::ExpressionStatementFinish);
|
||||
context.PushState(ParserState::Expression);
|
||||
context.PushStateForExpression(PrecedenceGroup::ForExpressionStatement());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user