summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-01-07 23:09:58 +0000
committerEnrico Granata <egranata@apple.com>2013-01-07 23:09:58 +0000
commit070db184fb38cc73fdde3ab1efde8c1ad87e179f (patch)
tree0178d67aa359b916501b64234f69836204ffb8b8 /lldb/source/Interpreter/ScriptInterpreterPython.cpp
parent7eb06859692c41fef8900b3157838548e67e3078 (diff)
downloadbcm5719-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.cpp6
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 ();
OpenPOWER on IntegriCloud