public void Les3PrettyPrinterDemo()
{
// Pretty printer demo
var code = Les3LanguageService.Value.Parse(
@".memory 1
.fn _sumIntegersDemo(input: i32, length: i32): i32 {
sum: i32
sum = 0
.block {
.br stop if input s< 1
sum = 0
.loop loop {
// I picked := for set_local and = for tee_local;
// feel free to vote your own preference.
$sum := i32[$input] + $sum
$input := $input + 4
.br loop if $length = $length + -1
}
stop:
}
sum // return value
}", msgs: ConsoleMessageSink.Value);
var pp = new Les3PrettyPrinter(null, new Les3PrinterOptions { IndentString = " " });
pp.PrintToConsole(code.Cast<ILNode>());
}