diff options
author | Melody Horn <melody@boringcactus.com> | 2021-04-02 20:53:30 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-04-02 20:53:30 -0600 |
commit | 6488d227000c30e06b6ae50fa323d45d537698a7 (patch) | |
tree | bbd6d20c6fc36a9ccc3e84351f1974a5369bf541 /src/makefile/token.rs | |
parent | 68ebea2da2b178f740f4e0682ff1a8857adaaa3b (diff) | |
download | makers-6488d227000c30e06b6ae50fa323d45d537698a7.tar.gz makers-6488d227000c30e06b6ae50fa323d45d537698a7.zip |
add helper function for empty tokenstring
Diffstat (limited to 'src/makefile/token.rs')
-rw-r--r-- | src/makefile/token.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/makefile/token.rs b/src/makefile/token.rs index 3bb9f4e..5984901 100644 --- a/src/makefile/token.rs +++ b/src/makefile/token.rs @@ -23,6 +23,10 @@ impl<'a, T: 'a + ParseError<&'a str> + ContextError<&'a str>> Err<'a> for T {} pub struct TokenString(Vec<Token>); impl TokenString { + pub fn empty() -> Self { + Self(vec![]) + } + pub fn text(text: impl Into<String>) -> Self { Self(vec![Token::Text(text.into())]) } |