aboutsummaryrefslogtreecommitdiff
path: root/table_parser.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-12-13 18:28:41 +0700
committerShulhan <ms@kilabit.info>2023-12-13 18:28:41 +0700
commit008230e7e72251addceb5abe04af6a5edc16a04c (patch)
treed0a93cb03b62109baede763f7a2d0cddd215497b /table_parser.go
parentcb215a6d8138c04ec0e3a91228a9ef23f26148b3 (diff)
downloadasciidoctor-go-008230e7e72251addceb5abe04af6a5edc16a04c.tar.xz
all: replace "lib/parser" with "strings/parser"
The lib/parser has been deprecated.
Diffstat (limited to 'table_parser.go')
-rw-r--r--table_parser.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/table_parser.go b/table_parser.go
index 5f2c84a..c97ed04 100644
--- a/table_parser.go
+++ b/table_parser.go
@@ -7,11 +7,11 @@ import (
"bytes"
"strings"
- "github.com/shuLhan/share/lib/parser"
+ libstrings "github.com/shuLhan/share/lib/strings"
)
type tableParser struct {
- p *parser.Parser
+ p *libstrings.Parser
cells []*tableCell
nrow int
x int
@@ -19,7 +19,7 @@ type tableParser struct {
func newTableParser(content []byte) (pt *tableParser) {
pt = &tableParser{
- p: parser.New(string(content), "|\n"),
+ p: libstrings.NewParser(string(content), "|\n"),
}
pt.toCells()
return pt
@@ -28,7 +28,7 @@ func newTableParser(content []byte) (pt *tableParser) {
// toCells parse the raw table content into cells.
func (pt *tableParser) toCells() {
var (
- token, c = pt.p.TokenEscaped('\\')
+ token, c = pt.p.ReadEscaped('\\')
tokenTrim = strings.TrimSpace(token)
l = len(tokenTrim)
cell = &tableCell{}
@@ -49,7 +49,7 @@ func (pt *tableParser) toCells() {
// Case 2.
pt.cells = append(pt.cells, nil)
}
- token, c = pt.p.TokenEscaped('\\')
+ token, c = pt.p.ReadEscaped('\\')
tokenTrim = strings.TrimSpace(token)
l = len(tokenTrim)
}
@@ -75,7 +75,7 @@ func (pt *tableParser) toCells() {
}
}
- token, c = pt.p.TokenEscaped('\\')
+ token, c = pt.p.ReadEscaped('\\')
tokenTrim = strings.TrimSpace(token)
l = len(tokenTrim)
for {
@@ -101,7 +101,7 @@ func (pt *tableParser) toCells() {
pt.addCell(cell)
break
}
- token, c = pt.p.TokenEscaped('\\')
+ token, c = pt.p.ReadEscaped('\\')
tokenTrim = strings.TrimSpace(token)
l = len(tokenTrim)
}