chore: coding style (#3959)

This commit is contained in:
Kevin Wan
2024-03-02 22:45:24 +08:00
committed by GitHub
parent e08ba2fee8
commit 45be48a4ee
10 changed files with 23 additions and 12 deletions

View File

@@ -1158,15 +1158,18 @@ func (p *Parser) parseAtServerKVExpression() *ast.KVExpr {
if !p.advanceIfPeekTokenIs(token.IDENT) {
return nil
}
pathText += p.curTok.Text
if p.peekTokenIs(token.SUB) { // 解析 abc-efg 格式
if p.peekTokenIs(token.SUB) { // parse abc-efg format
if !p.nextToken() {
return nil
}
pathText += p.curTok.Text
if !p.advanceIfPeekTokenIs(token.IDENT) {
return nil
}
pathText += p.curTok.Text
}
@@ -1203,6 +1206,7 @@ func (p *Parser) parseAtServerKVExpression() *ast.KVExpr {
return nil
}
}
if !p.nextToken() {
return nil
}
@@ -1263,15 +1267,18 @@ func (p *Parser) parseAtServerKVExpression() *ast.KVExpr {
if !p.advanceIfPeekTokenIs(token.IDENT) {
return nil
}
pathText += p.curTok.Text
if p.peekTokenIs(token.SUB) { // 解析 abc-efg 格式
if p.peekTokenIs(token.SUB) { // parse abc-efg format
if !p.nextToken() {
return nil
}
pathText += p.curTok.Text
if !p.advanceIfPeekTokenIs(token.IDENT) {
return nil
}
pathText += p.curTok.Text
}