Skip to content

Commit

Permalink
chore: expose encode tokens on production rule to allow conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
viktordanov committed Oct 29, 2023
1 parent 1eaf9e8 commit 1eaf8ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lsystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (l *LSystem) encodeTokens() {

l.ByteRules = [255]ByteProductionRule{}
for t, rule := range l.Rules {
l.ByteRules[l.TokenBytes[t]] = rule.encodeTokens(l.TokenBytes)
l.ByteRules[l.TokenBytes[t]] = rule.EncodeTokens(l.TokenBytes)
}
}

Expand Down
2 changes: 1 addition & 1 deletion production_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type ByteProductionRule struct {
currentIndex int
}

func (r *ProductionRule) encodeTokens(tokenBytes map[Token]TokenStateId) ByteProductionRule {
func (r *ProductionRule) EncodeTokens(tokenBytes map[Token]TokenStateId) ByteProductionRule {
rule := ByteProductionRule{
Weights: make([]ByteWeightedRule, len(r.Weights), len(r.Weights)),
}
Expand Down

0 comments on commit 1eaf8ea

Please sign in to comment.