Highlight function names correctly.
authorGlenn Hutchings <zondo42@gmail.com>
Mon, 13 Jun 2016 18:20:57 +0000 (19:20 +0100)
committerGlenn Hutchings <zondo42@gmail.com>
Mon, 13 Jun 2016 18:20:57 +0000 (19:20 +0100)
tools/inform.py

index 73b0d0d76e580351645e2752e15a05fae61aa9b4..1fa4e5b2290b3a02173cb4df2560c73d66e1c7fb 100644 (file)
@@ -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),
         ],