diff --git a/src/parser.rs b/src/parser.rs index a8598eef5b..12e4821af6 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -805,6 +805,7 @@ impl<'a> ParserWorkingSet<'a> { Some(ParseError::UnknownCommand(spans[0])), ); } + let name = self.get_span_contents(spans[pos]); pos += 1; diff --git a/src/tests.rs b/src/tests.rs index e726beac06..9e130394db 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -133,3 +133,8 @@ fn env_shorthand() -> TestResult { fn floating_add() -> TestResult { run_test("10.1 + 0.8", "10.9") } + +#[test] +fn subcommand() -> TestResult { + run_test("def foo [] {}; def \"foo bar\" [] {3}; foo bar", "3") +}