FAQ  •  Register  •  Login

Parser bug (*solved*)

<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Tue Feb 26, 2013 4:16 pm

Parser bug (*solved*)

Trying to compile the following code:
  Code:
#define BIFROSTstop() \
    asm               \
        call 65012    \
    end asm

10 PAUSE 0 : BIFROSTstop() : PAUSE 0

Produces the following error message:
illegal character ':'

However the following code compiles just fine:
  Code:
#define BIFROSTstop() \
    asm               \
        call 65012    \
    end asm

10 PAUSE 0 : BIFROSTstop()
   PAUSE 0

This bug is relevant because BIFROST* interface library for ZX BASIC makes extensive use of defines as above, for performance reasons. I'm sure this is not the only case. Therefore I'm concerned about users getting confused by weird errors like this.
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Tue Feb 26, 2013 6:38 pm

Re: Parser bug

Hmmm. It's a parser bug due to the mix of pre-processing and BASIC parsing. Will check it. Thanks! :roll:

Just for clarification: Not sure what you meant by "performance reasons", but obviosly using the colon or newline is the same for the compiler (there's no performance impact; it's just cosmetic syntax).

Will fix it asap.
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Tue Feb 26, 2013 7:03 pm

Re: Parser bug

boriel wrote:Just for clarification: Not sure what you meant by "performance reasons"

I just meant that using a "define" has better performance (less overhead) than calling a function or sub-routine, for simple cases like in this example above.

boriel wrote:Will fix it asap.

Thanks!
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Fri Mar 01, 2013 10:49 pm

Re: Parser bug

Okay. It was a bug in the preprocessor. Can you download version 1.3.0s979 and check it please? :roll:
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Sat Mar 02, 2013 2:32 am

Re: Parser bug

boriel wrote:Okay. It was a bug in the preprocessor. Can you download version 1.3.0s979 and check it please? :roll:

It's working now. Thank you!!!

Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO