| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/pythran/analyses/ |
Upload File : |
"""
HasReturn detects if there's a return or yield statement
HasBreak detects if there's a break statement
HasContinue detects if there's a continue statement
"""
from pythran.passmanager import NodeAnalysis
class HasReturn(NodeAnalysis):
def __init__(self):
self.result = False
super(HasReturn, self).__init__()
def visit_Return(self, _):
self.result = True
def visit_Yield(self, _):
self.result = True
class HasBreak(NodeAnalysis):
def __init__(self):
self.result = False
super(HasBreak, self).__init__()
def visit_For(self, _):
return
visit_While = visit_For
def visit_Break(self, _):
self.result = True
class HasContinue(NodeAnalysis):
def __init__(self):
self.result = False
super(HasContinue, self).__init__()
def visit_For(self, _):
return
visit_While = visit_For
def visit_Continue(self, _):
self.result = True