-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex-lib-stub #601
Merged
Merged
Regex-lib-stub #601
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8219f05
wrote out the skeleton for the regex lib.
Cictrone c70086c
wrote out the skeleton for the regex lib.
Cictrone 67bc141
stubbed out docs and added the 'dir' test for the library
Cictrone 540421c
forgot word in doc stub
Cictrone 11c1325
i suck at words
Cictrone 3619ad2
one other doc update
Cictrone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use anyhow::Result; | ||
|
||
pub fn match_all(_haystack: String, _pattern: String) -> Result<Vec<String>> { | ||
unimplemented!("Method unimplemented") | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
// TODO: Write Tests After Implementing the Function! | ||
} |
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,10 @@ | ||
use anyhow::Result; | ||
|
||
pub fn r#match(_haystack: String, _pattern: String) -> Result<String> { | ||
unimplemented!("Method unimplemented") | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
// TODO: Write Tests After Implementing the Function! | ||
} |
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,46 @@ | ||
mod match_all_impl; | ||
mod match_impl; | ||
mod replace_all_impl; | ||
mod replace_impl; | ||
|
||
use starlark::{ | ||
environment::MethodsBuilder, | ||
starlark_module, | ||
values::{none::NoneType, starlark_value}, | ||
}; | ||
|
||
/* | ||
* Define our library for this module. | ||
*/ | ||
crate::eldritch_lib!(RegexLibrary, "regex_library"); | ||
|
||
/* | ||
* Below, we define starlark wrappers for all of our library methods. | ||
* The functions must be defined here to be present on our library. | ||
*/ | ||
#[starlark_module] | ||
#[rustfmt::skip] | ||
#[allow(clippy::needless_lifetimes, clippy::type_complexity, clippy::too_many_arguments)] | ||
fn methods(builder: &mut MethodsBuilder) { | ||
#[allow(unused_variables)] | ||
fn replace_all<'v>(this: &RegexLibrary, haystack: String, pattern: String, text: String) -> anyhow::Result<NoneType> { | ||
replace_all_impl::replace_all(haystack, pattern, text)?; | ||
Ok(NoneType{}) | ||
} | ||
|
||
#[allow(unused_variables)] | ||
fn replace<'v>(this: &RegexLibrary, haystack: String, pattern: String, text: String) -> anyhow::Result<NoneType> { | ||
replace_impl::replace(haystack, pattern, text)?; | ||
Ok(NoneType{}) | ||
} | ||
|
||
#[allow(unused_variables)] | ||
fn match_all<'v>(this: &RegexLibrary, haystack: String, pattern: String) -> anyhow::Result<Vec<String>> { | ||
match_all_impl::match_all(haystack, pattern) | ||
} | ||
|
||
#[allow(unused_variables)] | ||
fn r#match<'v>(this: &RegexLibrary, haystack: String, pattern: String) -> anyhow::Result<String> { | ||
match_impl::r#match(haystack, pattern) | ||
} | ||
} |
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,10 @@ | ||
use anyhow::Result; | ||
|
||
pub fn replace_all(_haystack: String, _pattern: String, _value: String) -> Result<()> { | ||
unimplemented!("Method unimplemented") | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
// TODO: Write Tests After Implementing the Function! | ||
} |
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,10 @@ | ||
use anyhow::Result; | ||
|
||
pub fn replace(_haystack: String, _pattern: String, _value: String) -> Result<()> { | ||
unimplemented!("Method unimplemented") | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
// TODO: Write Tests After Implementing the Function! | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to escape responsibility I see