Skip to content

Commit 82d0ad1

Browse files
cirrasfourls
authored andcommitted
Fix file position calculation for multiline string tokens
1 parent 4901ad3 commit 82d0ad1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Improve support for evaluating name references in compiler directive expressions.
1313

14+
### Fixed
15+
16+
- Incorrect file position calculation for multiline string tokens.
17+
1418
## [1.15.0] - 2025-04-03
1519

1620
### Added

delphi-frontend/src/main/java/au/com/integradev/delphi/antlr/ast/token/DelphiTokenImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ private void calculatePosition() {
8989
beginColumn = insertionToken.getBeginColumn();
9090
endLine = insertionToken.getEndLine();
9191
endColumn = insertionToken.getEndColumn();
92-
} else if (isComment() || isCompilerDirective()) {
92+
} else if (isComment()
93+
|| isCompilerDirective()
94+
|| tokenType == DelphiTokenType.MULTILINE_STRING) {
9395
TokenLocation location =
9496
new TokenLocation(token.getLine(), token.getCharPositionInLine(), token.getText());
9597
beginLine = location.startLine();

0 commit comments

Comments
 (0)