mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
parse.Parser.parse no longer return itself
This commit is contained in:
parent
5864354685
commit
33643163a3
|
@ -53,13 +53,13 @@ func main() {
|
|||
}
|
||||
|
||||
p := parse.NewParser(name)
|
||||
tree, pe := p.Parse(lr.Line, false)
|
||||
pe := p.Parse(lr.Line, false)
|
||||
if pe != nil {
|
||||
fmt.Print(pe.(*util.ContextualError).Pprint())
|
||||
continue
|
||||
}
|
||||
|
||||
ee := ev.Eval(name, lr.Line, tree.Root)
|
||||
ee := ev.Eval(name, lr.Line, p.Root)
|
||||
if ee != nil {
|
||||
fmt.Println(ee.(*util.ContextualError).Pprint())
|
||||
continue
|
||||
|
|
|
@ -135,7 +135,7 @@ func (p *Parser) stopParse() {
|
|||
|
||||
// Parse parses the script to construct a representation of the script for
|
||||
// execution.
|
||||
func (p *Parser) Parse(text string, tab bool) (tree *Parser, err error) {
|
||||
func (p *Parser) Parse(text string, tab bool) (err error) {
|
||||
defer util.Recover(&err)
|
||||
defer p.stopParse()
|
||||
|
||||
|
@ -147,7 +147,7 @@ func (p *Parser) Parse(text string, tab bool) (tree *Parser, err error) {
|
|||
p.Root = p.parse()
|
||||
|
||||
p.stopParse()
|
||||
return p, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
// parse parses a chunk and ensures there are no trailing tokens
|
||||
|
|
Loading…
Reference in New Issue
Block a user