Lines Matching refs:source
1 r"""Utilities to compile possibly incomplete Python source code.
15 First, check if the source consists entirely of blank lines and
31 successful outcome before reaching the end of the source; in this
39 compile_command(source, filename, symbol):
68 def _maybe_compile(compiler, source, filename, symbol):
69 # Check for source consisting of only blank lines and comments
70 for line in source.split("\n"):
76 source = "pass" # Replace it with a 'pass' statement
82 code = compiler(source, filename, symbol)
87 code1 = compiler(source + "\n", filename, symbol)
92 code2 = compiler(source + "\n\n", filename, symbol)
101 def _compile(source, filename, symbol):
102 return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT)
104 def compile_command(source, filename="<input>", symbol="single"):
109 source -- the source string; may contain \n characters
110 filename -- optional filename from which source was read; default
122 return _maybe_compile(_compile, source, filename, symbol)
132 def __call__(self, source, filename, symbol):
133 codeob = compile(source, filename, symbol, self.flags, 1)
149 def __call__(self, source, filename="<input>", symbol="single"):
154 source -- the source string; may contain \n characters
155 filename -- optional filename from which source was read;
168 return _maybe_compile(self.compiler, source, filename, symbol)