aboutsummaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/cmd/lex.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/cli/cmd/lex.go b/cli/cmd/lex.go
index 7efc814..14fbc01 100644
--- a/cli/cmd/lex.go
+++ b/cli/cmd/lex.go
@@ -74,15 +74,14 @@ Date time: %v
if err != nil {
return err
}
+ data, err := json.Marshal(tok)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "failed to marshal a token; token: %v, error: %v\n", tok, err)
+ }
+ fmt.Fprintf(os.Stdout, "%v\n", string(data))
if tok.EOF {
break
}
- if tok.Invalid {
- fmt.Fprintf(os.Stdout, "-: -: ")
- } else {
- fmt.Fprintf(os.Stdout, "%v: %v: ", tok.ID, clspec.Kinds[tok.ID])
- }
- fmt.Fprintf(os.Stdout, "\"%v\"\n", string(tok.Match))
}
return nil