mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-20 06:36:45 +00:00
Support for typeof. (#7858)
Implements `typeof(expr)`, as described in #7697. `expr` is treated as an unevaluated operand, and is kept in an `ExprRegion` separate from the enclosing scope. Assisted-by: Claude via Antigravity
This commit is contained in:
1 parent
99f910f179
commit
4ca08b136d
18 files changed
+846
-5
No files matched your search
@@ -179,6 +179,11 @@ auto HandleExprInPostfix(Context& context) -> void {
|
||||
context.PushState(StateKind::FormLiteral);
|
||||
break;
|
||||
}
|
||||
case Lex::TokenKind::TypeOf: {
|
||||
context.PushState(state);
|
||||
context.PushState(StateKind::TypeOfExpr);
|
||||
break;
|
||||
}
|
||||
case Lex::TokenKind::Package: {
|
||||
context.AddLeafNode(NodeKind::PackageExpr, context.Consume());
|
||||
if (context.PositionKind() != Lex::TokenKind::Period) {
|
||||
|
||||
Reference in new issue
Block a user