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

Concatenated labels in TASM

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

A lot of code in tasm-lib creates labels this way:

let entrypoint = self.entrypoint_name();
let code = format!("
    {entrypoint}:
        call {entrypoint}_inner
        return
        
    {entrypoint}_inner:
        ...
        ...
        return
")

Which works fine for string concatenation. But when you do the same with the triton_asm! macro, the macro inserts a space between the entrypoint string and _inner forcing you to pre-declare all labels which, in my opinion, reduces readability.

Sword-Smith avatar Aug 15 '23 14:08 Sword-Smith