Qudi
|
A compiler that caches code compiled from interactive statements. More...
Public Member Functions | |
def | __init__ (self) |
def | ast_parse (self, source, filename='< unknown >', symbol='exec') |
Parse code to an AST with the current compiler flags active. More... | |
def | reset_compiler_flags (self) |
Reset compiler flags to default state. More... | |
def | compiler_flags (self) |
Flags currently active in the compilation process. | |
def | cache (self, code, number=0) |
Make a name for a block of code, and cache the code. More... | |
Public Attributes | |
flags | |
A compiler that caches code compiled from interactive statements.
def compilerop.CachingCompiler.ast_parse | ( | self, | |
source, | |||
filename = '<unknown>' , |
|||
symbol = 'exec' |
|||
) |
Parse code to an AST with the current compiler flags active.
Arguments are exactly the same as ast.parse (in the standard library), and are passed to the built-in compile function.
def compilerop.CachingCompiler.cache | ( | self, | |
code, | |||
number = 0 |
|||
) |
Make a name for a block of code, and cache the code.
code str The Python source code to cache. number int A number which forms part of the code's name. Used for the execution counter.
The name of the cached code (as a string). Pass this as the filename argument to compilation, so that tracebacks are correctly hooked up.
def compilerop.CachingCompiler.reset_compiler_flags | ( | self | ) |
Reset compiler flags to default state.