Skip to content

Commit 122b786

Browse files
Recovered deleted, renumbered existing, reworded some.
1 parent d7e3447 commit 122b786

16 files changed

+88
-63
lines changed

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module ts {
55
Unknown_compiler_option_0: { code: 6001, category: DiagnosticCategory.Error, key: "Unknown compiler option '{0}'." },
66
File_0_not_found: { code: 6002, category: DiagnosticCategory.Error, key: "File '{0}' not found." },
77
File_0_must_have_extension_ts_or_d_ts: { code: 6003, category: DiagnosticCategory.Error, key: "File '{0}' must have extension '.ts' or '.d.ts'." },
8+
Unterminated_string_literal: { code: 1002, category: DiagnosticCategory.Error, key: "Unterminated string literal." },
89
Identifier_expected: { code: 1003, category: DiagnosticCategory.Error, key: "Identifier expected." },
910
_0_expected: { code: 1005, category: DiagnosticCategory.Error, key: "'{0}' expected." },
1011
Trailing_comma_not_allowed: { code: 1009, category: DiagnosticCategory.Error, key: "Trailing comma not allowed." },
@@ -21,10 +22,16 @@ module ts {
2122
An_index_signature_must_have_a_type_annotation: { code: 1021, category: DiagnosticCategory.Error, key: "An index signature must have a type annotation." },
2223
An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: DiagnosticCategory.Error, key: "An index signature parameter must have a type annotation." },
2324
An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: DiagnosticCategory.Error, key: "An index signature parameter type must be 'string' or 'number'." },
25+
A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: DiagnosticCategory.Error, key: "A class or interface declaration can only have one 'extends' clause." },
26+
An_extends_clause_must_precede_am_implements_clause: { code: 1025, category: DiagnosticCategory.Error, key: "An 'extends' clause must precede am 'implements' clause." },
27+
A_class_can_only_extend_a_single_class: { code: 1026, category: DiagnosticCategory.Error, key: "A class can only extend a single class." },
28+
A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: DiagnosticCategory.Error, key: "A class declaration can only have one 'implements' clause." },
2429
Accessibility_modifier_already_seen: { code: 1028, category: DiagnosticCategory.Error, key: "Accessibility modifier already seen." },
2530
_0_modifier_must_precede_1_modifier: { code: 1029, category: DiagnosticCategory.Error, key: "'{0}' modifier must precede '{1}' modifier." },
2631
_0_modifier_already_seen: { code: 1030, category: DiagnosticCategory.Error, key: "'{0}' modifier already seen." },
2732
_0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a class element." },
33+
An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: DiagnosticCategory.Error, key: "An interface declaration cannot have an 'implements' clause." },
34+
super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: DiagnosticCategory.Error, key: "'super' must be followed by an argument list or member access." },
2835
Only_ambient_modules_can_use_quoted_names: { code: 1035, category: DiagnosticCategory.Error, key: "Only ambient modules can use quoted names." },
2936
Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: DiagnosticCategory.Error, key: "Statements are not allowed in ambient contexts." },
3037
A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: DiagnosticCategory.Error, key: "A function implementation cannot be declared in an ambient context." },
@@ -46,6 +53,7 @@ module ts {
4653
Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." },
4754
Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: DiagnosticCategory.Error, key: "Unexpected token. A constructor, method, accessor, or property was expected." },
4855
A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an import declaration." },
56+
Invalid_reference_comment: { code: 1084, category: DiagnosticCategory.Error, key: "Invalid reference comment." },
4957
Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: DiagnosticCategory.Error, key: "Octal literals are not available when targeting ECMAScript 5 and higher." },
5058
An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: DiagnosticCategory.Error, key: "An accessor cannot be declared in an ambient context." },
5159
_0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a constructor declaration." },
@@ -209,7 +217,7 @@ module ts {
209217
The_current_host_does_not_support_the_0_option: { code: 5001, category: DiagnosticCategory.Error, key: "The current host does not support the '{0}' option." },
210218
Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." },
211219
Cannot_read_file_0_Colon_1: { code: 5012, category: DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" },
212-
Unsupported_file_encoding: { code: 5013, category: DiagnosticCategory.NoPrefix, key: "Unsupported file encoding." },
220+
Unsupported_file_encoding: { code: 5013, category: DiagnosticCategory.Error, key: "Unsupported file encoding." },
213221
Could_not_write_file_0_Colon_1: { code: 5033, category: DiagnosticCategory.Error, key: "Could not write file '{0}': {1}" },
214222
Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: DiagnosticCategory.Error, key: "Option mapRoot cannot be specified without specifying sourcemap option." },
215223
Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: DiagnosticCategory.Error, key: "Option sourceRoot cannot be specified without specifying sourcemap option." },
@@ -264,7 +272,6 @@ module ts {
264272
Digit_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Digit expected." },
265273
Hexadecimal_digit_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Hexadecimal digit expected." },
266274
Unexpected_end_of_text: { code: -9999999, category: DiagnosticCategory.Error, key: "Unexpected end of text." },
267-
Unterminated_string_constant: { code: -9999999, category: DiagnosticCategory.Error, key: "Unterminated string constant." },
268275
Invalid_character: { code: -9999999, category: DiagnosticCategory.Error, key: "Invalid character." },
269276
Declaration_or_statement_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Declaration or statement expected." },
270277
Statement_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Statement expected." },
@@ -280,13 +287,11 @@ module ts {
280287
Type_parameter_declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Type parameter declaration expected." },
281288
Type_argument_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Type argument expected." },
282289
String_literal_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "String literal expected." },
283-
super_must_be_followed_by_argument_list_or_member_access: { code: -9999999, category: DiagnosticCategory.Error, key: "'super' must be followed by argument list or member access." },
284290
Line_break_not_permitted_here: { code: -9999999, category: DiagnosticCategory.Error, key: "Line break not permitted here." },
285291
catch_or_finally_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "'catch' or 'finally' expected." },
286292
Block_or_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Block or ';' expected." },
287293
Modifiers_not_permitted_on_index_signature_members: { code: -9999999, category: DiagnosticCategory.Error, key: "Modifiers not permitted on index signature members." },
288294
Declaration_expected: { code: -9999999, category: DiagnosticCategory.Error, key: "Declaration expected." },
289-
Invalid_reference_comment: { code: -9999999, category: DiagnosticCategory.Error, key: "Invalid reference comment." },
290295
File_0_is_not_an_external_module: { code: -9999999, category: DiagnosticCategory.Error, key: "File '{0}' is not an external module." },
291296
Excessive_stack_depth_comparing_types_0_and_1: { code: -9999999, category: DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." },
292297
Type_0_is_not_assignable_to_type_1_Colon: { code: -9999999, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}':" },

src/compiler/diagnosticMessages.json

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
"code": 6003
1313
},
1414

15+
"Unterminated string literal.": {
16+
"category": "Error",
17+
"code": 1002
18+
},
1519
"Identifier expected.": {
1620
"category": "Error",
1721
"code": 1003
@@ -76,6 +80,22 @@
7680
"category": "Error",
7781
"code": 1023
7882
},
83+
"A class or interface declaration can only have one 'extends' clause.": {
84+
"category": "Error",
85+
"code": 1024
86+
},
87+
"An 'extends' clause must precede am 'implements' clause.": {
88+
"category": "Error",
89+
"code": 1025
90+
},
91+
"A class can only extend a single class.": {
92+
"category": "Error",
93+
"code": 1026
94+
},
95+
"A class declaration can only have one 'implements' clause.": {
96+
"category": "Error",
97+
"code": 1027
98+
},
7999
"Accessibility modifier already seen.": {
80100
"category": "Error",
81101
"code": 1028
@@ -92,6 +112,14 @@
92112
"category": "Error",
93113
"code": 1031
94114
},
115+
"An interface declaration cannot have an 'implements' clause.": {
116+
"category": "Error",
117+
"code": 1032
118+
},
119+
"'super' must be followed by an argument list or member access.": {
120+
"category": "Error",
121+
"code": 1034
122+
},
95123
"Only ambient modules can use quoted names.": {
96124
"category": "Error",
97125
"code": 1035
@@ -176,6 +204,10 @@
176204
"category": "Error",
177205
"code": 1079
178206
},
207+
"Invalid reference comment.": {
208+
"category": "Error",
209+
"code": 1084
210+
},
179211
"Octal literals are not available when targeting ECMAScript 5 and higher.": {
180212
"category": "Error",
181213
"code": 1085
@@ -831,7 +863,7 @@
831863
"code": 5012
832864
},
833865
"Unsupported file encoding.": {
834-
"category": "NoPrefix",
866+
"category": "Error",
835867
"code": 5013
836868
},
837869
"Could not write file '{0}': {1}": {
@@ -1051,10 +1083,6 @@
10511083
"category": "Error",
10521084
"code": -9999999
10531085
},
1054-
"Unterminated string constant.": {
1055-
"category": "Error",
1056-
"code": -9999999
1057-
},
10581086
"Invalid character.": {
10591087
"category": "Error",
10601088
"code": -9999999
@@ -1115,10 +1143,6 @@
11151143
"category": "Error",
11161144
"code": -9999999
11171145
},
1118-
"'super' must be followed by argument list or member access.": {
1119-
"category": "Error",
1120-
"code": -9999999
1121-
},
11221146
"Line break not permitted here.": {
11231147
"category": "Error",
11241148
"code": -9999999
@@ -1139,10 +1163,6 @@
11391163
"category": "Error",
11401164
"code": -9999999
11411165
},
1142-
"Invalid reference comment.": {
1143-
"category": "Error",
1144-
"code": -9999999
1145-
},
11461166
"File '{0}' is not an external module.": {
11471167
"category": "Error",
11481168
"code": -9999999

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ module ts {
19441944
primaryExpression.kind === SyntaxKind.SuperKeyword && token !== SyntaxKind.OpenParenToken && token !== SyntaxKind.DotToken;
19451945

19461946
if (illegalUsageOfSuperKeyword) {
1947-
error(Diagnostics.super_must_be_followed_by_argument_list_or_member_access);
1947+
error(Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
19481948
}
19491949

19501950
var expr = parseCallAndAccess(primaryExpression, /* inNewExpression */ false);

src/compiler/scanner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ module ts {
515515
}
516516
if (isLineBreak(ch)) {
517517
result += text.substring(start, pos);
518-
error(Diagnostics.Unterminated_string_constant);
518+
error(Diagnostics.Unterminated_string_literal);
519519
break;
520520
}
521521
pos++;

tests/baselines/reference/assignmentLHSIsValue.errors.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,19 @@
7676
class Derived extends C {
7777
constructor() { super(); super = value; }
7878
~
79-
!!! 'super' must be followed by argument list or member access.
79+
!!! 'super' must be followed by an argument list or member access.
8080
~~~~~
8181
!!! Invalid left-hand side of assignment expression.
8282

8383
foo() { super = value }
8484
~
85-
!!! 'super' must be followed by argument list or member access.
85+
!!! 'super' must be followed by an argument list or member access.
8686
~~~~~
8787
!!! Invalid left-hand side of assignment expression.
8888

8989
static sfoo() { super = value; }
9090
~
91-
!!! 'super' must be followed by argument list or member access.
91+
!!! 'super' must be followed by an argument list or member access.
9292
~~~~~
9393
!!! Invalid left-hand side of assignment expression.
9494
}

tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,38 +137,38 @@
137137
super();
138138
super *= value;
139139
~~
140-
!!! 'super' must be followed by argument list or member access.
140+
!!! 'super' must be followed by an argument list or member access.
141141
~~~~~
142142
!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
143143
super += value;
144144
~~
145-
!!! 'super' must be followed by argument list or member access.
145+
!!! 'super' must be followed by an argument list or member access.
146146
~~~~~
147147
!!! Invalid left-hand side of assignment expression.
148148
}
149149

150150
foo() {
151151
super *= value;
152152
~~
153-
!!! 'super' must be followed by argument list or member access.
153+
!!! 'super' must be followed by an argument list or member access.
154154
~~~~~
155155
!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
156156
super += value;
157157
~~
158-
!!! 'super' must be followed by argument list or member access.
158+
!!! 'super' must be followed by an argument list or member access.
159159
~~~~~
160160
!!! Invalid left-hand side of assignment expression.
161161
}
162162

163163
static sfoo() {
164164
super *= value;
165165
~~
166-
!!! 'super' must be followed by argument list or member access.
166+
!!! 'super' must be followed by an argument list or member access.
167167
~~~~~
168168
!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
169169
super += value;
170170
~~
171-
!!! 'super' must be followed by argument list or member access.
171+
!!! 'super' must be followed by an argument list or member access.
172172
~~~~~
173173
!!! Invalid left-hand side of assignment expression.
174174
}

tests/baselines/reference/errorSuperCalls.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
constructor() {
7373
super<string>();
7474
~
75-
!!! 'super' must be followed by argument list or member access.
75+
!!! 'super' must be followed by an argument list or member access.
7676
super();
7777
}
7878
}

tests/baselines/reference/parserSuperExpression2.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
M() {
44
super<T>(0);
55
~
6-
!!! 'super' must be followed by argument list or member access.
6+
!!! 'super' must be followed by an argument list or member access.
77
~~~~~
88
!!! 'super' can only be referenced in a derived class.
99
}

tests/baselines/reference/scannerStringLiterals.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"
1111
"Should error because of newline.
1212

13-
!!! Unterminated string constant.
13+
!!! Unterminated string literal.
1414
"Should error because of end of file.
1515

1616
!!! Unexpected end of text.

tests/baselines/reference/stringLiteralsErrors.errors.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,46 @@
22
// Srtings missing line terminator
33
var es1 = "line 1
44

5-
!!! Unterminated string constant.
5+
!!! Unterminated string literal.
66
";
77

8-
!!! Unterminated string constant.
8+
!!! Unterminated string literal.
99
var es2 = 'line 1
1010

11-
!!! Unterminated string constant.
11+
!!! Unterminated string literal.
1212
';
1313

14-
!!! Unterminated string constant.
14+
!!! Unterminated string literal.
1515

1616
// Space after backslash
1717
var es3 = 'line 1\
1818

19-
!!! Unterminated string constant.
19+
!!! Unterminated string literal.
2020
';
2121

22-
!!! Unterminated string constant.
22+
!!! Unterminated string literal.
2323
var es4 = 'line 1\
2424

25-
!!! Unterminated string constant.
25+
!!! Unterminated string literal.
2626
';
2727

28-
!!! Unterminated string constant.
28+
!!! Unterminated string literal.
2929

3030
// Unterminated strings
3131
var es5 = "unterminated
3232

33-
!!! Unterminated string constant.
33+
!!! Unterminated string literal.
3434
var es6 = 'unterminated
3535

36-
!!! Unterminated string constant.
36+
!!! Unterminated string literal.
3737

3838
// wrong terminator
3939
var es7 = "unterminated '
4040

41-
!!! Unterminated string constant.
41+
!!! Unterminated string literal.
4242
var es8 = 'unterminated "
4343

44-
!!! Unterminated string constant.
44+
!!! Unterminated string literal.
4545

4646
// wrong unicode sequences
4747
var es9 = "\u00";

0 commit comments

Comments
 (0)