| Age | Commit message (Collapse) | Author |
|
|
|
This reduce the struct size from 64 to 56 bytes (-8).
|
|
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
|
|
The TokenTrimSpace read the next token until one of the delimiter found,
with leading and trailing spaces are ignored.
|
|
The SetDelimiters replace the current delimiters.
|
|
|
|
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.
|
|
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.
|
|
In case of content end without new line, for example "a\nb", the Line()
method always return "b, 0" on the last line.
|
|
The Stop method return the remaining unparsed content and its last
position, and then call Close to reset the internal state back to zero.
|
|
|
|
|
|
|
|
|
|
|