From 59811c41142f650c21992bfe97b71057d29db7d2 Mon Sep 17 00:00:00 2001 From: Jonah Jeleniewski Date: Tue, 4 Mar 2025 16:40:46 +1100 Subject: [PATCH] Fix file pointer errors around `>=` and `<=` tokens --- CHANGELOG.md | 4 ++++ .../src/main/antlr3/au/com/integradev/delphi/antlr/Delphi.g | 2 ++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d37c3a132..08595eba8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- File pointer errors around `>=` and `<=` tokens. + ## [1.14.0] - 2025-03-03 ### Added diff --git a/delphi-frontend/src/main/antlr3/au/com/integradev/delphi/antlr/Delphi.g b/delphi-frontend/src/main/antlr3/au/com/integradev/delphi/antlr/Delphi.g index e6a633975..b86bfea13 100644 --- a/delphi-frontend/src/main/antlr3/au/com/integradev/delphi/antlr/Delphi.g +++ b/delphi-frontend/src/main/antlr3/au/com/integradev/delphi/antlr/Delphi.g @@ -335,6 +335,8 @@ import org.apache.commons.lang3.StringUtils; CommonToken lastToken = (CommonToken) input.LT(-1); lastToken.setType(type); lastToken.setStartIndex(firstToken.getStartIndex()); + lastToken.setLine(firstToken.getLine()); + lastToken.setCharPositionInLine(firstToken.getCharPositionInLine()); return lastToken; }