|
Post by rikky on May 20, 2020 22:54:41 GMT 1
Hello I'm using a Fossil from a few days ago. When I declare a variable A$ = "[" then this works perfectly. However when I declare it Globally, or Locally in a subroutine it gives an error: missing terminating character " Also "abc[123" etc causes this error. Rik.
|
|
|
Post by rikky on May 21, 2020 6:47:15 GMT 1
Okee, I'm sorry. This 'problem is easily solved by NOT taking the shortcut. So: GLOBAL Purple$ Purple$ = "\033[0;35m" Purple , by the way, seems to be a color that has been 'forgotten' in the Bacon colors. Rik.
|
|
|
Post by Pjot on May 21, 2020 7:40:19 GMT 1
Okee, I'm sorry. No need to, because you're right: this is a bug. If you would compile with the BaCon shell version then it would be fine. So the problem only occurs in the BaCon version of BaCon. The fix is available in fossil already. Your workaround also can be used, of course. Purple , by the way, seems to be a color that has been 'forgotten' in the Bacon colors. This is not true, all ANSI colors are defined. In BaCon, the ANSI sequence "\033[0;35m" is defined as: COLOR FG TO MAGENTA
Thanks for the bug report! Regards Peter
|
|
|
Post by rikky on May 24, 2020 11:13:41 GMT 1
I've encountered a few more bugs of this kind. I'm using the latest fossil from just a few moments ago. GLOBAL A$ = " ASSOC " GLOBAL A$ = " TYPE "
=> error: expected identifier or '(' before '=' token
and GLOBAL A$ = " RECORD " GLOBAL A$ = " ENDRECORD " GLOBAL A$ = "ENDRECORD "
=> error: expected ':', ',', ';', '}' or '__attribute__' before '=' token and GLOBAL A$ = " ARRAY "
=> missing terminating " character and GLOBAL A$ = " ARRAY " & \ "" => Syntax error: string array cannot have more than one dimension Rik.
|
|
|
Post by alexfish on May 24, 2020 12:48:44 GMT 1
and
GLOBAL A$ = "[]"
and if enclosed
GLOBAL A$ = "[test]"
BR Alex
|
|
|
Post by Pjot on May 24, 2020 17:48:38 GMT 1
Thanks guys, You're recursively testing BaCon code, and the flaws you're running into are caused by code which is there from the very beginning of BaCon (2009). At the time, the implementation did not have real tokenization functions and had to workaround this limitation by using a plain INSTR. But now BaCon has matured and actually can tokenize natively All the aforementioned issues are solved in the latest beta! Best regards Peter
|
|
|
Post by rikky on Aug 1, 2020 7:23:56 GMT 1
One more: (Using a Fossil from 5 minutes ago.) GLOBAL bla$ = "[" GLOBAL blabla$ = "]" GLOBAL blablabla$ = "=" GLOBAL blablablabla$ = "[]"
GLOBAL bloep$ = "[=" GLOBAL bloepbloep$ = "]="
GLOBAL plop$ = "=[" GLOBAL plopplop$ = "=]" GLOBAL plopplopplop$ = "=[]" gives => Compilation finished successfully. but: GLOBAL bloepbloepbloep$ = "[]=" gives => error: missing terminating " character Rik.
|
|
|
Post by vovchik on Aug 1, 2020 10:42:31 GMT 1
Dear Rik,
I think that "error" will be very difficult for Peter to replicate. The program compiles fine on Pi4 (Bullseye/Sid) and on Mint 19.2. And it runs without error on both platforms. I wonder whether Joe or Alex have that same problem on Pi3...
With kind regards, vovchik
|
|
|
Post by rikky on Aug 1, 2020 11:05:44 GMT 1
Well, I did a Fossil this morning. To be sure I am not using some older version, I now use '/home/pi/bacon_trunk/build/bacon' Chances that Peter accidentally put and old bacon in the Fossil are practically zero. This is the output: /home/pi/bacon_trunk/build/bacon /home/pi/test.bac WARNING: 8 temporary files found! Do you want to delete them ([y]/n)? y Temporary files were deleted. Converting '/home/pi/test.bac'... done, 26 lines were processed in 0.049 seconds. Compiling '/home/pi/test.bac'... cc -c test.bac.c Makefile.bacon:6: recipe for target 'test.bac.o' failed
/home/pi/test.bac:13:43: warning: missing terminating " character GLOBAL bloepbloepbloep$ = "[]=" ^ /home/pi/test.bac:13:43: error: missing terminating " character
INFO: see full error report (y/[n])? y In file included from test.bac.c:2:0: /home/pi/test.bac:13:43: warning: missing terminating " character GLOBAL bloepbloepbloep$ = "[]=" ^ /home/pi/test.bac:13:43: error: missing terminating " character GLOBAL bloepbloepbloep$ = "[]=" ^ In file included from test.bac.c:3:0: test.bac.string.h:1:1: error: expected expression before 'char' char* __b2c__stringarray[] = { ^~~~ /home/pi/test.bac: In function 'main': /home/pi/test.bac:13:35: warning: assignment makes pointer from integer without a cast [-Wint-conversion] GLOBAL bloepbloepbloep$ = "[]=" ^ /home/pi/test.bac:13:145: error: expected ';' before ')' token GLOBAL bloepbloepbloep$ = "[]=" ^ /home/pi/test.bac:13:145: error: expected statement before ')' token make: *** [test.bac.o] Error 1
To be certain I'll put all the temp files in an attachment. Attachments:test.tgz (23.63 KB)
|
|
|
Post by Pjot on Aug 1, 2020 12:40:49 GMT 1
Hi rikky, This is an issue with assigning values to strings during initialization. It can be worked around by splitting the code: GLOBAL plopplopplop$ plopplopplop$ = "=[]"
Anyway, the latest fossil code contains a fix. Thanks and regards,
Peter
|
|