INNER CODE UNIT · Rust
trim_comments_and_whitespace
steineggerlab/folddisco · lib/pdbtbx-cif/src/lib.rs:380
fn trim_comments_and_whitespace(input: &mut Position<'_>) {
loop {
trim_whitespace(input);
if input.text.is_empty() {
return;
}
if input.text.starts_with('#') {
skip_to_eol(input);
} else {
return;
}
}
}
/// Parse a piece of text enclosed by a char, it assumes the first position also matches the char.
/// It will fail if it finds a newline in the text. SO it can be used for single or double quoted strings.
fn parse_enclosed<'a>(input: &mut Position<'a>, pat: char) -> Result<&'a str, PDBError> {
let mut chars_to_remove = 1; //Assume the first position is 'pat'