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

Add type fields #316

Merged
merged 7 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions corpus/classes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public class F<T> where T:class?, notnull, Mine? {}
constraints: (type_parameter_constraint
(type_constraint
type: (nullable_type
(identifier)))))
type: (identifier)))))
body: (declaration_list)))

================================================================================
Expand Down Expand Up @@ -586,7 +586,7 @@ class A {
(modifier)
type: (predefined_type)
parameters: (bracketed_parameter_list
(array_type
type: (array_type
type: (predefined_type)
rank: (array_rank_specifier))
name: (identifier))
Expand Down
10 changes: 5 additions & 5 deletions corpus/contextual-keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,17 @@ class scoped { }
(local_declaration_statement
(variable_declaration
type: (scoped_type
(ref_type
(predefined_type)))
type: (ref_type
type: (predefined_type)))
(variable_declarator
(identifier)
(equals_value_clause
(null_literal)))))
(local_declaration_statement
(variable_declaration
type: (scoped_type
(ref_type
(identifier)))
type: (ref_type
type: (identifier)))
(variable_declarator
(identifier)
(equals_value_clause
Expand Down Expand Up @@ -313,7 +313,7 @@ class scoped { }
(identifier)
(equals_value_clause
(lambda_expression
(identifier)
type: (identifier)
parameters: (parameter_list
(parameter
type: (predefined_type)
Expand Down
40 changes: 20 additions & 20 deletions corpus/expressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ var u = x is int?
condition: (is_expression
left: (identifier)
right: (nullable_type
(predefined_type)))
type: (predefined_type)))
consequence: (identifier)
alternative: (identifier))))))))

Expand Down Expand Up @@ -1286,7 +1286,7 @@ void a() {
(identifier)
(equals_value_clause
(lambda_expression
(identifier)
type: (identifier)
parameters: (parameter_list
(parameter
type: (identifier)
Expand Down Expand Up @@ -1659,7 +1659,7 @@ void b() {
(identifier)
(equals_value_clause
(stack_alloc_array_creation_expression
(array_type
type: (array_type
type: (predefined_type)
rank: (array_rank_specifier))
(initializer_expression
Expand Down Expand Up @@ -1692,7 +1692,7 @@ void b() {
(identifier)
(equals_value_clause
(array_creation_expression
(array_type
type: (array_type
type: (predefined_type)
rank: (array_rank_specifier
(integer_literal)))
Expand All @@ -1707,7 +1707,7 @@ void b() {
(identifier)
(equals_value_clause
(array_creation_expression
(array_type
type: (array_type
type: (predefined_type)
rank: (array_rank_specifier))
(initializer_expression
Expand Down Expand Up @@ -1742,7 +1742,7 @@ void b() {
(identifier)
(equals_value_clause
(array_creation_expression
(array_type
type: (array_type
type: (predefined_type)
rank: (array_rank_specifier
(integer_literal)
Expand Down Expand Up @@ -1782,7 +1782,7 @@ void a() {
(identifier)
(equals_value_clause
(array_creation_expression
(array_type
type: (array_type
type: (tuple_type
(tuple_element
type: (predefined_type)
Expand Down Expand Up @@ -1930,7 +1930,7 @@ void b() {
(identifier)
(equals_value_clause
(size_of_expression
(predefined_type))))))))))
type: (predefined_type))))))))))

================================================================================
typeof
Expand All @@ -1957,15 +1957,15 @@ void b() {
(identifier)
(equals_value_clause
(type_of_expression
(predefined_type))))))
type: (predefined_type))))))
(local_declaration_statement
(variable_declaration
type: (implicit_type)
(variable_declarator
(identifier)
(equals_value_clause
(type_of_expression
(qualified_name
type: (qualified_name
(generic_name
(identifier)
(type_argument_list
Expand Down Expand Up @@ -2150,7 +2150,7 @@ string b(Object operation) =>
(string_literal_fragment)))
(switch_expression_arm
(type_pattern
(predefined_type))
type: (predefined_type))
(string_literal
(string_literal_fragment))))))))

Expand Down Expand Up @@ -2378,7 +2378,7 @@ var t = typeof(Tuple<,,,>);
(identifier)
(equals_value_clause
(type_of_expression
(generic_name
type: (generic_name
(identifier)
(type_argument_list))))))))
(global_statement
Expand All @@ -2389,7 +2389,7 @@ var t = typeof(Tuple<,,,>);
(identifier)
(equals_value_clause
(type_of_expression
(generic_name
type: (generic_name
(identifier)
(type_argument_list)))))))))

Expand Down Expand Up @@ -2435,7 +2435,7 @@ ref var elementRef = ref arr[0];
(local_declaration_statement
(variable_declaration
type: (ref_type
(identifier))
type: (identifier))
(variable_declarator
(identifier)
(equals_value_clause
Expand All @@ -2445,7 +2445,7 @@ ref var elementRef = ref arr[0];
(local_declaration_statement
(variable_declaration
type: (ref_type
(implicit_type))
type: (implicit_type))
(variable_declarator
(identifier)
(equals_value_clause
Expand Down Expand Up @@ -2730,7 +2730,7 @@ var b = true == 1 as int? is int;
left: (as_expression
left: (integer_literal)
right: (nullable_type
(predefined_type)))
type: (predefined_type)))
right: (predefined_type)))))))))

================================================================================
Expand Down Expand Up @@ -2899,7 +2899,7 @@ var x = operand is ILiteralOperation { ConstantValue.HasValue: true, ConstantVal
(is_pattern_expression
expression: (identifier)
pattern: (recursive_pattern
(identifier)
type: (identifier)
(property_pattern_clause
(subpattern
(expression_colon
Expand All @@ -2926,7 +2926,7 @@ var x = operand is ILiteralOperation { ConstantValue.HasValue: true, ConstantVal
(is_pattern_expression
expression: (identifier)
pattern: (recursive_pattern
(identifier)
type: (identifier)
(property_pattern_clause
(subpattern
(expression_colon
Expand Down Expand Up @@ -3011,9 +3011,9 @@ var c = o is int; //is_expression with type
expression: (identifier)
pattern: (or_pattern
left: (type_pattern
(predefined_type))
type: (predefined_type))
right: (type_pattern
(predefined_type)))))))))
type: (predefined_type)))))))))
(comment)
(global_statement
(local_declaration_statement
Expand Down
6 changes: 3 additions & 3 deletions corpus/records.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ record Teacher(string FirstName, string LastName, string Subject) : Person(First
name: (identifier)))
bases: (base_list
(primary_constructor_base_type
(identifier)
type: (identifier)
(argument_list
(argument
(identifier))
Expand Down Expand Up @@ -248,7 +248,7 @@ record Teacher(string FirstName, string LastName, string Subject) : Person(First
name: (identifier)))
bases: (base_list
(primary_constructor_base_type
(identifier)
type: (identifier)
(argument_list
(argument
(identifier))
Expand All @@ -275,7 +275,7 @@ record A : System.IEquatable<A>;
parameters: (parameter_list)
bases: (base_list
(primary_constructor_base_type
(generic_name
type: (generic_name
(identifier)
(type_argument_list
(identifier)))
Expand Down
6 changes: 3 additions & 3 deletions corpus/source-file-structure.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class Z {
(delegate_declaration
(modifier)
type: (ref_type
(predefined_type))
type: (predefined_type))
name: (identifier)
parameters: (parameter_list
(parameter
Expand All @@ -218,7 +218,7 @@ class Z {
(delegate_declaration
(modifier)
type: (ref_type
(predefined_type))
type: (predefined_type))
name: (identifier)
parameters: (parameter_list
(parameter
Expand All @@ -242,7 +242,7 @@ class Z {
type: (predefined_type)
name: (identifier)
parameters: (parameter_list
(array_type
type: (array_type
type: (predefined_type)
rank: (array_rank_specifier))
name: (identifier)))
Expand Down
8 changes: 4 additions & 4 deletions corpus/statements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ switch (i)
(switch_section
(case_pattern_switch_label
(type_pattern
(predefined_type))
type: (predefined_type))
(when_clause
(binary_expression
left: (identifier)
Expand Down Expand Up @@ -1205,7 +1205,7 @@ class A {
(local_declaration_statement
(variable_declaration
type: (ref_type
(implicit_type))
type: (implicit_type))
(variable_declarator
(identifier)
(equals_value_clause
Expand Down Expand Up @@ -1839,7 +1839,7 @@ ref T Choice(bool condition, ref T a, ref T b)
(global_statement
(local_function_statement
type: (ref_type
(identifier))
type: (identifier))
name: (identifier)
parameters: (parameter_list
(parameter
Expand All @@ -1857,7 +1857,7 @@ ref T Choice(bool condition, ref T a, ref T b)
(local_declaration_statement
(variable_declaration
type: (ref_type
(implicit_type))
type: (implicit_type))
(variable_declarator
(identifier)
(equals_value_clause
Expand Down
Loading