Example #1
0
// Tokens parses a file into a token array
func Tokens(f string, r io.Reader) ([]*lex8.Token, []*lex8.Error) {
	x, _ := makeTokener(f, r)
	toks := lex8.TokenAll(x)
	if errs := x.Errs(); errs != nil {
		return nil, errs
	}
	return toks, nil
}
Example #2
0
File: lex.go Project: yingmsky/e8vm
// Tokens parses a file in a token array
func Tokens(f string, r io.Reader) ([]*lex8.Token, []*lex8.Error) {
	x := newLexer(f, r)
	toks := lex8.TokenAll(x)
	if es := x.Errs(); es != nil {
		return nil, es
	}
	return toks, nil
}