Fix string interp/shorthand overlap (#3412)

This commit is contained in:
JT
2021-05-12 16:20:29 +12:00
committed by GitHub
parent 2bb23c57df
commit efac712f62
2 changed files with 15 additions and 3 deletions

View File

@ -1738,9 +1738,9 @@ fn expand_shorthand_forms(
lite_pipeline: &LitePipeline,
) -> (LitePipeline, Option<SpannedKeyValue>, Option<ParseError>) {
if !lite_pipeline.commands.is_empty() {
if lite_pipeline.commands[0].parts[0].item == "=" {
(lite_pipeline.clone(), None, None)
} else if lite_pipeline.commands[0].parts[0].contains('=') {
if lite_pipeline.commands[0].parts[0].contains('=')
&& !lite_pipeline.commands[0].parts[0].starts_with('$')
{
let assignment: Vec<_> = lite_pipeline.commands[0].parts[0].split('=').collect();
if assignment.len() != 2 {
(