Skip to content

Commit

Permalink
use global tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
DQNEO committed Aug 29, 2019
1 parent c8ecbc6 commit a03e504
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,16 @@ func tokenize() []*Token {
return tokens
}

var tokens []*Token

type Expr struct {
kind string // "intliteral"
intval int // for intliteral
}

func main() {
source, _ = ioutil.ReadFile("/dev/stdin")
tokens := tokenize()
tokens = tokenize()

token := tokens[0]

Expand Down

0 comments on commit a03e504

Please sign in to comment.