When deciding not to wrap add the last token ';' we advanced to.

This fixes Github issue 113, breaking Jupiter notebooks.
This commit is contained in:
Vassil Vassilev 2016-10-16 11:17:03 +02:00 committed by sftnight
parent e4f2dddf5a
commit fbd110fc67
2 changed files with 8 additions and 1 deletions

View File

@ -382,7 +382,10 @@ size_t cling::utils::getWrapPoint(std::string& source,
}
// There is "more" - let's assume this input consists of a using
// declaration or definition plus some code that should be wrapped.
return getFileOffset(Tok);
//
// We need to include the ';' in the offset as this will be a
// non-wrapped statement.
return getFileOffset(Tok) + 1;
}
if (keyword.equals("extern"))
return std::string::npos;

View File

@ -228,4 +228,8 @@ int *& RefRPtr = RPtr;
cIntStarRef(RefRPtr)
// CHECK: (int *) 0x{{[0-9]+}}
namespace Issue_113 {}
// Keep the blank space after the using clause.
using namespace Issue_113;
// expected-no-diagnostics