mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
cmd/easm: print debug to stderr
This commit is contained in:
parent
10a090a75a
commit
75bb2958cc
2 changed files with 3 additions and 3 deletions
|
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"unicode"
|
"unicode"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
@ -168,7 +169,7 @@ func (l *Lexer) emit(t itemType) {
|
||||||
item := item{t, l.lineno, l.blob()}
|
item := item{t, l.lineno, l.blob()}
|
||||||
|
|
||||||
if l.debug {
|
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
|
l.items <- item
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,6 @@ func newCompiler(debug bool) *Compiler {
|
||||||
// position.
|
// position.
|
||||||
func (c *Compiler) feed(ch <-chan item) {
|
func (c *Compiler) feed(ch <-chan item) {
|
||||||
for i := range ch {
|
for i := range ch {
|
||||||
fmt.Println(c.pc, i.text)
|
|
||||||
switch i.typ {
|
switch i.typ {
|
||||||
case number:
|
case number:
|
||||||
num := common.String2Big(i.text).Bytes()
|
num := common.String2Big(i.text).Bytes()
|
||||||
|
|
@ -133,7 +132,7 @@ func (c *Compiler) feed(ch <-chan item) {
|
||||||
c.tokens = append(c.tokens, i)
|
c.tokens = append(c.tokens, i)
|
||||||
}
|
}
|
||||||
if c.debug {
|
if c.debug {
|
||||||
fmt.Println("found", len(c.labels), "labels")
|
fmt.Sprintln(os.Stderr, "found", len(c.labels), "labels")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue