QuTech-Delft / libqasm

libQASM: Library to parse cQASM files
https://arxiv.org/abs/1805.09607
Other
18 stars 16 forks source link

[Frontend] No AST variables gives a string instead of an array #251

Closed Siilwyn closed 4 weeks ago

Siilwyn commented 1 month ago

When the AST has no variables in the Program root we expect variables to an empty array []. Instead a string is given containing an empty array: "[]".

(Using analyze_string_to_json).

Siilwyn commented 1 month ago

Just realized there is a newer version, we are using v0.6.6 but unsure if we'll have to time to update. That said, this issue could be fixed.

rturrado commented 1 month ago

Thanks for opening the issue, @Siilwyn! I'll have a look at it.

rturrado commented 1 month ago

I've found the issue. It's in one of libqasm's dependencies, in tree-gen. When a field is empty, we are indeed writing "[]" instead of [].

I'll create a new tree-gen release with the fix, and try to use it in the next libqasm release.

rturrado commented 4 weeks ago

This bug should be fixed in libqasm/0.6.8.