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

Method switchStmt

syntax/parser.go:2419–2442  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2417}
2418
2419func (p *parser) switchStmt() *SwitchStmt {
2420 if trace {
2421 defer p.trace("switchStmt")()
2422 }
2423
2424 s := new(SwitchStmt)
2425 s.pos = p.pos()
2426
2427 s.Init, s.Tag, _ = p.header(_Switch)
2428
2429 p.async(func() {
2430 if !p.got(_Lbrace) {
2431 p.syntaxError("missing { after switch clause")
2432 p.advance(_Case, _Default, _Rbrace)
2433 }
2434 for p.tok != _EOF && p.tok != _Rbrace {
2435 s.Body = append(s.Body, p.caseClause())
2436 }
2437 s.Rbrace = p.pos()
2438 p.want(_Rbrace)
2439 })
2440
2441 return s
2442}
2443
2444func (p *parser) selectStmt() *SelectStmt {
2445 if trace {

Callers 1

stmtOrNilMethod · 0.95

Calls 11

traceMethod · 0.95
posMethod · 0.95
headerMethod · 0.95
asyncMethod · 0.95
gotMethod · 0.95
syntaxErrorMethod · 0.95
advanceMethod · 0.95
caseClauseMethod · 0.95
wantMethod · 0.95
newFunction · 0.50
appendFunction · 0.50

Tested by

no test coverage detected