Commit graph

328 commits

Author SHA1 Message Date
Ivo Gabe de Wolff 39027d901a Rename emitParenthesized to emitParenthesizedIf 2015-01-23 15:46:32 +01:00
Ivo Gabe de Wolff cbec9a3a3a Respond to CR 2015-01-23 15:44:21 +01:00
Ivo Gabe de Wolff 434c908c36 Re-add debug assert & fix indent 2015-01-19 11:45:48 +01:00
Ivo Gabe de Wolff 161545de97 Change tagged template emit to new style 2015-01-19 11:33:43 +01:00
Ivo Gabe de Wolff 349841e2e3 Emit var in front of statement with tagged template 2015-01-09 21:22:42 +01:00
Ivo Gabe de Wolff a13af6b482 Move code to separate functions 2015-01-05 21:22:12 +01:00
Ivo Gabe de Wolff 8f28c95b04 Emit parens when an argument is a comma operator
Example:
foo`A${ 1 }B${ 2, 3 }C`;
2015-01-05 20:30:38 +01:00
Ivo Gabe de Wolff 69d724f554 Fix tagged templates that consist of a single part
Example:
foo `bar` should compile to foo([“bar”])
2015-01-04 20:58:45 +01:00
Ivo Gabe de Wolff c2d0bf82c4 Emit tagged templates when targeting ES3 or 5 2015-01-04 14:47:18 +01:00
Cyrus Najmabadi b37b98138d Merge branch 'master' into layering
Conflicts:
	src/compiler/checker.ts
	src/compiler/utilities.ts
2014-12-17 15:35:30 -08:00
Cyrus Najmabadi 6a08c54f42 Merge branch 'master' into sourceFileUpdate
Conflicts:
	src/compiler/checker.ts
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
	src/harness/fourslash.ts
2014-12-17 13:22:04 -08:00
Cyrus Najmabadi 7f893f9b9a Rename method to be clearer. 2014-12-16 18:50:34 -08:00
Anders Hejlsberg fed3b5c0de Adding comment 2014-12-16 15:47:22 -08:00
Cyrus Najmabadi 94d576290e Don't expose EmitHost. it is only used by a non-exposed function. 2014-12-16 15:10:15 -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 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
Cyrus Najmabadi 0a8744e841 Add helper method to reduce so many double negatives in the code. 2014-12-16 03:19:13 -08:00
Cyrus Najmabadi c7bb0a5ae6 Don't store variable statement flags on its variable declaration children. 2014-12-16 02:50:38 -08:00
Anders Hejlsberg 667e82fba2 Addressing CR feedback + Run fourslash tests with ES5 emit 2014-12-15 15:16:54 -08:00
Anders Hejlsberg b878a27113 Support -target ES6 emit for destructuring, spread, and rest. 2014-12-14 09:43:14 -08:00
Anders Hejlsberg b416cbc599 Merge branch 'master' into spreadAndRest
Conflicts:
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
	src/compiler/parser.ts
2014-12-12 14:32:53 -08:00
Cyrus Najmabadi ffdddd53af Merge branch 'master' into funcDeclsInBlocks
Conflicts:
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
	src/compiler/parser.ts
2014-12-12 14:05:09 -08:00
Cyrus Najmabadi 83f0c91999 Properly emit 'void 0' when emitting destructuring assignments. 2014-12-12 11:28:05 -08:00
Anders Hejlsberg a42df7547e Rest element support in array destructuring declarations 2014-12-11 18:27:08 -08:00
Anders Hejlsberg 6babef417f Rest element support in array literal destructuring assignment 2014-12-11 17:41:24 -08:00
Anders Hejlsberg afa3111955 Check and emit of spread elements in array literals 2014-12-11 16:23:57 -08:00
Cyrus Najmabadi b692ea9b66 Remove TryBlock and FinallyBlock.
They break the rule that syntactically identical constructs use the same syntax kind.  This
prevents node reuse in incremental parsing.
2014-12-11 14:40:25 -08:00
Cyrus Najmabadi fe57f3d2e4 Support modifiers on object literal methods and accessors, and question tokens on object literal methods.
This makes parsing of these constructs the same whether they are in an object literal or a class.

This is important for incrementla parsing for knowing if we can reuse these nodes if we run
into them.
2014-12-10 22:30:40 -08:00
Anders Hejlsberg 7bc35b3ae0 Merge branch 'master' into destructuring
Conflicts:
	src/compiler/binder.ts
	src/compiler/checker.ts
	src/compiler/emitter.ts
	src/compiler/parser.ts
	src/services/services.ts
	tests/baselines/reference/parserCommaInTypeMemberList2.errors.txt
2014-12-09 11:26:43 -08:00
Cyrus Najmabadi cc83925f32 Also split out .PropertyDeclaration and .PropertySignature from .Property. 2014-12-08 16:37:35 -08:00
Cyrus Najmabadi c1b19d761d Remove the 'Method' syntaxkind and introduce MethodSignature and MethodDeclaration instead.
Sharing a single kind here would be bad for incremental scenarios as these two node types
are not interchangeable.

For now, i have updated nearly all code to look for both kinds.  However, it may not make sense
in all locations, and we could likely tighten up many code locations to only have to deal with
one or the other.
2014-12-08 16:16:11 -08:00
Anders Hejlsberg 459dee0e84 Merge branch 'master' into destructuring
Move downlevel vs. ES6 emit branching into individual emit functions
2014-12-08 14:42:38 -08:00
Anders Hejlsberg 05c9966180 Addressing CR feedback:
New SyntaxKind.BindingElement
Introduced new VariableLikeDeclaration and BindingElement types
Cleaned up VariableDeclaration, ParameterDeclaration, PropertyDeclaration types
Node kind of binding element is always SyntaxKind.BindingElement
Changed CheckVariableDeclaration to CheckVariableLikeDeclaration
Reorganized CheckVariableLikeDeclaration
2014-12-06 13:53:06 -08:00
jbondc ab51f3069a Missing reference for getModuleInstanceState() 2014-12-05 07:18:23 -05:00
Anders Hejlsberg b49e2772ea Addressing CR feedback 2014-12-04 17:43:15 -08:00
Anders Hejlsberg 816abb19e4 Merge branch 'master' into destructuring
Conflicts:
	src/compiler/checker.ts
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
	src/compiler/emitter.ts
	src/compiler/parser.ts
	src/compiler/types.ts
	src/services/navigationBar.ts
	tests/baselines/reference/assignmentLHSIsValue.errors.txt
	tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt
	tests/baselines/reference/parserErrorRecovery_ParameterList2.errors.txt
2014-12-03 16:43:01 -08:00
Cyrus Najmabadi 22d7aed980 CR feedback. 2014-12-03 15:27:14 -08:00
Cyrus Najmabadi d5ef6226da Emit FunctionPropertyAssignments in their native form when emitting in ES6 mode. 2014-12-03 02:09:15 -08:00
Cyrus Najmabadi 0900005438 Don't rewrite function property assignments in the AST. 2014-12-03 01:46:04 -08:00
Cyrus Najmabadi ed81cad39a Remove the 'FunctionBlock' ast kind.
We don't want different AST forms for identical syntactic constructs ('Block' and 'FunctionBock').
This prevents reuse in incremental scenarios and forces the incremental parser to know when to
change between the two.
2014-12-02 22:52:21 -08:00
Cyrus Najmabadi a8badd921e Update the name of 'PropertyAssignment' to 'LonghandPropertyAssignment'.
'PropertyAssignment' is now the name of the super interface brand we use for all thigns that can
be members of an object literal.
2014-12-02 22:01:52 -08:00
Cyrus Najmabadi 5a7500ca5e Add a dedicated 'EndOfFile' token to a SourceFile.
This is important for incremental parsing, as it is where we can attach parse errors at the end of
the file to.  Also, it helps with things like emitting comments at the end of the file.
2014-12-02 16:09:41 -08:00
Anders Hejlsberg 0731a28978 Support exported destructuring variable declarations
Support .d.ts generation for functions with destructuring parameters
2014-12-02 15:52:29 -08:00
Yui T 1f6192578e Merge branch 'master' into refactorEmitter
Conflicts:
	src/compiler/emitter.ts
	src/compiler/parser.ts
	src/compiler/types.ts
2014-12-02 14:55:30 -08:00
Yui T ff3d64f83c Address codereview 2014-12-02 14:41:54 -08:00
Mohamed Hegazy cf1f6406bb Merge pull request #1332 from Microsoft/getEmitOutputCleanup
Ensure getEmitOutput only check the file requested
2014-12-02 13:21:13 -08:00
Anders Hejlsberg 7994e9013c Emit for destructuring parameter declarations 2014-12-02 12:51:44 -08:00
Anders Hejlsberg 9e639113f8 Emit for destructuring assignments 2014-12-02 11:39:04 -08:00