aboutsummaryrefslogtreecommitdiff
path: root/main.go
blob: 2d615b199cad60a01b015049052aecee380dd91e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main

import (
	"bufio"
	"io"
	"os"
	"fmt"
)

func main() {
	in := bufio.NewReader(os.Stdin)

	for {
		os.Stdout.WriteString("\t")
		line, err := in.ReadString('\n')
		if err == io.EOF {
			return
		}
		l := lex(line)
		for {
			i, s := l.Lex()
			if i == EOF {
				break
			}
			fmt.Println(i, s)
		}
	}
}