commit - 5b0199e0674b051428672a1460ed5109b3cedadf
commit + 3083e3dd1cb493efa7557138726614b1d3758e81
blob - 7d300c15271e3cb09d4575390b9a2fbe754d859f
blob + e3d28a0f2d8b84a79679df36ff2b10219b4b703d
--- m3u8/lex.go
+++ m3u8/lex.go
"bufio"
"fmt"
"io"
+ "os"
"strings"
"unicode/utf8"
)
pos int
width int
items chan item
+
+ // if enabled, emitted items are printed to standard error.
+ debug bool
}
type stateFn func(*lexer) stateFn
func (l *lexer) emit(t itemType) {
l.items <- item{t, l.input[l.start:l.pos]}
- // fmt.Println(item{t, l.input[l.start:l.pos]})
+ if l.debug {
+ fmt.Fprintln(os.Stderr, item{t, l.input[l.start:l.pos]})
+ }
l.start = l.pos
}