Re: [PATCH for Dlang support] d: examples: fix coding style

Akim Demaille <[email protected]>
Newsgroups gmane.comp.parsers.bison.patches
Message-ID <[email protected]>
Hi Adela,

I can't install this patch, it was mangled by your mailer.  Please send
it as an attachment, or also provide a PR.

> Le 6 nov. 2020 à 16:52, Adela Vais <[email protected]> a écrit :
> 
> Fixed whitespace issues and removed the @property attribute.
> * examples/d/calc/calc.y, examples/d/simple/calc.y: Here.

Make this:

* examples/d/calc/calc.y, examples/d/simple/calc.y: Fixe whitespace issues
and remove the @property attribute.


I use "here" when the commit title is clear enough, but if you
have to spell something different, do it with the file name,
and imperative.

> @@ -72,12 +72,12 @@ import std.range.primitives;
> import std.stdio;
> 
> auto calcLexer(R)(R range)
> -  if (isInputRange!R && is (ElementType!R : dchar))
> +if (isInputRange!R && is(ElementType!R : dchar))
> {
>   return new CalcLexer!R(range);
> }

I'm surprised by this.  That style came from H.S., and clearly
shows that that 'if' is compile-time, and controls the
availability of the function.

But you are right, the D coding style does not use indentation
here (https://dlang.org/dstyle.html#phobos_declarations).
I preferred H.S.'s style, but you're change is right.


Cheers!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.