Skip to content

Commit

Permalink
luau: consider trivia when testing string interpolation double brace (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyMorganz committed Jan 7, 2024
1 parent c9cd219 commit 969c448
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions full-moon/src/ast/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2113,13 +2113,17 @@ fn expect_interpolated_string(
let first_string = current.clone();

loop {
let has_double_brace = if let Some(double_brace) = state.consume_if(Symbol::LeftBrace) {
state.token_error(
double_brace,
"unexpected double brace, try \\{ if you meant to escape",
);
let has_double_brace = if current.trailing_trivia.is_empty() {
if let Some(double_brace) = state.consume_if(Symbol::LeftBrace) {
state.token_error(
double_brace,
"unexpected double brace, try \\{ if you meant to escape",
);

true
true
} else {
false
}
} else {
false
};
Expand Down

0 comments on commit 969c448

Please sign in to comment.