Allow users to define new zero-argument functions
[fur] / tokenization.py
index a736912..1a2653e 100644 (file)
@@ -31,13 +31,13 @@ def _make_token_matcher(definition):
 
     return token_matcher
 
-
 _TOKEN_MATCHERS = [
+    ('keyword',                         r'(def|end)(?![a-z_])'),
     ('open_parenthese',                 r'\('),
     ('close_parenthese',                r'\)'),
     ('comma',                           r','),
     ('integer_literal',                 r'\d+'),
-    ('symbol',                          r'[a-z]+'),
+    ('symbol',                          r'[a-z_]+'),
     ('single_quoted_string_literal',    r"'.*?'"),
     ('comparison_level_operator',         r'(<=|>=|==|!=|<|>)'),
     ('assignment_operator',             r'='),