Boriel Basic Forum
Possible String issue? (*solved*) - Printable Version

+- Boriel Basic Forum (https://forum.boriel.com)
+-- Forum: Compilers and Computer Languages (https://forum.boriel.com/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://forum.boriel.com/forumdisplay.php?fid=11)
+---- Forum: Bug Reports (https://forum.boriel.com/forumdisplay.php?fid=15)
+---- Thread: Possible String issue? (*solved*) (/showthread.php?tid=329)

Pages: 1 2


Re: Possible String issue? - boriel - 2011-03-17

Please, download and check 1.2.8-s620 from the download page and tell me. :roll: This version fixes more than 10 bugs (well, not exactly) and generate much faster code. Still many fixes pending. :!:


Re: Possible String issue? - LTee - 2011-03-17

Thanks, boriel - downloading that now, I'll give it a test-run today.


Re: Possible String issue? - LTee - 2011-03-17

Hmm. I seem to be having problems compiling the example with arrays.

This code:
Code:
dim testglobal(5) as string dim pos as UBYTE cls pos = 1 testglobal(pos) = "global" print testglobal(pos) setlocal() print testglobal(pos) print "done" sub setlocal dim testlocal as string testlocal = "local" testglobal(pos) = testlocal print testlocal print testglobal(pos) end sub

... produces this error output:

Code:
Traceback (most recent call last): File "C:\program files\zxbasic\zxb.py", line 312, in <module> sys.exit(main(sys.argv)) # Exit File "C:\program files\zxbasic\zxb.py", line 265, in main asm_output = backend.emmit(MEMORY) File "C:\program files\zxbasic\backend\__init__.py", line 2384, in emmit output_join(output, QUADS[i.quad[0]][1](i)) File "C:\program files\zxbasic\backend\__array.py", line 391, in _astorestr raise InvalidIC(str(ins)) backend.errors.InvalidIC: Invalid intermediate code instruction: "('astorestr', '_testglobal', '#__LABEL0')"

Any ideas? The example without the arrays is compiling and running okay, as is the version with arrays indexed with literal numbers rather than with an array.

I'm using the zip package with python scripts this time, by the way.


Re: Possible String issue? - boriel - 2011-03-17

LTee Wrote:
Code:
Traceback (most recent call last): File "C:\program files\zxbasic\zxb.py", line 312, in <module> sys.exit(main(sys.argv)) # Exit File "C:\program files\zxbasic\zxb.py", line 265, in main asm_output = backend.emmit(MEMORY) File "C:\program files\zxbasic\backend\__init__.py", line 2384, in emmit output_join(output, QUADS[i.quad[0]][1](i)) File "C:\program files\zxbasic\backend\__array.py", line 391, in _astorestr raise InvalidIC(str(ins)) backend.errors.InvalidIC: Invalid intermediate code instruction: "('astorestr', '_testglobal', '#__LABEL0')"

Any ideas? The example without the arrays is compiling and running okay, as is the version with arrays indexed with literal numbers rather than with an array.

I'm using the zip package with python scripts this time, by the way.
Yep. It means the low level part of the compiler in charge of generating that instruction is not implemented yet :wink:


Re: Possible String issue? - LTee - 2011-03-17

I see! :-D

Apart from code which indexes arrays using variables, then.... seems good! Everything else seems to be compiling and running correctly.


Re: Possible String issue? - boriel - 2011-03-18

Okay. Please, download and try 1.2.8-s631 from the Download page and tell me. I think it works ok now... :roll:


Re: Possible String issue? - LTee - 2011-03-18

Brilliant! It all appears to be working perfectly now! Big Grin

Many, many thanks as usual, boriel!