diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /contrib/tools/cython/Cython/Compiler/CodeGeneration.py | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/cython/Cython/Compiler/CodeGeneration.py')
-rw-r--r-- | contrib/tools/cython/Cython/Compiler/CodeGeneration.py | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/contrib/tools/cython/Cython/Compiler/CodeGeneration.py b/contrib/tools/cython/Cython/Compiler/CodeGeneration.py index e64049c7f5..30c464db00 100644 --- a/contrib/tools/cython/Cython/Compiler/CodeGeneration.py +++ b/contrib/tools/cython/Cython/Compiler/CodeGeneration.py @@ -1,35 +1,35 @@ -from __future__ import absolute_import - -from .Visitor import VisitorTransform -from .Nodes import StatListNode - - -class ExtractPxdCode(VisitorTransform): - """ - Finds nodes in a pxd file that should generate code, and - returns them in a StatListNode. - - The result is a tuple (StatListNode, ModuleScope), i.e. - everything that is needed from the pxd after it is processed. - +from __future__ import absolute_import + +from .Visitor import VisitorTransform +from .Nodes import StatListNode + + +class ExtractPxdCode(VisitorTransform): + """ + Finds nodes in a pxd file that should generate code, and + returns them in a StatListNode. + + The result is a tuple (StatListNode, ModuleScope), i.e. + everything that is needed from the pxd after it is processed. + A purer approach would be to separately compile the pxd code, - but the result would have to be slightly more sophisticated - than pure strings (functions + wanted interned strings + - wanted utility code + wanted cached objects) so for now this - approach is taken. - """ - - def __call__(self, root): - self.funcs = [] - self.visitchildren(root) - return (StatListNode(root.pos, stats=self.funcs), root.scope) - - def visit_FuncDefNode(self, node): - self.funcs.append(node) - # Do not visit children, nested funcdefnodes will - # also be moved by this action... - return node - - def visit_Node(self, node): - self.visitchildren(node) - return node + but the result would have to be slightly more sophisticated + than pure strings (functions + wanted interned strings + + wanted utility code + wanted cached objects) so for now this + approach is taken. + """ + + def __call__(self, root): + self.funcs = [] + self.visitchildren(root) + return (StatListNode(root.pos, stats=self.funcs), root.scope) + + def visit_FuncDefNode(self, node): + self.funcs.append(node) + # Do not visit children, nested funcdefnodes will + # also be moved by this action... + return node + + def visit_Node(self, node): + self.visitchildren(node) + return node |