kpsewhich now expects "-var-value" instead of "-var".
[ibg.git] / tools / inform.py
index 94b4b03b4dd566ba5040e315c159c0b2907016d7..1fa4e5b2290b3a02173cb4df2560c73d66e1c7fb 100644 (file)
@@ -44,7 +44,9 @@ properties = ["n_to", "s_to", "e_to", "w_to", "ne_to", "se_to", "nw_to",
               "time_left", "time_out", "when_closed", "when_open", "when_on",
               "when_off", "with_key"]
 
-keywords = ["box", "break", "continue", "do", "else", "font off", "font on",
+extension_properties = ["pname"]
+
+keywords = ["box", "break", "continue", "do", "else", "font",
             "for", "give", "has", "hasnt", "if", "in", "inversion", "jump",
             "move", "new_line", "notin", "objectloop", "ofclass", "or",
             "print", "print_ret", "provides", "quit", "read", "remove",
@@ -70,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),
@@ -80,7 +83,7 @@ class InformLexer(RegexLexer):
             (r'\\', Text),
             (r'=', Operator),
             (r"[A-Za-z_,]+:", Name.Label),
-            (r"<<\S+>>", Name.Label),
+            (r"<.+?>", Name.Label),
 
             (wordlist(objects), Name.Class),
             (wordlist(keywords), Token.Keyword.Reserved),
@@ -89,6 +92,8 @@ class InformLexer(RegexLexer):
             (wordlist(attributes), Name.Attribute),
             (wordlist(constants), Name.Constant),
 
+            (wordlist(extension_properties), Name.Builtin),
+
             (r'[a-zA-Z_][a-zA-Z0-9_.]*', Name),
             (r'(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
             (r'\d+', Number.Integer),
@@ -96,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),
         ],