![]() |
Small brackets-parsing glitch (*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: Small brackets-parsing glitch (*solved*) (/showthread.php?tid=315) |
Small brackets-parsing glitch (*solved*) - LTee - 02-23-2011 Messing around with some of my other code over lunchtime with the latest beta (2100), I discovered a small error when parsing brackets. Take a look at this code: Code: DIM test(10, 10) as UBYTE The final PRINT statement will not compile unless you remove the brackets from around the (y - 1). Strangely, the brackets seem to be okay if we're dealing with the first dimension of the array (so it's okay to have 'x - 1' in brackets), just not for the second. :-) Re: Small brackets-parsing glitch - LTee - 02-23-2011 Whoops, I forgot to mention that the compile error is this: Code: Error: syntax error. Unexpected token '(' [LLP] Re: Small brackets-parsing glitch - boriel - 02-23-2011 LTee Wrote:Whoops, I forgot to mention that the compile error is this:OMG! ![]() Try filtering it throug zxbpp: Code: zxbpp yourprogram.bas Update: Confirmed. It's the preprocessor :x :roll: Re: Small brackets-parsing glitch - LTee - 02-23-2011 Oops! Sorry! :-D Re: Small brackets-parsing glitch - boriel - 02-23-2011 Ok, seems to be fixed. As always, download 1.2.7-r2103 from here: <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Archive">http://www.boriel.com/wiki/en/index.php ... IC:Archive</a><!-- m --> Re: Small brackets-parsing glitch - LTee - 02-24-2011 That seems to have done the trick, boriel - code's compiling and running normally now! Many thanks, as usual! ![]() |