This patch allows the users to use backslash to tell clang-repl that more input is coming. This would help support OpenMP directives which generally require to be in separate lines.
Details
Diff Detail
Event Timeline
clang/test/Interpreter/multiline.cpp | ||
---|---|---|
12–17 | Another fun test case: // Requires -ftrigraphs but the following line ends with a backslash (surprise!) i=??/ 12; |
clang/test/Interpreter/multiline.cpp | ||
---|---|---|
12–17 | Yes, the implementation of the multiline support here is actually rather rudimentary. It intentionally does not include deeper language understanding but provides a way for the users typing "well-behaved" code to tell clang-repl that more is coming before it could compile it. In theory we could check for the ??/ trigraph and do the same but I don't think that would be used people use clang-repl on things like IBM 3270 terminals which seem not to have some characters and trigraphs could help there ;) Our full-fledged solution is described here https://discourse.llvm.org/t/rfc-flexible-lexer-buffering-for-handling-incomplete-input-in-interactive-c-c/64180/9 Until that lands we can have this to unblock work on things like OpenMP support. |
LGTM!
clang/test/Interpreter/multiline.cpp | ||
---|---|---|
12–17 | Okay, that's reasonable enough for the initial commit. Thanks! |
Another fun test case: