From 5e4dc87ffec7f87bbf3ebfcf256777ad773e8450 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 14 Mar 2020 16:47:38 +0100 Subject: cache: replace the all-in-one query parser by a complete one with AST/lexer/parser --- termui/bug_table.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'termui/bug_table.go') diff --git a/termui/bug_table.go b/termui/bug_table.go index 41aa4e83..74f92826 100644 --- a/termui/bug_table.go +++ b/termui/bug_table.go @@ -12,6 +12,8 @@ import ( "github.com/MichaelMure/git-bug/cache" "github.com/MichaelMure/git-bug/entity" + "github.com/MichaelMure/git-bug/query" + "github.com/MichaelMure/git-bug/query/ast" "github.com/MichaelMure/git-bug/util/colors" ) @@ -26,7 +28,7 @@ const defaultQuery = "status:open" type bugTable struct { repo *cache.RepoCache queryStr string - query *cache.Query + query *ast.Query allIds []entity.Id excerpts []*cache.BugExcerpt pageCursor int @@ -34,14 +36,14 @@ type bugTable struct { } func newBugTable(c *cache.RepoCache) *bugTable { - query, err := cache.ParseQuery(defaultQuery) + q, err := query.Parse(defaultQuery) if err != nil { panic(err) } return &bugTable{ repo: c, - query: query, + query: q, queryStr: defaultQuery, pageCursor: 0, selectCursor: 0, -- cgit From 314fcbb2293d869c33d6a76aedd148aedff6561d Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 22 Mar 2020 13:53:34 +0100 Subject: query: no need for an ast package --- termui/bug_table.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'termui/bug_table.go') diff --git a/termui/bug_table.go b/termui/bug_table.go index 74f92826..80d5ebcb 100644 --- a/termui/bug_table.go +++ b/termui/bug_table.go @@ -13,7 +13,6 @@ import ( "github.com/MichaelMure/git-bug/cache" "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/query" - "github.com/MichaelMure/git-bug/query/ast" "github.com/MichaelMure/git-bug/util/colors" ) @@ -28,7 +27,7 @@ const defaultQuery = "status:open" type bugTable struct { repo *cache.RepoCache queryStr string - query *ast.Query + query *query.Query allIds []entity.Id excerpts []*cache.BugExcerpt pageCursor int -- cgit