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 b6c46148e IDefinition: add getEndLine() and getEndColumn(), similar to 
ISourceLocation
b6c46148e is described below

commit b6c46148e635756c363beeb211728620cbc5f128
Author: Josh Tynjala <[email protected]>
AuthorDate: Tue Apr 4 08:31:36 2023 -0700

    IDefinition: add getEndLine() and getEndColumn(), similar to ISourceLocation
    
    Workaround until it's available: getNode().getEndLine() and 
getNode().getEndColumn()
---
 .../royale/compiler/definitions/IDefinition.java     | 16 ++++++++++++++++
 .../internal/definitions/DefinitionBase.java         | 20 ++++++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git 
a/compiler-common/src/main/java/org/apache/royale/compiler/definitions/IDefinition.java
 
b/compiler-common/src/main/java/org/apache/royale/compiler/definitions/IDefinition.java
index 89bfd78c3..95c8362de 100644
--- 
a/compiler-common/src/main/java/org/apache/royale/compiler/definitions/IDefinition.java
+++ 
b/compiler-common/src/main/java/org/apache/royale/compiler/definitions/IDefinition.java
@@ -101,6 +101,22 @@ public interface IDefinition
      * @return An <code>int</code> for the column number.
      */
     int getColumn();
+    
+    /**
+     * Gets the local line number of the end of the entire definition (not just
+     * the name). It is zero-based.
+     * 
+     * @return An <code>int</code> for the line number.
+     */
+    int getEndLine();
+
+    /**
+     * Gets the local column number of the end of the entire definition (not
+     * just the name). It is zero-based.
+     * 
+     * @return An <code>int</code> for the column number.
+     */
+    int getEndColumn();
 
     /**
      * Gets the absolute starting offset of the entire definition (not just the
diff --git 
a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/DefinitionBase.java
 
b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/DefinitionBase.java
index 27f617d6c..640ed320a 100644
--- 
a/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/DefinitionBase.java
+++ 
b/compiler/src/main/java/org/apache/royale/compiler/internal/definitions/DefinitionBase.java
@@ -413,6 +413,26 @@ public abstract class DefinitionBase implements 
IDocumentableDefinition, IDefini
         return node.getColumn();
     }
 
+    @Override
+    public int getEndLine()
+    {
+        final IDefinitionNode node = getNode();
+        if (node == null)
+            return UNKNOWN;
+
+        return node.getEndLine();
+    }
+
+    @Override
+    public int getEndColumn()
+    {
+        final IDefinitionNode node = getNode();
+        if (node == null)
+            return UNKNOWN;
+
+        return node.getEndColumn();
+    }
+
     @Override
     public int getAbsoluteStart()
     {

Reply via email to