Allow comments on same line as settings (#1339)
This commit is contained in:
parent
3135db5e51
commit
baaa8cb194
@ -333,8 +333,10 @@ impl<'tokens, 'src> Parser<'tokens, 'src> {
|
|||||||
}
|
}
|
||||||
Some(Keyword::Set)
|
Some(Keyword::Set)
|
||||||
if self.next_are(&[Identifier, Identifier, ColonEquals])
|
if self.next_are(&[Identifier, Identifier, ColonEquals])
|
||||||
|| self.next_are(&[Identifier, Identifier, Eol])
|
|| self.next_are(&[Identifier, Identifier, Comment, Eof])
|
||||||
|| self.next_are(&[Identifier, Identifier, Eof]) =>
|
|| self.next_are(&[Identifier, Identifier, Comment, Eol])
|
||||||
|
|| self.next_are(&[Identifier, Identifier, Eof])
|
||||||
|
|| self.next_are(&[Identifier, Identifier, Eol]) =>
|
||||||
{
|
{
|
||||||
items.push(Item::Set(self.parse_set()?));
|
items.push(Item::Set(self.parse_set()?));
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,7 @@ mod json;
|
|||||||
mod line_prefixes;
|
mod line_prefixes;
|
||||||
mod misc;
|
mod misc;
|
||||||
mod multibyte_char;
|
mod multibyte_char;
|
||||||
|
mod parser;
|
||||||
mod positional_arguments;
|
mod positional_arguments;
|
||||||
mod quiet;
|
mod quiet;
|
||||||
mod quote;
|
mod quote;
|
||||||
|
13
tests/parser.rs
Normal file
13
tests/parser.rs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn dont_run_duplicate_recipes() {
|
||||||
|
Test::new()
|
||||||
|
.justfile(
|
||||||
|
"
|
||||||
|
set dotenv-load # foo
|
||||||
|
bar:
|
||||||
|
",
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user