mirror of
https://github.com/nushell/nushell.git
synced 2024-11-08 01:24:38 +01:00
Add comments
This commit is contained in:
parent
5163dbb7a1
commit
75b3b3e090
@ -1711,6 +1711,7 @@ pub fn parse_import_pattern(
|
||||
);
|
||||
}
|
||||
|
||||
// We can have either "head" or "head::tail"
|
||||
if (tokens.len() != 1) && (tokens.len() != 4) {
|
||||
return (
|
||||
ImportPattern {
|
||||
@ -1721,6 +1722,7 @@ pub fn parse_import_pattern(
|
||||
);
|
||||
}
|
||||
|
||||
// Check if the second : of the :: is really a :
|
||||
let has_second_colon = if let Some(t) = tokens.get(2) {
|
||||
let potential_colon = working_set.get_span_contents(t.span);
|
||||
potential_colon == b":"
|
||||
@ -1729,6 +1731,7 @@ pub fn parse_import_pattern(
|
||||
};
|
||||
|
||||
if (tokens.len() == 4) && !has_second_colon {
|
||||
// Applies only to the "head::tail" structure; "head" only doesn't have :
|
||||
return (
|
||||
ImportPattern {
|
||||
head: vec![],
|
||||
|
Loading…
Reference in New Issue
Block a user