Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Allison (3003)

  (email not shown publicly)

Human (I think).

Journal of Allison (3003)

Tuesday February 14, 2006
12:00 AM

Punie do, if, unless

[ #28672 ]

Whoops, no journal entries in a while. Mostly I've been working on bug fixes. Not exactly progress on the Punie compiler, but I consider it progress, since one of the main goals of Punie is to give Parrot/PGE/TGE a workout.

Today I added simple do block support. One "ah-ha" moment in there resulted in me adding a new POST node type: Ops. This node is just a sequence of opcode statements, and the conversion to PIR flattens it out. The way TGE works at the moment, the code for dealing with a transformation that can return either a single opcode or multiple opcodes is a bit clunky. This happens when a single HLL statement breaks down into multiple assembly operations (like a block with multiple statements, or a single print of a list that turns into multiple independent print statements in POST). Adding POST::Ops means this fragmentation isn't an issue. The transformation always returns a single node, even if it's generating multiple opcodes. (I haven't decided if this is ultimately the right solution yet. It'll partly depend on how useful it proves to be across the rest of the language.)

I also added simple conditional support today, such as:

if (1) {
    print "hello world";

unless (0) {
    print "hello world";

It only supports simple values as conditional expressions so far (that's just about all Punie supports as expressions so far anyway). It also doesn't support else or elsif blocks yet. That's probably next. Although, it's also time to work on the operator precedence parser again, as Patrick pushed it two steps further while I was bug chasing. Decisions, decisions.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.