Make DEBUG private: _DEBUG
This commit is contained in:
parent
235dee6a0d
commit
a5baf52283
10
zscan.go
10
zscan.go
|
@ -8,6 +8,11 @@ import (
|
||||||
"text/scanner"
|
"text/scanner"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Only used when debugging the parser itself.
|
||||||
|
var _DEBUG = false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Tokinize a RFC 1035 zone file. The tokenizer will normalize it:
|
// Tokinize a RFC 1035 zone file. The tokenizer will normalize it:
|
||||||
// * Add ownernames if they are left blank;
|
// * Add ownernames if they are left blank;
|
||||||
// * Suppress sequences of spaces;
|
// * Suppress sequences of spaces;
|
||||||
|
@ -40,9 +45,6 @@ const (
|
||||||
_EXPECT_RDATA // The first element of the rdata
|
_EXPECT_RDATA // The first element of the rdata
|
||||||
)
|
)
|
||||||
|
|
||||||
// Only used when debugging the parser itself.
|
|
||||||
var DEBUG = false
|
|
||||||
|
|
||||||
type ParseError struct {
|
type ParseError struct {
|
||||||
err string
|
err string
|
||||||
lex Lex
|
lex Lex
|
||||||
|
@ -110,7 +112,7 @@ func ParseZone(r io.Reader, t chan Token) {
|
||||||
var h RR_Header
|
var h RR_Header
|
||||||
var ok bool
|
var ok bool
|
||||||
for l := range c {
|
for l := range c {
|
||||||
if DEBUG {
|
if _DEBUG {
|
||||||
fmt.Printf("[%v]\n", l)
|
fmt.Printf("[%v]\n", l)
|
||||||
}
|
}
|
||||||
switch st {
|
switch st {
|
||||||
|
|
|
@ -87,13 +87,13 @@ func setRR(h RR_Header, c chan Lex) (RR, *ParseError) {
|
||||||
|
|
||||||
func slurpRemainder(c chan Lex) *ParseError {
|
func slurpRemainder(c chan Lex) *ParseError {
|
||||||
l := <-c
|
l := <-c
|
||||||
if DEBUG {
|
if _DEBUG {
|
||||||
fmt.Printf("%\v", l)
|
fmt.Printf("%\v", l)
|
||||||
}
|
}
|
||||||
switch l.value {
|
switch l.value {
|
||||||
case _BLANK:
|
case _BLANK:
|
||||||
l = <-c
|
l = <-c
|
||||||
if DEBUG {
|
if _DEBUG {
|
||||||
fmt.Printf("%\v", l)
|
fmt.Printf("%\v", l)
|
||||||
}
|
}
|
||||||
if l.value != _NEWLINE && l.value != _EOF {
|
if l.value != _NEWLINE && l.value != _EOF {
|
||||||
|
|
Loading…
Reference in New Issue