hlorenzi / customasm

💻 An assembler for custom, user-defined instruction sets! https://hlorenzi.github.io/customasm/web/
Apache License 2.0
715 stars 56 forks source link

Matched braces break recursive ruledefs on 0.13.6 #204

Closed PerkyElixir22 closed 4 months ago

PerkyElixir22 commented 5 months ago

On 0.13.6, recursive ruledefs (which do not seem to work at all on 0.13.4) do not work when using matched braces around them, giving a multiple matches with same encoding size error; this issue does not appear to be present on 0.13.5.

#ruledef Foo {
    f{e:u7} => 0`1 @ e`7
    f{e:u7}+{m:Foo} => m @ 1`1 @ e`7
}

#ruledef Bar {
    |{f:Foo}|   => f
    ){f:Foo}(   => f
    ]{f:Foo}[   => f
    ({f:Foo})   => f
    [{f:Foo}]   => f
}

     f1+f2+f3+f4    ; Works
    |f1+f2+f3+f4|   ; Works
    )f1+f2+f3+f4(   ; Works
    ]f1+f2+f3+f4[   ; Works
    (f1+f2+f3+f4)   ; Doesn't work on 0.13.6
    [f1+f2+f3+f4]   ; Doesn't work on 0.13.6