You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2021/07/22 20:45:05 UTC

[royale-compiler] branch develop updated: RepairingTokenBuffer: fixed previous() returning position - 2 instead of position - 1

This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git


The following commit(s) were added to refs/heads/develop by this push:
     new b48a0cb  RepairingTokenBuffer: fixed previous() returning position - 2 instead of position - 1
b48a0cb is described below

commit b48a0cb0f8b65ee4f6da1cd375f2a5688d16347b
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Thu Jul 22 13:44:23 2021 -0700

    RepairingTokenBuffer: fixed previous() returning position - 2 instead of position - 1
    
    RepairingTokenBuffer is currently unused, so that's probably why this was missed.
---
 .../royale/compiler/internal/parsing/as/RepairingTokenBuffer.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/as/RepairingTokenBuffer.java b/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/as/RepairingTokenBuffer.java
index 2f085d3..0eddd0f 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/as/RepairingTokenBuffer.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/parsing/as/RepairingTokenBuffer.java
@@ -126,7 +126,7 @@ public class RepairingTokenBuffer extends BaseRepairingTokenBuffer implements IR
     @Override
     public ASToken previous()
     {
-        final int prevPos = position - 2;
+        final int prevPos = position - 1;
         if (prevPos < size && prevPos > 0)
             return tokens[prevPos];
         else