| 904 | } |
| 905 | |
| 906 | func (p *codeParser) parseSectionKeyword() *nodeSection { |
| 907 | // enter function one past the "section" IDENT token |
| 908 | // FIXME(paulsmith): we are currently requiring that the name of the |
| 909 | // partial be a valid Go identifier, but there is no reason that need be |
| 910 | // the case. perhaps a string is better here. |
| 911 | if p.peek().tok != token.IDENT { |
| 912 | p.errorf("expected IDENT, got %s", p.peek().tok.String()) |
| 913 | } |
| 914 | result := &nodeSection{name: p.peek().lit} |
| 915 | result.pos.start = p.parser.offset |
| 916 | p.advance() |
| 917 | result.pos.end = p.parser.offset |
| 918 | result.block = p.parseStmtBlock() |
| 919 | return result |
| 920 | } |
| 921 | |
| 922 | func (p *codeParser) parsePartialKeyword() *nodePartial { |
| 923 | // enter function one past the "partial" IDENT token |