triton-vm icon indicating copy to clipboard operation
triton-vm copied to clipboard

Cannot use angle brackets for type hints

Open Sword-Smith opened this issue 1 year ago • 0 comments

I wrote this code:

let asm_annotation_str =
                format!("hint {var_name}: {data_type} = stack[0..{last_stack_for_value_plus_one}]");
            let asm_annotation = triton_asm!({ asm_annotation_str });

Where data_type is Vec<BFieldElement>. This fails with the following error:

called `Result::unwrap()` on an `Err` value: Error(VerboseError { errors: [("hint a: Vec<BFieldElement> = stack[0..1] ", Nom(Eof)), ("hint a: Vec<BFieldElement> = stack[0..1] ", Context("expecting label, instruction or eof"))] })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The assembly parser doesn't allow for angle brackets (> and <) in type names.

Sword-Smith avatar Jan 17 '24 11:01 Sword-Smith