Stream: t-compiler/help

Topic: How to convert TokenStream to AST


Derek (Dec 12 2019 at 06:11, on Zulip):

Hi, by using libsyntax, I got
let stream = source_file_to_stream(...)
for tokentree in stream.trees().
my question is how can I covert tokenStream or TokenTree into AST. Could anyone give some hint? thanks for you help!

oli (Dec 12 2019 at 07:56, on Zulip):

I suggest you use the syn crate, the compiler's parser is not really meant for external consumption

Last update: Apr 05 2020 at 01:30UTC