diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-04-30 18:23:40 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-04-30 18:23:40 -0300 |
| commit | 1cc484a05cf9c7da8c859f3f52ea5a85009c4509 (patch) | |
| tree | 68983c515343cb1759e6b94a14f911fa8405f0d7 /lpcode.c | |
| parent | eb8b906d5eb5113e7377f06afbfd641c1c5e6a1e (diff) | |
| download | lpeg-1cc484a05cf9c7da8c859f3f52ea5a85009c4509.tar.gz lpeg-1cc484a05cf9c7da8c859f3f52ea5a85009c4509.tar.bz2 lpeg-1cc484a05cf9c7da8c859f3f52ea5a85009c4509.zip | |
'nullable' ('checkaux') uses tag from 'verifyrule'
When checking whether a rule is nullable, 'checkaux' reuses tag
previously set by 'verifyrule'.
Diffstat (limited to 'lpcode.c')
| -rw-r--r-- | lpcode.c | 7 |
1 files changed, 6 insertions, 1 deletions
| @@ -139,7 +139,12 @@ int checkaux (TTree *tree, int pred) { | |||
| 139 | if (checkaux(sib2(tree), pred)) return 1; | 139 | if (checkaux(sib2(tree), pred)) return 1; |
| 140 | /* else return checkaux(sib1(tree), pred); */ | 140 | /* else return checkaux(sib1(tree), pred); */ |
| 141 | tree = sib1(tree); goto tailcall; | 141 | tree = sib1(tree); goto tailcall; |
| 142 | case TCapture: case TGrammar: case TRule: case TXInfo: | 142 | case TRule: |
| 143 | assert(tree->cap == RLNULL || tree->cap == RLNONNULL); | ||
| 144 | if (pred == PEnullable) | ||
| 145 | return (tree->cap == RLNULL); | ||
| 146 | /* else */ /* FALLTHROUGH */ | ||
| 147 | case TCapture: case TGrammar: case TXInfo: | ||
| 143 | /* return checkaux(sib1(tree), pred); */ | 148 | /* return checkaux(sib1(tree), pred); */ |
| 144 | tree = sib1(tree); goto tailcall; | 149 | tree = sib1(tree); goto tailcall; |
| 145 | case TCall: /* return checkaux(sib2(tree), pred); */ | 150 | case TCall: /* return checkaux(sib2(tree), pred); */ |
