Closed Xisec closed 2 months ago
Hey @Xisec,
thanks for reporting. Sorry that it took a bit of time to address the issue. I had to essentially refactor parts of the transformer.
The issue related to the comment should be fixed now with version 0.7.0
. The example:
_eol = char(13)
_hexDigitMap = {}
for i in range(0, 15)
if i < 10 then
_hexDigitMap[str(i)] = i
else
_hexDigitMap[char(55 + i) // (lowercase hex digit)] = i <--- wrong brackets closure
_hexDigitMap[char(87 + i) // (uppercase hex digit)] = i <--- wrong brackets closure
end if
end for
should now result into
_eol = char(13)
_hexDigitMap = {}
for i in range(0, 15)
if i < 10 then
_hexDigitMap[str(i)] = i
else
_hexDigitMap[char(55 + i)] = i // (lowercase hex digit)
_hexDigitMap[char(87 + i)] = i // (uppercase hex digit)
end if
end for
Regarding your second report:
_escapeFrom = [
"\\",
"""",
char(8),
char(9),
char(10),
char(12),
char(13), <--- wrong comma
]
Unfortunately that is by design since MiniScript does not allow multiline arrays without tailing commas unless you would write:
test = [
"\\",
"""",
char(8),
char(9),
char(10),
char(12),
char(13)]
which wouldn't look too nice IMO.
Also a hint since you're building the code. I recommend for building to use either default or uglify since beautify is usually an option you would use in development phase. I for example only use the beautifying via the formatter which you can activate in your VSCode settings by for example activating format on save.
Closing issue for now. In case you're still experiencing issues feel free to reopen this issue.
Tried to build this code
With the following wrong results:
The problem solver if I move the "// (uppercase hex digit)]" comments out of the conflict line (up or down)