From a592d1b4a5fdc4526ea12c013d28f944ecf93e8a Mon Sep 17 00:00:00 2001 From: Arpad Ryszka Date: Sat, 29 Jul 2017 23:26:08 +0200 Subject: [PATCH] disable tracing --- char.go | 8 ++++---- choice.go | 18 +++++++++--------- sequence.go | 14 ++++++++------ 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/char.go b/char.go index b0c833a..d09a066 100644 --- a/char.go +++ b/char.go @@ -69,16 +69,16 @@ func (p *charParser) match(t rune) bool { } func (p *charParser) parse(t Trace, c *context) { - t = t.Extend(p.name) - t.Out1("parsing", c.offset) + // t = t.Extend(p.name) + // t.Out1("parsing", c.offset) if tok, ok := c.token(); !ok || !p.match(tok) { - t.Out1("fail") + // t.Out1("fail") c.fail(c.offset) return } - t.Out1("success") + // t.Out1("success") c.success(c.offset + 1) for _, includedBy := range p.includedBy { c.store.setMatch(c.offset, includedBy, c.offset+1) diff --git a/choice.go b/choice.go index bf77cc9..4b7193f 100644 --- a/choice.go +++ b/choice.go @@ -144,23 +144,23 @@ func (p *choiceParser) nodeName() string { return p.name } func (p *choiceParser) nodeID() int { return p.id } func (p *choiceParser) parse(t Trace, c *context) { - t = t.Extend(p.name) - t.Out1("parsing choice", c.offset) + // t = t.Extend(p.name) + // t.Out1("parsing choice", c.offset) // TODO: don't add documentation if p.commit&Documentation != 0 { - t.Out1("fail, doc") + // t.Out1("fail, doc") c.fail(c.offset) return } - if m, ok := c.fromStore(p.id); ok { - t.Out1("found in store, match:", m) + if _, ok := c.fromStore(p.id); ok { + // t.Out1("found in store, match:", m) return } if c.excluded(c.offset, p.id) { - t.Out1("fail, excluded") + // t.Out1("fail, excluded") c.fail(c.offset) return } @@ -194,7 +194,7 @@ func (p *choiceParser) parse(t Trace, c *context) { c.store.setMatch(from, p.id, to) for _, includedBy := range p.includedBy { if c.excluded(from, includedBy) { - t.Out1("storing included", includedBy) + // t.Out1("storing included", includedBy) c.store.setMatch(from, includedBy, to) } } @@ -208,11 +208,11 @@ func (p *choiceParser) parse(t Trace, c *context) { if match { c.success(to) c.include(from, p.id) - t.Out1("choice, success") + // t.Out1("choice, success") return } - t.Out1("fail") + // t.Out1("fail") c.store.setNoMatch(from, p.id) c.fail(from) c.include(from, p.id) diff --git a/sequence.go b/sequence.go index b952dc0..d69d098 100644 --- a/sequence.go +++ b/sequence.go @@ -171,15 +171,17 @@ func (p *sequenceParser) nodeName() string { return p.name } func (p *sequenceParser) nodeID() int { return p.id } func (p *sequenceParser) parse(t Trace, c *context) { - t = t.Extend(p.name) + // t = t.Extend(p.name) + // t.Out1("parsing sequence") + if p.commit&Documentation != 0 { - t.Out1("fail, doc") + // t.Out1("fail, doc") c.fail(c.offset) return } if c.excluded(c.offset, p.id) { - t.Out1("fail, excluded") + // t.Out1("fail, excluded") c.fail(c.offset) return } @@ -203,7 +205,7 @@ func (p *sequenceParser) parse(t Trace, c *context) { // c.store.setNoMatch(from, p.id) c.fail(from) c.include(from, p.id) - t.Out1("fail, not enough items") + // t.Out1("fail, not enough items") return } @@ -227,12 +229,12 @@ func (p *sequenceParser) parse(t Trace, c *context) { for _, includedBy := range p.includedBy { if c.excluded(from, includedBy) { - t.Out1("storing included", includedBy) + // t.Out1("storing included", includedBy) c.store.setMatch(from, includedBy, to) } } - t.Out1("success") + // t.Out1("success") c.store.setMatch(from, p.id, to) c.success(to) c.include(from, p.id)