diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2023-02-13 00:27:24 +0100 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2023-02-13 00:27:24 +0100 |
| commit | 8f6000d774ef583073baf8f11feb1d65e0753485 (patch) | |
| tree | 454050f26c84adab9676228391d9edc8eaaad644 | |
| parent | 74acfe4fa2fd9a1c8636c3666b8fea38ebdef727 (diff) | |
Add support for pointer type in get_node_length
| -rw-r--r-- | src/odin/printer/visit.odin | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/odin/printer/visit.odin b/src/odin/printer/visit.odin index 93b8cfb..92e378a 100644 --- a/src/odin/printer/visit.odin +++ b/src/odin/printer/visit.odin @@ -1822,9 +1822,17 @@ visit_expr :: proc( switch v.inlining { case .None: case .Inline: - document = cons(document, text("#force_inline"), break_with_no_newline()) + document = cons( + document, + text("#force_inline"), + break_with_no_newline(), + ) case .No_Inline: - document = cons(document, text("#force_no_inline"), break_with_no_newline()) + document = cons( + document, + text("#force_no_inline"), + break_with_no_newline(), + ) } document = cons(document, visit_expr(p, v.expr), text("(")) @@ -2681,6 +2689,8 @@ get_node_length :: proc(node: ^ast.Node) -> int { return 0 case ^ast.Paren_Expr: return 1 + get_node_length(v.expr) + 1 + case ^ast.Pointer_Type: + return 1 + get_node_length(v.elem) case ^ast.Selector_Expr: return( get_node_length(v.expr) + |