diff options
author | Sergio Queiroz <sqmedeiros@gmail.com> | 2016-05-27 15:00:23 -0300 |
---|---|---|
committer | Sergio Queiroz <sqmedeiros@gmail.com> | 2016-05-27 15:00:23 -0300 |
commit | 06fcbfd8d3f1c1cd0ae76d726778cebc3bcde9bd (patch) | |
tree | f58ca4cceddb17e2cc61ac2cec22a9d2390777d9 /lpcode.c | |
parent | 49fa2fc52c6913abfce7d0cd5fac24b2c88bce05 (diff) | |
download | lpeglabel-06fcbfd8d3f1c1cd0ae76d726778cebc3bcde9bd.tar.gz lpeglabel-06fcbfd8d3f1c1cd0ae76d726778cebc3bcde9bd.tar.bz2 lpeglabel-06fcbfd8d3f1c1cd0ae76d726778cebc3bcde9bd.zip |
Fixing a bug reported by Matthew Allen.
Result of p = m.Lc(m.P"A", m.P(true), 1) + m.P("B")
was "nil" instead of "2"
Diffstat (limited to 'lpcode.c')
-rw-r--r-- | lpcode.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -192,10 +192,13 @@ int checkaux (TTree *tree, int pred) { | |||
192 | if (!checkaux(sib1(tree), pred)) return 0; | 192 | if (!checkaux(sib1(tree), pred)) return 0; |
193 | /* else return checkaux(sib2(tree), pred); */ | 193 | /* else return checkaux(sib2(tree), pred); */ |
194 | tree = sib2(tree); goto tailcall; | 194 | tree = sib2(tree); goto tailcall; |
195 | case TChoice: case TLabChoice: /* labeled failure */ | 195 | case TChoice: |
196 | if (checkaux(sib2(tree), pred)) return 1; | 196 | if (checkaux(sib2(tree), pred)) return 1; |
197 | /* else return checkaux(sib1(tree), pred); */ | 197 | /* else return checkaux(sib1(tree), pred); */ |
198 | tree = sib1(tree); goto tailcall; | 198 | tree = sib1(tree); goto tailcall; |
199 | case TLabChoice: /* labeled failure */ | ||
200 | /* in a labeled ordered choice we do not know whether sib2 will be evaluated */ | ||
201 | tree = sib1(tree); goto tailcall; | ||
199 | case TCapture: case TGrammar: case TRule: | 202 | case TCapture: case TGrammar: case TRule: |
200 | /* return checkaux(sib1(tree), pred); */ | 203 | /* return checkaux(sib1(tree), pred); */ |
201 | tree = sib1(tree); goto tailcall; | 204 | tree = sib1(tree); goto tailcall; |