(cur *ListNode)
| 117 | } |
| 118 | |
| 119 | func (p *Parser) parseText(cur *ListNode) error { |
| 120 | for { |
| 121 | if strings.HasPrefix(p.input[p.pos:], leftDelim) { |
| 122 | if p.pos > p.start { |
| 123 | cur.append(newText(p.consumeText())) |
| 124 | } |
| 125 | return p.parseLeftDelim(cur) |
| 126 | } |
| 127 | if p.next() == eof { |
| 128 | break |
| 129 | } |
| 130 | } |
| 131 | // Correctly reached EOF. |
| 132 | if p.pos > p.start { |
| 133 | cur.append(newText(p.consumeText())) |
| 134 | } |
| 135 | return nil |
| 136 | } |
| 137 | |
| 138 | // parseLeftDelim scans the left delimiter, which is known to be present. |
| 139 | func (p *Parser) parseLeftDelim(cur *ListNode) error { |
no test coverage detected