From 7027d7d253856a01cbb0f1c1c1d14509003a866e Mon Sep 17 00:00:00 2001 From: Peace-Maker Date: Sun, 16 Mar 2025 22:26:21 +0100 Subject: [PATCH 1/2] Fix syntax highlighting of multiline comments in ASM Enable DOT_ALL next to the default MULTILINE regex flags to match newlines too with the `.*?`. ``` /* this works */ /* this is not highlighted as a comment */ ``` --- pwnlib/lexer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwnlib/lexer.py b/pwnlib/lexer.py index b3a3ac64f..49fa8141a 100644 --- a/pwnlib/lexer.py +++ b/pwnlib/lexer.py @@ -95,7 +95,7 @@ class PwntoolsLexer(RegexLexer): 'whitespace': [ (r'\n', Text), (r'\s+', Text), - (r'/\*.*?\*/', Comment), + (r'(?ms)/\*.*?\*/', Comment), (r';.*$', Comment) ], 'punctuation': [ From 7c1b05d81542a0dc6b3a8e45e14b35028b507479 Mon Sep 17 00:00:00 2001 From: Peace-Maker Date: Sun, 16 Mar 2025 23:13:16 +0100 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcd36ff42..a94104477 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -117,10 +117,12 @@ The table below shows which release corresponds to each branch, and what date th - [#2533][2533] Fix installation on Python 3.5 and lower - [#2518][2518] fix: update apport coredump path handling for CorefileFinder - [#2559][2559] Fix parsing corefile with missing auxv +- [#2562][2562] Fix syntax highlighting of multiline comments in ASM [2533]: https://github.com/Gallopsled/pwntools/pull/2533 [2518]: https://github.com/Gallopsled/pwntools/pull/2518 [2559]: https://github.com/Gallopsled/pwntools/pull/2559 +[2562]: https://github.com/Gallopsled/pwntools/pull/2562 ## 4.14.0