mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-16 07:06:45 +00:00
feat: enter and exit handlers
This commit is contained in:
@ -63,7 +63,7 @@ func (p *Parser) parse(r io.Reader) (err error) {
|
||||
}
|
||||
|
||||
func (p *Parser) enter() {
|
||||
p.stack = append(p.stack, &Part{})
|
||||
p.stack = append(p.stack, &Part{parent: p.top()})
|
||||
}
|
||||
|
||||
func (p *Parser) exit() {
|
||||
@ -79,6 +79,10 @@ func (p *Parser) exit() {
|
||||
}
|
||||
|
||||
func (p *Parser) top() *Part {
|
||||
if len(p.stack) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
return p.stack[len(p.stack)-1]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user