How to Implement Recursive data type
I want to Implement abstract syntax tree in mojo, so far no luck,
Something simple as this in C :
https://github.com/orangeduck/mpc/blob/master/mpc.h#L291
GitHub
mpc/mpc.h at master · orangeduck/mpc
A Parser Combinator library for C. Contribute to orangeduck/mpc development by creating an account on GitHub.
2 Replies
How could I create child1 without any children?
OK, I've done that now I could not implement add_child()
I'm getting this error:
I can not convert AST to value & register_passable, then I get an other error:
no matching function in call to 'init':
var child1 = AST()
~~~^~
candidate not viable: callee expects at least 1 argument, but 0 were specified
is there a way to use memory.unsafe.bitcast to solve this ?
Again I changed it and now getting new error, I can not post it here (I reached the limit)
I posted it on github discussion
https://github.com/modularml/mojo/discussions/1194
GitHub
How to Implement Recursive data type? · modularml mojo · Discussion...
NOTICE: I've read this post #69 anyway I want to Implement this with current unsafe features I want to Implement abstract syntax tree in mojo, so far no luck, Something simple as this in C : ht...