diff options
author | Sérgio Queiroz <sqmedeiros@gmail.com> | 2017-12-28 15:45:29 -0300 |
---|---|---|
committer | Sérgio Queiroz <sqmedeiros@gmail.com> | 2017-12-28 15:45:29 -0300 |
commit | 261e41117c2ec8d50b9aff1ecaaa701d2af5c211 (patch) | |
tree | 834bdb33f8bad3692c392d96daca15218420dd0d /lpcode.c | |
parent | 59da25ff241a83d8139e41199ef7a23f6e17fa65 (diff) | |
download | lpeglabel-261e41117c2ec8d50b9aff1ecaaa701d2af5c211.tar.gz lpeglabel-261e41117c2ec8d50b9aff1ecaaa701d2af5c211.tar.bz2 lpeglabel-261e41117c2ec8d50b9aff1ecaaa701d2af5c211.zip |
When matching a predicate, the position of the farthest failure may not be the subject position where the predicate started to match
Diffstat (limited to 'lpcode.c')
-rw-r--r-- | lpcode.c | 2 |
1 files changed, 0 insertions, 2 deletions
@@ -759,7 +759,6 @@ static void codeand (CompileState *compst, TTree *tree, int tt) { | |||
759 | else */{ /* default: Choice L1; p1; BackCommit L2; L1: Fail; L2: */ | 759 | else */{ /* default: Choice L1; p1; BackCommit L2; L1: Fail; L2: */ |
760 | int pcommit; | 760 | int pcommit; |
761 | int pchoice = addoffsetinst(compst, IPredChoice); /* labeled failure */ | 761 | int pchoice = addoffsetinst(compst, IPredChoice); /* labeled failure */ |
762 | getinstr(compst, pchoice).i.aux = ANDPRED; | ||
763 | codegen(compst, tree, 0, tt, fullset); | 762 | codegen(compst, tree, 0, tt, fullset); |
764 | pcommit = addoffsetinst(compst, IBackCommit); | 763 | pcommit = addoffsetinst(compst, IBackCommit); |
765 | jumptohere(compst, pchoice); | 764 | jumptohere(compst, pchoice); |
@@ -862,7 +861,6 @@ static void codenot (CompileState *compst, TTree *tree) { | |||
862 | else { | 861 | else { |
863 | /* test(fail(p))-> L1; choice L1; <p>; failtwice; L1: */ | 862 | /* test(fail(p))-> L1; choice L1; <p>; failtwice; L1: */ |
864 | int pchoice = addoffsetinst(compst, IPredChoice); /* labeled failure */ | 863 | int pchoice = addoffsetinst(compst, IPredChoice); /* labeled failure */ |
865 | getinstr(compst, pchoice).i.aux = NOTPRED; | ||
866 | codegen(compst, tree, 0, NOINST, fullset); | 864 | codegen(compst, tree, 0, NOINST, fullset); |
867 | addinstruction(compst, IFailTwice, 0); | 865 | addinstruction(compst, IFailTwice, 0); |
868 | jumptohere(compst, pchoice); | 866 | jumptohere(compst, pchoice); |