diff options
author | Enrico Granata <egranata@apple.com> | 2013-01-07 23:09:58 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2013-01-07 23:09:58 +0000 |
commit | 070db184fb38cc73fdde3ab1efde8c1ad87e179f (patch) | |
tree | 0178d67aa359b916501b64234f69836204ffb8b8 /lldb/source/Interpreter/ScriptInterpreterPython.cpp | |
parent | 7eb06859692c41fef8900b3157838548e67e3078 (diff) | |
download | bcm5719-llvm-070db184fb38cc73fdde3ab1efde8c1ad87e179f.tar.gz bcm5719-llvm-070db184fb38cc73fdde3ab1efde8c1ad87e179f.zip |
Make sure that the GenerateFunction call can support arbitrary levels of indentation for user code
llvm-svn: 171810
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp')
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index 78f8524d29c..7a12a9e6862 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -1609,10 +1609,11 @@ ScriptInterpreterPython::GenerateFunction(const char *signature, const StringLis // Wrap everything up inside the function, increasing the indentation. + auto_generated_function.AppendString(" if True:"); for (int i = 0; i < num_lines; ++i) { sstr.Clear (); - sstr.Printf (" %s", input.GetStringAtIndex (i)); + sstr.Printf (" %s", input.GetStringAtIndex (i)); auto_generated_function.AppendString (sstr.GetData()); } auto_generated_function.AppendString (" for key in new_keys:"); // Iterate over all the keys from session dict @@ -1702,7 +1703,8 @@ ScriptInterpreterPython::GenerateTypeSynthClass (StringList &user_input, std::st auto_generated_class.AppendString (sstr.GetData()); // Wrap everything up inside the class, increasing the indentation. - + // we don't need to play any fancy indentation tricks here because there is no + // surrounding code whose indentation we need to honor for (int i = 0; i < num_lines; ++i) { sstr.Clear (); |