Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One true brace style is enforced #78

Open
jrfondren opened this issue Dec 10, 2019 · 1 comment
Open

One true brace style is enforced #78

jrfondren opened this issue Dec 10, 2019 · 1 comment

Comments

@jrfondren
Copy link

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.

@MartinNowak
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants