mirror of
https://github.com/nushell/nushell.git
synced 2025-01-11 00:38:23 +01:00
Improve colon sep
This commit is contained in:
parent
6aef00ecff
commit
03a93bd089
10
src/lex.rs
10
src/lex.rs
@ -54,6 +54,13 @@ impl LexMode {
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn special_contains(&self, b: u8) -> bool {
|
||||
match self {
|
||||
LexMode::Custom { ref special, .. } => special.contains(&b),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A baseline token is terminated if it's not nested inside of a paired
|
||||
@ -67,7 +74,8 @@ fn is_item_terminator(block_level: &[BlockKind], c: u8, lex_mode: &LexMode) -> b
|
||||
|| c == b'|'
|
||||
|| c == b';'
|
||||
|| c == b'#'
|
||||
|| lex_mode.whitespace_contains(c))
|
||||
|| lex_mode.whitespace_contains(c)
|
||||
|| lex_mode.special_contains(c))
|
||||
}
|
||||
|
||||
// A special token is one that is a byte that stands alone as its own token. For example
|
||||
|
@ -999,7 +999,7 @@ impl ParserWorkingSet {
|
||||
desc: String::new(),
|
||||
long: String::from_utf8_lossy(contents).to_string(),
|
||||
short: None,
|
||||
required: true,
|
||||
required: false,
|
||||
}));
|
||||
} else {
|
||||
// Positional arg
|
||||
|
Loading…
Reference in New Issue
Block a user