From 54830106a3ef48c411e0346f54bfb56f3072b8a2 Mon Sep 17 00:00:00 2001 From: Glenn Hutchings Date: Mon, 13 Jun 2016 19:20:57 +0100 Subject: [PATCH] Highlight function names correctly. --- tools/inform.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/inform.py b/tools/inform.py index 73b0d0d..1fa4e5b 100644 --- a/tools/inform.py +++ b/tools/inform.py @@ -72,8 +72,9 @@ class InformLexer(RegexLexer): tokens = { 'root': [ - (r'"', String.Double, 'stringdouble'), - (r"'", String.Single, 'stringsingle'), + (r'"', String.Double, 'string-double'), + (r"'", String.Single, 'string-single'), + (r"\[ *", Text, 'function-name'), (r'\n', Text), (r'[^\S\n]+', Text), @@ -100,13 +101,18 @@ class InformLexer(RegexLexer): (r'.', Punctuation), ], - 'stringdouble': [ + 'function-name': [ + (r"[ ;]", Text, '#pop'), + (r".", Name.Function), + ], + + 'string-double': [ (r'"', String.Double, '#pop'), (r'.', String.Double), (r'\n', String.Double), ], - 'stringsingle': [ + 'string-single': [ (r"'", String.Single, '#pop'), (r'.', String.Single), ], -- 2.31.1