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) {
36
36
boolean inQuoted = false ;
37
37
38
38
int level = 0 ;
39
+ int pos = 0 ;
39
40
40
41
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 );
43
44
if (inComment ) {
44
45
if (c == '\n' ) {
45
46
// End of a comment
@@ -57,7 +58,7 @@ public static List<String> tokenize(String input) {
57
58
// We have a double quote: Check that it's not followed by another and actually closes
58
59
// the string.
59
60
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 ));
61
62
if (n .isEmpty () || n .orElseThrow () != '"' ) {
62
63
// Close the string
63
64
token .append (c );
@@ -66,7 +67,7 @@ public static List<String> tokenize(String input) {
66
67
// Add both quotes to the token and skip one character ahead
67
68
token .append (c );
68
69
token .append (n .orElseThrow ());
69
- i ++;
70
+ pos ++;
70
71
}
71
72
} else {
72
73
token .append (c );
@@ -128,6 +129,7 @@ public static List<String> tokenize(String input) {
128
129
}
129
130
}
130
131
}
132
+ pos ++;
131
133
}
132
134
if (level != 0 ) {
133
135
// Throw an exception if the brackets don't match
You can’t perform that action at this time.
0 commit comments