Skip to content

Commit

Permalink
cue/parser: remove last vestiges of <foo>: T
Browse files Browse the repository at this point in the history
This was once the notation for pattern constraints.

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Iccf91c81a13f30a2a44c7e7cf16a5ef12784ee7a
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/547011
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
  • Loading branch information
mpvl committed Feb 1, 2023
1 parent a6055ea commit fd170da
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cue/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,6 @@ func (p *parser) parseField() (decl ast.Decl) {
p.errf(l.Pos(), "square bracket must have exactly one element")
}

tok := p.tok
label, expr, _, ok := p.parseLabel(true)
if !ok || (p.tok != token.COLON && p.tok != token.OPTION) {
if expr == nil {
Expand All @@ -921,7 +920,7 @@ func (p *parser) parseField() (decl ast.Decl) {
m.Value = &ast.StructLit{Elts: []ast.Decl{field}}
m = field

if tok != token.LSS && p.tok == token.OPTION {
if p.tok == token.OPTION {
m.Optional = p.pos
p.next()
}
Expand Down

0 comments on commit fd170da

Please sign in to comment.