Remove the unused 'parent' param from the function newTerm().
This commit is contained in:
parent
775751c67b
commit
0a9543543d
2
ast.go
2
ast.go
@ -60,7 +60,7 @@ func (self *ast) addToken(tk *Token) (err error) {
|
||||
}
|
||||
|
||||
func (self *ast) addToken2(tk *Token) (t *term, err error) {
|
||||
if t = newTerm(tk, nil); t != nil {
|
||||
if t = newTerm(tk); t != nil {
|
||||
err = self.addTerm(t)
|
||||
} else {
|
||||
err = tk.Errorf("unexpected token %q", tk.String())
|
||||
|
@ -119,7 +119,7 @@ func (self *parser) parseFuncDef(scanner *scanner) (tree *term, err error) {
|
||||
for lastSym != SymClosedRound && lastSym != SymEos {
|
||||
tk = scanner.Next()
|
||||
if tk.IsSymbol(SymIdentifier) {
|
||||
param := newTerm(tk, nil)
|
||||
param := newTerm(tk)
|
||||
args = append(args, param)
|
||||
tk = scanner.Next()
|
||||
} else if itemExpected {
|
||||
|
@ -17,11 +17,10 @@ func registerTermConstructor(sym Symbol, constructor termContructor) {
|
||||
constructorRegistry[sym] = constructor
|
||||
}
|
||||
|
||||
func newTerm(tk *Token, parent *term) (inst *term) {
|
||||
func newTerm(tk *Token) (inst *term) {
|
||||
if constructorRegistry != nil {
|
||||
if construct, exists := constructorRegistry[tk.Sym]; exists {
|
||||
inst = construct(tk)
|
||||
inst.setParent(parent)
|
||||
}
|
||||
}
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user