From bd0fc10bc069d4869935978de0debc5cd0a9e8cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Mon, 30 Sep 2024 17:06:34 +0200 Subject: [PATCH] Fix formatting/warnings --- source/parsing/Token.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/parsing/Token.cpp b/source/parsing/Token.cpp index ddc0781e0..bf3aaa78e 100644 --- a/source/parsing/Token.cpp +++ b/source/parsing/Token.cpp @@ -104,26 +104,25 @@ Trivia Trivia::withLocation(BumpAllocator& alloc, SourceLocation anchorLocation) break; } - auto fullLocation = alloc.emplace(); - fullLocation->text = getRawText(); - fullLocation->location = anchorLocation - fullLocation->text.size(); + auto resultLocation = alloc.emplace(); + resultLocation->text = getRawText(); + resultLocation->location = anchorLocation - resultLocation->text.size(); Trivia result; result.kind = kind; result.hasFullLocation = true; - result.fullLocation = fullLocation; + result.fullLocation = resultLocation; return result; } // Get the start location of a token including its trivia -static SourceLocation tokenLocationInclTrivia(const Token &token) -{ +static SourceLocation tokenLocationInclTrivia(const Token& token) { size_t locOffset = 0; // We iterate over trivia until we hit one which has explicit location. // All trivia without explicit location must be raw source text, for which // we can easily query its length and add it to the offset. - for (const Trivia &trivia : token.trivia()) { + for (const Trivia& trivia : token.trivia()) { if (auto loc = trivia.getExplicitLocation()) return *loc - locOffset; else