From 11ef5aafc739202f823db79ca89e0c73e1db4e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matth=C3=A4us=20G=2E=20Chajdas?= Date: Sat, 11 Mar 2023 13:51:17 +0100 Subject: Improve Gnuplot lexer. * Merge comment tokens. * Improve whitespace matching accuracy. --- pygments/lexers/graphics.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pygments') diff --git a/pygments/lexers/graphics.py b/pygments/lexers/graphics.py index 63c76373..a20dfb28 100644 --- a/pygments/lexers/graphics.py +++ b/pygments/lexers/graphics.py @@ -562,13 +562,14 @@ class GnuplotLexer(RegexLexer): Keyword, 'noargs'), (r'([a-zA-Z_]\w*)(\s*)(=)', bygroups(Name.Variable, Whitespace, Operator), 'genericargs'), - (r'([a-zA-Z_]\w*)(\s*\(.*?\)\s*)(=)', - bygroups(Name.Function, Whitespace, Operator), 'genericargs'), + (r'([a-zA-Z_]\w*)(\s*)(\()(.*?)(\))(\s*)(=)', + bygroups(Name.Function, Whitespace, Punctuation, + Text, Punctuation, Whitespace, Operator), 'genericargs'), (r'@[a-zA-Z_]\w*', Name.Constant), # macros (r';', Keyword), ], 'comment': [ - (r'[^\\\n]', Comment), + (r'[^\\\n]+', Comment), (r'\\\n', Comment), (r'\\', Comment), # don't add the newline to the Comment token -- cgit v1.2.1