Commit graph

680 commits

Author SHA1 Message Date
Cyrus Najmabadi
b12be3db19 Remove dependency from the typechecker to the compiler host.
This also lets us not expose the compiler host from the Program instance.
The compiler host was only needed by the type checker to get the host newline.
The host newline was used for concatenating diagnostic message chains.  Now
we don't concatenate them up front.  Instead, we just store the message chain
in the diagnostic itself.  Then when we pass it to the host, it can then decide
what newline to use.
2015-02-04 23:20:26 -08:00
Cyrus Najmabadi
28c1a23e7c Track performance statistics in the ts module.
This allows us to greatly simplify the compile function in tsc.
2015-02-04 18:42:44 -08:00
Cyrus Najmabadi
3cadb3c30c Use a diagnostics collection inside the program instance. 2015-02-04 18:12:13 -08:00
Cyrus Najmabadi
476c8249ac Remove 'isEmitBlocked' from the program API.
If emitting is blocked, then calling .emit on the program will simply return
immediately with an appropriate reason given in the EmitResult.
2015-02-04 17:48:29 -08:00
Cyrus Najmabadi
2a1d78d9e3 Simplify the createProgram API.
Allow the host parameter to be optional to simplify command line programs.
2015-02-04 17:02:26 -08:00
Cyrus Najmabadi
bb307f8163 Simplify the API for emitting code from the Program instance. 2015-02-04 16:53:14 -08:00
Cyrus Najmabadi
b6d083fa40 Do not publicly expose a way on a Program instance to get typecheckers with differing behavior.
Now, you can only get the non-diagnostics, pull-type-checker from the Program instance.
If you want diagnostics, you simply ask the Program instance for the diagnostics you want.
2015-02-04 16:11:38 -08:00
Cyrus Najmabadi
5b049feb36 Hide the diagnostic producing methods from TypeChecker.
Instead, consumers should get these diagnostics through the Program instance.
2015-02-04 14:29:25 -08:00
Cyrus Najmabadi
95702a89a7 Fix spelling of 'Filename' to be 'FileName'. 2015-02-03 16:08:46 -08:00
Vladimir Matveev
288e38fa36 merge with master 2015-02-03 11:26:39 -08:00
Mohamed Hegazy
d6bd9f74d2 Merge branch 'master' into LSAPICleanup 2015-02-02 18:49:13 -08:00
Cyrus Najmabadi
d66e70a960 Emit even in the presence of parse errors. 2015-02-02 15:28:23 -08:00
Cyrus Najmabadi
dd8d3535ff Remove the concept of early errors from the compiler.
Currently only parse errors prevent emitting (And this will be changed in the next
code review as well).
2015-02-02 15:14:19 -08:00
Mohamed Hegazy
0ce51e684f Fix #1871 by ensuring the at we get the canonical filename before we check the extension 2015-01-30 18:22:12 -08:00
Mohamed Hegazy
04d8f5af12 Merge branch 'master' into LSAPICleanup
Conflicts:
	src/services/services.ts
2015-01-27 20:11:16 -08:00
Sheetal Nandi
e0581899fa Rename existing import declaration to ImportEqualsDeclaration 2015-01-27 14:42:20 -08:00
Mohamed Hegazy
0257acebd3 Respond to code review comments 2015-01-26 16:45:34 -08:00
Vladimir Matveev
ad42afc4af resolve merge conflicts 2015-01-22 11:23:27 -08:00
Vladimir Matveev
c40977c5fb move getSyntacticDiagnostics out of SourceFile 2015-01-16 12:32:37 -08:00
Anders Hejlsberg
65452aa011 Hardening compiler to accept empty CompilerOptions object 2015-01-15 15:57:08 -08:00
Anders Hejlsberg
f9f95ba614 Support for tsconfig.json files in command-line compiler 2015-01-15 13:22:23 -08:00
Mohamed Hegazy
3c59b9fe9c Add getDefaultLibraryFilePath to retrive the default lib file path for node package consumers 2015-01-14 15:52:53 -08:00
Mohamed Hegazy
a99b958484 Manual port of fixe for #1593 from release-1.4 2015-01-13 09:30:54 -08:00
Cyrus Najmabadi
67b2f13cce Merge branch 'master' into layering
Conflicts:
	src/compiler/parser.ts
2014-12-18 00:39:56 -08:00
Cyrus Najmabadi
71c82dd33f Remove obsolete comment. 2014-12-16 15:32:56 -08:00
Cyrus Najmabadi
5a2fb94a95 Clean things up so the services layer can easily emit without having to contort compiler hosts. 2014-12-16 14:42:58 -08:00
Cyrus Najmabadi
f5ad79fe7a Remove the dependency that TypeChecker and Emitter have on Program.
Instead, these layers explicitly specify the functionality they need, and don't take in anything extra.
2014-12-16 14:12:17 -08:00
Cyrus Najmabadi
b665323d45 Make the emitter no longer depend on the Program.
This breaks layering.  Also, it means the emitter depends on too large a surface area.
Now the emitter declares exactly what it needs, and only gets that.
2014-12-16 13:52:47 -08:00
Cyrus Najmabadi
96c3c90d9a Rename typechecker parameter related to whether or not we produce diagnostics.
Comment what the flag means.
2014-12-16 13:30:34 -08:00
Cyrus Najmabadi
4aa361d4bf Layer the compiler so that every layer only depends on hte layers below it.
The layering is now:

types
core
scanner
parser
binder
checker
emitter
program
2014-12-16 13:14:14 -08:00