mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
ClosureNode.Args -> .ArgNames
This commit is contained in:
parent
f24a3cb685
commit
ca50213cdb
|
@ -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))
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ func (tn *TableNode) appendToDict(key *ListNode, value *ListNode) {
|
|||
|
||||
type ClosureNode struct {
|
||||
Pos
|
||||
Args *ListNode
|
||||
ArgNames *ListNode
|
||||
Chunk *ListNode
|
||||
}
|
||||
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user