Georg Brandl avatar Georg Brandl committed a93f4e4

Fix test failures.

Comments (0)

Files changed (2)

pygments/lexers/agile.py

 
     keywords = [
         'fn', 'def', 'defn', 'defmacro', 'defmethod', 'defmulti', 'defn-',
-        'defstruct',
-        'if', 'cond',
-        'let', 'for'
+        'defstruct', 'if', 'cond', 'let', 'for'
     ]
     builtins = [
         '.', '..',
         'double', 'down', 'drop', 'drop-while', 'edit', 'end?', 'ensure',
         'eval', 'every?', 'false?', 'ffirst', 'file-seq', 'filter', 'find',
         'find-doc', 'find-ns', 'find-var', 'first', 'float', 'flush',
-        'fnseq', 'frest', 'gensym', 'get', 'get-proxy-class',
+        'fnseq', 'frest', 'gensym', 'get-proxy-class', 'get',
         'hash-map', 'hash-set', 'identical?', 'identity', 'if-let', 'import',
         'in-ns', 'inc', 'index', 'insert-child', 'insert-left', 'insert-right',
         'inspect-table', 'inspect-tree', 'instance?', 'int', 'interleave',
         'intersection', 'into', 'into-array', 'iterate', 'join', 'key', 'keys',
         'keyword', 'keyword?', 'last', 'lazy-cat', 'lazy-cons', 'left',
-        'lefts', 'line-seq', 'list', 'list*', 'load', 'load-file',
+        'lefts', 'line-seq', 'list*', 'list', 'load', 'load-file',
         'locking', 'long', 'loop', 'macroexpand', 'macroexpand-1',
         'make-array', 'make-node', 'map', 'map-invert', 'map?', 'mapcat',
         'max', 'max-key', 'memfn', 'merge', 'merge-with', 'meta', 'min',
 
     # TODO / should divide keywords/symbols into namespace/rest
     # but that's hard, so just pretend / is part of the name
-    valid_name = r'[\w!$%*+,<=>?/-]+'
-
-    prefix_operators = ['`', "'", '#', '^', '~', '~@']
+    valid_name = r'[\w!$%*+,<=>?/.-]+'
 
     def _multi_escape(entries):
-        return '(%s)' % ('|'.join([
-                    re.escape(entry) + ' ' for entry in entries]))
+        return '|'.join([re.escape(entry) + '(?![\\w-!$%*+,<=>?/.-])'
+                         for entry in entries]))
 
     tokens = {
         'root' : [
             (r':' + valid_name, Name.Constant),
 
             # special operators
-            (_multi_escape(prefix_operators),
-                Operator
-            ),
+            (r'~@|[`\'#^~&]', Operator),
 
             # highlight the keywords
-            (_multi_escape(keywords),
-                Keyword
-            ),
+            (_multi_escape(keywords), Keyword),
 
             # highlight the builtins
-            (_multi_escape(builtins),
-                Name.Builtin
-            ),
+            (_multi_escape(builtins), Name.Builtin),
 
             # the remaining functions
             (r'(?<=\()' + valid_name, Name.Function),

pygments/lexers/functional.py

             (r'\(\*', Comment.Multiline, 'comment'),
 
             (r'\'[0-9a-zA-Z_\']*', Name.Decorator),
+            (alphanumid_re, Name),
             (r',', Punctuation),
             (r'\)', Punctuation, '#pop'),
-            (r'', Error, '#pop'),
+            (symbolicid_re, Name),
         ],
 
         'comment': [
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.