MCPcopy Create free account
hub / github.com/pyload/pyload / interpret_statement

Method interpret_statement

module/plugins/hoster/YoutubeCom.py:870–890  ·  view source on GitHub ↗
(self, stmt, local_vars, allow_recursion=100)

Source from the content-addressed store, hash-verified

868 self._objects = objects
869
870 def interpret_statement(self, stmt, local_vars, allow_recursion=100):
871 if allow_recursion < 0:
872 raise JSInterpreterError('Recursion limit reached')
873
874 should_abort = False
875 stmt = stmt.lstrip()
876 stmt_m = re.match(r'var\s', stmt)
877 if stmt_m:
878 expr = stmt[len(stmt_m.group(0)):]
879
880 else:
881 return_m = re.match(r'return(?:\s+|$)', stmt)
882 if return_m:
883 expr = stmt[len(return_m.group(0)):]
884 should_abort = True
885 else:
886 # Try interpreting it as an expression
887 expr = stmt
888
889 v = self.interpret_expression(expr, local_vars, allow_recursion)
890 return v, should_abort
891
892 def interpret_expression(self, expr, local_vars, allow_recursion):
893 expr = expr.strip()

Callers 2

interpret_expressionMethod · 0.95
resfMethod · 0.95

Calls 3

interpret_expressionMethod · 0.95
JSInterpreterErrorClass · 0.85
matchMethod · 0.45

Tested by

no test coverage detected