rename none to null
This commit is contained in:
@@ -244,9 +244,9 @@ lower_compound_expr :: proc(state: ^State, expr_id: hir.Expr_Id) -> ir.Instructi
|
||||
b=ir.INVALID_INSTRUCTION,
|
||||
diagnostic=source.INVALID_DIAGNOSTIC,
|
||||
})
|
||||
case .None:
|
||||
case .Null:
|
||||
return append_instruction(state, ir.Instruction{
|
||||
op=.None, span=expr.span, type=expr.type,
|
||||
op=.Null, span=expr.span, type=expr.type,
|
||||
target=ir.INVALID_REF, a=ir.INVALID_INSTRUCTION, b=ir.INVALID_INSTRUCTION,
|
||||
diagnostic=source.INVALID_DIAGNOSTIC,
|
||||
})
|
||||
@@ -563,8 +563,8 @@ lower_compound_expr :: proc(state: ^State, expr_id: hir.Expr_Id) -> ir.Instructi
|
||||
case .Eq, .Ne, .Lt, .Le, .Gt, .Ge:
|
||||
left_expr := state.hir_module.exprs[expr.left]
|
||||
right_expr := state.hir_module.exprs[expr.right]
|
||||
if left_expr.kind == .None || right_expr.kind == .None {
|
||||
optional_expr := expr.right if left_expr.kind == .None else expr.left
|
||||
if left_expr.kind == .Null || right_expr.kind == .Null {
|
||||
optional_expr := expr.right if left_expr.kind == .Null else expr.left
|
||||
optional := lower_nested_expr(state, optional_expr)
|
||||
present := append_instruction(state, ir.Instruction{
|
||||
op=.Optional_Is_Some, span=expr.span, type=types.BOOL,
|
||||
@@ -716,7 +716,7 @@ lower_expr :: proc(state: ^State, expr_id: hir.Expr_Id) -> ir.Instruction_Id {
|
||||
diagnostic=source.INVALID_DIAGNOSTIC,
|
||||
})
|
||||
_ = pop(&stack)
|
||||
case .String, .Array, .Struct, .Range, .None, .Optional_Some, .Address, .Deref,
|
||||
case .String, .Array, .Struct, .Range, .Null, .Optional_Some, .Address, .Deref,
|
||||
.Index, .Slice, .Field, .Union_Tag, .Length, .Slice_Ptr, .Unwrap, .Orelse,
|
||||
.Try, .Catch, .Not, .Eq, .Ne, .Lt, .Le, .Gt, .Ge, .And, .Or:
|
||||
last = lower_compound_expr(state, frame.expr)
|
||||
|
||||
Reference in New Issue
Block a user