mirror of
https://github.com/nushell/nushell
synced 2024-12-30 15:03:25 +00:00
Improve colon sep
This commit is contained in:
parent
6aef00ecff
commit
03a93bd089
2 changed files with 10 additions and 2 deletions
10
src/lex.rs
10
src/lex.rs
|
@ -54,6 +54,13 @@ impl LexMode {
|
||||||
_ => false,
|
_ => 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
|
// 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';'
|
|| 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
|
// 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(),
|
desc: String::new(),
|
||||||
long: String::from_utf8_lossy(contents).to_string(),
|
long: String::from_utf8_lossy(contents).to_string(),
|
||||||
short: None,
|
short: None,
|
||||||
required: true,
|
required: false,
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
// Positional arg
|
// Positional arg
|
||||||
|
|
Loading…
Reference in a new issue