From 75bb2958cc9527fc1ebd3771db205b03ef21d2c6 Mon Sep 17 00:00:00 2001 From: Jeffrey Wilcke Date: Sun, 19 Feb 2017 22:52:21 +0100 Subject: [PATCH] cmd/easm: print debug to stderr --- cmd/easm/lexer.go | 3 ++- cmd/easm/main.go | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/easm/lexer.go b/cmd/easm/lexer.go index 00bb37d59e..d7320f399d 100644 --- a/cmd/easm/lexer.go +++ b/cmd/easm/lexer.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "os" "strings" "unicode" "unicode/utf8" @@ -168,7 +169,7 @@ func (l *Lexer) emit(t itemType) { item := item{t, l.lineno, l.blob()} if l.debug { - fmt.Printf("%04d: (%-20v) %s\n", item.lineno, item.typ, item.text) + fmt.Fprintf(os.Stderr, "%04d: (%-20v) %s\n", item.lineno, item.typ, item.text) } l.items <- item diff --git a/cmd/easm/main.go b/cmd/easm/main.go index 264dd822e2..e8538d0ebc 100644 --- a/cmd/easm/main.go +++ b/cmd/easm/main.go @@ -111,7 +111,6 @@ func newCompiler(debug bool) *Compiler { // position. func (c *Compiler) feed(ch <-chan item) { for i := range ch { - fmt.Println(c.pc, i.text) switch i.typ { case number: num := common.String2Big(i.text).Bytes() @@ -133,7 +132,7 @@ func (c *Compiler) feed(ch <-chan item) { c.tokens = append(c.tokens, i) } if c.debug { - fmt.Println("found", len(c.labels), "labels") + fmt.Sprintln(os.Stderr, "found", len(c.labels), "labels") } }