projects
/
re2c
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
16a376b
)
Skeleton: respect fixed-length contexts.
author
Ulya Trofimovich
<skvadrik@gmail.com>
Mon, 14 Mar 2016 21:45:42 +0000
(21:45 +0000)
committer
Ulya Trofimovich
<skvadrik@gmail.com>
Mon, 14 Mar 2016 21:45:42 +0000
(21:45 +0000)
re2c/src/ir/skeleton/path.h
patch
|
blob
|
history
diff --git
a/re2c/src/ir/skeleton/path.h
b/re2c/src/ir/skeleton/path.h
index 5cb83d1aa5cbe9728a5d29f6b2ccd1ba047bdc0a..a3452fdf9bdba31c26ebc79b1749137f0995ab63 100644
(file)
--- a/
re2c/src/ir/skeleton/path.h
+++ b/
re2c/src/ir/skeleton/path.h
@@
-49,9
+49,14
@@
public:
}
size_t len_matching () const
{
- return rule && rule->ctx_len == ~0u
- ? ctx_pos
- : rule_pos;
+ if (rule) {
+ switch (rule->ctx_len) {
+ case 0: return rule_pos;
+ case ~0u: return ctx_pos;
+ default: return rule_pos - rule->ctx_len;
+ }
+ }
+ return 0;
}
rule_rank_t match () const
{