Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Public Attributes
MoinMoin.support.pygments.lexers.functional.CommonLispLexer Class Reference
Inheritance diagram for MoinMoin.support.pygments.lexers.functional.CommonLispLexer:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.pygments.lexers.functional.CommonLispLexer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def get_tokens_unprocessed

Public Attributes

 builtin_function
 special_forms
 macros
 lambda_list_keywords
 declarations
 builtin_types
 builtin_classes

Static Public Attributes

string name = 'Common Lisp'
list aliases = ['common-lisp', 'cl']
list filenames = ['*.cl', '*.lisp', '*.el']
list mimetypes = ['text/x-common-lisp']
 flags = re.IGNORECASE|re.MULTILINE
string nonmacro = r'\\.|[a-zA-Z0-9!$%&*+-/<=>?@\[\]^_{}~]'
 couple of useful regexes
string constituent = '|[#.:]'
string terminated = r'(?=[ "()\'\n,;`])'
string symbol = r'(\|[^|]+\||(?:%s)(?:%s)*)'
 symbol token, reverse-engineered from hyperspec Take a deep breath...
dictionary tokens

Detailed Description

A Common Lisp lexer.

*New in Pygments 0.9.*

Definition at line 155 of file functional.py.


Constructor & Destructor Documentation

Definition at line 179 of file functional.py.

00179 
00180     def __init__(self, **options):
00181         from pygments.lexers._clbuiltins import BUILTIN_FUNCTIONS, \
00182             SPECIAL_FORMS, MACROS, LAMBDA_LIST_KEYWORDS, DECLARATIONS, \
00183             BUILTIN_TYPES, BUILTIN_CLASSES
00184         self.builtin_function = BUILTIN_FUNCTIONS
00185         self.special_forms = SPECIAL_FORMS
00186         self.macros = MACROS
00187         self.lambda_list_keywords = LAMBDA_LIST_KEYWORDS
00188         self.declarations = DECLARATIONS
00189         self.builtin_types = BUILTIN_TYPES
00190         self.builtin_classes = BUILTIN_CLASSES
00191         RegexLexer.__init__(self, **options)


Member Function Documentation

Definition at line 192 of file functional.py.

00192 
00193     def get_tokens_unprocessed(self, text):
00194         stack = ['root']
00195         for index, token, value in RegexLexer.get_tokens_unprocessed(self, text, stack):
00196             if token is Name.Variable:
00197                 if value in self.builtin_function:
00198                     yield index, Name.Builtin, value
00199                     continue
00200                 if value in self.special_forms:
00201                     yield index, Keyword, value
00202                     continue
00203                 if value in self.macros:
00204                     yield index, Name.Builtin, value
00205                     continue
00206                 if value in self.lambda_list_keywords:
00207                     yield index, Keyword, value
00208                     continue
00209                 if value in self.declarations:
00210                     yield index, Keyword, value
00211                     continue
00212                 if value in self.builtin_types:
00213                     yield index, Keyword.Type, value
00214                     continue
00215                 if value in self.builtin_classes:
00216                     yield index, Name.Class, value
00217                     continue
00218             yield index, token, value

Here is the caller graph for this function:


Member Data Documentation

Definition at line 162 of file functional.py.

Definition at line 189 of file functional.py.

Definition at line 183 of file functional.py.

Definition at line 188 of file functional.py.

Definition at line 172 of file functional.py.

Definition at line 187 of file functional.py.

Definition at line 163 of file functional.py.

Definition at line 166 of file functional.py.

Definition at line 186 of file functional.py.

Definition at line 185 of file functional.py.

Definition at line 164 of file functional.py.

Definition at line 161 of file functional.py.

string MoinMoin.support.pygments.lexers.functional.CommonLispLexer.nonmacro = r'\\.|[a-zA-Z0-9!$%&*+-/<=>?@\[\]^_{}~]' [static]

couple of useful regexes

Definition at line 171 of file functional.py.

Definition at line 184 of file functional.py.

string MoinMoin.support.pygments.lexers.functional.CommonLispLexer.symbol = r'(\|[^|]+\||(?:%s)(?:%s)*)' [static]

symbol token, reverse-engineered from hyperspec Take a deep breath...

Definition at line 177 of file functional.py.

Definition at line 173 of file functional.py.

Definition at line 219 of file functional.py.


The documentation for this class was generated from the following file: