goctl features of 1.8.4-alpha (#4849)

This commit is contained in:
kesonan
2025-05-15 21:59:48 +08:00
committed by GitHub
parent 5048c350ae
commit 91ab1f6d2b
32 changed files with 11101 additions and 207 deletions

View File

@@ -1356,7 +1356,7 @@ func (p *Parser) parseKVExpression() *ast.KVExpr {
expr.Colon = p.curTokenNode()
// token STRING
if !p.advanceIfPeekTokenIs(token.STRING, token.RAW_STRING) {
if !p.advanceIfPeekTokenIs(token.STRING, token.RAW_STRING, token.IDENT) {
return nil
}

View File

@@ -130,6 +130,8 @@ func TestParser_Parse_infoStmt(t *testing.T) {
"author": `"type author here"`,
"email": `"type email here"`,
"version": `"type version here"`,
"enable": `true`,
"disable": `false`,
}
p := New("foo.api", infoTestAPI)
result := p.Parse()

View File

@@ -4,4 +4,6 @@ info(
author: "type author here"
email: "type email here"
version: "type version here"
enable: true
disable: false
)

View File

@@ -10,6 +10,8 @@ info ( // info stmt
author: "type author here"
email: "type email here"
version: "type version here"
enable: true
disable: false
)
type AliasInt int