@@ -60,14 +60,18 @@ protected IntegerFormula wrapInteger(TFormulaInfo formulaInfo) {
6060 @ Override
6161 public StringFormula makeString (String value ) {
6262 checkArgument (
63- isCodePointInRange (value ),
63+ areAllCodePointsInRange (value ),
6464 "String constant is out of supported Unicode range (Plane 0-2)." );
6565 return wrapString (makeStringImpl (value ));
6666 }
6767
6868 /** returns whether all Unicode characters in Planes 0-2. */
69- static boolean isCodePointInRange (String str ) {
70- return str .codePoints ().allMatch (codePoint -> 0x00000 <= codePoint && codePoint <= 0x2FFFF );
69+ private static boolean areAllCodePointsInRange (String str ) {
70+ return str .codePoints ().allMatch (AbstractStringFormulaManager ::isCodePointInRange );
71+ }
72+
73+ private static boolean isCodePointInRange (int codePoint ) {
74+ return 0x00000 <= codePoint && codePoint <= 0x2FFFF ;
7175 }
7276
7377 /** Replace Unicode letters in UTF16 representation with their escape sequences. */
@@ -94,7 +98,7 @@ public static String unescapeUnicodeForSmtlib(String input) {
9498 }
9599 int codePoint = Integer .parseInt (hexCodePoint , 16 );
96100 checkArgument (
97- 0x00000 <= codePoint && codePoint <= 0x2FFFF ,
101+ isCodePointInRange ( codePoint ) ,
98102 "SMTLIB does only specify Unicode letters from Planes 0-2" );
99103 matcher .appendReplacement (sb , Character .toString (codePoint ));
100104 }
0 commit comments