I started out the day by looking through the RT queue for Rakudo. Two tickets were already dealt with, so I just closed those. Another was a bug report concerning assigning undef to typed variables. Doing:
my Int $x = undef;
Would give a type check failure. This is now resolved. Furthermore, if your type is a class name, then assigning undef at any point to it will result in it holding the protoobject for that class again. I also took a moment to post to Perl 6 Language to get some clarifications on what "my TypeName $x;" left $x being when $x was a role, subset type or a junction of types.
Last week I started getting grammars in place. I got so far as having the regex live in the correct namespaces, but that didn't make grammars at all class-like, which is how they should be. This week I set out to fix that. Grammars now get protoobjects too, which you can call
grammar Loads { regex Lots { \d+s } };
grammar Many is Loads { rule TOP { <Lots> of <Lots> } };
if "100s of 1000s" ~~ Many {
say $/; # 100s of 1000s
}
Having closed four RT tickets so far, I took a look through there to see what else there was. There was one that did most of what was needed to implement the
With that done, I spent a little time on the S12 tests. I added fudge directives to get one of the that failed to parse to do so, and added an extra test. I plan to add much more here and flesh out the tests quite a bit over time.
Turning back to the OO support, I did some updates to the grammar that both brought us closer to STD.pm - the official grammar - and added the ability to parse a range of extra things. The first grammar changes were related to method calling. Normally you call a method just with ".", but private methods are called with "!". Additionally, there are ways to call sets of methods with quantifiers (.?,
So, now there's a bunch of stubs in there for another bunch of OO features and, if nobody beats me to it, I'll be filling some of those out on my next Rakudo day, or maybe before then if time allows (though I'm moving apartment - and country - over the coming week, so I'm not expecting to have much time). A big thanks to Vienna.pm for funding today's work.
Grammar example not working (Score:1)
Re: (Score:1)
In interactive mode, if you try and do that it won't work out, since it doesn't recognize that an opening { means that it should wait for more input before attempting to parse. You need to change the last three lines to be on one, like:
if "100s of 1000s" ~~ Many { say $/ }
Otherwise, not sure why it isn't working for you - I've just svn up'd and it runs here (tried it in interactive mode and as a file
Re: (Score:1)
Re: (Score:1)
Sorry 'bout that. Seems HTML is harder than compiler writing...
Re: (Score:1)
BTW... (Score:1)
Re: (Score:1)
Re: (Score:1)
Thanks You! (Score:2)