mirror of
https://github.com/nushell/nushell.git
synced 2025-01-09 15:58:17 +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) {
|
if (tokens.len() != 1) && (tokens.len() != 4) {
|
||||||
return (
|
return (
|
||||||
ImportPattern {
|
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 has_second_colon = if let Some(t) = tokens.get(2) {
|
||||||
let potential_colon = working_set.get_span_contents(t.span);
|
let potential_colon = working_set.get_span_contents(t.span);
|
||||||
potential_colon == b":"
|
potential_colon == b":"
|
||||||
@ -1729,6 +1731,7 @@ pub fn parse_import_pattern(
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (tokens.len() == 4) && !has_second_colon {
|
if (tokens.len() == 4) && !has_second_colon {
|
||||||
|
// Applies only to the "head::tail" structure; "head" only doesn't have :
|
||||||
return (
|
return (
|
||||||
ImportPattern {
|
ImportPattern {
|
||||||
head: vec![],
|
head: vec![],
|
||||||
|
Loading…
Reference in New Issue
Block a user