www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Exact Grammar for D and Implicit Violations without Documentation

reply tyckesak <josipp live.de> writes:
Hi all, is there a definitive grammar sheet for D somewhere? I 
looked
through the grammar documentation online and through some bugs on 
Bugzilla
and it seems that D tacitly encourages violating the grammar 
specs in favor of some
ill-defined notion of brevity, but this comes at the cost of much 
needed clarity.
I would like to try to clean up some old bugs in Bugzilla that 
have gone stale, and it would
be _very_ helpful to have a common reference to stick to; right 
now it looks like everybody
is just winging it.

Take care and be safe!
Apr 03 2022
next sibling parent max haughton <maxhaton gmail.com> writes:
On Sunday, 3 April 2022 at 17:37:09 UTC, tyckesak wrote:
 Hi all, is there a definitive grammar sheet for D somewhere? I 
 looked
 through the grammar documentation online and through some bugs 
 on Bugzilla
 and it seems that D tacitly encourages violating the grammar 
 specs in favor of some
 ill-defined notion of brevity, but this comes at the cost of 
 much needed clarity.
 I would like to try to clean up some old bugs in Bugzilla that 
 have gone stale, and it would
 be _very_ helpful to have a common reference to stick to; right 
 now it looks like everybody
 is just winging it.

 Take care and be safe!
The grammar as listed on dlang.org is the closest thing to a singular reference but as you mention it does have bugs. There was some movement to get this cleaned up so a tree-sitter grammar can be done for D, but this is still ongoing.
Apr 03 2022
prev sibling parent Basile B. <b2.temp gmx.com> writes:
On Sunday, 3 April 2022 at 17:37:09 UTC, tyckesak wrote:
 Hi all, is there a definitive grammar sheet for D somewhere? I 
 looked
 through the grammar documentation online and through some bugs 
 on Bugzilla
 and it seems that D tacitly encourages violating the grammar 
 specs in favor of some
 ill-defined notion of brevity,
???
 but this comes at the cost of much needed clarity.
 I would like to try to clean up some old bugs in Bugzilla that 
 have gone stale, and it would
 be _very_ helpful to have a common reference to stick to; right 
 now it looks like everybody
 is just winging it.

 Take care and be safe!
I've looked a bit to the [updates in the issue tracker] and it turns out that what you actually talk about is not the grammar but the semantics. Grammar issues are tracked in [this meta issue], and are only related to errors in the parsing rules, i.e sequences of tokens. [updates in the issue tracker]: https://forum.dlang.org/group/issues [this meta issue]: https://issues.dlang.org/show_bug.cgi?id=10233
Apr 03 2022