Commits

Joe Jevnik  committed c9376b9

Adds commented form #;(sexpr) to comment out whole sexprs and support
for the '#!r6rs' lexeme as defined in:
http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-7.html#node_sec_4.2.3

  • Participants
  • Parent commits 678d53a

Comments (0)

Files changed (1)

File pygments/lexers/functional.py

 
     tokens = {
         'root' : [
-            # the comments - always starting with semicolon
+            # the comments
             # and going to the end of the line
             (r';.*$', Comment.Single),
             # multi-line comment
             (r'#\|', Comment.Multiline, 'multiline-comment'),
+            # commented form (entire sexpr folliwng)
+            (r'#;\s*\(', Comment, 'commented-form'),
+            # signifies that the program text that follows is written with the
+            # lexical and datum syntax described in r6rs
+            (r'#!r6rs', Comment),
 
             # whitespaces - usually not relevant
             (r'\s+', Text),
             (r'[^|#]+', Comment.Multiline),
             (r'[|#]', Comment.Multiline),
         ],
+        'commented-form' : [
+            (r'\(', Comment, '#push'),
+            (r'\)', Comment, '#pop'),
+            (r'[^()]+', Comment),
+        ],
     }