From: Charles Comstock Date: 2004-03-01T19:24:50+09:00 Subject: Re: perl6 grammar rules in ruby Simon Strandgaard wrote: > On Mon, 01 Mar 2004 02:11:52 -0600, Charles Comstock wrote: > [snip] > >>I think the lack of subroutine calls from the ruby regex engine would >>make it difficult to program outside of the interpreter. > > > I am working on a regexp engine, written entirely in Ruby. > Mark Sparshatt is working on a perl6 parser for the engine. > We plan to support ruby code inside regexp. > The reason I like the grammar usage is I don't mind embedding code inside of a grammar, but I don't like the idea of embedding code inside of a regex, because it just seems to go against the grain of what regex is intended for. > http://rubyforge.org/projects/aeditor/ > > What really drives me crazy, is that I keep thinking: That Ruby will > have perl6 regexp, even long before Perl gets them ;-) > Anyway its just syntactical sugar.. there is also an XML flavor. > I don't really want perl6 regex, I want perl6 grammars with embedded regex, I guess that's just a symantics issue, but really i'm more interested in embedded grammars then regex. > > >>Clearly the idea of including a bare regex system in >>the language is very powerful, as we have already included it in the >>language, but a grammar adds even more power and seems equally >>important. Plus if it is implemented correctly, it clearly extends to >>allowing many meta functions across ruby if the ruby grammar is >>specified internally. > > > At some point Ruby will switch it regexp engine from gnu to oniguruma. > Then an engine which is gnu compatible may become in handy. > > At the moment I am struggling with nested quantifiers.. (yes, I have been > busy with this task for more than 30 days). My goal is to pass ok in more > than 95% of the regexp-testcases in rubicon. Last time I checked, I used a > conceptual wrong design, but managed to pass 92.5% out of 1652 assertions. > > > >>I'm thinking about submitting an RCR on this, but thought I would ask >>everyone what they thought? >> > > > Not sure if I understand the proposal? The proposal was that Rite/Ruby 2.0 should have an embedded grammar system. It seems like an acceptable time to jump in and add it, or at the very least add the requisite keywords so it could be added later, thus allowing Rite to mostly freeze the syntax of the language. > -- > Simon Strandgaard