From 0df18820211428e3e6dbb5df20c48140a15c65ce Mon Sep 17 00:00:00 2001 From: Pawel Murias Date: Fri, 3 Apr 2015 20:14:06 +0200 Subject: [PATCH] Pass test 78. Implement bos, eos regex anchors. --- src/vm/js/QAST/Compiler.nqp | 11 +++++++++++ src/vm/js/bin/run_tests | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/vm/js/QAST/Compiler.nqp b/src/vm/js/QAST/Compiler.nqp index 6aeb91000c..14e5d032e7 100644 --- a/src/vm/js/QAST/Compiler.nqp +++ b/src/vm/js/QAST/Compiler.nqp @@ -1193,6 +1193,17 @@ class RegexCompiler { ~ self.case($done); } + + method anchor($node) { + if $node.subtype eq 'eos' { + "if ($!pos < $!target.length) \{{self.fail}\}\n"; + } elsif $node.subtype eq 'bos' { + "if ($!pos != 0) \{{self.fail}\}\n"; + } else { + $!compiler.NYI("anchor type: {$node.subtype}"); + } + } + method pass($node) { my $name; diff --git a/src/vm/js/bin/run_tests b/src/vm/js/bin/run_tests index 1927774fdf..04ea2fbaef 100755 --- a/src/vm/js/bin/run_tests +++ b/src/vm/js/bin/run_tests @@ -1,3 +1,3 @@ #!/bin/bash # 19 and 30 where moved out as they were parrot specific, 52,54 is missing, we can't pass 49 till we are bootstraped -prove "$@" -e './nqp-js' t/nqp/{01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,20,21,22,23,25,26,27,28,33,35,36,37,38,39,40,41,42,46,47,48,51,53,55,56,57,58,59,63,64,65,68,69,70,71,75,76,79,81,83,88,89,90,91,92,93,94,95}* t/js/getcomp-js.t t/qast/02* +prove "$@" -e './nqp-js' t/nqp/{01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,20,21,22,23,25,26,27,28,33,35,36,37,38,39,40,41,42,46,47,48,51,53,55,56,57,58,59,63,64,65,68,69,70,71,75,76,78,79,81,83,88,89,90,91,92,93,94,95}* t/js/getcomp-js.t t/qast/02*