Bug 13538 – Divide old C style syntax from D style grammar rule

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-09-27T04:56:00Z
Last change time
2014-10-12T21:20:29Z
Keywords
pull, spec
Assigned to
nobody
Creator
k.hara.pg
Blocks
10233

Comments

Comment #0 by k.hara.pg — 2014-09-27T04:56:03Z
Current declaration grammar contains both D style syntax and C style one. Decl: StorageClasses_opt BasicType Declarators ; [snip] Declarator: BasicType2_opt ( Declarator ) DeclaratorSuffixes_opt BasicType2_opt Identifier DeclaratorSuffixes_opt // [x] [snip] DeclaratorSuffix: [ ] [ AssignExpression ] [ Type ] Parameters MemberFunctionAttributes_opt TemplateParameters Parameters MemberFunctionAttributes_opt Constraint_opt The grammar [x] accept both: int[] var and int var[] But it's confusing, and hard to understand what the grammar will accept. Instead of mixing C style grammar rules under the one "Declarator", I'd propose to separate them into "AltDeclarator". And finally we can easily say that the AltDeclarator will be deprecated.
Comment #1 by k.hara.pg — 2014-09-27T05:21:21Z
Comment #2 by github-bugzilla — 2014-10-12T21:20:26Z
Commits pushed to master at https://github.com/D-Programming-Language/dlang.org https://github.com/D-Programming-Language/dlang.org/commit/6305b155c8b37c3a30a48038e1d102bade064bd3 fix Issue 13538 - Divide old C style syntax from D style grammar rule https://github.com/D-Programming-Language/dlang.org/commit/3b110153edaf850b0a4ad28026bbdc111896ae16 Merge pull request #664 from 9rnsr/fix_declaration Issue 13538 & 13539 - Improve variable declaration grammar for old C style syntax