MCPcopy Create free account
hub / github.com/adhocteam/pushup / parsePartialKeyword

Method parsePartialKeyword

parser.go:922–938  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

920}
921
922func (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
940func (p *codeParser) parseCodeBlock() *nodeGoCode {
941 result := &nodeGoCode{context: inlineGoCode}

Callers 1

parseCodeMethod · 0.95

Calls 5

peekMethod · 0.95
errorfMethod · 0.95
advanceMethod · 0.95
parseStmtBlockMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected