Results 545 comments of David Neto

At first look: - inline single rule elements: Looks straightforward - combine duplicate rules: the grammar representation already uniques rules, so this *should* be straightforward. - right recursive rules become...

Hm.. About for_init being folded back in. I think once we do the collapse of `x | epsilon` into `x?` then the for_init will look better. Context: ``` for_header: for_header/0.0...

I've implemented all but 'for_init can be folded into ...' It's looking pretty good. [wgsl.recursive.txt](https://github.com/gpuweb/gpuweb/files/9293278/wgsl.recursive.txt)

I used a heuristic, so that you do the * and ? substitutions only when the substituted thing only has one non-epsilon option. So you still have things like: ```...

An implementor can refactor that as: ``` multiplicative_operator -> `/` | `*` | `%` multiplicative_expression.rest -> multiplicative_operator * ``` One of our rules, "inline a thing when it's only seen...

About "rules with *.post.unary_expression should use them". Looking for confounding patterns. Consider: ``` element_count_expression: unary_expression bitwise_expression.post.unary_expression | unary_expression multiplicative_expression.rest additive_expression.rest ``` It's helpful to have unary_expression out in front. We...

Latest result: [wgsl.recursive.txt](https://github.com/gpuweb/gpuweb/files/9294269/wgsl.recursive.txt)

The remaining remnants of the normalization are found via `$egrep '\d\.\d'`, yielding: ``` assignment_statement/0.1: | lhs_expression/0.0/0/0.0 * core_lhs_expression postfix_expression ? assignment_statement/0.1 expression | lhs_expression/0.0/0/0.0 * core_lhs_expression postfix_expression ? minus_minus |...

There's a small difficulty because: ``` variable_ident_decl: ident colon type_decl ``` which might prompt a refactoring of the original grammar, or a refactoring step in this tooling.