ZoKrates icon indicating copy to clipboard operation
ZoKrates copied to clipboard

Incorrect block expression formatting in typed AST

Open dark64 opened this issue 2 years ago • 0 comments

Description

Add depth info to the expression part of the AST so we can print with proper indentation as we do with statements.

Steps to Reproduce

Compile the code below with --isolate-branches flag and with RUST_LOG set to trace

def main(bool a) -> field {
    return if a { 1f } else { 2f };
}

This currently prints as:

def main(bool a) -> field {
    return if a { 
1f 
} else { 
2f 
};
}

dark64 avatar Jun 14 '22 08:06 dark64