From: Ulya Trofimovich Date: Mon, 14 Mar 2016 21:45:42 +0000 (+0000) Subject: Skeleton: respect fixed-length contexts. X-Git-Tag: 1.0~39^2~361 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87525eb8ea56eec27a3b51a4ec796b6b3564a5c8;p=re2c Skeleton: respect fixed-length contexts. --- diff --git a/re2c/src/ir/skeleton/path.h b/re2c/src/ir/skeleton/path.h index 5cb83d1a..a3452fdf 100644 --- 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 {