Bug 15250 – Grammar does not contain rules for multiple slices in an index expression

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-10-26T19:29:00Z
Last change time
2016-01-03T14:20:05Z
Keywords
pull, spec
Assigned to
nobody
Creator
briancschott
Blocks
10233

Comments

Comment #0 by briancschott — 2015-10-26T19:29:33Z
Context: https://github.com/Hackerpilot/libdparse/issues/67 The grammar contains the following rule: PostfixExpression [ AssignExpression .. AssignExpression ] This does not allow for multi-dimensional slicing such as `a[1..2, 3..4];`
Comment #1 by briancschott — 2015-10-27T19:05:02Z
I think that it might be useful to delete the SliceExpression rule and modify the IndexExpression rule to look like this: IndexExpression: PostfixExpression '[' ']' | PostfixExpression '[' Index (',' Index)* ','? ']' ; Index: AssignExpression ('..' AssignExpression)? ;
Comment #2 by briancschott — 2015-10-27T20:47:57Z
Comment #3 by github-bugzilla — 2015-11-14T23:22:28Z
Commits pushed to master at https://github.com/D-Programming-Language/dlang.org https://github.com/D-Programming-Language/dlang.org/commit/f5d948df33498aec6f1cd9692244e8bce77e6129 Document variations on slice expressions to fix issue 15250 https://github.com/D-Programming-Language/dlang.org/commit/d014880f155b4fafd5c6f304a2bb620d7ffc9c59 Merge pull request #1143 from economicmodeling/issue-15250 Document variations on slice expressions to fix issue 15250
Comment #4 by github-bugzilla — 2016-01-03T14:20:05Z