diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-08-02 01:37:30 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-08-02 01:37:30 +0200 |
| commit | b7b21f1b56a867a33a27bde0b24ef07d8761fea5 (patch) | |
| tree | 9a5cbffc26e6b8c4fc086a1d564ebe752cb4359e | |
| parent | 8869f3f639c5dcf222d52e78f56996a4d5abf271 (diff) | |
Remove `#maybe`
| -rw-r--r-- | src/odin/printer/visit.odin | 2 | ||||
| -rw-r--r-- | src/server/analysis.odin | 1 | ||||
| -rw-r--r-- | tests/completions_test.odin | 8 |
3 files changed, 4 insertions, 7 deletions
diff --git a/src/odin/printer/visit.odin b/src/odin/printer/visit.odin index bb0ba0b..f6c39f5 100644 --- a/src/odin/printer/visit.odin +++ b/src/odin/printer/visit.odin @@ -1156,8 +1156,6 @@ visit_expr :: proc(p: ^Printer, expr: ^ast.Expr, called_from: Expr_Called_Type = ) #partial switch v.kind { - case .maybe: - document = cons_with_opl(document, text("#maybe")) case .no_nil: document = cons_with_opl(document, text("#no_nil")) case .shared_nil: diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 9be28dd..f82b907 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -2155,7 +2155,6 @@ get_generic_assignment :: proc(file: ast.File, value: ^ast.Expr, ast_context: ^A } case ^Type_Assertion: if v.type != nil { - //This is the unique .? that can only be used with maybe if unary, ok := v.type.derived.(^ast.Unary_Expr); ok && unary.op.kind == .Question { append(results, cast(^ast.Expr)&v.node) } else { diff --git a/tests/completions_test.odin b/tests/completions_test.odin index 5fda923..6beb610 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -1228,7 +1228,7 @@ ast_union_identifier_completion :: proc(t: ^testing.T) { ast_union_poly :: proc(t: ^testing.T) { source := test.Source { main = `package main - My_Union :: union($T: typeid) #maybe {T} + My_Union :: union($T: typeid) {T} main :: proc() { m: My_Union(int) @@ -1244,7 +1244,7 @@ ast_union_poly :: proc(t: ^testing.T) { ast_maybe_first_value :: proc(t: ^testing.T) { source := test.Source { main = `package main - Maybe :: union($T: typeid) #maybe {T} + Maybe :: union($T: typeid) {T} main :: proc() { m: Maybe(int) @@ -1276,7 +1276,7 @@ ast_maybe_second_value :: proc(t: ^testing.T) { ast_maybe_array :: proc(t: ^testing.T) { source := test.Source { main = `package main - My_Union :: union($T: typeid) #maybe {T} + My_Union :: union($T: typeid) {T} main :: proc() { m: My_Union([5]u8) @@ -1296,7 +1296,7 @@ ast_maybe_index_completion :: proc(t: ^testing.T) { append(&packages, test.Package { pkg = "my_package", source = `package my_package - Maybe :: union($T: typeid) #maybe {T} + Maybe :: union($T: typeid) {T} `, }); |