Closed rawsyntax closed 5 years ago
Hi, thanks for the issue :heart:
So TSL has two sets of string operators for "like":
1 - The SQL like: https://github.com/yaacov/tree-search-language/blob/master/pkg/tsl/consts.go#L33 https://github.com/yaacov/tree-search-language/blob/master/pkg/tsl/consts.go#L34
2 - The NoSQL regexp: RegexOp: https://github.com/yaacov/tree-search-language/blob/master/pkg/tsl/consts.go#L31
I did not implement all the operator in all the walkers ... , for example the SQL implementation did not implement the regexp
operator, while the mongo one will skip the like
.
./tsl-mem example use the semantic walker to implement an in memory database: https://github.com/yaacov/tree-search-language/blob/master/cmd/tsl_mem/main.go#L31
When giving semantic meaning to the operators in semantic pkg ( https://godoc.org/github.com/yaacov/tree-search-language/pkg/walkers/semantics ) I only implemented the Regexp operator:
In the function that handle string operators: https://github.com/yaacov/tree-search-language/blob/master/pkg/walkers/semantics/walk.go#L192 I only implemented: RegExp: https://github.com/yaacov/tree-search-language/blob/master/pkg/walkers/semantics/walk.go#L212
And like falls into unexpected literal here: https://github.com/yaacov/tree-search-language/blob/master/pkg/walkers/semantics/walk.go#L226
P.S.
This will also happen in the mongo walker: https://github.com/yaacov/tree-search-language/blob/master/pkg/walkers/mongo/walk.go#L79 That only implement Regexp: https://github.com/yaacov/tree-search-language/blob/master/pkg/walkers/mongo/walk.go#L110
But not in the SQL walker :smile: : https://github.com/yaacov/tree-search-language/blob/master/pkg/walkers/sql/walk.go#L139
@yaacov thanks! 🙏
Should the tsl_mem binary work with
like
? For example:I see it listed as part of the grammar and used with other tsl binaries