Lexer reads runes from buffer

This commit is contained in:
2015-02-18 20:26:53 +07:00
parent 9b787b749b
commit 6b9a8bebbc
2 changed files with 36 additions and 33 deletions
+3 -1
View File
@@ -5,6 +5,7 @@ import (
"strconv"
"strings"
"github.com/localhots/punk/buffer"
"github.com/localhots/punk/lexer"
)
@@ -20,8 +21,9 @@ type (
// Creates a new parser
func New(b []byte, sels []string) *Parser {
buf := buffer.NewDataBuffer(b)
return &Parser{
lex: lexer.New(string(b)),
lex: lexer.New(buf),
ctx: &context{
exps: []expectation{},
},