From #ruby-lang on Freenode IRC tonight:
[21:44] <manveru> Sonja:
http://github.com/shyouhei/ruby/blob/trunk/parse.y#L10106-10154
[21:44] <argv[0]> right. you either get "if" or you get "somethingelse",
but not both
[21:45] <zenspider> if you want both, you'll have to declare both
english and otherlanguage as keywords and then modify the grammar
productions to accept both
[21:46] <argv[0]> yea, that.
[21:46] <argv[0]> which is not quite as easy
[21:46] <zenspider> essentially: if expr then? expr => (if|fi) expr
(then|neht)?
[21:46] <zenspider> just a bit tedious considering how f'd up the yacc
file is
[21:47] <zenspider> but start with something that isn't replicated in C
like class or module
[21:47] <zenspider> experiment with that one change
[21:47] <zenspider> and then expand
[21:48] <zenspider> should all just be algebraic changes, substitute A|B
for all A
[21:50] <zenspider> looks like the 1.9 (trunk) version is very cleaned
up... keyword_elsif... very easy to track down all versions then
[21:51] <zenspider> yacc kinda sucks... but we're stuck with it
(*cough*for now*cough*)
[21:52] <zenspider> my algebraic statement above isn't quite that easy
since yacc doesn't support EBNF productions cleanly... but you'll get it
[22:06] <argv[0]> Sonja this is about as good as it gets without messing
with parse.y
http://gist.github.com/259256