Make unexpected token formatting clearer (#243)

Symbols are now be surrounded by single quotes, to set them off more
clearly.
This commit is contained in:
Casey Rodarmor 2017-11-14 13:03:26 -08:00 committed by GitHub
parent fcc27a9993
commit b9e1f73919
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 7 deletions

View File

@ -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,

View File

@ -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",