Code structure for keyword.

This commit is contained in:
Tom Alexander
2023-04-21 22:33:10 -04:00
parent 96d9158602
commit f0bab39778
7 changed files with 73 additions and 0 deletions

View File

@@ -84,6 +84,11 @@ pub struct HorizontalRule<'s> {
pub source: &'s str,
}
#[derive(Debug)]
pub struct Keyword<'s> {
pub source: &'s str,
}
impl<'s> Paragraph<'s> {
pub fn of_text(input: &'s str) -> Self {
let mut objects = Vec::with_capacity(1);
@@ -168,3 +173,9 @@ impl<'s> Source<'s> for HorizontalRule<'s> {
self.source
}
}
impl<'s> Source<'s> for Keyword<'s> {
fn get_source(&'s self) -> &'s str {
self.source
}
}