diff --git a/src/grammar.ts b/src/grammar.ts index 82841993..48bb53fd 100644 --- a/src/grammar.ts +++ b/src/grammar.ts @@ -739,6 +739,10 @@ function _checkWhileConditions(grammar: Grammar, lineText: OnigString, isFirstLi } } } else { + if (DebugFlags.InDebugMode) { + console.log(' popping ' + whileRule.rule.debugName + ' - ' + whileRule.rule.debugWhileRegExp); + } + stack = whileRule.stack.pop(); break; } diff --git a/src/rule.ts b/src/rule.ts index 64bfc352..11ba5fcc 100644 --- a/src/rule.ts +++ b/src/rule.ts @@ -529,6 +529,14 @@ export class BeginWhileRule extends Rule { this._cachedCompiledWhilePatterns = null; } + public get debugBeginRegExp(): string { + return `${this._begin.source}`; + } + + public get debugWhileRegExp(): string { + return `${this._while.source}`; + } + public getWhileWithResolvedBackReferences(lineText: string, captureIndices: IOnigCaptureIndex[]): string { return this._while.resolveBackReferences(lineText, captureIndices); }