Draco-lang / Compiler

The compiler repository for the Draco programming language.
Apache License 2.0
74 stars 9 forks source link

Quoter tool #309

Open LPeter1997 opened 10 months ago

LPeter1997 commented 10 months ago

It's quite painful having to type out parse-tree expressions for a test-case (and eventually probably other things too). We should ship a tool that can dump Draco code as a syntax tree expression, similarly to Roslyn-quoter. For now it's enough if it only supports C# as the target language. I suggest using Scriban templates, so eventually when we do want Draco code to be emitted, we can do that.

The tool can be built into the compiler as a command or as a separate CLI tool. It would be nice to be able to ship this with the playground as well.

Kuinox commented 5 months ago

I think we can ship this tool in the vscode extension.

LPeter1997 commented 5 months ago

@Kuinox It would probably lie in the language server itself as a custom command or something, but the functionality itself should come from the core compiler itself, as it's the thing knowing the syntax tree API