Author Topic: Why does this not compile?  (Read 5374 times)

0 Members and 2 Guests are viewing this topic.

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Why does this not compile?
« on: March 29, 2011, 06:07:09 pm »
I was recently starting up some old projects again, and made a few changes.

The attached program will not compile (under Axe 0.5.0 and 0.5.1), it stops on the second pass, 93% finished with an 'UNDEFINED' error, with the cursor hereabouts:

Code: (Context) [Select]
Lbl MAP
ClrDraw
ClrDraw^^r
sub(RCT,1,1,94,62,1)
sub(RCT,3,3,90,58,1)
For(T,0,6)
    For(S,0,10)
        11*T+S+L1->W
        !If {W}/16-1
            !If rand^16
                4->{W}
            End
        Else
            {W}^16->{W}
        End
        
        Pt-Mask(S*8+4,T*8+4,{W}*16+Pic1)
    End
End
Return

Specifically, it stops on the Pt-Mask, right at the Pic1 part.  This puzzles me, since one of the first things I do is to explicitly store data to Pic1.

Attached is the 8xp and for convenience, a text file translation.
(I would also attach a screenie, but for some reason, Wabbitemu no longer seems to want to run apps, which is weird.)

Help?
« Last Edit: March 29, 2011, 07:35:10 pm by Michael_Lee »
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Why does this not compile?
« Reply #1 on: March 29, 2011, 06:10:42 pm »
It could be an error scrolling error.  :P
If it is, do you have RCT defined?
also, did you store data by accident into Str1 or something instead?


EDIT:  disregard.  I'm going to try this when I get home, I've looked at the source using SC already.
« Last Edit: March 29, 2011, 06:13:28 pm by yunhua98 »

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Why does this not compile?
« Reply #2 on: March 29, 2011, 06:13:04 pm »
What is RT?

And I checked several times to make sure that they matched - I tried changing both to Str8 or something several times, and all the other pointers seem to work (I tried commenting that line out - apart from the fact that I couldn't see my tiles, the game worked fine).
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Why does this not compile?
« Reply #3 on: March 29, 2011, 06:14:41 pm »
I meant RCT.  But you did define that...  Do you have any braces where they're not supposed to be?  As in, should {W} be W?

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Why does this not compile?
« Reply #4 on: March 29, 2011, 06:19:37 pm »
Well, I commented that single line out, and the game worked nearly perfectly (apart from not drawing what I wanted to draw).  I think I matched up all of my braces (I think), and it's probably not a problem with the specific version of Axe I'm using (I compiled previous versions fine, but after I made a few minor changes, this happened).
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Why does this not compile?
« Reply #5 on: March 29, 2011, 06:21:29 pm »
Do you have a slightly older version?  If not, do you remember what you changed?

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Why does this not compile?
« Reply #6 on: March 29, 2011, 06:24:31 pm »
Here is the last backup I have -- I don't think I modified it beyond recognition to the current one, but I did make a large amount of changes that still compiled correctly.  I don't remember exactly what changes I did that stopped it from compiling.
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Why does this not compile?
« Reply #7 on: March 29, 2011, 09:17:59 pm »
strange.  Is pic2 being defined as well?

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Why does this not compile?
« Reply #8 on: March 29, 2011, 09:20:24 pm »
It has to do with the brackets in any of the Pt commands.  I'm not sure how to fix it, but you could always do something like this:
{W}->A
Pt-Mask(S*8+4,T*8+4,A*16+Pic1)

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Why does this not compile?
« Reply #9 on: March 29, 2011, 09:22:23 pm »
After a bit of testing I found the problem, and I bet you'll never guess in what code I found it...



COMMENTS! You thought they didn't affect your program, but you were wrong! Apparently there's a very peculiar bug regarding multi-line comments for which I will make a post in the Bug Reports thread as soon as I'm done with this post. If the ending "..." for a multi-line comment has an odd number of blank lines immediately preceding it, the comment doesn't actually end! So although you thought the parser was doing this:
Code: [Select]
... [[START COMMENT]]
SOLID WALL
BREAK WALL
WALK FLOOR
INCREASE RADIUS

... [[END COMMENT]]

[7EFFFFFFFFFFFF7E→Pic1
[7EC39FBFFFFFFF7E
[7EC5A3A995C5A37E
[7EFFFFFFFFFFFF7E
[00242400423C0000
[FFDBDBFFBDC3FFFF
[003C525E7A4A3C00
[003C7E7E7E7E3C00]



... [[START COMMENT]]
P1
P2
P3
P4
BOMB SMALL
BOMB MED
BOMB LARGE
BOMB EXPLODE
TOMBSTONE
... [[END COMMENT]]

It was actually doing this:

Code: [Select]
... [[START COMMENT]]
SOLID WALL
BREAK WALL
WALK FLOOR
INCREASE RADIUS

... [[1 BLANK LINE ABOVE, DO NOTHING]]

[7EFFFFFFFFFFFF7E→Pic1
[7EC39FBFFFFFFF7E
[7EC5A3A995C5A37E
[7EFFFFFFFFFFFF7E
[00242400423C0000
[FFDBDBFFBDC3FFFF
[003C525E7A4A3C00
[003C7E7E7E7E3C00]



... [[3 BLANK LINES ABOVE, DO NOTHING]]
P1
P2
P3
P4
BOMB SMALL
BOMB MED
BOMB LARGE
BOMB EXPLODE
TOMBSTONE
... [[0 BLANK LINES ABOVE, END COMMENT]]


Very peculiar, indeed. You have to wonder how seemingly random bugs like this even come to be. :o

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Why does this not compile?
« Reply #10 on: March 29, 2011, 09:25:06 pm »
Very nice, Runer.  For the record, I fail. ;)
Kudos, Runer, great job. ;D

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Why does this not compile?
« Reply #11 on: March 29, 2011, 09:44:40 pm »
Runer, you are a genius and a wizard.

Thankyouthankyou.

And that is one of the weirdest bugs ever.
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.