From a5baf5228320bc50e836e7a4dc523f81f2dcf239 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Fri, 16 Dec 2011 10:30:42 +0100 Subject: [PATCH] Make DEBUG private: _DEBUG --- zscan.go | 10 ++++++---- zscan_rr.go | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/zscan.go b/zscan.go index 7c47a281..dce52dd7 100644 --- a/zscan.go +++ b/zscan.go @@ -8,6 +8,11 @@ import ( "text/scanner" ) +// Only used when debugging the parser itself. +var _DEBUG = false + + + // Tokinize a RFC 1035 zone file. The tokenizer will normalize it: // * Add ownernames if they are left blank; // * Suppress sequences of spaces; @@ -40,9 +45,6 @@ const ( _EXPECT_RDATA // The first element of the rdata ) -// Only used when debugging the parser itself. -var DEBUG = false - type ParseError struct { err string lex Lex @@ -110,7 +112,7 @@ func ParseZone(r io.Reader, t chan Token) { var h RR_Header var ok bool for l := range c { - if DEBUG { + if _DEBUG { fmt.Printf("[%v]\n", l) } switch st { diff --git a/zscan_rr.go b/zscan_rr.go index b0934b62..1d111eb1 100644 --- a/zscan_rr.go +++ b/zscan_rr.go @@ -87,13 +87,13 @@ func setRR(h RR_Header, c chan Lex) (RR, *ParseError) { func slurpRemainder(c chan Lex) *ParseError { l := <-c - if DEBUG { + if _DEBUG { fmt.Printf("%\v", l) } switch l.value { case _BLANK: l = <-c - if DEBUG { + if _DEBUG { fmt.Printf("%\v", l) } if l.value != _NEWLINE && l.value != _EOF {