TOPLLab / WARDuino-VSCode

🕵️ A VSCode debugger plugin for WARDuino.
Mozilla Public License 2.0
2 stars 2 forks source link

:bug: Fix `.wast` column sourcemap #119

Closed tolauwae closed 1 year ago

carllocos commented 1 year ago

So for a reason extractLineInfo stopped working because the JSON.parse was given an invalid json string. The strings are of the form { line: 5, col_start: 29, col_end: 38 } and miss the double quotes around the keys. I'm not sure why this became a problem since it used to be able to parse the string without double quotes :/. Anyways, my commit modifies the string to include the missing double quotes if necessary. It works for me now.

When time allows can you please check if it still works for you @tolauwae? Then I'll accept the PR.

tolauwae commented 1 year ago

Yes the changes to wabt gave invalid JSON. I had fixed this before with:

new Function(`return ${obj}`)

Since I was fixing the column info, I thought I could also fix this properly, so I updated the wabt tools. The submodule was also updated in this PR so it should work.

carllocos commented 1 year ago

@tolauwae so now WABT prints valid json? If so, then my commit 14ed230 is no longer needed. I will remove it then.