-
function
str_match()did not emulatestringr::str_matchexactly. The latter function only uses regular expressions. -
function
parser_error_context()caused an error when input had only a few lines and the error occurred on the first few lines.
- Improved error messaging.
- The line where the parser fails is now displayed together with its context
- The error message mentions expected values. Some of these are automatically inferred, whereas others can be induced by creating named parsers
- The function
stringparser()depended onstringr::str_match(). However, the dependency was not listed in DESCRIPTION. This may have led to errors when thestringrpackage was not installed. The function has been fixed by implementing it with base functions.
- Added a constructor function for string parsers using stringr::str_match() because the pattern occurs very often in the construction of string parsers.
- Parser zero_or_one() was not greedy, meaning that it sometimes did not parse input that it should be able to parse (see issue #12).
- Added the function Ignore() which reads and discards all elements until the end of a vector.
- Because of the use of base::isa() this package requires R 4.1 or higher, not R 2.1. This has been corrected in the DESCRIPTION. Running on ubuntu-latest and R 4.1 is checked by CI workflow on Github.
- Minor corrections and additions to both vignettes.
- All function descriptions and documentation thoroughly reviewed and updated.
- Vignettes reviewed and updated.
- Published on CRAN
- Extended the fasta file example in the vignette by showing the use of %or% to apply alternative parsers. Added a protein sequence fasta file to the data set.
- Function
Parser()was changed and renamed toreporter(). This better reflects its use.
- Added (started) Details vignette.
- Custom
error_parserincludes line number and line content fields of the element index on which the parser failed. - Added function
finished()to test for complete consumption of the input by the parser.
print.markernow emits '[]' to make explicit that it differs from a simplelist().- Export of function
failed()to test failure of a parser. Useful in unit testing.
- Resolved issue #5
- Correct example in documentation for Parser() function
- Marker error messaging implemented and tested. Markers are line numbers
(element numbers in a character vector) where the parser fails. In case of
alternative parsers like
p1 %or% p2the marker with the largest index value is reported when both parsers fail.
- Developing marker error messaging
- Again modified
exacly(n,p)because, since repeater functions call the same instance of a function, the counter is not reset when this parser is nested in a repeater parser (zero_or_more, etc.). The reset is now performed in the function itself.
- Added
fastafileexample data which is used in the vignette.
-
Redesigned
exactly(n,p)to behave as expected with non-emitting parsers likeliteral("A") %ret% NULLandeof(). -
Dependencies on packages
stringrandmethodswere removed.
- Added function
eof()which detects an end of file. With that, the behavior ofsatisfy(b)andmatch_s(s)has been modified: they now fail on empty input, regardless of the functionsb()ands().
- Initial Github submission.