AttributeError: 'SymbolSTRSLICE' object has... (*solved*) - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Bug Reports (https://www.boriel.com/forum/forumdisplay.php?fid=15) +---- Thread: AttributeError: 'SymbolSTRSLICE' object has... (*solved*) (/showthread.php?tid=203) |
AttributeError: 'SymbolSTRSLICE' object has... (*solved*) - programandala.net - 04-18-2010 For the second time, I get the following output (version 1.2.5): Quote:marcos$ zxb.py --tap --autorun --BASIC --sinclair colegio_erevest_4.bas I've searched for "mangled" in the forums, but there's no message about it. It seems it happens when no more syntax errors are found in the source, but I'm not sure. Any clue? Is it a compiler issue or is it caused by my program? Re: AttributeError: 'SymbolSTRSLICE' object has no attribute '_m - boriel - 04-18-2010 You should paste the code snippet producing this error, if possible. If you want your code not disclosed for whatever reason, please send it to me in a private message. Re: AttributeError: 'SymbolSTRSLICE' object has no attribute '_m - programandala.net - 04-18-2010 boriel Wrote:You should paste the code snippet producing this error, if possible. If you want your code not disclosed for whatever reason, please send it to me in a private message. No snippet... the program has more than 1500 lines I'll try to figure out what's the wrong piece and I will post it. Re: AttributeError: 'SymbolSTRSLICE' object has no attribute '_m - programandala.net - 04-18-2010 More clues: It happens with 1.2.5 and 1.2.6. It seems it happens when there are no more syntax errors in the code, but warnings don't make any difference: If I add a final line at the bottom of the source, to force a warning, the error happens anyway; but if the line creates a syntax error, the error doesn't happen. So it seems something is wrong in the next step, after the parsing. I'll comment out chunks of code, in order to find out any difference. Re: AttributeError: 'SymbolSTRSLICE' object has no attribute '_m - programandala.net - 04-18-2010 I've found out the line that caused the compiling error: Code: let ending = genderEnding(val(genderTypes(thing-firstPortableThing+1))) In fact the same calculation is used in two functions, with the same effect. The context is: Code: dim genderEnding(1 to 3) as string I isolated the function and the needed DIMs into another file, to debug it. Here you are the results, in chronological order. Every try is marked "!!!ERROR" or "!!!fine and then commented out: Code: dim genderEnding(1 to 3) as string I don't understand what's wrong in the code. I suspect it's a compiler issue. I think it has something to do with nesting, don't you think so? Re: AttributeError: 'SymbolSTRSLICE' object has no attribute '_m - boriel - 04-18-2010 programandala.net Wrote:I don't understand what's wrong in the code. I suspect it's a compiler issue. I think it has something to do with nesting, don't you think so?Your code is Ok! :!: It was a compiler bug and has been fixed. Please download 1.2.6r1542b and install. And please, CHECK the compiler is now working. The problem was in the VAL function: Code: REM This code crashes the compiler if version < 1.2.6 Re: AttributeError: 'SymbolSTRSLICE' object has no attribute '_m - programandala.net - 04-19-2010 boriel Wrote:Your code is Ok! :!: It was a compiler bug and has been fixed. Please download 1.2.6r1542b and install. Now it works fine. Thank you. I have succeeded in compiling my large program by the first time! No warning, no error, no message. It's great. The only inconvenience is the need to put some string functions at the top of the source. boriel Wrote:Download link: <!-- m --><a class="postlink" href="http://www.boriel.com/files/zxb/zxbasic-1.2.6r1542b.msi">http://www.boriel.com/files/zxb/zxbasic-1.2.6r1542b.msi</a><!-- m --> It seems the tar.gz is corrupted. I could'nt open it. I used the .zip instead. |