Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing support (including incremental parsing) for 'yield' expressions. #1129

Merged
merged 12 commits into from
Nov 14, 2014
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/services/resources/diagnosticCode.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ module TypeScript {
Type_expected: "Type expected.",
Template_literal_cannot_be_used_as_an_element_name: "Template literal cannot be used as an element name.",
Computed_property_names_cannot_be_used_here: "Computed property names cannot be used here.",
yield_expression_must_be_contained_within_a_generator_declaration: "'yield' expression must be contained within a generator declaration.",
Duplicate_identifier_0: "Duplicate identifier '{0}'.",
The_name_0_does_not_exist_in_the_current_scope: "The name '{0}' does not exist in the current scope.",
The_name_0_does_not_refer_to_a_value: "The name '{0}' does not refer to a value.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ module TypeScript {
"Type expected.": { "code": 1110, "category": DiagnosticCategory.Error },
"Template literal cannot be used as an element name.": { "code": 1111, "category": DiagnosticCategory.Error },
"Computed property names cannot be used here.": { "code": 1112, "category": DiagnosticCategory.Error },
"'yield' expression must be contained within a generator declaration.": { "code": 1113, "category": DiagnosticCategory.Error },
"Duplicate identifier '{0}'.": { "code": 2000, "category": DiagnosticCategory.Error },
"The name '{0}' does not exist in the current scope.": { "code": 2001, "category": DiagnosticCategory.Error },
"The name '{0}' does not refer to a value.": { "code": 2002, "category": DiagnosticCategory.Error },
Expand Down
4 changes: 4 additions & 0 deletions src/services/resources/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@
"category": "Error",
"code": 1112
},
"'yield' expression must be contained within a generator declaration.": {
"category": "Error",
"code": 1113
},
"Duplicate identifier '{0}'.": {
"category": "Error",
"code": 2000
Expand Down
101 changes: 58 additions & 43 deletions src/services/syntax/SyntaxGenerator.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/services/syntax/SyntaxGenerator.js.map

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions src/services/syntax/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ module TypeScript {
// only be used by the incremental parser if it is parsed in the same strict context as before.
// last masks off the part of the int
//
// The width of the node is stored in the remainder of the int. This allows us up to 256MB
// for a node by using all 28 bits. However, in the common case, we'll use less than 28 bits
// The width of the node is stored in the remainder of the int. This allows us up to 128MB
// for a node by using all 27 bits. However, in the common case, we'll use less than 27 bits
// for the width. Thus, the info will be stored in a single int in chakra.
NodeDataComputed = 0x00000001, // 0000 0000 0000 0000 0000 0000 0000 0001
NodeIncrementallyUnusableMask = 0x00000002, // 0000 0000 0000 0000 0000 0000 0000 0010
NodeParsedInStrictModeMask = 0x00000004, // 0000 0000 0000 0000 0000 0000 0000 0100
NodeParsedInDisallowInMask = 0x00000008, // 0000 0000 0000 0000 0000 0000 0000 1000
NodeFullWidthShift = 4, // 1111 1111 1111 1111 1111 1111 1111 0000
NodeParsedInAllowYieldMask = 0x00000010, // 0000 0000 0000 0000 0000 0000 0001 0000
NodeFullWidthShift = 5, // 1111 1111 1111 1111 1111 1111 1110 0000
}
}
Loading