Skip to content

Commit

Permalink
Port binding statement node functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesaorson committed Oct 1, 2022
1 parent 3b489a0 commit 66ed738
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion std/compiler/parser/ast/binding_statement_node.day
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
importc "parser/prelude.h"

fun ast_new_binding_statement_node (kind: AstNodeKind value: BindingStatementNodeUnion) ptr<BindingStatementNode> do
mut node: ptr<BindingStatementNode> <- new {BindingStatementNode
kind <- kind
value <- value
}
node
end

fun ast_free_binding_statement_node(node_ptr: ptr<AstNode>) int do
let node: AstNode <- (deref node_ptr)
let kind: AstNodeKind <- node.kind
Expand All @@ -17,4 +27,4 @@ fun ast_free_binding_statement_node(node_ptr: ptr<AstNode>) int do

(delete node_ptr)
0
end
end

0 comments on commit 66ed738

Please sign in to comment.