JavaScript: Distinguish {lo} and {lo,} in the regular expression parser.

This commit is contained in:
Max Schaefer
2020-02-14 14:08:31 +00:00
parent 9e3ed214d0
commit 4346691cdc
7 changed files with 45 additions and 6 deletions

View File

@@ -0,0 +1,4 @@
| tst.js:1:2:1:5 | a{1} | 1 | 1 |
| tst.js:2:2:2:6 | a{1,} | 1 | <none> |
| tst.js:3:2:3:7 | a{1,5} | 1 | 5 |
| tst.js:4:2:4:6 | a{,5} | 0 | 5 |

View File

@@ -0,0 +1,7 @@
import javascript
from RegExpRange rr, string lb, string ub
where
lb = rr.getLowerBound().toString() and
if exists(rr.getUpperBound()) then ub = rr.getUpperBound().toString() else ub = "<none>"
select rr, lb, ub

View File

@@ -0,0 +1,4 @@
/a{1}/;
/a{1,}/;
/a{1,5}/;
/a{,5}/;