Harden regexp parsing a bit

This commit is contained in:
dcodeIO
2018-01-07 18:15:21 +01:00
parent 7c8670ac35
commit 0de05b543b
7 changed files with 54 additions and 18 deletions

View File

@ -10,6 +10,7 @@ export enum DiagnosticCode {
Type_0_cannot_be_changed_to_type_1 = 106,
Structs_cannot_extend_classes_and_vice_versa = 107,
Structs_cannot_implement_interfaces = 108,
Invalid_regular_expression_flags = 109,
Unterminated_string_literal = 1002,
Identifier_expected = 1003,
_0_expected = 1005,
@ -95,6 +96,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string {
case 106: return "Type '{0}' cannot be changed to type '{1}'.";
case 107: return "Structs cannot extend classes and vice-versa.";
case 108: return "Structs cannot implement interfaces.";
case 109: return "Invalid regular expression flags.";
case 1002: return "Unterminated string literal.";
case 1003: return "Identifier expected.";
case 1005: return "'{0}' expected.";