'inline': 'CYTHON_INLINE'
}.get
+
def get_utility_dir():
# make this a function and not global variables:
# http://trac.cython.org/cython_trac/ticket/475
Cython_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
return os.path.join(Cython_dir, "Utility")
+
class UtilityCodeBase(object):
"""
Support for loading utility code from a file.
replace_comments = re.compile(r'^\s*//.*|^\s*/\*[^*]*\*/').sub
match_special = re.compile(
(r'^%(C)s{5,30}\s*(?P<name>(?:\w|\.)+)\s*%(C)s{5,30}|'
- r'^%(C)s+@(?P<tag>\w+)\s*:\s*(?P<value>(?:\w|[.:])+)' # add more tag names here at need
+ r'^%(C)s+@(?P<tag>\w+)\s*:\s*(?P<value>(?:\w|[.:])+)'
) % {'C':comment}).match
match_type = re.compile('(.+)[.](proto|impl|init|cleanup)$').match
def get_tree(self):
pass
+
class UtilityCode(UtilityCodeBase):
"""
Stores utility code to add during code generation.