[t/spec] fix svn props
[pugs.git] / misc / STD_red / README
blob90e010f005a9ffbe2366302739691062705c8e49
1 A ruby transliteration of an old src/perl6/STD.pm
3 INSTALL
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/
12 $ ruby --version
13 ruby 1.9.0 (2007-12-25 revision 14709) [...]
15 Debian:
16  ruby1.9 libreadline-ruby1.9
17  But readline is now not required for most users.
19 Non-debian:
20  After installing ruby 1.9, you may have to create a ruby1.9 alias:
21  # ln -s ruby ruby1.9
24 Quick test:
25   ./STD_red_run -e 42
28 ======================================================================
29 The rest of this file is quite old, and of little interest.
32 EXAMPLE
33   ./STD_red_run -e 42
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)
36   ~5 minutes
38 NOTES
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.
45 Regex reminders
46   given { <a>+ <b>+ }
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
58 comments actually do.
60 Re backtracking,
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
66   case won't arise.
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.
72 RUBY YAML
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:
83 PATCH_START
84 --- yaml.rb.orig        2008-03-20 13:25:42.000000000 -0400
85 +++ yaml.rb     2008-03-20 13:26:03.000000000 -0400
86 @@ -386,6 +386,7 @@
87              end
88          oid =
89              case oid when Fixnum, NilClass; oid
90 +            when Hash,Array; oid.object_id
91              else oid = "#{oid.object_id}-#{oid.hash}"
92              end
93          out.emit( oid, &e )
94 PATCH_END