-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#12 Add changes to code tokenizer and expression tree code
- Loading branch information
1 parent
2f43450
commit c6a83b4
Showing
3 changed files
with
43 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package rule | ||
|
||
import "fmt" | ||
|
||
type expressionTree node | ||
|
||
type ExpressionTreeBuilder interface { | ||
BuildExpressionTree(variable, expression string) (expressionTree, error) | ||
} | ||
|
||
type expressionTreeBuilder struct { | ||
tokenizer Tokenizer | ||
} | ||
|
||
var _ ExpressionTreeBuilder = (*expressionTreeBuilder)(nil) | ||
|
||
func newCustomRulesTokenizer() *expressionTreeBuilder { | ||
return &expressionTreeBuilder{ | ||
tokenizer: &tokenizer{}, | ||
} | ||
} | ||
|
||
func (c *expressionTreeBuilder) BuildExpressionTree(variable, expression string) (expressionTree, error) { | ||
tokens, err := c.tokenizer.BuildTokens(variable, expression) | ||
if err != nil { | ||
return nil, fmt.Errorf("build tokens: %w", err) | ||
} | ||
|
||
return nil, nil | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters