Skip to content

Commit

Permalink
Support relative type
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielGavin committed Mar 26, 2024
1 parent 680728b commit 1be454a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/common/ast.odin
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,11 @@ free_ast_node :: proc(node: ^ast.Node, allocator: mem.Allocator) {
free_ast(n.elem, allocator)
case ^Matrix_Type:
free_ast(n.elem, allocator)
case ^Relative_Type:
free_ast(n.tag, allocator)
free_ast(n.type, allocator)
case:
panic(fmt.aprintf("free Unhandled node kind: %T", n))
panic(fmt.aprintf("free Unhandled node kind: %v", node.derived))
}

mem.free(node, allocator)
Expand Down Expand Up @@ -911,7 +914,6 @@ node_equal_node :: proc(a, b: ^ast.Node) -> bool {
case ^Typeid_Type:
return true
case:
log.warn("Unhandled poly node kind: %T", m)
}

return false
Expand Down
3 changes: 1 addition & 2 deletions src/server/analysis.odin
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ internal_resolve_type_expression :: proc(
}
}
case:
log.warnf("default node kind, internal_resolve_type_expression: %T", v)
log.warnf("default node kind, internal_resolve_type_expression: %v", v)
}

return Symbol{}, false
Expand Down Expand Up @@ -5075,6 +5075,5 @@ get_document_position_node :: proc(
case ^ast.Or_Return_Expr:
get_document_position(n.expr, position_context)
case:
log.warnf("Unhandled node kind: %T", n)
}
}
4 changes: 3 additions & 1 deletion src/server/clone.odin
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,10 @@ clone_node :: proc(
case ^Type_Assertion:
r.expr = clone_type(r.expr, allocator, unique_strings)
r.type = clone_type(r.type, allocator, unique_strings)
case ^Relative_Type:
r.tag = clone_type(r.tag, allocator, unique_strings)
r.type = clone_type(r.type, allocator, unique_strings)
case:
//fmt.logf("Unhandled node kind: %T", r)
}

return res
Expand Down
1 change: 0 additions & 1 deletion src/server/collector.odin
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,5 @@ replace_package_alias_node :: proc(
case ^Multi_Pointer_Type:
replace_package_alias(n.elem, package_map, collection)
case:
log.warnf("Replace Unhandled node kind: %T", n)
}
}
2 changes: 0 additions & 2 deletions src/server/semantic_tokens.odin
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,6 @@ visit_node :: proc(

visit(n.body, builder, ast_context)
case:
//log.errorf("unhandled semantic token node %v", n);
//panic(fmt.tprintf("Missed semantic token handling %v", n));
}
}

Expand Down

0 comments on commit 1be454a

Please sign in to comment.