improved likely_repl composability by taking in the ast instead of the source code