dmajda/pegjs — pull request #209 by Mingun (2013-09-20 15:25:22+00:00)
Title: Issue 30

Sorry fo my english, I hope, that it is not so bad...

I realize issue #30 -- feature for specify exact count an min-max range of repetitions of rule. Syntax:
```
expression |exact|
expression |min..|
expression |..max|
expression |min..max|
expression |..|
```
Now all constraints -- a `int` in grammar, but bytecode not limited by this.

I add 3 opcodes to abstract VM, but only 2 are used: `IF_ARRLEN_MIN` and `IF_ARRLEN_MAX`, opcode BREAK wasn't necessary, but I keep it realization.

New `IF...` opcodes use stack to get constraint and array and compiled to:
```
min = stack.pop();
if (typeof(min) !== "undefined" && stack.top().length < min) {

} else {

}

max = stack.pop();
if (typeof(max) !== "undefined" && stack.top().length >= max) {

} else {

}
```
Unused BREAK opcode use one parameter -- relative offset to opcode, which begin new scope, and which should be breaked.

In grammar its able set delimiter expression for elements of list, but process of it not yet implemented.