| Age | Commit message (Collapse) | Author |
|
The Peek method take a look on n bytes inside the buffer without
using delimiters.
The returned bytes may empty or have length less than n.
|
|
This is to see the return value when no token can be parsed
and to make the test coverage become 100%.
|
|
There are several reasons that why we move from github.com.
First, related to the name of package.
We accidentally name the package with "share" a common word in English
that does not reflect the content of repository.
By moving to other repository, we can rename it to better and unique
name, in this "pakakeh.go".
Pakakeh is Minang word for tools, and ".go" suffix indicate that the
repository related to Go programming language.
Second, supporting open source.
The new repository is hosted under sourcehut.org, the founder is known
to support open source, and all their services are licensed under AGPL,
unlike GitHub that are closed sources.
Third, regarding GitHub CoPilot.
The GitHub Terms of Service [1], allow any public content that are hosted
there granted them to parse the content.
On one side, GitHub helps and flourish the open source, but on another
side have an issues regarding scraping the copyleft license [2].
[1]: https://docs.github.com/en/site-policy/github-terms/github-terms-of-service#4-license-grant-to-us
[2]: https://githubcopilotinvestigation.com
|
|
The %q will print the character itself if its printable or an hexadecimal
representation.
|
|
Using an example not only test the code but also provide example snippet
when opened in the godoc.
|
|
The ReadLine method read until it found new line ('\n') or end of content,
ignoring all delimiters.
The returned line will not contain '\n'.
|
|
|
|
The Remaining method return the copy of un-parsed content.
|
|
The AddDelimiters method add another delimiters to the current parser.
The ReadNoSpace method read the next token by ignoring the leading spaces,
even if its one of the delimiter. The returned token will have no
trailing spaces.
The RemoveDelimiters method remove delimiters delims from current
delimiters.
The Reset method set all internal state to new content and
delimiters.
The SetDelimiters method replace the current delimiters with delims.
The SkipHorizontalSpaces method skip space (" "), tab ("\t"), carriage
return ("\r"), and form feed ("\f") characters; and return the first
non-space character or 0 if it reach end-of-content.
The SkipSpaces method skip all spaces character
(' ', '\f', '\n', '\r', '\t') and return the first non-space character
or 0 if it reach end-of-content.
The Stop method stop the parser, return the remaining unparsed content
and its last position, and then call Reset to reset the internal state
back to zero.
The UnreadN method unread N characters and return the character its
pointed to. If N greater than current position index, it will reset the
read pointer index back to zero.
|