Browse files

Miscellaneous fixes to get STD/tryfile.exe working again

  • Loading branch information...
1 parent 0307722 commit 589fce1fde41d147393bbede231faea684d2c6a4 @sorear committed Dec 23, 2010
Showing with 13 additions and 2 deletions.
  1. +2 −1 lib/CLRBackend.cs
  2. +3 −0 lib/Cursor.cs
  3. +2 −0 lib/Kernel.cs
  4. +5 −0 test2.pl
  5. +1 −1 v6/tryfile
View
3 lib/CLRBackend.cs
@@ -109,6 +109,7 @@ class Reader {
switch (input[ix+1]) {
case '/': i = '/'; break;
case '\\': i = '\\'; break;
+ case '"': i = '"'; break;
case 't': i = '\t'; break;
case 'r': i = '\r'; break;
case 'n': i = '\n'; break;
@@ -798,7 +799,7 @@ sealed class Tokens {
n["Str"] = typeof(LADStr).GetConstructor(new Type[] { String });
n["Param"] = typeof(LADParam).GetConstructor(new Type[] { String });
n["Method"] = typeof(LADMethod).GetConstructor(new Type[] { String });
- n["ProtoRegex"] = typeof(LADStr).GetConstructor(new Type[] { String });
+ n["ProtoRegex"] = typeof(LADProtoRegex).GetConstructor(new Type[] { String });
n["StrNoCase"] = typeof(LADStrNoCase).GetConstructor(new Type[] { String });
n["Imp"] = typeof(LADImp).GetConstructor(new Type[] { });
n["Dot"] = typeof(LADDot).GetConstructor(new Type[] { });
View
3 lib/Cursor.cs
@@ -1370,6 +1370,9 @@ public class Lexer {
if (lc.repl_methods.Contains(u))
goto anew;
}
+ if (LtmTrace)
+ Console.WriteLine("Reused {0} alternation lexer for {1} in {2}",
+ title, lc.parent.mo.name, kl.name);
return lc.nfas[lads] = ret;
}
anew:
View
2 lib/Kernel.cs
@@ -1021,6 +1021,8 @@ class IxListAtPos : IndexHandler {
Kernel.RunInferior(os.InvokeMethod(Kernel.GetInferiorRoot(),
"eager", new Variable[] { obj }, null));
}
+ if (ix < 0)
+ return Kernel.NewROScalar(Kernel.AnyP);
if (items.Count() <= ix) {
if (extend) {
return new SimpleVariable(true, false, Kernel.AnyMO,
View
5 test2.pl
@@ -47,6 +47,11 @@
INIT $str ~= 4;
is $str, '2413', 'INIT blocks run in correct order';
+ my @arr;
+ my $ix = -1;
+ ok !(defined @arr[$ix]), "can index before arrays to get undef";
+}
+
#is $?FILE, 'test.pl', '$?FILE works';
#is $?ORIG.substr(0,5), '# vim', '$?ORIG works';
View
2 v6/tryfile
@@ -28,7 +28,7 @@ augment class List {
method push(\|$args) { Q:CgOp {
(letn iter (vvarlist_from_fvarlist (unbox fvarlist (@ {$args})))
targ (getslot rest vvarlist (@ {self}))
- (vvarlist_shift (l iter))
+ (sink (vvarlist_shift (l iter)))
(ternary (== (i 0) (vvarlist_count (l targ)))
(l targ (getslot items vvarlist (@ {self})))
(prog))

0 comments on commit 589fce1

Please sign in to comment.