File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/org/sosy_lab/java_smt/basicimpl Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,11 @@ public static List<String> tokenize(String input) {
3636 boolean inQuoted = false ;
3737
3838 int level = 0 ;
39+ int pos = 0 ;
3940
4041 StringBuilder token = new StringBuilder ();
41- for ( int i = 0 ; i < input .length (); i ++ ) {
42- char c = input .charAt (i );
42+ while ( pos < input .length ()) {
43+ char c = input .charAt (pos );
4344 if (inComment ) {
4445 if (c == '\n' ) {
4546 // End of a comment
@@ -57,7 +58,7 @@ public static List<String> tokenize(String input) {
5758 // We have a double quote: Check that it's not followed by another and actually closes
5859 // the string.
5960 Optional <Character > n =
60- (i == input .length () - 1 ) ? Optional .empty () : Optional .of (input .charAt (i + 1 ));
61+ (pos == input .length () - 1 ) ? Optional .empty () : Optional .of (input .charAt (pos + 1 ));
6162 if (n .isEmpty () || n .orElseThrow () != '"' ) {
6263 // Close the string
6364 token .append (c );
@@ -66,7 +67,7 @@ public static List<String> tokenize(String input) {
6667 // Add both quotes to the token and skip one character ahead
6768 token .append (c );
6869 token .append (n .orElseThrow ());
69- i ++;
70+ pos ++;
7071 }
7172 } else {
7273 token .append (c );
@@ -128,6 +129,7 @@ public static List<String> tokenize(String input) {
128129 }
129130 }
130131 }
132+ pos ++;
131133 }
132134 if (level != 0 ) {
133135 // Throw an exception if the brackets don't match
You can’t perform that action at this time.
0 commit comments