diff options
| author | Shulhan <ms@kilabit.info> | 2023-12-13 18:28:41 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-12-13 18:28:41 +0700 |
| commit | 008230e7e72251addceb5abe04af6a5edc16a04c (patch) | |
| tree | d0a93cb03b62109baede763f7a2d0cddd215497b | |
| parent | cb215a6d8138c04ec0e3a91228a9ef23f26148b3 (diff) | |
| download | asciidoctor-go-008230e7e72251addceb5abe04af6a5edc16a04c.tar.xz | |
all: replace "lib/parser" with "strings/parser"
The lib/parser has been deprecated.
| -rw-r--r-- | table_parser.go | 14 |
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) } |
