int idx = 0;
while ((idx = line.indexOf(TEST_APOS, idx)) >= 0) {
// ignore if quote was not escaped either
int expected_idx = idx - offset;
if (expected_idx < 0 || line.indexOf(TEST_QUOT, expected_idx) != expected_idx) {
this.errors.add(new ValidationError(Type.WARNING, lineNr, idx, "Unescaped ' character"));
}
idx++;
}
idx = 0;
while ((idx = line.indexOf(TEST_QUOT, idx)) >= 0) {
// ignore if apostrophe was not escaped either
int expected_idx = idx + offset;
if (expected_idx < 0 || line.indexOf(TEST_APOS, expected_idx) != expected_idx) {
this.errors.add(new ValidationError(Type.WARNING, lineNr, idx, "Unescaped \" character"));
}
idx++;
}
}