* g4 code generation

* Update grammar

* g4 code generation

* fix #2108

* fix #2102

* Remove comments
This commit is contained in:
anqiansong
2022-07-20 22:49:41 +08:00
committed by GitHub
parent d9218e1551
commit 1b51d0ce82
24 changed files with 2481 additions and 2288 deletions

View File

@@ -125,6 +125,14 @@ func TestRoute(t *testing.T) {
},
}))
v, err = parser.Accept(fn, `post /1/2a/3b/4`)
assert.Nil(t, err)
route = v.(*ast.Route)
assert.True(t, route.Equal(&ast.Route{
Method: ast.NewTextExpr("post"),
Path: ast.NewTextExpr("/1/2a/3b/4"),
}))
v, err = parser.Accept(fn, `post /foo/foo-bar/:bar`)
assert.Nil(t, err)
route = v.(*ast.Route)