mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
Variable nodes now have the variable name in .Value.
This commit is contained in:
parent
77df994361
commit
64401af225
|
@ -503,7 +503,7 @@ func (cp *compiler) primary(n *parse.Primary) valuesOp {
|
|||
case parse.Bareword, parse.SingleQuoted, parse.DoubleQuoted:
|
||||
return literalStr(n.Value)
|
||||
case parse.Variable:
|
||||
qname := n.Value[1:]
|
||||
qname := n.Value
|
||||
if !cp.registerVariableGet(qname) {
|
||||
cp.errorf(n.Begin(), "variable %s not found", n.Value)
|
||||
}
|
||||
|
|
|
@ -557,7 +557,7 @@ func hexToDigit(r rune) (rune, bool) {
|
|||
|
||||
func (pn *Primary) variable(ps *parser) {
|
||||
pn.Type = Variable
|
||||
defer func() { pn.Value = ps.src[pn.begin:ps.pos] }()
|
||||
defer func() { pn.Value = ps.src[pn.begin+1 : ps.pos] }()
|
||||
ps.next()
|
||||
// The character of the variable name can be anything.
|
||||
if ps.next() == EOF {
|
||||
|
|
Loading…
Reference in New Issue
Block a user