https://github.com/DavidSpickett commented:

I had a dark thought that maybe mutli-line input would mess up checking for % 
commands, but luckily it does not.

```
clang-repl> int a = 1;
clang-repl> int b = 10 \
clang-repl...   %undo
In file included from <<< inputs >>>:1:
input_line_2:1:13: error: use of undeclared identifier 'undo'
    1 | int b = 10 %undo
      |             ^~~~
input_line_2:1:17: error: expected ';' after top level declarator
    1 | int b = 10 %undo
      |                 ^
      |                 ;
error: Parsing failed.
```
If it was doing as I feared, it would have treated that as a command, but it 
does not. I think it's seeing the two input lines as one, with an internal 
newline.

% commands have to start with % **after** leading and trailing whitespace has 
been removed. This is also why `      %undo` works.

```
clang-repl>          %undo
error: Operation failed. No input left to undo
```

https://github.com/llvm/llvm-project/pull/150348
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to