drepl icon indicating copy to clipboard operation
drepl copied to clipboard

One true brace style is enforced

Open jrfondren opened this issue 6 years ago • 1 comments

In drepl 0.2.1, this input is accepted:

Welcome to D REPL.
D> import std;
std
D> real times_pi(real n) {
 | return n * PI;
 | }
times_pi
D> times_pi(3)
9.42478

But this heathen, disgusting input is refused:

Welcome to D REPL.
D> import std;
std
D> real times_pi(real n)
core.exception.RangeError@../../.dub/packages/libdparse-0.8.7/libdparse/src/dparse/parser.d(7511): Range violation
... more errors ...

I approve of this restriction, of course, but as drepl itself follows dstyle's brace recommendations, I think it may be an unintentional one.

jrfondren avatar Dec 10 '19 22:12 jrfondren

It's used to simplify detection of multi-line continuations. Other approaches welcome.

MartinNowak avatar Mar 13 '20 22:03 MartinNowak