![]() |
Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
|
Public Member Functions | |
__init__ (self, [(str, Optional[str])] defs, [(str, str)] replaces, [str] undefs) | |
preprocess (self, filename) | |
__init__ (self, [(str, Optional[str])] defs, [(str, str)] replaces, [str] undefs) | |
preprocess (self, filename) | |
__init__ (self, [(str, Optional[str])] defs, [(str, str)] replaces, [str] undefs) | |
preprocess (self, filename) | |
Data Fields | |
bool | _inlines = True |
Protected Member Functions | |
_log (self, *args, **kwargs) | |
_strip_comments (self, line) | |
_fixup_indentation (self, macro, [str] replace) | |
_handle_if_block (self, macro, idx, is_true, prepend) | |
_preprocess_once (self) | |
_log (self, *args, **kwargs) | |
_strip_comments (self, line) | |
_fixup_indentation (self, macro, [str] replace) | |
_handle_if_block (self, macro, idx, is_true, prepend) | |
_preprocess_once (self) | |
_log (self, *args, **kwargs) | |
_strip_comments (self, line) | |
_fixup_indentation (self, macro, [str] replace) | |
_handle_if_block (self, macro, idx, is_true, prepend) | |
_preprocess_once (self) | |
Protected Attributes | |
dict | _defs = {macro:value for macro, value in defs} |
dict | _replaces = {macro:value for macro, value in replaces} |
_undefs = set(undefs) | |
_define = re.compile(r"\s*#\s*define") | |
_if = re.compile(r"\s*#\s*if") | |
_elif = re.compile(r"\s*#\s*(?P<elif>el)if") | |
_else = re.compile(r"\s*#\s*(?P<else>else)") | |
_endif = re.compile(r"\s*#\s*endif") | |
_ifdef = re.compile(fr"\s*#\s*if(?P<not>n)?def {MACRO_GROUP}\s*") | |
_if_defined | |
_if_defined_value | |
_if_true | |
_c_comment = re.compile(r"/\*.*?\*/") | |
_cpp_comment = re.compile(r"//") | |
_inlines = outlines | |
Looks for simple ifdefs and ifndefs and replaces them. Handles && and ||. Has fancy logic to handle translating elifs to ifs. Only looks for macros in the first part of the expression with no parens. Does not handle multi-line macros (only looks in first line).
|
protected |
|
protected |
|
protected |
|
protected |
Remove the #if or #elif block starting on this line.
|
protected |
Remove the #if or #elif block starting on this line.
|
protected |
Remove the #if or #elif block starting on this line.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
preprocess | ( | self, | |
filename ) |
preprocess | ( | self, | |
filename ) |
preprocess | ( | self, | |
filename ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |