disable tracing
This commit is contained in:
parent
ad025586f2
commit
a592d1b4a5
8
char.go
8
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)
|
||||
|
18
choice.go
18
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)
|
||||
|
14
sequence.go
14
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)
|
||||
|
Loading…
Reference in New Issue
Block a user