MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / opcode

Method opcode

utils/vscode/src/parser/parser.go:637–645  ·  view source on GitHub ↗

opcode returns the schema.Opcode for the i'th token, or nil if the i'th token does not represent an opcode.

(i int)

Source from the content-addressed store, hash-verified

635// opcode returns the schema.Opcode for the i'th token, or nil if the i'th token
636// does not represent an opcode.
637func (p *parser) opcode(i int) *schema.Opcode {
638 if tok := p.ident(i); tok != nil {
639 name := tok.Text(p.lines)
640 if inst, found := schema.Opcodes[name]; found {
641 return inst
642 }
643 }
644 return nil
645}
646
647// operator returns the operator for the i'th token, or and empty string if the
648// i'th token is not an operator.

Callers 1

instructionMethod · 0.95

Calls 2

identMethod · 0.95
TextMethod · 0.45

Tested by

no test coverage detected