1 A ruby transliteration of an old src/perl6/STD.pm
5 The release of ruby 1.9.0 (dated late December '07) is recommended.
6 It will not work with ruby 1.8. ruby svn HEAD is also not the right thing.
7 There used to be iffy support for 1.8, but adding utf handling broke it.
9 Ruby 1.9.1 has now been released, but has not yet been tested.
11 http://www.ruby-lang.org/en/news/2007/12/25/ruby-1-9-0-released/
13 ruby 1.9.0 (2007-12-25 revision 14709) [...]
16 ruby1.9 libreadline-ruby1.9
17 But readline is now not required for most users.
20 After installing ruby 1.9, you may have to create a ruby1.9 alias:
28 ======================================================================
29 The rest of this file is quite old, and of little interest.
35 time ((find ../../v6/v6-KindaPerl6/t/kp6/ -type f ; find ../../t/ -type f )| grep -v '\.svn' | sort | xargs -n 1 perl -e 'local $_=shift;exit if !/\.t$/;$r=system("./STD_red_run $_ > /dev/null 2>&1");print "",($r == 0 ? "-" : "X")," ",$_,"\n";' > test-status)
40 Debian (testing aka "Lenny") error:
41 `require': no such file to load -- readline (LoadError) from -e:1:in `<main>'
42 Means you don't have libreadline-ruby1.9.
43 But readline is now only loaded if you run the repl.
47 token: /^ <a>+: <b>+: $/
48 rule: /^ <.ws> <a>+: <.ws> <b>+: <.ws> $/
49 regex: /^ <a>+ <b>+ $/
50 which transliterate as
51 token: plusTOK{a} and plusTOK{b}
52 rule: wsp and plusTOK{a} and wsp and plusTOK{b} and wsp #handwritten rules
53 rule: plusTOK{a} and wsp and plusTOK{b} #in token rules #XXX hmm
54 regex: plusRX(lambda{ a }){ plusRX{ b }}
55 # but note, <a> can't be a regex - we won't backtrack into it.
57 There are lots of regex ruls. Only the two noted as backtracking in
61 plusRX et al, _do not backtrack into their subrules_.
62 We are simplifying implementation by noting there are tokens everywhere.
63 If there turns out to be a case of a regex with backtracking, containing
64 a subrule which is itself a regex with backtracking, then we'll need to
65 hand fudge passing a continuation to that subrule. Very hopefully, the
67 We're not making a regexp engine, nor a real Grammar.
68 We're simply trying to get the ability to parse static p6, by the
69 easiest possible development path.
74 Is not being used now, so you can ignore this section.
76 --yaml won't work under ruby 1.9 without a patch applied to 1.9's yaml.rb.
77 *** But --yaml isn't being used now, so this is no longer needed.
78 Error ruby/1.9.0/yaml.rb:391:in `hash': can't convert Hash into Integer (TypeError)
79 ruby 1.9.0 yaml has a bug. On some of Match objects, (eg, --yaml -e '3'),
80 .hash fails with : can't convert Hash into Integer (TypeError).
81 But 1.9's lookbehind provides 10x faster parsing than than our current 1.8 workaround.
82 So here is a patch to lib/ruby/1.9.0/yaml.rb:
84 --- yaml.rb.orig 2008-03-20 13:25:42.000000000 -0400
85 +++ yaml.rb 2008-03-20 13:26:03.000000000 -0400
89 case oid when Fixnum, NilClass; oid
90 + when Hash,Array; oid.object_id
91 else oid = "#{oid.object_id}-#{oid.hash}"