diff options
| author | Michael Williamson <mike@zwobble.org> | 2025-01-01 10:26:50 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2025-01-01 10:26:50 +0000 |
| commit | 061851e68fbe7656f9ee8174c74de03f4bbbe59f (patch) | |
| tree | bedff6f7b19ed08da8dff684458fa9fbba67f521 /src/main/java | |
| parent | 34a783f9a6a796bd2477f7596327867a9be3683c (diff) | |
Update JSON5 parser to use character instead of code point index
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/org/shedlang/compiler/config/json/Json5Source.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main/java/org/shedlang/compiler/config/json/Json5Source.java b/src/main/java/org/shedlang/compiler/config/json/Json5Source.java index 6b761a6a..409dc265 100644 --- a/src/main/java/org/shedlang/compiler/config/json/Json5Source.java +++ b/src/main/java/org/shedlang/compiler/config/json/Json5Source.java @@ -7,12 +7,9 @@ public class Json5Source { private Json5Source() {} public static Source fromSourceRange(Source fullSource, Json5SourceRange sourceRange) { - // TODO: decide whether we're using code points or code units, and make - // consistent (currently Shed sources use UTF-16 code units, JSON5 - // sources use code points) return fullSource.at( - sourceRange.startCodePointIndex(), - sourceRange.endCodePointIndex() + sourceRange.start().characterIndex(), + sourceRange.end().characterIndex() ); } } |
