Skip to content

Commit

Permalink
Update src/libexpr/parser-state.hh
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
  • Loading branch information
infinisil and roberth authored Jul 18, 2024
1 parent 23c44d9 commit 20e916b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libexpr/parser-state.hh
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ inline Expr * ParserState::stripIndentation(const PosIdx pos,
std::visit(overloaded { trimExpr, trimString }, i->second);
}

/* If there is nothing at all, return the empty string directly */
// If there is nothing at all, return the empty string directly.
// This also ensures that equivalent empty strings result in the same ast, which is helpful when testing formatters.
if (es2->size() == 0) {
auto *const result = new ExprString("");
delete es2;
Expand Down

0 comments on commit 20e916b

Please sign in to comment.