mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 10:54:49 +01:00
Semantics & Lowering for simple assignment. (#3058)
Co-authored-by: Farzana Ahmed Siddique <fasiddique@google.com>
This commit is contained in:
co-authored by
Farzana Ahmed Siddique
parent
3a093980a6
commit
ce459d4da7
@@ -51,7 +51,15 @@ auto SemanticsHandleInfixOperator(SemanticsContext& context,
|
||||
resume_block_id));
|
||||
return true;
|
||||
}
|
||||
|
||||
case TokenKind::Equal: {
|
||||
// TODO: handle complex assignment expression such as `a += 1`.
|
||||
// TODO: check if lhs node is assignable.
|
||||
context.ImplicitAsRequired(
|
||||
parse_node, rhs_id, context.semantics_ir().GetNode(lhs_id).type_id());
|
||||
context.AddNodeAndPush(
|
||||
parse_node, SemanticsNode::Assign::Make(parse_node, lhs_id, rhs_id));
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return context.TODO(parse_node, llvm::formatv("Handle {0}", token_kind));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user