summaryrefslogtreecommitdiff
path: root/json
diff options
context:
space:
mode:
authorMartin Atkins <mart@degeneration.co.uk>2020-03-06 17:17:12 -0800
committerMartin Atkins <mart@degeneration.co.uk>2020-03-09 09:16:33 -0700
commitfee90926da530bf43feabe66348239c7c1dfd250 (patch)
treed00609fb1b4193e621024803b594fa20b9c8d957 /json
parent2cf95f2b60823e85a34924f3a35723a892ea6f92 (diff)
Use Unicode 12.0.0 grapheme cluster segmentation rules
HCL uses grapheme cluster segmentation to produce accurate "column" indications in diagnostic messages and other human-oriented source location information. Each new major version of Unicode introduces new codepoints, some of which are defined to combine with other codepoints to produce a single visible character (grapheme cluster). We were previously using the rules from Unicode 9.0.0. This change switches to using the segmentation rules from Unicode 12.0.0, which is the latest version at the time of this commit and is also the version of Unicode used for other purposes by the Go 1.14 runtime. HCL does not use text segmentation results for any purpose that would affect the meaning of decoded data extracted from HCL files, so this change will only affect the human-oriented source positions generated for files containing characters that were newly-introduced in Unicode 10, 11, or 12. (Machine-oriented uses of source location information are based on byte offsets and not affected by text segmentation.)
Diffstat (limited to 'json')
-rw-r--r--json/scanner.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/json/scanner.go b/json/scanner.go
index 912eabc..f66251f 100644
--- a/json/scanner.go
+++ b/json/scanner.go
@@ -3,7 +3,7 @@ package json
import (
"fmt"
- "github.com/apparentlymart/go-textseg/textseg"
+ "github.com/apparentlymart/go-textseg/v12/textseg"
"github.com/hashicorp/hcl/v2"
)