Illegal Character "." - 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: Help & Support (https://www.boriel.com/forum/forumdisplay.php?fid=16) +---- Thread: Illegal Character "." (/showthread.php?tid=243) |
Illegal Character "." - britlion - 06-16-2010 I was playing with putChars to tighten it and add attribs... This comes back with "illegal character "." in line 52. There is indeed one in that line. It's in a comment. If you remove it (I already removed all the others) it freaks into "Too many errors. Giving up". Line 52: ; gets screen address in HL, and bytes address in DE. [<<<< This . is apparently an error] Copies the 8 bytes to the screen I have no idea why! Code: SUB Baspaint (x as uByte,y as uByte, width as uByte, height as uByte, attribute as ubyte) Re: Illegal Character "." - boriel - 06-16-2010 I saved your program as "dotbug.bas". Compiling it, gives the following errors: Quote:dotbug.bas:23: Syntax Error. Unexpected token 'a' <ID>The 1st error says It gets an "unexpected 'a' token". And this is your code: britlion Wrote:This is because you forgot to add "ASM" in line 21, so the compiler thinks it's still parsing in BASIC context. Hence the syntax errors. The "dot error" is because in BASIC context, ; does not comment the line (as you already know). The compiler cannot report "You forgot to start 'ASM'". In fact this is why you have to write it yourself. Instead of focusing in the last error, you should pay attention to the 1st one. In many compilers, the 1st error reported is usually the most important one as subsequent errors might be a consequence of the 1st one. Re: Illegal Character "." - britlion - 06-16-2010 Ahh, bitten by the IDE. In the default setup, if I'd seen that list, I'd have been much clearer. You're absolutely right - error treacing should go back to the source; but in tommygun all I could see was the last one. *ahem*. My real error was assuming it was the only one, since I got used to it tending towards issuing single errors and stopping - and in fact it only does seem to stop at the "." characters before calling it a failed build. I was sure I'd made a programming error - I just couldn't see why it lead to that statement. It was a head scratcher - especially since the code was a move-around to speed it up; and it ought to work. And in fact, with "asm" in line 21, it does. :-) Thanks for looking at it, Boriel. I do appreciate it, even if it makes me look like an idiot :-) Re: Illegal Character "." - boriel - 06-16-2010 Tommy Gun Reported just the last one??? Ok, there are a flag to tell the compiler to output only the first N errors. I will check if that option is already enabled in the command line (the feature is internally implemented). Then you should configure TommyGun to invoke the compiler with --max-errors=N (or the like). Re: Illegal Character "." - britlion - 06-16-2010 Nono - ZXB basic reported them all, but tommygun's default setup just leaves enough space to exactly see the last one. Scrolling up shows the others. It was me that was the idiot. I've made the window section a little bigger, and boom, there they all are. I was mislead by the "." problem, because I went to the line with a "." in it, and removed it, and the error moved. And given that was a comment, I was then baffled! Re: Illegal Character "." - LCD - 06-16-2010 This problem will not appear in BorIDE as it displays all errors or warnings sent by ZXBC in e editor gadget. |