-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.2.4 use 'stringi' instead of 'stringr' for lighter dependency
- Loading branch information
1 parent
a01563c
commit 0ec55c7
Showing
13 changed files
with
140 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: flexo | ||
Type: Package | ||
Title: Simple Tools for Lexing/Parsing Text Data | ||
Version: 0.2.1 | ||
Version: 0.2.4 | ||
Author: mikefc | ||
Maintainer: mikefc <[email protected]> | ||
Description: Simple tools for lexing/parsing text data. | ||
|
@@ -12,7 +12,7 @@ Encoding: UTF-8 | |
LazyData: true | ||
RoxygenNote: 7.1.1 | ||
Imports: | ||
stringr, | ||
stringi, | ||
R6 | ||
Suggests: | ||
knitr, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Copyright (c) 2018-2020 [email protected] | ||
Copyright (c) 2018-2021 [email protected] | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
|
||
export(TokenStream) | ||
export(lex) | ||
export(regex) | ||
export(re) | ||
import(R6) | ||
import(stringr) | ||
import(stringi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
|
||
|
||
test_that("consume_until works", { | ||
|
||
|
||
named_values <- c(one = 1, two = 2, three = 3, four = 4, five = 5) | ||
stream <- TokenStream$new(named_values) | ||
|
||
jnk <- stream$consume_until(name = 'one', inclusive = FALSE) | ||
expect_equivalent(stream$read(1), 1) | ||
|
||
jnk <- stream$consume_until(name = 'one', inclusive = FALSE) | ||
expect_equivalent(stream$read(1), 1) | ||
|
||
jnk <- stream$consume_until(name = 'two', inclusive = FALSE) | ||
expect_equivalent(stream$read(1), 2) | ||
|
||
jnk <- stream$consume_until(name = 'two', inclusive = FALSE) | ||
expect_equivalent(stream$read(1), 2) | ||
|
||
|
||
|
||
|
||
|
||
stream <- TokenStream$new(named_values) | ||
|
||
jnk <- stream$consume_until(name = 'one', inclusive = TRUE) | ||
expect_equivalent(stream$read(1), 2) | ||
|
||
jnk <- stream$consume_until(name = 'one', inclusive = FALSE) | ||
expect_true(stream$end_of_stream()) | ||
|
||
stream$reset() | ||
|
||
jnk <- stream$consume_until(name = 'two', inclusive = TRUE) | ||
expect_equivalent(stream$read(1), 3) | ||
|
||
jnk <- stream$consume_until(name = 'two', inclusive = TRUE) | ||
expect_true(stream$end_of_stream()) | ||
|
||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters