| 920 | } |
| 921 | |
| 922 | func (p *codeParser) parsePartialKeyword() *nodePartial { |
| 923 | // enter function one past the "partial" IDENT token |
| 924 | // FIXME(paulsmith): we are currently requiring that the name of the |
| 925 | // partial be a valid Go identifier, but there is no reason that need be |
| 926 | // the case. authors may want to, for example, have a name that is contains |
| 927 | // dashes or other punctuation (which would need to be URL-escaped for the |
| 928 | // routing of partials). perhaps a string is better here. |
| 929 | if p.peek().tok != token.IDENT { |
| 930 | p.errorf("expected IDENT, got %s", p.peek().tok.String()) |
| 931 | } |
| 932 | result := &nodePartial{name: p.peek().lit} |
| 933 | result.pos.start = p.parser.offset |
| 934 | p.advance() |
| 935 | result.pos.end = p.parser.offset |
| 936 | result.block = p.parseStmtBlock() |
| 937 | return result |
| 938 | } |
| 939 | |
| 940 | func (p *codeParser) parseCodeBlock() *nodeGoCode { |
| 941 | result := &nodeGoCode{context: inlineGoCode} |