Parsing scala 3 code from a String into Scala 3 AST at runtime

My goal is to get Scala 3 code as a String and to parse it into Abstract Syntax Tree for Scala 3 at runtime. In the process if the code has compilation errors, I should get that as part of some exception. The larger goal is to end up with Expr[T] if the scala code is valid and execute it by splicing in the right bits(I have this part covered).

More detailed Q at StackOverflow - reflection - Parsing scala 3 code from a String into Scala 3 AST at runtime - Stack Overflow

2 Likes