mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-08 15:39:59 +08:00
(goctl): fix prefix syntax (#4113)
This commit is contained in:
@@ -1247,6 +1247,34 @@ func (p *Parser) parseAtServerKVExpression() *ast.KVExpr {
|
||||
}
|
||||
}
|
||||
|
||||
valueTok.Type = token.PATH
|
||||
node := ast.NewTokenNode(valueTok)
|
||||
node.SetLeadingCommentGroup(leadingCommentGroup)
|
||||
expr.Value = node
|
||||
return expr
|
||||
} else if p.peekTokenIs(token.SUB) {
|
||||
for {
|
||||
if p.peekTokenIs(token.SUB) {
|
||||
if !p.nextToken() {
|
||||
return nil
|
||||
}
|
||||
|
||||
subTok := p.curTok
|
||||
if !p.advanceIfPeekTokenIs(token.IDENT) {
|
||||
return nil
|
||||
}
|
||||
|
||||
idTok := p.curTok
|
||||
valueTok = token.Token{
|
||||
Text: valueTok.Text + subTok.Text + idTok.Text,
|
||||
Position: valueTok.Position,
|
||||
}
|
||||
leadingCommentGroup = p.curTokenNode().LeadingCommentGroup
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
valueTok.Type = token.PATH
|
||||
node := ast.NewTokenNode(valueTok)
|
||||
node.SetLeadingCommentGroup(leadingCommentGroup)
|
||||
|
||||
Reference in New Issue
Block a user