Skip to content

Commit 4897af6

Browse files
committed
unified: Regenerate QL
1 parent 2647ab6 commit 4897af6

2 files changed

Lines changed: 52 additions & 2 deletions

File tree

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,32 @@ module Unified {
11761176

11771177
class Stmt extends @unified_stmt, F::AstNode { }
11781178

1179+
/** A class representing `string_interpolation_expr` nodes. */
1180+
class StringInterpolationExpr extends @unified_string_interpolation_expr, F::Expr {
1181+
/** Gets the name of the primary QL class for this element. */
1182+
final override string getAPrimaryQlClass() { result = "StringInterpolationExpr" }
1183+
1184+
/** Gets the node corresponding to the field `element`. */
1185+
final F::Expr getElement(int i) { unified_string_interpolation_expr_element(this, i, result) }
1186+
1187+
/** Gets the node corresponding to the field `element`. */
1188+
final F::Expr getAnElement() { result = this.getElement(_) }
1189+
1190+
/** Gets the node corresponding to the field `modifier`. */
1191+
final F::Modifier getModifier(int i) {
1192+
unified_string_interpolation_expr_modifier(this, i, result)
1193+
}
1194+
1195+
/** Gets the node corresponding to the field `modifier`. */
1196+
final F::Modifier getAModifier() { result = this.getModifier(_) }
1197+
1198+
/** Gets a field or child node of this node. */
1199+
final override F::AstNode getAFieldOrChild() {
1200+
unified_string_interpolation_expr_element(this, _, result) or
1201+
unified_string_interpolation_expr_modifier(this, _, result)
1202+
}
1203+
}
1204+
11791205
/** A class representing `string_literal` tokens. */
11801206
class StringLiteral extends @unified_token_string_literal, F::Expr, F::Token {
11811207
/** Gets the name of the primary QL class for this element. */
@@ -1746,6 +1772,10 @@ module Unified {
17461772
or
17471773
result = node.(ReturnExpr).getValue() and i = -1 and name = "getValue"
17481774
or
1775+
result = node.(StringInterpolationExpr).getElement(i) and name = "getElement"
1776+
or
1777+
result = node.(StringInterpolationExpr).getModifier(i) and name = "getModifier"
1778+
or
17491779
result = node.(SwitchCase).getBody() and i = -1 and name = "getBody"
17501780
or
17511781
result = node.(SwitchCase).getModifier(i) and name = "getModifier"
@@ -1951,6 +1981,8 @@ module UnifiedFinal {
19511981

19521982
final class Stmt = F::Stmt;
19531983

1984+
final class StringInterpolationExpr = F::StringInterpolationExpr;
1985+
19541986
final class StringLiteral = F::StringLiteral;
19551987

19561988
final class SuperExpr = F::SuperExpr;

‎unified/ql/lib/unified.dbscheme‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ unified_equality_type_constraint_def(
443443
int right: @unified_expr ref
444444
);
445445

446-
@unified_expr = @unified_array_literal | @unified_assign_expr | @unified_binary_expr | @unified_block | @unified_break_expr | @unified_bulk_importing_pattern | @unified_call_expr | @unified_compound_assign_expr | @unified_conditional_pattern | @unified_continue_expr | @unified_expr_pattern | @unified_function_expr | @unified_generic_type_expr | @unified_if_expr | @unified_key_value_pair | @unified_map_literal | @unified_member_access_expr | @unified_named_pattern | @unified_or_pattern | @unified_pattern_guard_expr | @unified_return_expr | @unified_switch_expr | @unified_throw_expr | @unified_token_boolean_literal | @unified_token_builtin_expr | @unified_token_empty_expr | @unified_token_float_literal | @unified_token_identifier | @unified_token_inferred_type_expr | @unified_token_int_literal | @unified_token_regex_literal | @unified_token_string_literal | @unified_token_super_expr | @unified_token_unsupported_node | @unified_try_expr | @unified_tuple_expr | @unified_type_cast_expr | @unified_type_test_expr | @unified_unary_expr | @unified_unresolved_operator_sequence
446+
@unified_expr = @unified_array_literal | @unified_assign_expr | @unified_binary_expr | @unified_block | @unified_break_expr | @unified_bulk_importing_pattern | @unified_call_expr | @unified_compound_assign_expr | @unified_conditional_pattern | @unified_continue_expr | @unified_expr_pattern | @unified_function_expr | @unified_generic_type_expr | @unified_if_expr | @unified_key_value_pair | @unified_map_literal | @unified_member_access_expr | @unified_named_pattern | @unified_or_pattern | @unified_pattern_guard_expr | @unified_return_expr | @unified_string_interpolation_expr | @unified_switch_expr | @unified_throw_expr | @unified_token_boolean_literal | @unified_token_builtin_expr | @unified_token_empty_expr | @unified_token_float_literal | @unified_token_identifier | @unified_token_inferred_type_expr | @unified_token_int_literal | @unified_token_regex_literal | @unified_token_string_literal | @unified_token_super_expr | @unified_token_unsupported_node | @unified_try_expr | @unified_tuple_expr | @unified_type_cast_expr | @unified_type_test_expr | @unified_unary_expr | @unified_unresolved_operator_sequence
447447

448448
@unified_expr_or_operator = @unified_expr | @unified_token_infix_operator
449449

@@ -756,6 +756,24 @@ unified_return_expr_def(
756756

757757
@unified_stmt = @unified_accessor_declaration | @unified_class_like_declaration | @unified_constructor_declaration | @unified_destructor_declaration | @unified_do_while_stmt | @unified_expr | @unified_for_each_stmt | @unified_function_declaration | @unified_guard_if_stmt | @unified_import_declaration | @unified_labeled_stmt | @unified_operator_syntax_declaration | @unified_type_alias_declaration | @unified_variable_declaration | @unified_while_stmt
758758

759+
#keyset[unified_string_interpolation_expr, index]
760+
unified_string_interpolation_expr_element(
761+
int unified_string_interpolation_expr: @unified_string_interpolation_expr ref,
762+
int index: int ref,
763+
unique int element: @unified_expr ref
764+
);
765+
766+
#keyset[unified_string_interpolation_expr, index]
767+
unified_string_interpolation_expr_modifier(
768+
int unified_string_interpolation_expr: @unified_string_interpolation_expr ref,
769+
int index: int ref,
770+
unique int modifier: @unified_token_modifier ref
771+
);
772+
773+
unified_string_interpolation_expr_def(
774+
unique int id: @unified_string_interpolation_expr
775+
);
776+
759777
#keyset[unified_switch_case, index]
760778
unified_switch_case_modifier(
761779
int unified_switch_case: @unified_switch_case ref,
@@ -989,7 +1007,7 @@ unified_trivia_tokeninfo(
9891007
string value: string ref
9901008
);
9911009

992-
@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_conditional_pattern | @unified_constructor_declaration | @unified_continue_expr | @unified_destructor_declaration | @unified_do_while_stmt | @unified_equality_type_constraint | @unified_expr_pattern | @unified_for_each_stmt | @unified_function_declaration | @unified_function_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_named_pattern | @unified_operator_syntax_declaration | @unified_or_pattern | @unified_parameter | @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_type_alias_declaration | @unified_type_cast_expr | @unified_type_parameter | @unified_type_test_expr | @unified_unary_expr | @unified_unresolved_operator_sequence | @unified_variable_declaration | @unified_while_stmt
1010+
@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_conditional_pattern | @unified_constructor_declaration | @unified_continue_expr | @unified_destructor_declaration | @unified_do_while_stmt | @unified_equality_type_constraint | @unified_expr_pattern | @unified_for_each_stmt | @unified_function_declaration | @unified_function_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_named_pattern | @unified_operator_syntax_declaration | @unified_or_pattern | @unified_parameter | @unified_pattern_guard_expr | @unified_return_expr | @unified_string_interpolation_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_type_alias_declaration | @unified_type_cast_expr | @unified_type_parameter | @unified_type_test_expr | @unified_unary_expr | @unified_unresolved_operator_sequence | @unified_variable_declaration | @unified_while_stmt
9931011

9941012
unified_ast_node_location(
9951013
unique int node: @unified_ast_node ref,

0 commit comments

Comments
 (0)