Allowed comment directives to be multiline (#38228)

* Allowed comment directives to be multiline

* Added tests, and perhaps fixed a test runner bug?

* I think it's going to need a consistent variable to loop over

* Used dynamically computed indexes in verifies

* Added multiline tests

* Increased flexibility for multiline comment parsing

* Undid a couple of formatting changes; removed backslashes from multiline regexp

* Added baseline tests for multiline comment skipping

Co-authored-by: Orta Therox <orta.therox@gmail.com>
This commit is contained in:
Josh Goldberg
2020-05-06 13:09:29 -07:00
committed by GitHub
co-authored by Orta Therox
parent 4b08c0582d
commit be2eb8a2e1
17 changed files with 867 additions and 213 deletions
+40 -14
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -474,7 +474,7 @@ namespace ts {
export function createCommentDirectivesMap(sourceFile: SourceFile, commentDirectives: CommentDirective[]): CommentDirectivesMap {
const directivesByLine = createMapFromEntries(
commentDirectives.map(commentDirective => ([
`${getLineAndCharacterOfPosition(sourceFile, commentDirective.range.pos).line}`,
`${getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line}`,
commentDirective,
]))
);