报错
1 2
| illegal character U+005C '\' 在编程和文本处理中,`U+005C` 是一个 Unicode 编码,它对应的是反斜杠字符(backslash),即 `\`。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| global: { aaa: "111" bbb: "222" ccc: "333" ddd: "444" }
ARCH: "amd64"
if ARCH == "amd64" { aaa: \(global.aaa) bbb: \(global.bbb) } if ARCH == "arm64" { ccc: \(global.ccc) ddd: \(global.ddd) }
|
解决:加上引号
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| global: { aaa: "111" bbb: "222" ccc: "333" ddd: "444" }
ARCH: "amd64"
if ARCH == "amd64" { aaa: "\(global.aaa)" bbb: "\(global.bbb)" } if ARCH == "arm64" { ccc: "\(global.ccc)" ddd: "\(global.ddd)" }
|
工具
[cue工具](CUE Playground | CUE (cuelang.org))