Skip to content

Commit 10861b1

Browse files
Amended comment.
1 parent 534105c commit 10861b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/compiler/parser.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3995,12 +3995,13 @@ module ts {
39953995
}
39963996
break;
39973997

3998-
// 'declare', 'module', 'namespace', 'interface'* and 'type' are all legal JavaScript identifiers when
3999-
// ASI takes effect. In such cases, we cannot parse out the "expected" declarations. For instance, while
3998+
// 'declare', 'module', 'namespace', 'interface'* and 'type' are all legal JavaScript identifiers;
3999+
// however, an identifier cannot be followed by another identifier on the same line. This is what we
4000+
// count on to parse out the respective declarations. For instance, we exploit this to say that
40004001
//
40014002
// namespace n
40024003
//
4003-
// can be none other than the beginning of a namespace declaration, JavaScript sees
4004+
// can be none other than the beginning of a namespace declaration, but need to respect that JavaScript sees
40044005
//
40054006
// namespace
40064007
// n

0 commit comments

Comments
 (0)