diff --git a/src/integration.rs b/src/integration.rs index bb56adf..a28ac8d 100644 --- a/src/integration.rs +++ b/src/integration.rs @@ -1274,7 +1274,7 @@ integration_test! { } integration_test! { - name: unexpected_token, + name: unexpected_token_in_dependency_position, justfile: "foo: 'bar'", args: ("foo"), stdout: "", @@ -1286,6 +1286,18 @@ integration_test! { status: EXIT_FAILURE, } +integration_test! { + name: unexpected_token_after_name, + justfile: "foo 'bar'", + args: ("foo"), + stdout: "", + stderr: "error: Expected name, '+', ':', or '=', but found raw string + | +1 | foo 'bar' + | ^^^^^ +", + status: EXIT_FAILURE, +} integration_test! { name: self_dependency, diff --git a/src/lib.rs b/src/lib.rs index 005174f..216ad4d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1493,19 +1493,19 @@ impl Display for TokenKind { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { write!(f, "{}", match *self { Backtick => "backtick", - Colon => "\":\"", + Colon => "':'", Comment => "comment", Dedent => "dedent", Eof => "end of file", Eol => "end of line", - Equals => "\"=\"", + Equals => "'='", Indent => "indent", - InterpolationEnd => "}}", - InterpolationStart => "{{", + InterpolationEnd => "'}}'", + InterpolationStart => "'{{'", Line => "command", Name => "name", - Plus => "\"+\"", - At => "\"@\"", + Plus => "'+'", + At => "'@'", StringToken => "string", RawString => "raw string", Text => "command text",