Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
hidetatz committed Sep 9, 2023
1 parent 9eac1e7 commit b36cc49
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tokenizer.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package main

// tokenizer reads and manages tokens read by tokenreader.
type tokenizer struct {
tr *tokenreader
tokens []*token
Expand All @@ -10,14 +11,6 @@ func newtokenizer(mod *module) *tokenizer {
return &tokenizer{tr: newtokenreader(mod)}
}

func (t *tokenizer) mark() int {
return t.pos
}

func (t *tokenizer) reset(pos int) {
t.pos = pos
}

func (t *tokenizer) gettoken() (*token, error) {
tk, err := t.peektoken()
if err != nil {
Expand All @@ -40,3 +33,11 @@ func (t *tokenizer) peektoken() (*token, error) {

return t.tokens[t.pos], nil
}

func (t *tokenizer) mark() int {
return t.pos
}

func (t *tokenizer) reset(pos int) {
t.pos = pos
}

0 comments on commit b36cc49

Please sign in to comment.