Skip to content

Commit

Permalink
Modify
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuichiueda committed Feb 2, 2024
1 parent 5bbfa19 commit 197401c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/elements/subword/unquoted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,18 @@ pub struct UnquotedSubword {
}

impl UnquotedSubword {
fn new() -> UnquotedSubword {
fn new(s: &str) -> UnquotedSubword {
UnquotedSubword {
text: String::new(),
text: s.to_string(),
}
}

pub fn parse(feeder: &mut Feeder, core: &mut ShellCore) -> Option<UnquotedSubword> {
let mut ans = Self::new();

let len = feeder.scanner_word(core);
if len == 0 {
return None;
}

ans.text = feeder.consume(len);
Some(ans)
Some(UnquotedSubword::new(&feeder.consume(len)))
}
}

0 comments on commit 197401c

Please sign in to comment.