diff --git a/autotests/folding/d399388_dynamic_RegExpr.dyInclRl.fold b/autotests/folding/d399388_dynamic_RegExpr.dyInclRl.fold new file mode 100644 --- /dev/null +++ b/autotests/folding/d399388_dynamic_RegExpr.dyInclRl.fold @@ -0,0 +1,2 @@ +normal X:string other: normal X:string other: normal +normal X{string other} normal X:string other: normal diff --git a/autotests/html/d399388_dynamic_RegExpr.dyInclRl.html b/autotests/html/d399388_dynamic_RegExpr.dyInclRl.html new file mode 100644 --- /dev/null +++ b/autotests/html/d399388_dynamic_RegExpr.dyInclRl.html @@ -0,0 +1,9 @@ + + + +d399388_dynamic_RegExpr.dyInclRl + +
+normal X:string other: normal X:string other: normal
+normal X{string other} normal X:string other: normal
+
diff --git a/autotests/input/d399388_dynamic_RegExpr.dyInclRl b/autotests/input/d399388_dynamic_RegExpr.dyInclRl new file mode 100644 --- /dev/null +++ b/autotests/input/d399388_dynamic_RegExpr.dyInclRl @@ -0,0 +1,2 @@ +normal X:string other: normal X:string other: normal +normal X{string other} normal X:string other: normal diff --git a/autotests/input/syntax/d399388_dynamic_RegExpr.xml b/autotests/input/syntax/d399388_dynamic_RegExpr.xml new file mode 100644 --- /dev/null +++ b/autotests/input/syntax/d399388_dynamic_RegExpr.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/autotests/reference/d399388_dynamic_RegExpr.dyInclRl.ref b/autotests/reference/d399388_dynamic_RegExpr.dyInclRl.ref new file mode 100644 --- /dev/null +++ b/autotests/reference/d399388_dynamic_RegExpr.dyInclRl.ref @@ -0,0 +1,2 @@ +normal X:string other: normal X:string other: normal
+normal X{string other} normal X:string other: normal
diff --git a/src/lib/rule.cpp b/src/lib/rule.cpp --- a/src/lib/rule.cpp +++ b/src/lib/rule.cpp @@ -612,8 +612,10 @@ /** * no match + * the pattern of a dynamic regex depends on the previous contexts + * so that skipOffset cannot be computed */ - return MatchResult(offset, result.capturedStart()); + return MatchResult(offset, m_dynamic ? 0 : result.capturedStart()); }