@@ -163,19 +163,13 @@ private predicate summaryModel(string row) { any(SummaryModelCsv s).row(inverseP
163163
164164private predicate typeModel ( string row ) { any ( TypeModelCsv s ) .row ( inversePad ( row ) ) }
165165
166- /**
167- * Replaces `..` with `-->` in order to simplify subsequent parsing.
168- */
169- bindingset [ path]
170- private string normalizePath ( string path ) { result = path .replaceAll ( ".." , "-->" ) }
171-
172166/** Holds if a source model exists for the given parameters. */
173167predicate sourceModel ( string package , string type , string path , string kind ) {
174168 exists ( string row |
175169 sourceModel ( row ) and
176170 row .splitAt ( ";" , 0 ) = package and
177171 row .splitAt ( ";" , 1 ) = type and
178- normalizePath ( row .splitAt ( ";" , 2 ) ) = path and
172+ row .splitAt ( ";" , 2 ) = path and
179173 row .splitAt ( ";" , 3 ) = kind
180174 )
181175}
@@ -186,7 +180,7 @@ private predicate sinkModel(string package, string type, string path, string kin
186180 sinkModel ( row ) and
187181 row .splitAt ( ";" , 0 ) = package and
188182 row .splitAt ( ";" , 1 ) = type and
189- normalizePath ( row .splitAt ( ";" , 2 ) ) = path and
183+ row .splitAt ( ";" , 2 ) = path and
190184 row .splitAt ( ";" , 3 ) = kind
191185 )
192186}
@@ -199,9 +193,9 @@ private predicate summaryModel(
199193 summaryModel ( row ) and
200194 row .splitAt ( ";" , 0 ) = package and
201195 row .splitAt ( ";" , 1 ) = type and
202- normalizePath ( row .splitAt ( ";" , 2 ) ) = path and
203- normalizePath ( row .splitAt ( ";" , 3 ) ) = input and
204- normalizePath ( row .splitAt ( ";" , 4 ) ) = output and
196+ row .splitAt ( ";" , 2 ) = path and
197+ row .splitAt ( ";" , 3 ) = input and
198+ row .splitAt ( ";" , 4 ) = output and
205199 row .splitAt ( ";" , 5 ) = kind
206200 )
207201}
@@ -216,7 +210,7 @@ private predicate typeModel(
216210 row .splitAt ( ";" , 1 ) = type1 and
217211 row .splitAt ( ";" , 2 ) = package2 and
218212 row .splitAt ( ";" , 3 ) = type2 and
219- normalizePath ( row .splitAt ( ";" , 4 ) ) = path
213+ row .splitAt ( ";" , 4 ) = path
220214 )
221215}
222216
@@ -434,9 +428,9 @@ bindingset[arg]
434428private int getAnIntFromString ( string arg ) {
435429 result = arg .toInt ( )
436430 or
437- // Match "n1..n2", where ".." has previously been replaced with "-->" to simplify parsing
431+ // Match "n1..n2"
438432 exists ( string lo , string hi |
439- regexpCaptureTwo ( arg , "(\\d+)--> (\\d+)" , lo , hi ) and
433+ regexpCaptureTwo ( arg , "(\\d+)\\.\\. (\\d+)" , lo , hi ) and
440434 result = [ lo .toInt ( ) .. hi .toInt ( ) ]
441435 )
442436}
@@ -446,8 +440,8 @@ private int getAnIntFromString(string arg) {
446440 */
447441bindingset [ arg]
448442private int getLowerBoundFromString ( string arg ) {
449- // Match "n..", where ".." has previously been replaced with "-->" to simplify parsing
450- result = arg .regexpCapture ( "(\\d+)--> " , 1 ) .toInt ( )
443+ // Match "n.."
444+ result = arg .regexpCapture ( "(\\d+)\\.\\. " , 1 ) .toInt ( )
451445}
452446
453447/**
@@ -479,22 +473,22 @@ private int getAnIntFromStringWithArity(string arg, int arity) {
479473 result = arity - lo .toInt ( )
480474 or
481475 // N-x..
482- lo = arg .regexpCapture ( "N-(\\d+)--> " , 1 ) and
476+ lo = arg .regexpCapture ( "N-(\\d+)\\.\\. " , 1 ) and
483477 result = [ arity - lo .toInt ( ) , arity - 1 ]
484478 )
485479 or
486480 exists ( string lo , string hi |
487481 // x..N-y
488- regexpCaptureTwo ( arg , "(\\d+)--> N-(\\d+)" , lo , hi ) and
482+ regexpCaptureTwo ( arg , "(\\d+)\\.\\. N-(\\d+)" , lo , hi ) and
489483 result = [ lo .toInt ( ) .. arity - hi .toInt ( ) ]
490484 or
491485 // N-x..Ny
492- regexpCaptureTwo ( arg , "N-(\\d+)--> N-(\\d+)" , lo , hi ) and
486+ regexpCaptureTwo ( arg , "N-(\\d+)\\.\\. N-(\\d+)" , lo , hi ) and
493487 result = [ arity - lo .toInt ( ) .. arity - hi .toInt ( ) ] and
494488 result >= 0
495489 or
496490 // N-x..y
497- regexpCaptureTwo ( arg , "N-(\\d+)--> (\\d+)" , lo , hi ) and
491+ regexpCaptureTwo ( arg , "N-(\\d+)\\.\\. (\\d+)" , lo , hi ) and
498492 result = [ arity - lo .toInt ( ) .. hi .toInt ( ) ] and
499493 result >= 0
500494 )
0 commit comments