Skip to content

Commit 736438d

Browse files
authored
Allow shell-expanded strings in attributes (#3007)
1 parent 60a6967 commit 736438d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ impl<'run, 'src> Parser<'run, 'src> {
13481348
arguments.push(self.parse_string_literal_token()?);
13491349
} else if self.accepted(ParenL)? {
13501350
loop {
1351-
if self.next_is(Identifier) {
1351+
if self.next_is(Identifier) && !self.next_is_shell_expanded_string() {
13521352
let name = self.parse_name()?;
13531353

13541354
self.expect(Equals)?;

tests/attributes.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,3 +311,15 @@ fn duplicate_non_repeatable_attributes_are_forbidden() {
311311
.status(EXIT_FAILURE)
312312
.run();
313313
}
314+
315+
#[test]
316+
fn shell_expanded_strings_can_be_used_in_attributes() {
317+
Test::new()
318+
.justfile(
319+
"
320+
[doc(x'foo')]
321+
bar:
322+
",
323+
)
324+
.run();
325+
}

0 commit comments

Comments
 (0)