Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Feb 8, 2020
1 parent 034ff8f commit cd228df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4430,6 +4430,7 @@ private void GenerateOneCode()

// runtextpos += len;
// i = 0;
// goto loopEnd;
Ldloc(_runtextposLocal!);
Ldloc(lenLocal);
Add();
Expand All @@ -4441,6 +4442,7 @@ private void GenerateOneCode()
// charFound:
// runtextpos += i;
// i = len - i;
// goto loopEnd;
MarkLabel(charFound);
Ldloc(_runtextposLocal!);
Ldloc(iLocal);
Expand Down Expand Up @@ -4519,6 +4521,7 @@ private void GenerateOneCode()
Stloc(_runtextposLocal!);
}

// loopEnd:
MarkLabel(loopEnd);
if (Code() != RegexCode.Oneloopatomic && Code() != RegexCode.Notoneloopatomic && Code() != RegexCode.Setloopatomic)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ private void Goto(int newpos)

private void Trackto(int newpos) => runtrackpos = runtrack!.Length - newpos;

/// <summary>Push onto the backtracking stack.</summary>
private int Trackpos() => runtrack!.Length - runtrackpos;

/// <summary>Push onto the backtracking stack.</summary>
private void TrackPush() => runtrack![--runtrackpos] = _codepos;

private void TrackPush(int i1)
Expand Down Expand Up @@ -161,10 +161,10 @@ private void SetOperator(int op)
/// <summary>Pop framesize items from the backtracking stack.</summary>
private void TrackPop(int framesize) => runtrackpos += framesize;

/// <summary>
/// Technically we are actually peeking at items already popped. So if you want to
/// get and pop the top item from the stack, you do `TrackPop(); TrackPeek();`.
/// </summary>
/// <summary>Peek at the item popped from the stack.</summary>
/// <remarks>
/// If you want to get and pop the top item from the stack, you do `TrackPop(); TrackPeek();`.
/// </remarks>
private int TrackPeek() => runtrack![runtrackpos - 1];

/// <summary>Get the ith element down on the backtracking stack.</summary>
Expand Down

0 comments on commit cd228df

Please sign in to comment.