aboutsummaryrefslogtreecommitdiff
path: root/lib/parser
AgeCommit message (Collapse)Author
2023-12-13lib/parser: removed, this package has been merged into lib/stringsShulhan
2023-09-11lib/parser: realign struct ParserShulhan
This reduce the struct size from 64 to 56 bytes (-8).
2023-04-05lib/strings: merge lib/parser hereShulhan
The first idea of parser is to provide generic parser for both bytes and string. After we introduce lib/parser there is not much changes to that package. Also, since we create another Parser in lib/bytes that accept and return token as []byte, the lib/parser is not unique anymore. The following function/methods changes to minimize conflict in the future, * Lines become LinesOfFile * New become NewParser * Open become OpenForParser * Token become Read * TokenEscaped become ReadEscaped * TokenTrimSpace become ReadNoSpace
2023-03-12lib/parser: add method TokenTrimSpaceShulhan
The TokenTrimSpace read the next token until one of the delimiter found, with leading and trailing spaces are ignored.
2023-03-12lib/parser: add method SetDelimitersShulhan
The SetDelimiters replace the current delimiters.
2022-05-09all: reformat all codes using gofmt 1.19 (the Go tip)Shulhan
2022-04-06all: replace any usage of ioutil package with os or ioShulhan
Since Go 1.16, the ioutil package has been deprecated. This changes replace any usage that use functions from ioutil package with their replacement from package os or package io.
2021-03-14all: refactoring the test.Assert and test.AssertBench signatureShulhan
Previously, the test.Assert and test.AssertBench functions has the boolean parameter to print the stack trace of test in case its not equal. Since this parameter is not mandatory and its usually always set to "true", we remove them from function signature to simplify the call to Assert and AssertBench.
2020-11-15parser: fix Line method that always return non-empty lineShulhan
In case of content end without new line, for example "a\nb", the Line() method always return "b, 0" on the last line.
2020-10-13parser: add Stop methodShulhan
The Stop method return the remaining unparsed content and its last position, and then call Close to reset the internal state back to zero.
2020-07-24parser: add method to get single lineShulhan
2020-06-10all: update email addressShulhan
2020-03-26all: fix and suppress linter warningsShulhan
2020-03-24parser: simplify zeroing delimiter on TokenShulhan
2020-03-01lib/parser: a general parser libraryShulhan