}
} catch (InvalidInputException e) {
token = TokenNameERROR;
+ String detailedMessage = e.getMessage();
+
+ if (detailedMessage==Scanner.UNTERMINATED_STRING) {
+ throwSyntaxError("Unterminated string.");
+ } else if (detailedMessage==Scanner.UNTERMINATED_COMMENT) {
+ throwSyntaxError("Unterminated commment.");
+ }
}
return;
}
// }
}
} catch (IndexOutOfBoundsException e) {
+// reset end position for error reporting
+ currentPosition-=2;
throw new InvalidInputException(UNTERMINATED_STRING);
} catch (InvalidInputException e) {
if (e.getMessage().equals(INVALID_ESCAPE)) {
// }
}
} catch (IndexOutOfBoundsException e) {
+ // reset end position for error reporting
+ currentPosition-=2;
throw new InvalidInputException(UNTERMINATED_STRING);
} catch (InvalidInputException e) {
if (e.getMessage().equals(INVALID_ESCAPE)) {
// }
}
} catch (IndexOutOfBoundsException e) {
+// reset end position for error reporting
+ currentPosition-=2;
throw new InvalidInputException(UNTERMINATED_STRING);
} catch (InvalidInputException e) {
if (e.getMessage().equals(INVALID_ESCAPE)) {
return TokenNameCOMMENT_BLOCK;
}
} catch (IndexOutOfBoundsException e) {
+// reset end position for error reporting
+ currentPosition-=2;
throw new InvalidInputException(UNTERMINATED_COMMENT);
}
break;