Adding check that charset range is in correct order
This commit is contained in:
parent
9b8eef9c02
commit
d882ee8e08
@ -17,6 +17,13 @@ describe('parser/javascript/charset_range.js', function() {
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('throws an exception when the range is out of order', function() {
|
||||||
|
var parser = new javascript.Parser('z-a');
|
||||||
|
expect(() => {
|
||||||
|
parser.__consume__charset_range();
|
||||||
|
}).toThrow('Range out of order in character class: z-a');
|
||||||
|
});
|
||||||
|
|
||||||
describe('#_render', function() {
|
describe('#_render', function() {
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
|
@ -26,5 +26,9 @@ export default {
|
|||||||
setup() {
|
setup() {
|
||||||
this.first = this.properties.first;
|
this.first = this.properties.first;
|
||||||
this.last = this.properties.last;
|
this.last = this.properties.last;
|
||||||
|
|
||||||
|
if (this.first.ordinal > this.last.ordinal) {
|
||||||
|
throw `Range out of order in character class: ${this.textValue}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user