From: Glenn Hutchings Date: Mon, 13 Jun 2016 18:20:57 +0000 (+0100) Subject: Highlight function names correctly. X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=54830106a3ef48c411e0346f54bfb56f3072b8a2;p=ibg.git Highlight function names correctly. --- 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), ],