www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Removing the Symbol rule from the grammar

Context: http://dlang.org/spec/grammar.html

The "Symbol" rule is used only by two other rules in the grammar, 
"TemplateArgument" and "WithStatement".

In the case of "WithStatement", the grammar looks like this:

     'with' '(' Expression | Symbol | TemplateInstance ')' 

Looking at the definition of the "Symbol" and "Expression" rules 
you can see that anything that can parse as "Symbol" can also 
parse as "Expression", so there's no point in this rule being 

In the case of "TemplateArgument", the grammar looks like this:

     Type | AssignExpression | Symbol

Again, reading the grammar for "Type" shows that it's a superset 
of the grammar of "Symbol" so "Symbol" does not justify its 
existence here either.

Am I missing something, or is this a good opportunity to simplify 
the spec and make IDE plugin development easier?
Jul 07 2016