From 3931fc8d1e389ddc3e6518a36e9c901d02cf0e5a Mon Sep 17 00:00:00 2001 From: Basile-z <16154339+Basile-z@users.noreply.github.com> Date: Tue, 28 May 2019 15:51:24 +0200 Subject: [PATCH] fixup, the fix for #353 could lead to missing comments (#364) --- src/dparse/parser.d | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dparse/parser.d b/src/dparse/parser.d index 8037d212..a9108a4b 100644 --- a/src/dparse/parser.d +++ b/src/dparse/parser.d @@ -2304,10 +2304,13 @@ class Parser return null; } const b2 = setBookmark(); + auto savedComment = comment; node.variableDeclaration = parseVariableDeclaration(t, false); if (node.variableDeclaration is null) { goToBookmark(b2); + if (savedComment && comment is null) + comment = savedComment; node.functionDeclaration = parseFunctionDeclaration(t, false); } else abandonBookmark(b2);