MCPcopy Create free account
hub / github.com/despiteallobjections/amigo / typeInstance

Method typeInstance

syntax/parser.go:1340–1358  ·  view source on GitHub ↗
(typ Expr)

Source from the content-addressed store, hash-verified

1338}
1339
1340func (p *parser) typeInstance(typ Expr) Expr {
1341 if trace {
1342 defer p.trace("typeInstance")()
1343 }
1344
1345 pos := p.pos()
1346 p.want(_Lbrack)
1347 x := new(IndexExpr)
1348 x.pos = pos
1349 x.X = typ
1350 if p.tok == _Rbrack {
1351 p.syntaxError("expecting type")
1352 x.Index = p.badExpr()
1353 } else {
1354 x.Index, _ = p.typeList()
1355 }
1356 p.want(_Rbrack)
1357 return x
1358}
1359
1360// If context != "", type parameters are not permitted.
1361func (p *parser) funcType(context string, tparamList *[]*Field) *FuncType {

Callers 1

qualifiedNameMethod · 0.95

Calls 7

traceMethod · 0.95
posMethod · 0.95
wantMethod · 0.95
syntaxErrorMethod · 0.95
badExprMethod · 0.95
typeListMethod · 0.95
newFunction · 0.50

Tested by

no test coverage detected