Improved error message for invalid instructions
This commit is contained in:
parent
28292a64e3
commit
2b9cecd62b
3 changed files with 8 additions and 2 deletions
|
@ -37,6 +37,6 @@ func parseNode(tokens token.List, source []byte, nodes AST) (Node, error) {
|
|||
return &Call{Expression: expr}, nil
|
||||
|
||||
default:
|
||||
return nil, errors.New(&errors.InvalidInstruction{Instruction: expr.Token.Text(source)}, nil, expr.Token.Position)
|
||||
return nil, errors.New(&errors.InvalidInstruction{Instruction: tokens.Text(source)}, nil, tokens[0].Position)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue