This repository has been archived by the owner on May 19, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix declare class with qualified type identifier (#97)
This makes declare class extends behave the same way as in flow The ast-token after the extends keyword, might be either Identifier or QualifiedTypeIdentifier To do that this commits splits the parseGenericType into two functions, one for parsing genericType and on for qualifiedTypeIdentifier
- Loading branch information
Showing
3 changed files
with
202 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare class A extends C.B.D { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 33, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 33 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 33, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 33 | ||
} | ||
}, | ||
"sourceType": "module", | ||
"body": [ | ||
{ | ||
"type": "DeclareClass", | ||
"start": 0, | ||
"end": 33, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 33 | ||
} | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 14, | ||
"end": 15, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 15 | ||
}, | ||
"identifierName": "A" | ||
}, | ||
"name": "A" | ||
}, | ||
"typeParameters": null, | ||
"extends": [ | ||
{ | ||
"type": "InterfaceExtends", | ||
"start": 24, | ||
"end": 29, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 24 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 29 | ||
} | ||
}, | ||
"id": { | ||
"type": "QualifiedTypeIdentifier", | ||
"start": 24, | ||
"end": 29, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 24 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 29 | ||
} | ||
}, | ||
"qualification": { | ||
"type": "QualifiedTypeIdentifier", | ||
"start": 24, | ||
"end": 27, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 24 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 27 | ||
} | ||
}, | ||
"qualification": { | ||
"type": "Identifier", | ||
"start": 24, | ||
"end": 25, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 24 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 25 | ||
}, | ||
"identifierName": "C" | ||
}, | ||
"name": "C" | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 26, | ||
"end": 27, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 26 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 27 | ||
}, | ||
"identifierName": "B" | ||
}, | ||
"name": "B" | ||
} | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 28, | ||
"end": 29, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 28 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 29 | ||
}, | ||
"identifierName": "D" | ||
}, | ||
"name": "D" | ||
} | ||
}, | ||
"typeParameters": null | ||
} | ||
], | ||
"mixins": [], | ||
"body": { | ||
"type": "ObjectTypeAnnotation", | ||
"start": 30, | ||
"end": 33, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 30 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 33 | ||
} | ||
}, | ||
"callProperties": [], | ||
"properties": [], | ||
"indexers": [] | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |