dmajda/pegjs — pull request #299 by Mingun (2014-10-25 11:31:25+00:00)
Title: Revert "PEG.js grammar: Disallow empty sequences"

This reverts commit df154daafb9c6c952351493af02d3a55e0b05c59.

Conflicts:
lib/compiler/passes/generate-bytecode.js
lib/parser.js
spec/parser.spec.js
spec/unit/compiler/passes/generate-bytecode.spec.js
src/parser.pegjs

I think, change from df154daafb9c6c952351493af02d3a55e0b05c59 creates more problems, than decides. For example, I have a grammar describing the protocol of the ATM which looks approximately so (I use Ranges extension from #267):
```
GS 'Group Separator' = '\x1D' {return ''};
n4 'n4' = n:$[0-9]| 4| {return parseInt(n,10);};
n5 'n5' = n:$[0-9]| 5| {return parseInt(n,10);};
n7 'n7' = n:$[0-9]| 7| {return parseInt(n,10);};

TerminalState 'Terminal State'
= '1' ConfigInfo // Send configuration information
//...
/ '7' ExtendedSupplyCounter|.., GS|// Send supply counters (extended)
//...
;
ConfigInfo = ...;
ExtendedSupplyCounter
= 'A' tsn:n4 tranCnt:n7 // Transaction
/ 'B' cardsCaptured:n5 // Card Reader
//...
// Though all fields are marked with the identifier, however documentation
// says that they will go in strictly certain order (as it is specified here) and
// if any data aren't, there will be GS
/ // <-- Problem. What here shall be?
;
```
The grammar shall accept such sequence (field `B` is omitted, but GS for this still present) but after this commit it is impossible:
```
...7A...C...D...
```
I suggest to rollback it since it creates unnecessary complication of a parser and isn't obvious at all.