commit | d05ea952e37160e206b0bfc9ec86b179ecebf09c | [log] [tgz] |
---|---|---|
author | Marcel van Lohuizen <mpvl@golang.org> | Mon Feb 24 12:19:14 2020 +0100 |
committer | Marcel van Lohuizen <mpvl@golang.org> | Mon Feb 24 11:29:37 2020 +0000 |
tree | 7ef747917e1476aeb031e5142139b72513738ace | |
parent | 6ad04b3ffed260e9a5fd111c35bef2ee6320c7da [diff] |
cue/format: fix simplification bug Closes Issue #294 Change-Id: If7ac761d9cea5745f273f5c4ced11509d08efd80 Reviewed-on: https://cue-review.googlesource.com/c/cue/+/5061 Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/cue/format/simplify.go b/cue/format/simplify.go index 410911b..2152ac4 100644 --- a/cue/format/simplify.go +++ b/cue/format/simplify.go
@@ -95,7 +95,7 @@ case *ast.Ident: s.scope[x.Name] = true - case *ast.ListLit: + case *ast.ListLit, *ast.Interpolation: return false } return true
diff --git a/cue/format/testdata/simplify.golden b/cue/format/testdata/simplify.golden index 53f7a18..84506b9 100644 --- a/cue/format/testdata/simplify.golden +++ b/cue/format/testdata/simplify.golden
@@ -27,6 +27,9 @@ // TODO(legacy): Don't simplify "hidden" fields for now. "_foo": 3 +// Issue #294 +"\("x")": "x" + x: { @tag0(foo) r1: baz1
diff --git a/cue/format/testdata/simplify.input b/cue/format/testdata/simplify.input index d642ae1..271c6a0 100644 --- a/cue/format/testdata/simplify.input +++ b/cue/format/testdata/simplify.input
@@ -29,6 +29,9 @@ // TODO(legacy): Don't simplify "hidden" fields for now. "_foo": 3 +// Issue #294 +"\("x")": "x" + x: { @tag0(foo) r1: baz1