summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorMatthäus G. Chajdas <dev@anteru.net>2023-03-11 13:51:17 +0100
committerMatthäus G. Chajdas <dev@anteru.net>2023-03-11 13:51:32 +0100
commit11ef5aafc739202f823db79ca89e0c73e1db4e8f (patch)
tree5e4b0c68754dcaad739e55adf23538e997e2bc4d /pygments
parent2350fdabb57d8c592b2041f917f74b6276cc6314 (diff)
downloadpygments-git-11ef5aafc739202f823db79ca89e0c73e1db4e8f.tar.gz
Improve Gnuplot lexer.
* Merge comment tokens. * Improve whitespace matching accuracy.
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/graphics.py7
1 files changed, 4 insertions, 3 deletions
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