Skip to content

Commit

Permalink
cue: fix compilation bug using $foo identifiers
Browse files Browse the repository at this point in the history
Change-Id: I3d64316f11e12da8e7ffa617081a9843c052c1a6
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/4320
Reviewed-by: Marcel van Lohuizen <[email protected]>
  • Loading branch information
mpvl committed Dec 5, 2019
1 parent 630935e commit 13628f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmd/cue/cmd/testdata/script/export.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cue export ./hello
cmp stdout expect-stdout
-- expect-stdout --
{
"$type": "demo",
"message": "Hello World!"
}
-- hello/data.cue --
Expand All @@ -11,5 +12,6 @@ who :: "World"
-- hello/hello.cue --
package hello

$type: "demo"
message: "Hello \(who)!" // who declared in data.cue
-- hello/cue.mod --
2 changes: 1 addition & 1 deletion cue/ast/ident.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func ParseIdent(n *Ident) (string, error) {
}

for _, r := range ident {
if isLetter(r) || isDigit(r) || r == '_' {
if isLetter(r) || isDigit(r) || r == '_' || r == '$' {
continue
}
if r == '-' && quoted {
Expand Down

0 comments on commit 13628f1

Please sign in to comment.