Skip to content

Commit 9c1e2c6

Browse files
authored
Remove 32 from token32, tokens32 and node32 (pointlander#167)
* Rename token32 to token * Remove shadowing by renaming print to printFunc * Rename receiver and function argument * Rename node32 to node * Rename tokens32 to tokens * Replace sort.Ints with slices.Sort * Use variable for same added token * Add comments for ansii control sequence
1 parent ff3929a commit 9c1e2c6

3 files changed

Lines changed: 109 additions & 103 deletions

File tree

grammars/calculatorast/calculator.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func (c *Calculator[_]) Eval() *big.Int {
1212
return c.Rulee(c.AST())
1313
}
1414

15-
func (c *Calculator[U]) Rulee(node *node32[U]) *big.Int {
15+
func (c *Calculator[U]) Rulee(node *node[U]) *big.Int {
1616
node = node.up
1717
for node != nil {
1818
switch node.pegRule {
@@ -24,7 +24,7 @@ func (c *Calculator[U]) Rulee(node *node32[U]) *big.Int {
2424
return nil
2525
}
2626

27-
func (c *Calculator[U]) Rulee1(node *node32[U]) *big.Int {
27+
func (c *Calculator[U]) Rulee1(node *node[U]) *big.Int {
2828
node = node.up
2929
var a *big.Int
3030
for node != nil {
@@ -45,7 +45,7 @@ func (c *Calculator[U]) Rulee1(node *node32[U]) *big.Int {
4545
return a
4646
}
4747

48-
func (c *Calculator[U]) Rulee2(node *node32[U]) *big.Int {
48+
func (c *Calculator[U]) Rulee2(node *node[U]) *big.Int {
4949
node = node.up
5050
var a *big.Int
5151
for node != nil {
@@ -70,7 +70,7 @@ func (c *Calculator[U]) Rulee2(node *node32[U]) *big.Int {
7070
return a
7171
}
7272

73-
func (c *Calculator[U]) Rulee3(node *node32[U]) *big.Int {
73+
func (c *Calculator[U]) Rulee3(node *node[U]) *big.Int {
7474
node = node.up
7575
var a *big.Int
7676
for node != nil {
@@ -87,7 +87,7 @@ func (c *Calculator[U]) Rulee3(node *node32[U]) *big.Int {
8787
return a
8888
}
8989

90-
func (c *Calculator[U]) Rulee4(node *node32[U]) *big.Int {
90+
func (c *Calculator[U]) Rulee4(node *node[U]) *big.Int {
9191
node = node.up
9292
minus := false
9393
for node != nil {
@@ -106,7 +106,7 @@ func (c *Calculator[U]) Rulee4(node *node32[U]) *big.Int {
106106
return nil
107107
}
108108

109-
func (c *Calculator[U]) Rulevalue(node *node32[U]) *big.Int {
109+
func (c *Calculator[U]) Rulevalue(node *node[U]) *big.Int {
110110
node = node.up
111111
for node != nil {
112112
switch node.pegRule {
@@ -122,7 +122,7 @@ func (c *Calculator[U]) Rulevalue(node *node32[U]) *big.Int {
122122
return nil
123123
}
124124

125-
func (c *Calculator[U]) Rulesub(node *node32[U]) *big.Int {
125+
func (c *Calculator[U]) Rulesub(node *node[U]) *big.Int {
126126
node = node.up
127127
for node != nil {
128128
switch node.pegRule {

peg.peg.go

Lines changed: 51 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)