Merge pull request #427 from sparecycles/fix/reference-static-regex

fix: /// <reference path="..." static='true' />
This commit is contained in:
Mohamed Hegazy 2014-08-12 17:46:06 -07:00
commit 2a106bf923
6 changed files with 46 additions and 1 deletions

View File

@ -49,7 +49,7 @@ module TypeScript {
return isNoDefaultLibRegex.exec(comment);
}
export var tripleSlashReferenceRegExp = /^(\/\/\/\s*<reference\s+path=)('|")(.+?)\2\s*(static=('|")(.+?)\2\s*)*\/>/;
export var tripleSlashReferenceRegExp = /^(\/\/\/\s*<reference\s+path=)('|")(.+?)\2\s*(static=('|")(.+?)\5\s*)*\/>/;
function getFileReferenceFromReferencePath(fileName: string, text: ISimpleText, position: number, comment: string, diagnostics: Diagnostic[]): IFileReference {
// First, just see if they've written: /// <reference\s+

View File

@ -0,0 +1,16 @@
{
"scenario": "Reference-path-static",
"projectRoot": "tests/cases/projects/reference-path-static",
"inputFiles": [
"test.ts"
],
"resolvedInputFiles": [
"test.ts",
"lib.ts",
"lib.d.ts"
],
"emittedFiles": [
"lib.js",
"test.js"
]
}

View File

@ -0,0 +1,16 @@
{
"scenario": "Reference-path-static",
"projectRoot": "tests/cases/projects/reference-path-static",
"inputFiles": [
"test.ts"
],
"resolvedInputFiles": [
"test.ts",
"lib.ts",
"lib.d.ts"
],
"emittedFiles": [
"lib.js",
"test.js"
]
}

View File

@ -0,0 +1,7 @@
{
"scenario": "Reference-path-static",
"projectRoot": "tests/cases/projects/reference-path-static",
"inputFiles": [
"test.ts"
]
}

View File

@ -0,0 +1,3 @@
module Lib {
export class LibType {}
}

View File

@ -0,0 +1,3 @@
/// <reference path="lib.ts" static='true' />
var libType: Lib.LibType;