PDA

View Full Version : Multiline statement support



rokicki
02-15-2007, 07:14 AM
The current IDE does support multiline statements. Just use a multiline comment to connect lines:




a := b1 + (b2 << 1) + (b3 << 2) + (b4 << 3) + {
} (b5 << 4) + (b6 << 5) + (b7 << 6)




Is this "feature" going to continue to work with new versions of the IDE? Should I replicate this
behavior in my Spin compiler?

There are some other interesting oddities, for instance




a + = 3




uses the "+=" operator, and




a := 1and 5




is also valid (a space is not needed after numeric literals).

I'd be interested if these would be classified as bugs, or as just the way the parser works.

Phil Pilgrim (PhiPi)
02-15-2007, 08:45 AM
Wow! Great discovery! I really like the multiline thing. Even if it wasn't planned that way, it's a pleasing syntax. I hope it stays.

-Phil

QuattroRS4
02-15-2007, 08:46 AM
ditto - nice one Rokicki ..

Paul Baker
02-15-2007, 09:03 AM
Interesting, since the carriage return is encapsulated in the block comment it is removed by the parser, it is likely this will continue to be parsed this way since comments are stripped, though Im not the writer of the compiler so I can't state this catagorically.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker (mailto:pbaker@parallax.com)
Propeller Applications Engineer
[/url][url=http://www.parallax.com] (http://www.parallax.com)
Parallax, Inc. (http://www.parallax.com)

rokicki
02-15-2007, 09:18 AM
Another interesting thing is if a spin program starts with a CON block, the CON can be omitted; the first block is
always a CON if there is no other directive at the top.

I have to say I am impressed with the robustness of the IDE/compiler. Other than the few bugs I've posted in
the sticky threads at the top, it's pretty much handled everything I can throw at it (and I've been intentionally
pushing its limits and trying to break it).