Skip to content

Commit 1842382

Browse files
committed
unified: regenerate QL
1 parent db449dc commit 1842382

2 files changed

Lines changed: 45 additions & 8 deletions

File tree

unified/ql/lib/codeql/unified/Ast.qll

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,23 @@ module Unified {
978978
}
979979
}
980980

981+
/** A class representing `or_pattern` nodes. */
982+
class OrPattern extends @unified_or_pattern, AstNode {
983+
/** Gets the name of the primary QL class for this element. */
984+
final override string getAPrimaryQlClass() { result = "OrPattern" }
985+
986+
/** Gets the node corresponding to the field `modifier`. */
987+
final Modifier getModifier(int i) { unified_or_pattern_modifier(this, i, result) }
988+
989+
/** Gets the node corresponding to the field `pattern`. */
990+
final Pattern getPattern(int i) { unified_or_pattern_pattern(this, i, result) }
991+
992+
/** Gets a field or child node of this node. */
993+
final override AstNode getAFieldOrChild() {
994+
unified_or_pattern_modifier(this, _, result) or unified_or_pattern_pattern(this, _, result)
995+
}
996+
}
997+
981998
/** A class representing `parameter` nodes. */
982999
class Parameter extends @unified_parameter, AstNode {
9831000
/** Gets the name of the primary QL class for this element. */
@@ -1109,14 +1126,14 @@ module Unified {
11091126
final Modifier getModifier(int i) { unified_switch_case_modifier(this, i, result) }
11101127

11111128
/** Gets the node corresponding to the field `pattern`. */
1112-
final Pattern getPattern(int i) { unified_switch_case_pattern(this, i, result) }
1129+
final Pattern getPattern() { unified_switch_case_pattern(this, result) }
11131130

11141131
/** Gets a field or child node of this node. */
11151132
final override AstNode getAFieldOrChild() {
11161133
unified_switch_case_def(this, result) or
11171134
unified_switch_case_guard(this, result) or
11181135
unified_switch_case_modifier(this, _, result) or
1119-
unified_switch_case_pattern(this, _, result)
1136+
unified_switch_case_pattern(this, result)
11201137
}
11211138
}
11221139

@@ -1654,6 +1671,10 @@ module Unified {
16541671
i = -1 and
16551672
name = "getPrecedence"
16561673
or
1674+
result = node.(OrPattern).getModifier(i) and name = "getModifier"
1675+
or
1676+
result = node.(OrPattern).getPattern(i) and name = "getPattern"
1677+
or
16571678
result = node.(Parameter).getDefault() and i = -1 and name = "getDefault"
16581679
or
16591680
result = node.(Parameter).getExternalName() and i = -1 and name = "getExternalName"
@@ -1682,7 +1703,7 @@ module Unified {
16821703
or
16831704
result = node.(SwitchCase).getModifier(i) and name = "getModifier"
16841705
or
1685-
result = node.(SwitchCase).getPattern(i) and name = "getPattern"
1706+
result = node.(SwitchCase).getPattern() and i = -1 and name = "getPattern"
16861707
or
16871708
result = node.(SwitchExpr).getCase(i) and name = "getCase"
16881709
or

unified/ql/lib/unified.dbscheme

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,24 @@ unified_operator_syntax_declaration_def(
716716
int name: @unified_token_identifier ref
717717
);
718718

719+
#keyset[unified_or_pattern, index]
720+
unified_or_pattern_modifier(
721+
int unified_or_pattern: @unified_or_pattern ref,
722+
int index: int ref,
723+
unique int modifier: @unified_token_modifier ref
724+
);
725+
726+
#keyset[unified_or_pattern, index]
727+
unified_or_pattern_pattern(
728+
int unified_or_pattern: @unified_or_pattern ref,
729+
int index: int ref,
730+
unique int pattern: @unified_pattern ref
731+
);
732+
733+
unified_or_pattern_def(
734+
unique int id: @unified_or_pattern
735+
);
736+
719737
unified_parameter_default(
720738
unique int unified_parameter: @unified_parameter ref,
721739
unique int default: @unified_expr ref
@@ -747,7 +765,7 @@ unified_parameter_def(
747765
unique int id: @unified_parameter
748766
);
749767

750-
@unified_pattern = @unified_bulk_importing_pattern | @unified_constructor_pattern | @unified_expr_equality_pattern | @unified_name_pattern | @unified_token_ignore_pattern | @unified_token_unsupported_node | @unified_tuple_pattern
768+
@unified_pattern = @unified_bulk_importing_pattern | @unified_constructor_pattern | @unified_expr_equality_pattern | @unified_name_pattern | @unified_or_pattern | @unified_token_ignore_pattern | @unified_token_unsupported_node | @unified_tuple_pattern
751769

752770
unified_pattern_element_key(
753771
unique int unified_pattern_element: @unified_pattern_element ref,
@@ -795,10 +813,8 @@ unified_switch_case_modifier(
795813
unique int modifier: @unified_token_modifier ref
796814
);
797815

798-
#keyset[unified_switch_case, index]
799816
unified_switch_case_pattern(
800-
int unified_switch_case: @unified_switch_case ref,
801-
int index: int ref,
817+
unique int unified_switch_case: @unified_switch_case ref,
802818
unique int pattern: @unified_pattern ref
803819
);
804820

@@ -1056,7 +1072,7 @@ unified_trivia_tokeninfo(
10561072
string value: string ref
10571073
);
10581074

1059-
@unified_ast_node = @unified_accessor_declaration | @unified_argument | @unified_array_literal | @unified_assign_expr | @unified_associated_type_declaration | @unified_base_type | @unified_binary_expr | @unified_block | @unified_bound_type_constraint | @unified_break_expr | @unified_bulk_importing_pattern | @unified_call_expr | @unified_catch_clause | @unified_class_like_declaration | @unified_compound_assign_expr | @unified_constructor_declaration | @unified_constructor_pattern | @unified_continue_expr | @unified_destructor_declaration | @unified_do_while_stmt | @unified_equality_type_constraint | @unified_expr_equality_pattern | @unified_for_each_stmt | @unified_function_declaration | @unified_function_expr | @unified_function_type_expr | @unified_generic_type_expr | @unified_guard_if_stmt | @unified_if_expr | @unified_import_declaration | @unified_initializer_declaration | @unified_key_value_pair | @unified_labeled_stmt | @unified_map_literal | @unified_member_access_expr | @unified_name_expr | @unified_name_pattern | @unified_named_type_expr | @unified_operator_syntax_declaration | @unified_parameter | @unified_pattern_element | @unified_pattern_guard_expr | @unified_return_expr | @unified_switch_case | @unified_switch_expr | @unified_throw_expr | @unified_token | @unified_top_level | @unified_trivia_token | @unified_try_expr | @unified_tuple_expr | @unified_tuple_pattern | @unified_tuple_type_element | @unified_tuple_type_expr | @unified_type_alias_declaration | @unified_type_cast_expr | @unified_type_parameter | @unified_type_test_expr | @unified_type_test_pattern | @unified_unary_expr | @unified_variable_declaration | @unified_while_stmt
1075+
@unified_ast_node = @unified_accessor_declaration | @unified_argument | @unified_array_literal | @unified_assign_expr | @unified_associated_type_declaration | @unified_base_type | @unified_binary_expr | @unified_block | @unified_bound_type_constraint | @unified_break_expr | @unified_bulk_importing_pattern | @unified_call_expr | @unified_catch_clause | @unified_class_like_declaration | @unified_compound_assign_expr | @unified_constructor_declaration | @unified_constructor_pattern | @unified_continue_expr | @unified_destructor_declaration | @unified_do_while_stmt | @unified_equality_type_constraint | @unified_expr_equality_pattern | @unified_for_each_stmt | @unified_function_declaration | @unified_function_expr | @unified_function_type_expr | @unified_generic_type_expr | @unified_guard_if_stmt | @unified_if_expr | @unified_import_declaration | @unified_initializer_declaration | @unified_key_value_pair | @unified_labeled_stmt | @unified_map_literal | @unified_member_access_expr | @unified_name_expr | @unified_name_pattern | @unified_named_type_expr | @unified_operator_syntax_declaration | @unified_or_pattern | @unified_parameter | @unified_pattern_element | @unified_pattern_guard_expr | @unified_return_expr | @unified_switch_case | @unified_switch_expr | @unified_throw_expr | @unified_token | @unified_top_level | @unified_trivia_token | @unified_try_expr | @unified_tuple_expr | @unified_tuple_pattern | @unified_tuple_type_element | @unified_tuple_type_expr | @unified_type_alias_declaration | @unified_type_cast_expr | @unified_type_parameter | @unified_type_test_expr | @unified_type_test_pattern | @unified_unary_expr | @unified_variable_declaration | @unified_while_stmt
10601076

10611077
unified_ast_node_location(
10621078
unique int node: @unified_ast_node ref,

0 commit comments

Comments
 (0)