M
Mikael Brockman
Markus said:Markus said:PS: I still like the other idea (end [(module|class|def) [<NAME>]])
better. =)
I have not been able to assure myself that this could be done
without breaking anything (or at least, be done by me). I can see how
to do it, but I am just rusty enough on the guts of LR(1)/LALR(1)
parsers to be uneasy with the potential for conflicts.
Would you like me to pursue the idea? (With the caveat that my
experiments are for our enlightenment, and not meant to be
shaping/forcing ruby's development in any way that it does not wish to
go.)
Yeah. I'm toying around, taking a brief look at parse.y. I know a lot of
the theory of lexing/parsing. I've hand crafted small itsy-bitsy toy
lexer/parsers. But I'm mostly ignorant of what I'm looking at here.
I was thinking, focusing soley on class defs for the moment, that at the
start of a class definition it should be possible to store the class
name (cname?). Then at the close accept a optional 'class' keyword
following end, and then an optional identifier which must match the
stored cname. But I have no idea how to implement that at the moment.
I guess I should be reading the bison manual...
I realized in my sleep (yes, I literally do program in my sleep)
...