func ParseCompoundStmt(filename string, readline func() ([]byte, error)) (f *File, err error) {
	in, err := newScanner(filename, readline, false)
	if err != nil {
		return nil, err
	}
	p := parser{in: in}
	defer p.in.recover(&err)
	p.nextToken()  
	var stmts []Stmt
	switch p.tok {
	case DEF, IF, FOR, WHILE:
		stmts = p.parseStmt(stmts)
	case NEWLINE:
	default:
		stmts = p.parseSimpleStmt(stmts, false)
		if p.tok != NEWLINE {
			p.in.errorf(p.in.pos, "invalid syntax")
		}
	}
	return &File{Path: filename, Stmts: stmts}, nil
}
ParseCompoundStmt parses a single compound statement:
a blank line, a def, for, while, or if statement, or a
semicolon-separated list of simple statements followed
by a newline. These are the units on which the REPL operates.
ParseCompoundStmt does not consume any following input.
The parser calls the readline function each
time it needs a new line of input.
package syntax
import "log"
const debug = false
type Mode uint
const (
	RetainComments Mode = 1 << iota  
)
func Parse(filename string, src interface{}, mode Mode) (f *File, err error) {
	in, err := newScanner(filename, src, mode&RetainComments != 0)
	if err != nil {
		return nil, err
	}
	p := parser{in: in}
	defer p.in.recover(&err)
	p.nextToken()  
	f = p.parseFile()
	if f != nil {
		f.Path = filename
	}
	p.assignComments(f)
	return f, nil
}