print it nicer
This commit is contained in:
parent
f73eb899f0
commit
7363deccfe
|
@ -44,7 +44,7 @@ func startParse(addr string) {
|
|||
// Not completely sure about this code..
|
||||
for {
|
||||
item := <-l.items
|
||||
fmt.Printf("%v\n", item)
|
||||
fmt.Printf("{%s %s}\n", itemString[item.typ], item.val)
|
||||
if l.state == nil {
|
||||
break
|
||||
}
|
||||
|
|
|
@ -25,6 +25,15 @@ const (
|
|||
itemVersionPatch // the patch level of the software (empty if not determined)
|
||||
)
|
||||
|
||||
var itemString = map[itemType]string{
|
||||
itemError: "error",
|
||||
itemSoftware: "software",
|
||||
itemVendor: "vendor",
|
||||
itemVersionMajor: "major",
|
||||
itemVersionMinor: "minor",
|
||||
itemVersionPatch: "patch",
|
||||
}
|
||||
|
||||
// stateFn represents the state of the scanner as a function that returns the next state.
|
||||
type stateFn func(*lexer) stateFn
|
||||
|
||||
|
|
Loading…
Reference in New Issue