ClosureNode.Args -> .ArgNames

This commit is contained in:
Cheer Xiao 2013-11-19 18:39:16 +08:00
parent f24a3cb685
commit ca50213cdb
3 changed files with 4 additions and 4 deletions

View File

@ -124,8 +124,8 @@ func (ev *Evaluator) evalFactor(n *parse.FactorNode) []Value {
words = []Value{word}
case *parse.ClosureNode:
var names []string
if n.Args != nil {
nameValues := ev.evalTermList(n.Args)
if n.ArgNames != nil {
nameValues := ev.evalTermList(n.ArgNames)
for _, v := range nameValues {
names = append(names, v.String(ev))
}

View File

@ -106,7 +106,7 @@ func (tn *TableNode) appendToDict(key *ListNode, value *ListNode) {
type ClosureNode struct {
Pos
Args *ListNode
ArgNames *ListNode
Chunk *ListNode
}

View File

@ -324,7 +324,7 @@ func (p *Parser) closure() (tn *ClosureNode) {
tn = newClosure(p.peek().Pos)
if p.peekNonSpace().Typ == ItemPipe {
p.next()
tn.Args = p.termList()
tn.ArgNames = p.termList()
if token := p.nextNonSpace(); token.Typ != ItemPipe {
p.unexpected(token, "argument list")
}