Adding documentation to repeat_spec.js

This commit is contained in:
Jeff Avallone 2015-04-23 19:08:35 -04:00
parent beb5a6fb52
commit 6beeddb83a

View File

@ -1,3 +1,7 @@
// RepeatSpec nodes are used for `a{m,n}` regular expression syntax. It is not
// rendered directly; it just indicates how many times the
// [Repeat](./repeat.html) node loops.
export default { export default {
setup() { setup() {
if (this.properties.min) { if (this.properties.min) {
@ -16,6 +20,7 @@ export default {
this.maximum = -1; this.maximum = -1;
} }
// Report invalid repeat when the minimum is larger than the maximum.
if (this.minimum > this.maximum && this.maximum !== -1) { if (this.minimum > this.maximum && this.maximum !== -1) {
throw `Numbers out of order: ${this.textValue}`; throw `Numbers out of order: ${this.textValue}`;
} }