opcode returns the schema.Opcode for the i'th token, or nil if the i'th token does not represent an opcode.
(i int)
| 635 | // opcode returns the schema.Opcode for the i'th token, or nil if the i'th token |
| 636 | // does not represent an opcode. |
| 637 | func (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. |
no test coverage detected