From 388d361ec3e202adc54afa4244ae351fc8ffb3c6 Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Tue, 1 Feb 2022 17:15:36 +0000 Subject: [PATCH] Ruby: put AST node locations in a single table --- ruby/extractor/src/extractor.rs | 8 +- ruby/generator/src/main.rs | 45 +- ruby/generator/src/ql_gen.rs | 185 ++---- ruby/ql/lib/codeql/ruby/AST.qll | 2 +- .../codeql/ruby/ast/internal/TreeSitter.qll | 591 ++++-------------- ruby/ql/lib/ruby.dbscheme | 332 ++++------ 6 files changed, 341 insertions(+), 822 deletions(-) diff --git a/ruby/extractor/src/extractor.rs b/ruby/extractor/src/extractor.rs index 7c83f51e0dc..8cdaff1b738 100644 --- a/ruby/extractor/src/extractor.rs +++ b/ruby/extractor/src/extractor.rs @@ -402,11 +402,12 @@ impl Visitor<'_> { match &table.kind { EntryKind::Token { kind_id, .. } => { self.trap_writer.add_tuple( - &format!("{}_ast_node_parent", self.language_prefix), + &format!("{}_ast_node_info", self.language_prefix), vec![ Arg::Label(id), Arg::Label(parent_id), Arg::Int(parent_index), + Arg::Label(loc), ], ); self.trap_writer.add_tuple( @@ -415,7 +416,6 @@ impl Visitor<'_> { Arg::Label(id), Arg::Int(*kind_id), sliced_source_arg(self.source, node), - Arg::Label(loc), ], ); } @@ -425,16 +425,16 @@ impl Visitor<'_> { } => { if let Some(args) = self.complex_node(&node, fields, &child_nodes, id) { self.trap_writer.add_tuple( - &format!("{}_ast_node_parent", self.language_prefix), + &format!("{}_ast_node_info", self.language_prefix), vec![ Arg::Label(id), Arg::Label(parent_id), Arg::Int(parent_index), + Arg::Label(loc), ], ); let mut all_args = vec![Arg::Label(id)]; all_args.extend(args); - all_args.push(Arg::Label(loc)); self.trap_writer.add_tuple(table_name, all_args); } } diff --git a/ruby/generator/src/main.rs b/ruby/generator/src/main.rs index 50e4d888f31..0fdc4352de6 100644 --- a/ruby/generator/src/main.rs +++ b/ruby/generator/src/main.rs @@ -233,15 +233,6 @@ fn convert_nodes( }); } - // Finally, the type's defining table also includes the location. - main_table.columns.push(dbscheme::Column { - unique: false, - db_type: dbscheme::DbColumnType::Int, - name: "loc", - ql_type: ql::Type::At("location"), - ql_type_is_ref: true, - }); - entries.push(dbscheme::Entry::Table(main_table)); } node_types::EntryKind::Token { .. } => {} @@ -251,18 +242,24 @@ fn convert_nodes( (entries, ast_node_members, token_kinds) } -/// Creates a dbscheme table entry representing the parent relation for AST nodes. +/// Creates a dbscheme table specifying the parent node and location for each +/// AST node. /// /// # Arguments -/// - `name` - the name of both the table to create and the node parent type. +/// - `name` - the name of the table to create. +/// - `parent_name` - the name of the parent type. /// - `ast_node_name` - the name of the node child type. -fn create_ast_node_parent_table<'a>(name: &'a str, ast_node_name: &'a str) -> dbscheme::Table<'a> { +fn create_ast_node_info_table<'a>( + name: &'a str, + parent_name: &'a str, + ast_node_name: &'a str, +) -> dbscheme::Table<'a> { dbscheme::Table { name, columns: vec![ dbscheme::Column { db_type: dbscheme::DbColumnType::Int, - name: "child", + name: "node", unique: false, ql_type: ql::Type::At(ast_node_name), ql_type_is_ref: true, @@ -271,7 +268,7 @@ fn create_ast_node_parent_table<'a>(name: &'a str, ast_node_name: &'a str) -> db db_type: dbscheme::DbColumnType::Int, name: "parent", unique: false, - ql_type: ql::Type::At(name), + ql_type: ql::Type::At(parent_name), ql_type_is_ref: true, }, dbscheme::Column { @@ -281,6 +278,13 @@ fn create_ast_node_parent_table<'a>(name: &'a str, ast_node_name: &'a str) -> db ql_type: ql::Type::Int, ql_type_is_ref: true, }, + dbscheme::Column { + unique: false, + db_type: dbscheme::DbColumnType::Int, + name: "loc", + ql_type: ql::Type::At("location"), + ql_type_is_ref: true, + }, ], keysets: Some(vec!["parent", "parent_index"]), } @@ -312,13 +316,6 @@ fn create_tokeninfo<'a>(name: &'a str, type_name: &'a str) -> dbscheme::Table<'a ql_type: ql::Type::String, ql_type_is_ref: true, }, - dbscheme::Column { - unique: false, - db_type: dbscheme::DbColumnType::Int, - name: "loc", - ql_type: ql::Type::At("location"), - ql_type_is_ref: true, - }, ], } } @@ -619,6 +616,7 @@ fn main() -> std::io::Result<()> { for language in languages { let prefix = node_types::to_snake_case(&language.name); let ast_node_name = format!("{}_ast_node", &prefix); + let node_info_table_name = format!("{}_ast_node_info", &prefix); let ast_node_parent_name = format!("{}_ast_node_parent", &prefix); let token_name = format!("{}_token", &prefix); let tokeninfo_name = format!("{}_tokeninfo", &prefix); @@ -641,7 +639,8 @@ fn main() -> std::io::Result<()> { name: &ast_node_parent_name, members: [&ast_node_name, "file"].iter().cloned().collect(), }), - dbscheme::Entry::Table(create_ast_node_parent_table( + dbscheme::Entry::Table(create_ast_node_info_table( + &node_info_table_name, &ast_node_parent_name, &ast_node_name, )), @@ -651,7 +650,7 @@ fn main() -> std::io::Result<()> { let mut body = vec![ ql::TopLevel::Class(ql_gen::create_ast_node_class( &ast_node_name, - &ast_node_parent_name, + &node_info_table_name, )), ql::TopLevel::Class(ql_gen::create_token_class(&token_name, &tokeninfo_name)), ql::TopLevel::Class(ql_gen::create_reserved_word_class(&reserved_word_name)), diff --git a/ruby/generator/src/ql_gen.rs b/ruby/generator/src/ql_gen.rs index 241d79f8cb9..e3a95d51073 100644 --- a/ruby/generator/src/ql_gen.rs +++ b/ruby/generator/src/ql_gen.rs @@ -3,7 +3,7 @@ use std::collections::BTreeSet; /// Creates the hard-coded `AstNode` class that acts as a supertype of all /// classes we generate. -pub fn create_ast_node_class<'a>(ast_node: &'a str, ast_node_parent: &'a str) -> ql::Class<'a> { +pub fn create_ast_node_class<'a>(ast_node: &'a str, node_info_table: &'a str) -> ql::Class<'a> { // Default implementation of `toString` calls `this.getAPrimaryQlClass()` let to_string = ql::Predicate { qldoc: Some(String::from( @@ -22,12 +22,22 @@ pub fn create_ast_node_class<'a>(ast_node: &'a str, ast_node_parent: &'a str) -> )), ), }; - let get_location = create_none_predicate( - Some(String::from("Gets the location of this element.")), - "getLocation", - false, - Some(ql::Type::Normal("L::Location")), - ); + let get_location = ql::Predicate { + name: "getLocation", + qldoc: Some(String::from("Gets the location of this element.")), + overridden: false, + return_type: Some(ql::Type::Normal("L::Location")), + formal_parameters: vec![], + body: ql::Expression::Pred( + node_info_table, + vec![ + ql::Expression::Var("this"), + ql::Expression::Var("_"), // parent + ql::Expression::Var("_"), // parent index + ql::Expression::Var("result"), // location + ], + ), + }; let get_a_field_or_child = create_none_predicate( Some(String::from("Gets a field or child node of this node.")), "getAFieldOrChild", @@ -41,11 +51,12 @@ pub fn create_ast_node_class<'a>(ast_node: &'a str, ast_node_parent: &'a str) -> return_type: Some(ql::Type::Normal("AstNode")), formal_parameters: vec![], body: ql::Expression::Pred( - ast_node_parent, + node_info_table, vec![ ql::Expression::Var("this"), ql::Expression::Var("result"), - ql::Expression::Var("_"), + ql::Expression::Var("_"), // parent index + ql::Expression::Var("_"), // location ], ), }; @@ -58,11 +69,12 @@ pub fn create_ast_node_class<'a>(ast_node: &'a str, ast_node_parent: &'a str) -> return_type: Some(ql::Type::Int), formal_parameters: vec![], body: ql::Expression::Pred( - ast_node_parent, + node_info_table, vec![ ql::Expression::Var("this"), - ql::Expression::Var("_"), - ql::Expression::Var("result"), + ql::Expression::Var("_"), // parent + ql::Expression::Var("result"), // parent index + ql::Expression::Var("_"), // location ], ), }; @@ -123,7 +135,7 @@ pub fn create_ast_node_class<'a>(ast_node: &'a str, ast_node_parent: &'a str) -> } pub fn create_token_class<'a>(token_type: &'a str, tokeninfo: &'a str) -> ql::Class<'a> { - let tokeninfo_arity = 4; + let tokeninfo_arity = 3; // id, kind, value let get_value = ql::Predicate { qldoc: Some(String::from("Gets the value of this token.")), name: "getValue", @@ -132,14 +144,6 @@ pub fn create_token_class<'a>(token_type: &'a str, tokeninfo: &'a str) -> ql::Cl formal_parameters: vec![], body: create_get_field_expr_for_column_storage("result", tokeninfo, 1, tokeninfo_arity), }; - let get_location = ql::Predicate { - qldoc: Some(String::from("Gets the location of this token.")), - name: "getLocation", - overridden: true, - return_type: Some(ql::Type::Normal("L::Location")), - formal_parameters: vec![], - body: create_get_field_expr_for_column_storage("result", tokeninfo, 2, tokeninfo_arity), - }; let to_string = ql::Predicate { qldoc: Some(String::from( "Gets a string representation of this element.", @@ -167,7 +171,7 @@ pub fn create_token_class<'a>(token_type: &'a str, tokeninfo: &'a str) -> ql::Cl characteristic_predicate: None, predicates: vec![ get_value, - get_location, + //get_location, to_string, create_get_a_primary_ql_class("Token"), ], @@ -225,55 +229,6 @@ fn create_get_a_primary_ql_class(class_name: &str) -> ql::Predicate { } } -/// Creates the `getLocation` predicate. -/// -/// # Arguments -/// -/// `def_table` - the name of the table that defines the entity and its location. -/// `arity` - the total number of columns in the table -fn create_get_location_predicate(def_table: &str, arity: usize) -> ql::Predicate { - ql::Predicate { - qldoc: Some(String::from("Gets the location of this element.")), - name: "getLocation", - overridden: true, - return_type: Some(ql::Type::Normal("L::Location")), - formal_parameters: vec![], - // body of the form: foo_bar_def(_, _, ..., result) - body: ql::Expression::Pred( - def_table, - [ - vec![ql::Expression::Var("this")], - vec![ql::Expression::Var("_"); arity - 2], - vec![ql::Expression::Var("result")], - ] - .concat(), - ), - } -} - -/// Creates the `getText` predicate for a leaf node. -/// -/// # Arguments -/// -/// `def_table` - the name of the table that defines the entity and its text. -fn create_get_text_predicate(def_table: &str) -> ql::Predicate { - ql::Predicate { - qldoc: Some(String::from("Gets the text content of this element.")), - name: "getText", - overridden: false, - return_type: Some(ql::Type::String), - formal_parameters: vec![], - body: ql::Expression::Pred( - def_table, - vec![ - ql::Expression::Var("this"), - ql::Expression::Var("result"), - ql::Expression::Var("_"), - ], - ), - } -} - /// Returns an expression to get a field that's defined as a column in the parent's table. /// /// # Arguments @@ -532,20 +487,17 @@ pub fn convert_nodes(nodes: &node_types::NodeTypeMap) -> Vec { name: main_table_name, fields, } => { - // Count how many columns there will be in the main table. - // There will be: - // - one for the id - // - one for the location - // - one for each field that's stored as a column - // - if there are no fields, one for the text column. - let main_table_arity = 2 + if fields.is_empty() { - 1 - } else { - fields - .iter() - .filter(|&f| matches!(f.storage, node_types::Storage::Column { .. })) - .count() - }; + if fields.is_empty() { + panic!("Encountered node '{}' with no fields", type_name.kind); + } + + // Count how many columns there will be in the main table. There + // will be one for the id, plus one for each field that's stored + // as a column. + let main_table_arity = 1 + fields + .iter() + .filter(|&f| matches!(f.storage, node_types::Storage::Column { .. })) + .count(); let main_class_name = &node.ql_class_name; let mut main_class = ql::Class { @@ -559,48 +511,39 @@ pub fn convert_nodes(nodes: &node_types::NodeTypeMap) -> Vec { .into_iter() .collect(), characteristic_predicate: None, - predicates: vec![ - create_get_a_primary_ql_class(main_class_name), - create_get_location_predicate(main_table_name, main_table_arity), - ], + predicates: vec![create_get_a_primary_ql_class(main_class_name)], }; - if fields.is_empty() { - main_class - .predicates - .push(create_get_text_predicate(main_table_name)); - } else { - let mut main_table_column_index: usize = 0; - let mut get_child_exprs: Vec = Vec::new(); + let mut main_table_column_index: usize = 0; + let mut get_child_exprs: Vec = Vec::new(); - // Iterate through the fields, creating: - // - classes to wrap union types if fields need them, - // - predicates to access the fields, - // - the QL expressions to access the fields that will be part of getAFieldOrChild. - for field in fields { - let (get_pred, get_child_expr) = create_field_getters( - main_table_name, - main_table_arity, - &mut main_table_column_index, - field, - nodes, - ); - main_class.predicates.push(get_pred); - if let Some(get_child_expr) = get_child_expr { - get_child_exprs.push(get_child_expr) - } + // Iterate through the fields, creating: + // - classes to wrap union types if fields need them, + // - predicates to access the fields, + // - the QL expressions to access the fields that will be part of getAFieldOrChild. + for field in fields { + let (get_pred, get_child_expr) = create_field_getters( + main_table_name, + main_table_arity, + &mut main_table_column_index, + field, + nodes, + ); + main_class.predicates.push(get_pred); + if let Some(get_child_expr) = get_child_expr { + get_child_exprs.push(get_child_expr) } - - main_class.predicates.push(ql::Predicate { - qldoc: Some(String::from("Gets a field or child node of this node.")), - name: "getAFieldOrChild", - overridden: true, - return_type: Some(ql::Type::Normal("AstNode")), - formal_parameters: vec![], - body: ql::Expression::Or(get_child_exprs), - }); } + main_class.predicates.push(ql::Predicate { + qldoc: Some(String::from("Gets a field or child node of this node.")), + name: "getAFieldOrChild", + overridden: true, + return_type: Some(ql::Type::Normal("AstNode")), + formal_parameters: vec![], + body: ql::Expression::Or(get_child_exprs), + }); + classes.push(ql::TopLevel::Class(main_class)); } } diff --git a/ruby/ql/lib/codeql/ruby/AST.qll b/ruby/ql/lib/codeql/ruby/AST.qll index e09d1d5b7d9..49edd048301 100644 --- a/ruby/ql/lib/codeql/ruby/AST.qll +++ b/ruby/ql/lib/codeql/ruby/AST.qll @@ -126,7 +126,7 @@ class AstNode extends TAstNode { /** A Ruby source file */ class RubyFile extends File { - RubyFile() { ruby_ast_node_parent(_, this, _) } + RubyFile() { ruby_ast_node_info(_, this, _, _) } /** Gets a token in this file. */ private Ruby::Token getAToken() { result.getLocation().getFile() = this } diff --git a/ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll b/ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll index 56ecf5046b8..390cdab06ea 100644 --- a/ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll +++ b/ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll @@ -12,13 +12,13 @@ module Ruby { string toString() { result = this.getAPrimaryQlClass() } /** Gets the location of this element. */ - L::Location getLocation() { none() } + L::Location getLocation() { ruby_ast_node_info(this, _, _, result) } /** Gets the parent of this element. */ - AstNode getParent() { ruby_ast_node_parent(this, result, _) } + AstNode getParent() { ruby_ast_node_info(this, result, _, _) } /** Gets the index of this node among the children of its parent. */ - int getParentIndex() { ruby_ast_node_parent(this, _, result) } + int getParentIndex() { ruby_ast_node_info(this, _, result, _) } /** Gets a field or child node of this node. */ AstNode getAFieldOrChild() { none() } @@ -33,10 +33,7 @@ module Ruby { /** A token. */ class Token extends @ruby_token, AstNode { /** Gets the value of this token. */ - string getValue() { ruby_tokeninfo(this, _, result, _) } - - /** Gets the location of this token. */ - override L::Location getLocation() { ruby_tokeninfo(this, _, _, result) } + string getValue() { ruby_tokeninfo(this, _, result) } /** Gets a string representation of this element. */ override string toString() { result = this.getValue() } @@ -84,18 +81,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Alias" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_alias_def(this, _, _, result) } - /** Gets the node corresponding to the field `alias`. */ - UnderscoreMethodName getAlias() { ruby_alias_def(this, result, _, _) } + UnderscoreMethodName getAlias() { ruby_alias_def(this, result, _) } /** Gets the node corresponding to the field `name`. */ - UnderscoreMethodName getName() { ruby_alias_def(this, _, result, _) } + UnderscoreMethodName getName() { ruby_alias_def(this, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_alias_def(this, result, _, _) or ruby_alias_def(this, _, result, _) + ruby_alias_def(this, result, _) or ruby_alias_def(this, _, result) } } @@ -104,9 +98,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "AlternativePattern" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_alternative_pattern_def(this, result) } - /** Gets the node corresponding to the field `alternatives`. */ UnderscorePatternExprBasic getAlternatives(int i) { ruby_alternative_pattern_alternatives(this, i, result) @@ -121,9 +112,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "ArgumentList" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_argument_list_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_argument_list_child(this, i, result) } @@ -136,9 +124,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Array" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_array_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_array_child(this, i, result) } @@ -151,9 +136,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "ArrayPattern" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_array_pattern_def(this, result) } - /** Gets the node corresponding to the field `class`. */ UnderscorePatternConstant getClass() { ruby_array_pattern_class(this, result) } @@ -171,18 +153,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "AsPattern" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_as_pattern_def(this, _, _, result) } - /** Gets the node corresponding to the field `name`. */ - Identifier getName() { ruby_as_pattern_def(this, result, _, _) } + Identifier getName() { ruby_as_pattern_def(this, result, _) } /** Gets the node corresponding to the field `value`. */ - UnderscorePatternExpr getValue() { ruby_as_pattern_def(this, _, result, _) } + UnderscorePatternExpr getValue() { ruby_as_pattern_def(this, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_as_pattern_def(this, result, _, _) or ruby_as_pattern_def(this, _, result, _) + ruby_as_pattern_def(this, result, _) or ruby_as_pattern_def(this, _, result) } } @@ -191,18 +170,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Assignment" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_assignment_def(this, _, _, result) } - /** Gets the node corresponding to the field `left`. */ - AstNode getLeft() { ruby_assignment_def(this, result, _, _) } + AstNode getLeft() { ruby_assignment_def(this, result, _) } /** Gets the node corresponding to the field `right`. */ - AstNode getRight() { ruby_assignment_def(this, _, result, _) } + AstNode getRight() { ruby_assignment_def(this, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_assignment_def(this, result, _, _) or ruby_assignment_def(this, _, result, _) + ruby_assignment_def(this, result, _) or ruby_assignment_def(this, _, result) } } @@ -211,9 +187,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "BareString" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_bare_string_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_bare_string_child(this, i, result) } @@ -226,9 +199,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "BareSymbol" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_bare_symbol_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_bare_symbol_child(this, i, result) } @@ -241,9 +211,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Begin" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_begin_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_begin_child(this, i, result) } @@ -256,9 +223,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "BeginBlock" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_begin_block_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_begin_block_child(this, i, result) } @@ -271,15 +235,12 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Binary" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_binary_def(this, _, _, _, result) } - /** Gets the node corresponding to the field `left`. */ - UnderscoreExpression getLeft() { ruby_binary_def(this, result, _, _, _) } + UnderscoreExpression getLeft() { ruby_binary_def(this, result, _, _) } /** Gets the node corresponding to the field `operator`. */ string getOperator() { - exists(int value | ruby_binary_def(this, _, value, _, _) | + exists(int value | ruby_binary_def(this, _, value, _) | result = "!=" and value = 0 or result = "!~" and value = 1 @@ -333,11 +294,11 @@ module Ruby { } /** Gets the node corresponding to the field `right`. */ - UnderscoreExpression getRight() { ruby_binary_def(this, _, _, result, _) } + UnderscoreExpression getRight() { ruby_binary_def(this, _, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_binary_def(this, result, _, _, _) or ruby_binary_def(this, _, _, result, _) + ruby_binary_def(this, result, _, _) or ruby_binary_def(this, _, _, result) } } @@ -346,9 +307,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Block" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_block_def(this, result) } - /** Gets the node corresponding to the field `parameters`. */ BlockParameters getParameters() { ruby_block_parameters(this, result) } @@ -366,9 +324,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "BlockArgument" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_block_argument_def(this, result) } - /** Gets the child of this node. */ UnderscoreArg getChild() { ruby_block_argument_child(this, result) } @@ -381,9 +336,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "BlockParameter" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_block_parameter_def(this, result) } - /** Gets the node corresponding to the field `name`. */ Identifier getName() { ruby_block_parameter_name(this, result) } @@ -396,9 +348,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "BlockParameters" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_block_parameters_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_block_parameters_child(this, i, result) } @@ -411,9 +360,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Break" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_break_def(this, result) } - /** Gets the child of this node. */ ArgumentList getChild() { ruby_break_child(this, result) } @@ -426,9 +372,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Call" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_call_def(this, _, result) } - /** Gets the node corresponding to the field `arguments`. */ ArgumentList getArguments() { ruby_call_arguments(this, result) } @@ -436,7 +379,7 @@ module Ruby { AstNode getBlock() { ruby_call_block(this, result) } /** Gets the node corresponding to the field `method`. */ - AstNode getMethod() { ruby_call_def(this, result, _) } + AstNode getMethod() { ruby_call_def(this, result) } /** Gets the node corresponding to the field `receiver`. */ AstNode getReceiver() { ruby_call_receiver(this, result) } @@ -445,7 +388,7 @@ module Ruby { override AstNode getAFieldOrChild() { ruby_call_arguments(this, result) or ruby_call_block(this, result) or - ruby_call_def(this, result, _) or + ruby_call_def(this, result) or ruby_call_receiver(this, result) } } @@ -455,9 +398,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Case" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_case_def(this, result) } - /** Gets the node corresponding to the field `value`. */ UnderscoreStatement getValue() { ruby_case_value(this, result) } @@ -475,9 +415,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "CaseMatch" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_case_match_def(this, _, result) } - /** Gets the node corresponding to the field `clauses`. */ InClause getClauses(int i) { ruby_case_match_clauses(this, i, result) } @@ -485,13 +422,13 @@ module Ruby { Else getElse() { ruby_case_match_else(this, result) } /** Gets the node corresponding to the field `value`. */ - UnderscoreStatement getValue() { ruby_case_match_def(this, result, _) } + UnderscoreStatement getValue() { ruby_case_match_def(this, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { ruby_case_match_clauses(this, _, result) or ruby_case_match_else(this, result) or - ruby_case_match_def(this, result, _) + ruby_case_match_def(this, result) } } @@ -500,9 +437,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "ChainedString" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_chained_string_def(this, result) } - /** Gets the `i`th child of this node. */ String getChild(int i) { ruby_chained_string_child(this, i, result) } @@ -521,11 +455,8 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Class" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_class_def(this, _, result) } - /** Gets the node corresponding to the field `name`. */ - AstNode getName() { ruby_class_def(this, result, _) } + AstNode getName() { ruby_class_def(this, result) } /** Gets the node corresponding to the field `superclass`. */ Superclass getSuperclass() { ruby_class_superclass(this, result) } @@ -535,7 +466,7 @@ module Ruby { /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_class_def(this, result, _) or + ruby_class_def(this, result) or ruby_class_superclass(this, result) or ruby_class_child(this, _, result) } @@ -564,23 +495,20 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Conditional" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_conditional_def(this, _, _, _, result) } - /** Gets the node corresponding to the field `alternative`. */ - UnderscoreArg getAlternative() { ruby_conditional_def(this, result, _, _, _) } + UnderscoreArg getAlternative() { ruby_conditional_def(this, result, _, _) } /** Gets the node corresponding to the field `condition`. */ - UnderscoreArg getCondition() { ruby_conditional_def(this, _, result, _, _) } + UnderscoreArg getCondition() { ruby_conditional_def(this, _, result, _) } /** Gets the node corresponding to the field `consequence`. */ - UnderscoreArg getConsequence() { ruby_conditional_def(this, _, _, result, _) } + UnderscoreArg getConsequence() { ruby_conditional_def(this, _, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_conditional_def(this, result, _, _, _) or - ruby_conditional_def(this, _, result, _, _) or - ruby_conditional_def(this, _, _, result, _) + ruby_conditional_def(this, result, _, _) or + ruby_conditional_def(this, _, result, _) or + ruby_conditional_def(this, _, _, result) } } @@ -595,9 +523,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "DelimitedSymbol" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_delimited_symbol_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_delimited_symbol_child(this, i, result) } @@ -610,9 +535,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "DestructuredLeftAssignment" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_destructured_left_assignment_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_destructured_left_assignment_child(this, i, result) } @@ -625,9 +547,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "DestructuredParameter" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_destructured_parameter_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_destructured_parameter_child(this, i, result) } @@ -640,9 +559,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Do" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_do_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_do_child(this, i, result) } @@ -655,9 +571,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "DoBlock" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_do_block_def(this, result) } - /** Gets the node corresponding to the field `parameters`. */ BlockParameters getParameters() { ruby_do_block_parameters(this, result) } @@ -675,18 +588,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "ElementReference" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_element_reference_def(this, _, result) } - /** Gets the node corresponding to the field `object`. */ - UnderscorePrimary getObject() { ruby_element_reference_def(this, result, _) } + UnderscorePrimary getObject() { ruby_element_reference_def(this, result) } /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_element_reference_child(this, i, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_element_reference_def(this, result, _) or ruby_element_reference_child(this, _, result) + ruby_element_reference_def(this, result) or ruby_element_reference_child(this, _, result) } } @@ -695,9 +605,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Else" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_else_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_else_child(this, i, result) } @@ -710,14 +617,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Elsif" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_elsif_def(this, _, result) } - /** Gets the node corresponding to the field `alternative`. */ AstNode getAlternative() { ruby_elsif_alternative(this, result) } /** Gets the node corresponding to the field `condition`. */ - UnderscoreStatement getCondition() { ruby_elsif_def(this, result, _) } + UnderscoreStatement getCondition() { ruby_elsif_def(this, result) } /** Gets the node corresponding to the field `consequence`. */ Then getConsequence() { ruby_elsif_consequence(this, result) } @@ -725,7 +629,7 @@ module Ruby { /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { ruby_elsif_alternative(this, result) or - ruby_elsif_def(this, result, _) or + ruby_elsif_def(this, result) or ruby_elsif_consequence(this, result) } } @@ -747,9 +651,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "EndBlock" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_end_block_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_end_block_child(this, i, result) } @@ -762,9 +663,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Ensure" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_ensure_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_ensure_child(this, i, result) } @@ -783,14 +681,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "ExceptionVariable" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_exception_variable_def(this, _, result) } - /** Gets the child of this node. */ - UnderscoreLhs getChild() { ruby_exception_variable_def(this, result, _) } + UnderscoreLhs getChild() { ruby_exception_variable_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { ruby_exception_variable_def(this, result, _) } + override AstNode getAFieldOrChild() { ruby_exception_variable_def(this, result) } } /** A class representing `exceptions` nodes. */ @@ -798,9 +693,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Exceptions" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_exceptions_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_exceptions_child(this, i, result) } @@ -813,14 +705,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "ExpressionReferencePattern" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_expression_reference_pattern_def(this, _, result) } - /** Gets the node corresponding to the field `value`. */ - UnderscoreExpression getValue() { ruby_expression_reference_pattern_def(this, result, _) } + UnderscoreExpression getValue() { ruby_expression_reference_pattern_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { ruby_expression_reference_pattern_def(this, result, _) } + override AstNode getAFieldOrChild() { ruby_expression_reference_pattern_def(this, result) } } /** A class representing `false` tokens. */ @@ -840,9 +729,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "FindPattern" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_find_pattern_def(this, result) } - /** Gets the node corresponding to the field `class`. */ UnderscorePatternConstant getClass() { ruby_find_pattern_class(this, result) } @@ -866,23 +752,20 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "For" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_for_def(this, _, _, _, result) } - /** Gets the node corresponding to the field `body`. */ - Do getBody() { ruby_for_def(this, result, _, _, _) } + Do getBody() { ruby_for_def(this, result, _, _) } /** Gets the node corresponding to the field `pattern`. */ - AstNode getPattern() { ruby_for_def(this, _, result, _, _) } + AstNode getPattern() { ruby_for_def(this, _, result, _) } /** Gets the node corresponding to the field `value`. */ - In getValue() { ruby_for_def(this, _, _, result, _) } + In getValue() { ruby_for_def(this, _, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_for_def(this, result, _, _, _) or - ruby_for_def(this, _, result, _, _) or - ruby_for_def(this, _, _, result, _) + ruby_for_def(this, result, _, _) or + ruby_for_def(this, _, result, _) or + ruby_for_def(this, _, _, result) } } @@ -909,9 +792,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Hash" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_hash_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_hash_child(this, i, result) } @@ -930,9 +810,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "HashPattern" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_hash_pattern_def(this, result) } - /** Gets the node corresponding to the field `class`. */ UnderscorePatternConstant getClass() { ruby_hash_pattern_class(this, result) } @@ -950,14 +827,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "HashSplatArgument" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_hash_splat_argument_def(this, _, result) } - /** Gets the child of this node. */ - UnderscoreArg getChild() { ruby_hash_splat_argument_def(this, result, _) } + UnderscoreArg getChild() { ruby_hash_splat_argument_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { ruby_hash_splat_argument_def(this, result, _) } + override AstNode getAFieldOrChild() { ruby_hash_splat_argument_def(this, result) } } /** A class representing `hash_splat_nil` tokens. */ @@ -971,9 +845,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "HashSplatParameter" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_hash_splat_parameter_def(this, result) } - /** Gets the node corresponding to the field `name`. */ Identifier getName() { ruby_hash_splat_parameter_name(this, result) } @@ -992,9 +863,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "HeredocBody" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_heredoc_body_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_heredoc_body_child(this, i, result) } @@ -1025,14 +893,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "If" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_if_def(this, _, result) } - /** Gets the node corresponding to the field `alternative`. */ AstNode getAlternative() { ruby_if_alternative(this, result) } /** Gets the node corresponding to the field `condition`. */ - UnderscoreStatement getCondition() { ruby_if_def(this, result, _) } + UnderscoreStatement getCondition() { ruby_if_def(this, result) } /** Gets the node corresponding to the field `consequence`. */ Then getConsequence() { ruby_if_consequence(this, result) } @@ -1040,7 +905,7 @@ module Ruby { /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { ruby_if_alternative(this, result) or - ruby_if_def(this, result, _) or + ruby_if_def(this, result) or ruby_if_consequence(this, result) } } @@ -1050,14 +915,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "IfGuard" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_if_guard_def(this, _, result) } - /** Gets the node corresponding to the field `condition`. */ - UnderscoreExpression getCondition() { ruby_if_guard_def(this, result, _) } + UnderscoreExpression getCondition() { ruby_if_guard_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { ruby_if_guard_def(this, result, _) } + override AstNode getAFieldOrChild() { ruby_if_guard_def(this, result) } } /** A class representing `if_modifier` nodes. */ @@ -1065,18 +927,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "IfModifier" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_if_modifier_def(this, _, _, result) } - /** Gets the node corresponding to the field `body`. */ - UnderscoreStatement getBody() { ruby_if_modifier_def(this, result, _, _) } + UnderscoreStatement getBody() { ruby_if_modifier_def(this, result, _) } /** Gets the node corresponding to the field `condition`. */ - UnderscoreExpression getCondition() { ruby_if_modifier_def(this, _, result, _) } + UnderscoreExpression getCondition() { ruby_if_modifier_def(this, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_if_modifier_def(this, result, _, _) or ruby_if_modifier_def(this, _, result, _) + ruby_if_modifier_def(this, result, _) or ruby_if_modifier_def(this, _, result) } } @@ -1085,14 +944,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "In" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_in_def(this, _, result) } - /** Gets the child of this node. */ - UnderscoreArg getChild() { ruby_in_def(this, result, _) } + UnderscoreArg getChild() { ruby_in_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { ruby_in_def(this, result, _) } + override AstNode getAFieldOrChild() { ruby_in_def(this, result) } } /** A class representing `in_clause` nodes. */ @@ -1100,9 +956,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "InClause" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_in_clause_def(this, _, result) } - /** Gets the node corresponding to the field `body`. */ Then getBody() { ruby_in_clause_body(this, result) } @@ -1110,13 +963,13 @@ module Ruby { AstNode getGuard() { ruby_in_clause_guard(this, result) } /** Gets the node corresponding to the field `pattern`. */ - UnderscorePatternTopExprBody getPattern() { ruby_in_clause_def(this, result, _) } + UnderscorePatternTopExprBody getPattern() { ruby_in_clause_def(this, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { ruby_in_clause_body(this, result) or ruby_in_clause_guard(this, result) or - ruby_in_clause_def(this, result, _) + ruby_in_clause_def(this, result) } } @@ -1137,9 +990,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Interpolation" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_interpolation_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_interpolation_child(this, i, result) } @@ -1152,18 +1002,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "KeywordParameter" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_keyword_parameter_def(this, _, result) } - /** Gets the node corresponding to the field `name`. */ - Identifier getName() { ruby_keyword_parameter_def(this, result, _) } + Identifier getName() { ruby_keyword_parameter_def(this, result) } /** Gets the node corresponding to the field `value`. */ UnderscoreArg getValue() { ruby_keyword_parameter_value(this, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_keyword_parameter_def(this, result, _) or ruby_keyword_parameter_value(this, result) + ruby_keyword_parameter_def(this, result) or ruby_keyword_parameter_value(this, result) } } @@ -1172,18 +1019,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "KeywordPattern" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_keyword_pattern_def(this, _, result) } - /** Gets the node corresponding to the field `key`. */ - AstNode getKey() { ruby_keyword_pattern_def(this, result, _) } + AstNode getKey() { ruby_keyword_pattern_def(this, result) } /** Gets the node corresponding to the field `value`. */ UnderscorePatternExpr getValue() { ruby_keyword_pattern_value(this, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_keyword_pattern_def(this, result, _) or ruby_keyword_pattern_value(this, result) + ruby_keyword_pattern_def(this, result) or ruby_keyword_pattern_value(this, result) } } @@ -1192,18 +1036,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Lambda" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_lambda_def(this, _, result) } - /** Gets the node corresponding to the field `body`. */ - AstNode getBody() { ruby_lambda_def(this, result, _) } + AstNode getBody() { ruby_lambda_def(this, result) } /** Gets the node corresponding to the field `parameters`. */ LambdaParameters getParameters() { ruby_lambda_parameters(this, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_lambda_def(this, result, _) or ruby_lambda_parameters(this, result) + ruby_lambda_def(this, result) or ruby_lambda_parameters(this, result) } } @@ -1212,9 +1053,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "LambdaParameters" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_lambda_parameters_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_lambda_parameters_child(this, i, result) } @@ -1227,9 +1065,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "LeftAssignmentList" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_left_assignment_list_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_left_assignment_list_child(this, i, result) } @@ -1248,11 +1083,8 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Method" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_method_def(this, _, result) } - /** Gets the node corresponding to the field `name`. */ - UnderscoreMethodName getName() { ruby_method_def(this, result, _) } + UnderscoreMethodName getName() { ruby_method_def(this, result) } /** Gets the node corresponding to the field `parameters`. */ MethodParameters getParameters() { ruby_method_parameters(this, result) } @@ -1262,7 +1094,7 @@ module Ruby { /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_method_def(this, result, _) or + ruby_method_def(this, result) or ruby_method_parameters(this, result) or ruby_method_child(this, _, result) } @@ -1273,9 +1105,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "MethodParameters" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_method_parameters_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_method_parameters_child(this, i, result) } @@ -1288,18 +1117,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Module" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_module_def(this, _, result) } - /** Gets the node corresponding to the field `name`. */ - AstNode getName() { ruby_module_def(this, result, _) } + AstNode getName() { ruby_module_def(this, result) } /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_module_child(this, i, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_module_def(this, result, _) or ruby_module_child(this, _, result) + ruby_module_def(this, result) or ruby_module_child(this, _, result) } } @@ -1308,9 +1134,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Next" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_next_def(this, result) } - /** Gets the child of this node. */ ArgumentList getChild() { ruby_next_child(this, result) } @@ -1335,15 +1158,12 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "OperatorAssignment" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_operator_assignment_def(this, _, _, _, result) } - /** Gets the node corresponding to the field `left`. */ - UnderscoreLhs getLeft() { ruby_operator_assignment_def(this, result, _, _, _) } + UnderscoreLhs getLeft() { ruby_operator_assignment_def(this, result, _, _) } /** Gets the node corresponding to the field `operator`. */ string getOperator() { - exists(int value | ruby_operator_assignment_def(this, _, value, _, _) | + exists(int value | ruby_operator_assignment_def(this, _, value, _) | result = "%=" and value = 0 or result = "&&=" and value = 1 @@ -1373,12 +1193,12 @@ module Ruby { } /** Gets the node corresponding to the field `right`. */ - UnderscoreExpression getRight() { ruby_operator_assignment_def(this, _, _, result, _) } + UnderscoreExpression getRight() { ruby_operator_assignment_def(this, _, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_operator_assignment_def(this, result, _, _, _) or - ruby_operator_assignment_def(this, _, _, result, _) + ruby_operator_assignment_def(this, result, _, _) or + ruby_operator_assignment_def(this, _, _, result) } } @@ -1387,19 +1207,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "OptionalParameter" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_optional_parameter_def(this, _, _, result) } - /** Gets the node corresponding to the field `name`. */ - Identifier getName() { ruby_optional_parameter_def(this, result, _, _) } + Identifier getName() { ruby_optional_parameter_def(this, result, _) } /** Gets the node corresponding to the field `value`. */ - UnderscoreArg getValue() { ruby_optional_parameter_def(this, _, result, _) } + UnderscoreArg getValue() { ruby_optional_parameter_def(this, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_optional_parameter_def(this, result, _, _) or - ruby_optional_parameter_def(this, _, result, _) + ruby_optional_parameter_def(this, result, _) or ruby_optional_parameter_def(this, _, result) } } @@ -1408,18 +1224,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Pair" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_pair_def(this, _, result) } - /** Gets the node corresponding to the field `key`. */ - AstNode getKey() { ruby_pair_def(this, result, _) } + AstNode getKey() { ruby_pair_def(this, result) } /** Gets the node corresponding to the field `value`. */ UnderscoreArg getValue() { ruby_pair_value(this, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_pair_def(this, result, _) or ruby_pair_value(this, result) + ruby_pair_def(this, result) or ruby_pair_value(this, result) } } @@ -1428,14 +1241,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "ParenthesizedPattern" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_parenthesized_pattern_def(this, _, result) } - /** Gets the child of this node. */ - UnderscorePatternExpr getChild() { ruby_parenthesized_pattern_def(this, result, _) } + UnderscorePatternExpr getChild() { ruby_parenthesized_pattern_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { ruby_parenthesized_pattern_def(this, result, _) } + override AstNode getAFieldOrChild() { ruby_parenthesized_pattern_def(this, result) } } /** A class representing `parenthesized_statements` nodes. */ @@ -1443,9 +1253,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "ParenthesizedStatements" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_parenthesized_statements_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_parenthesized_statements_child(this, i, result) } @@ -1458,14 +1265,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Pattern" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_pattern_def(this, _, result) } - /** Gets the child of this node. */ - AstNode getChild() { ruby_pattern_def(this, result, _) } + AstNode getChild() { ruby_pattern_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { ruby_pattern_def(this, result, _) } + override AstNode getAFieldOrChild() { ruby_pattern_def(this, result) } } /** A class representing `program` nodes. */ @@ -1473,9 +1277,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Program" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_program_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_program_child(this, i, result) } @@ -1488,9 +1289,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Range" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_range_def(this, _, result) } - /** Gets the node corresponding to the field `begin`. */ AstNode getBegin() { ruby_range_begin(this, result) } @@ -1499,7 +1297,7 @@ module Ruby { /** Gets the node corresponding to the field `operator`. */ string getOperator() { - exists(int value | ruby_range_def(this, value, _) | + exists(int value | ruby_range_def(this, value) | result = ".." and value = 0 or result = "..." and value = 1 @@ -1517,14 +1315,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Rational" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_rational_def(this, _, result) } - /** Gets the child of this node. */ - AstNode getChild() { ruby_rational_def(this, result, _) } + AstNode getChild() { ruby_rational_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { ruby_rational_def(this, result, _) } + override AstNode getAFieldOrChild() { ruby_rational_def(this, result) } } /** A class representing `redo` nodes. */ @@ -1532,9 +1327,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Redo" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_redo_def(this, result) } - /** Gets the child of this node. */ ArgumentList getChild() { ruby_redo_child(this, result) } @@ -1547,9 +1339,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Regex" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_regex_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_regex_child(this, i, result) } @@ -1562,9 +1351,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Rescue" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_rescue_def(this, result) } - /** Gets the node corresponding to the field `body`. */ Then getBody() { ruby_rescue_body(this, result) } @@ -1587,18 +1373,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "RescueModifier" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_rescue_modifier_def(this, _, _, result) } - /** Gets the node corresponding to the field `body`. */ - AstNode getBody() { ruby_rescue_modifier_def(this, result, _, _) } + AstNode getBody() { ruby_rescue_modifier_def(this, result, _) } /** Gets the node corresponding to the field `handler`. */ - UnderscoreExpression getHandler() { ruby_rescue_modifier_def(this, _, result, _) } + UnderscoreExpression getHandler() { ruby_rescue_modifier_def(this, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_rescue_modifier_def(this, result, _, _) or ruby_rescue_modifier_def(this, _, result, _) + ruby_rescue_modifier_def(this, result, _) or ruby_rescue_modifier_def(this, _, result) } } @@ -1607,9 +1390,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "RestAssignment" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_rest_assignment_def(this, result) } - /** Gets the child of this node. */ UnderscoreLhs getChild() { ruby_rest_assignment_child(this, result) } @@ -1622,9 +1402,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Retry" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_retry_def(this, result) } - /** Gets the child of this node. */ ArgumentList getChild() { ruby_retry_child(this, result) } @@ -1637,9 +1414,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Return" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_return_def(this, result) } - /** Gets the child of this node. */ ArgumentList getChild() { ruby_return_child(this, result) } @@ -1652,9 +1426,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "RightAssignmentList" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_right_assignment_list_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_right_assignment_list_child(this, i, result) } @@ -1667,18 +1438,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "ScopeResolution" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_scope_resolution_def(this, _, result) } - /** Gets the node corresponding to the field `name`. */ - AstNode getName() { ruby_scope_resolution_def(this, result, _) } + AstNode getName() { ruby_scope_resolution_def(this, result) } /** Gets the node corresponding to the field `scope`. */ AstNode getScope() { ruby_scope_resolution_scope(this, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_scope_resolution_def(this, result, _) or ruby_scope_resolution_scope(this, result) + ruby_scope_resolution_def(this, result) or ruby_scope_resolution_scope(this, result) } } @@ -1693,14 +1461,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Setter" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_setter_def(this, _, result) } - /** Gets the node corresponding to the field `name`. */ - Identifier getName() { ruby_setter_def(this, result, _) } + Identifier getName() { ruby_setter_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { ruby_setter_def(this, result, _) } + override AstNode getAFieldOrChild() { ruby_setter_def(this, result) } } /** A class representing `simple_symbol` tokens. */ @@ -1714,18 +1479,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "SingletonClass" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_singleton_class_def(this, _, result) } - /** Gets the node corresponding to the field `value`. */ - UnderscoreArg getValue() { ruby_singleton_class_def(this, result, _) } + UnderscoreArg getValue() { ruby_singleton_class_def(this, result) } /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_singleton_class_child(this, i, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_singleton_class_def(this, result, _) or ruby_singleton_class_child(this, _, result) + ruby_singleton_class_def(this, result) or ruby_singleton_class_child(this, _, result) } } @@ -1734,14 +1496,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "SingletonMethod" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_singleton_method_def(this, _, _, result) } - /** Gets the node corresponding to the field `name`. */ - UnderscoreMethodName getName() { ruby_singleton_method_def(this, result, _, _) } + UnderscoreMethodName getName() { ruby_singleton_method_def(this, result, _) } /** Gets the node corresponding to the field `object`. */ - AstNode getObject() { ruby_singleton_method_def(this, _, result, _) } + AstNode getObject() { ruby_singleton_method_def(this, _, result) } /** Gets the node corresponding to the field `parameters`. */ MethodParameters getParameters() { ruby_singleton_method_parameters(this, result) } @@ -1751,8 +1510,8 @@ module Ruby { /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_singleton_method_def(this, result, _, _) or - ruby_singleton_method_def(this, _, result, _) or + ruby_singleton_method_def(this, result, _) or + ruby_singleton_method_def(this, _, result) or ruby_singleton_method_parameters(this, result) or ruby_singleton_method_child(this, _, result) } @@ -1763,14 +1522,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "SplatArgument" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_splat_argument_def(this, _, result) } - /** Gets the child of this node. */ - UnderscoreArg getChild() { ruby_splat_argument_def(this, result, _) } + UnderscoreArg getChild() { ruby_splat_argument_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { ruby_splat_argument_def(this, result, _) } + override AstNode getAFieldOrChild() { ruby_splat_argument_def(this, result) } } /** A class representing `splat_parameter` nodes. */ @@ -1778,9 +1534,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "SplatParameter" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_splat_parameter_def(this, result) } - /** Gets the node corresponding to the field `name`. */ Identifier getName() { ruby_splat_parameter_name(this, result) } @@ -1793,9 +1546,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "String" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_string_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_string_child(this, i, result) } @@ -1808,9 +1558,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "StringArray" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_string_array_def(this, result) } - /** Gets the `i`th child of this node. */ BareString getChild(int i) { ruby_string_array_child(this, i, result) } @@ -1829,9 +1576,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Subshell" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_subshell_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_subshell_child(this, i, result) } @@ -1850,14 +1594,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Superclass" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_superclass_def(this, _, result) } - /** Gets the child of this node. */ - UnderscoreExpression getChild() { ruby_superclass_def(this, result, _) } + UnderscoreExpression getChild() { ruby_superclass_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { ruby_superclass_def(this, result, _) } + override AstNode getAFieldOrChild() { ruby_superclass_def(this, result) } } /** A class representing `symbol_array` nodes. */ @@ -1865,9 +1606,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "SymbolArray" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_symbol_array_def(this, result) } - /** Gets the `i`th child of this node. */ BareSymbol getChild(int i) { ruby_symbol_array_child(this, i, result) } @@ -1880,9 +1618,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Then" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_then_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { ruby_then_child(this, i, result) } @@ -1901,15 +1636,12 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Unary" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_unary_def(this, _, _, result) } - /** Gets the node corresponding to the field `operand`. */ - AstNode getOperand() { ruby_unary_def(this, result, _, _) } + AstNode getOperand() { ruby_unary_def(this, result, _) } /** Gets the node corresponding to the field `operator`. */ string getOperator() { - exists(int value | ruby_unary_def(this, _, value, _) | + exists(int value | ruby_unary_def(this, _, value) | result = "!" and value = 0 or result = "+" and value = 1 @@ -1925,7 +1657,7 @@ module Ruby { } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { ruby_unary_def(this, result, _, _) } + override AstNode getAFieldOrChild() { ruby_unary_def(this, result, _) } } /** A class representing `undef` nodes. */ @@ -1933,9 +1665,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Undef" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_undef_def(this, result) } - /** Gets the `i`th child of this node. */ UnderscoreMethodName getChild(int i) { ruby_undef_child(this, i, result) } @@ -1954,14 +1683,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Unless" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_unless_def(this, _, result) } - /** Gets the node corresponding to the field `alternative`. */ AstNode getAlternative() { ruby_unless_alternative(this, result) } /** Gets the node corresponding to the field `condition`. */ - UnderscoreStatement getCondition() { ruby_unless_def(this, result, _) } + UnderscoreStatement getCondition() { ruby_unless_def(this, result) } /** Gets the node corresponding to the field `consequence`. */ Then getConsequence() { ruby_unless_consequence(this, result) } @@ -1969,7 +1695,7 @@ module Ruby { /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { ruby_unless_alternative(this, result) or - ruby_unless_def(this, result, _) or + ruby_unless_def(this, result) or ruby_unless_consequence(this, result) } } @@ -1979,14 +1705,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "UnlessGuard" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_unless_guard_def(this, _, result) } - /** Gets the node corresponding to the field `condition`. */ - UnderscoreExpression getCondition() { ruby_unless_guard_def(this, result, _) } + UnderscoreExpression getCondition() { ruby_unless_guard_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { ruby_unless_guard_def(this, result, _) } + override AstNode getAFieldOrChild() { ruby_unless_guard_def(this, result) } } /** A class representing `unless_modifier` nodes. */ @@ -1994,18 +1717,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "UnlessModifier" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_unless_modifier_def(this, _, _, result) } - /** Gets the node corresponding to the field `body`. */ - UnderscoreStatement getBody() { ruby_unless_modifier_def(this, result, _, _) } + UnderscoreStatement getBody() { ruby_unless_modifier_def(this, result, _) } /** Gets the node corresponding to the field `condition`. */ - UnderscoreExpression getCondition() { ruby_unless_modifier_def(this, _, result, _) } + UnderscoreExpression getCondition() { ruby_unless_modifier_def(this, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_unless_modifier_def(this, result, _, _) or ruby_unless_modifier_def(this, _, result, _) + ruby_unless_modifier_def(this, result, _) or ruby_unless_modifier_def(this, _, result) } } @@ -2014,18 +1734,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Until" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_until_def(this, _, _, result) } - /** Gets the node corresponding to the field `body`. */ - Do getBody() { ruby_until_def(this, result, _, _) } + Do getBody() { ruby_until_def(this, result, _) } /** Gets the node corresponding to the field `condition`. */ - UnderscoreStatement getCondition() { ruby_until_def(this, _, result, _) } + UnderscoreStatement getCondition() { ruby_until_def(this, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_until_def(this, result, _, _) or ruby_until_def(this, _, result, _) + ruby_until_def(this, result, _) or ruby_until_def(this, _, result) } } @@ -2034,18 +1751,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "UntilModifier" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_until_modifier_def(this, _, _, result) } - /** Gets the node corresponding to the field `body`. */ - UnderscoreStatement getBody() { ruby_until_modifier_def(this, result, _, _) } + UnderscoreStatement getBody() { ruby_until_modifier_def(this, result, _) } /** Gets the node corresponding to the field `condition`. */ - UnderscoreExpression getCondition() { ruby_until_modifier_def(this, _, result, _) } + UnderscoreExpression getCondition() { ruby_until_modifier_def(this, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_until_modifier_def(this, result, _, _) or ruby_until_modifier_def(this, _, result, _) + ruby_until_modifier_def(this, result, _) or ruby_until_modifier_def(this, _, result) } } @@ -2054,14 +1768,11 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "VariableReferencePattern" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_variable_reference_pattern_def(this, _, result) } - /** Gets the node corresponding to the field `name`. */ - AstNode getName() { ruby_variable_reference_pattern_def(this, result, _) } + AstNode getName() { ruby_variable_reference_pattern_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { ruby_variable_reference_pattern_def(this, result, _) } + override AstNode getAFieldOrChild() { ruby_variable_reference_pattern_def(this, result) } } /** A class representing `when` nodes. */ @@ -2069,9 +1780,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "When" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_when_def(this, result) } - /** Gets the node corresponding to the field `body`. */ Then getBody() { ruby_when_body(this, result) } @@ -2089,18 +1797,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "While" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_while_def(this, _, _, result) } - /** Gets the node corresponding to the field `body`. */ - Do getBody() { ruby_while_def(this, result, _, _) } + Do getBody() { ruby_while_def(this, result, _) } /** Gets the node corresponding to the field `condition`. */ - UnderscoreStatement getCondition() { ruby_while_def(this, _, result, _) } + UnderscoreStatement getCondition() { ruby_while_def(this, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_while_def(this, result, _, _) or ruby_while_def(this, _, result, _) + ruby_while_def(this, result, _) or ruby_while_def(this, _, result) } } @@ -2109,18 +1814,15 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "WhileModifier" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_while_modifier_def(this, _, _, result) } - /** Gets the node corresponding to the field `body`. */ - UnderscoreStatement getBody() { ruby_while_modifier_def(this, result, _, _) } + UnderscoreStatement getBody() { ruby_while_modifier_def(this, result, _) } /** Gets the node corresponding to the field `condition`. */ - UnderscoreExpression getCondition() { ruby_while_modifier_def(this, _, result, _) } + UnderscoreExpression getCondition() { ruby_while_modifier_def(this, _, result) } /** Gets a field or child node of this node. */ override AstNode getAFieldOrChild() { - ruby_while_modifier_def(this, result, _, _) or ruby_while_modifier_def(this, _, result, _) + ruby_while_modifier_def(this, result, _) or ruby_while_modifier_def(this, _, result) } } @@ -2129,9 +1831,6 @@ module Ruby { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Yield" } - /** Gets the location of this element. */ - override L::Location getLocation() { ruby_yield_def(this, result) } - /** Gets the child of this node. */ ArgumentList getChild() { ruby_yield_child(this, result) } @@ -2147,13 +1846,13 @@ module Erb { string toString() { result = this.getAPrimaryQlClass() } /** Gets the location of this element. */ - L::Location getLocation() { none() } + L::Location getLocation() { erb_ast_node_info(this, _, _, result) } /** Gets the parent of this element. */ - AstNode getParent() { erb_ast_node_parent(this, result, _) } + AstNode getParent() { erb_ast_node_info(this, result, _, _) } /** Gets the index of this node among the children of its parent. */ - int getParentIndex() { erb_ast_node_parent(this, _, result) } + int getParentIndex() { erb_ast_node_info(this, _, result, _) } /** Gets a field or child node of this node. */ AstNode getAFieldOrChild() { none() } @@ -2168,10 +1867,7 @@ module Erb { /** A token. */ class Token extends @erb_token, AstNode { /** Gets the value of this token. */ - string getValue() { erb_tokeninfo(this, _, result, _) } - - /** Gets the location of this token. */ - override L::Location getLocation() { erb_tokeninfo(this, _, _, result) } + string getValue() { erb_tokeninfo(this, _, result) } /** Gets a string representation of this element. */ override string toString() { result = this.getValue() } @@ -2203,14 +1899,11 @@ module Erb { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "CommentDirective" } - /** Gets the location of this element. */ - override L::Location getLocation() { erb_comment_directive_def(this, _, result) } - /** Gets the child of this node. */ - Comment getChild() { erb_comment_directive_def(this, result, _) } + Comment getChild() { erb_comment_directive_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { erb_comment_directive_def(this, result, _) } + override AstNode getAFieldOrChild() { erb_comment_directive_def(this, result) } } /** A class representing `content` tokens. */ @@ -2224,14 +1917,11 @@ module Erb { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Directive" } - /** Gets the location of this element. */ - override L::Location getLocation() { erb_directive_def(this, _, result) } - /** Gets the child of this node. */ - Code getChild() { erb_directive_def(this, result, _) } + Code getChild() { erb_directive_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { erb_directive_def(this, result, _) } + override AstNode getAFieldOrChild() { erb_directive_def(this, result) } } /** A class representing `graphql_directive` nodes. */ @@ -2239,14 +1929,11 @@ module Erb { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "GraphqlDirective" } - /** Gets the location of this element. */ - override L::Location getLocation() { erb_graphql_directive_def(this, _, result) } - /** Gets the child of this node. */ - Code getChild() { erb_graphql_directive_def(this, result, _) } + Code getChild() { erb_graphql_directive_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { erb_graphql_directive_def(this, result, _) } + override AstNode getAFieldOrChild() { erb_graphql_directive_def(this, result) } } /** A class representing `output_directive` nodes. */ @@ -2254,14 +1941,11 @@ module Erb { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "OutputDirective" } - /** Gets the location of this element. */ - override L::Location getLocation() { erb_output_directive_def(this, _, result) } - /** Gets the child of this node. */ - Code getChild() { erb_output_directive_def(this, result, _) } + Code getChild() { erb_output_directive_def(this, result) } /** Gets a field or child node of this node. */ - override AstNode getAFieldOrChild() { erb_output_directive_def(this, result, _) } + override AstNode getAFieldOrChild() { erb_output_directive_def(this, result) } } /** A class representing `template` nodes. */ @@ -2269,9 +1953,6 @@ module Erb { /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Template" } - /** Gets the location of this element. */ - override L::Location getLocation() { erb_template_def(this, result) } - /** Gets the `i`th child of this node. */ AstNode getChild(int i) { erb_template_child(this, i, result) } diff --git a/ruby/ql/lib/ruby.dbscheme b/ruby/ql/lib/ruby.dbscheme index 24d81950f3a..fabe9e179ed 100644 --- a/ruby/ql/lib/ruby.dbscheme +++ b/ruby/ql/lib/ruby.dbscheme @@ -81,8 +81,7 @@ case @diagnostic.severity of ruby_alias_def( unique int id: @ruby_alias, int alias: @ruby_underscore_method_name ref, - int name: @ruby_underscore_method_name ref, - int loc: @location ref + int name: @ruby_underscore_method_name ref ); #keyset[ruby_alternative_pattern, index] @@ -93,8 +92,7 @@ ruby_alternative_pattern_alternatives( ); ruby_alternative_pattern_def( - unique int id: @ruby_alternative_pattern, - int loc: @location ref + unique int id: @ruby_alternative_pattern ); @ruby_argument_list_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression @@ -107,8 +105,7 @@ ruby_argument_list_child( ); ruby_argument_list_def( - unique int id: @ruby_argument_list, - int loc: @location ref + unique int id: @ruby_argument_list ); @ruby_array_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression @@ -121,8 +118,7 @@ ruby_array_child( ); ruby_array_def( - unique int id: @ruby_array, - int loc: @location ref + unique int id: @ruby_array ); ruby_array_pattern_class( @@ -140,15 +136,13 @@ ruby_array_pattern_child( ); ruby_array_pattern_def( - unique int id: @ruby_array_pattern, - int loc: @location ref + unique int id: @ruby_array_pattern ); ruby_as_pattern_def( unique int id: @ruby_as_pattern, int name: @ruby_token_identifier ref, - int value: @ruby_underscore_pattern_expr ref, - int loc: @location ref + int value: @ruby_underscore_pattern_expr ref ); @ruby_assignment_left_type = @ruby_left_assignment_list | @ruby_underscore_lhs @@ -158,8 +152,7 @@ ruby_as_pattern_def( ruby_assignment_def( unique int id: @ruby_assignment, int left: @ruby_assignment_left_type ref, - int right: @ruby_assignment_right_type ref, - int loc: @location ref + int right: @ruby_assignment_right_type ref ); @ruby_bare_string_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content @@ -172,8 +165,7 @@ ruby_bare_string_child( ); ruby_bare_string_def( - unique int id: @ruby_bare_string, - int loc: @location ref + unique int id: @ruby_bare_string ); @ruby_bare_symbol_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content @@ -186,8 +178,7 @@ ruby_bare_symbol_child( ); ruby_bare_symbol_def( - unique int id: @ruby_bare_symbol, - int loc: @location ref + unique int id: @ruby_bare_symbol ); @ruby_begin_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement @@ -200,8 +191,7 @@ ruby_begin_child( ); ruby_begin_def( - unique int id: @ruby_begin, - int loc: @location ref + unique int id: @ruby_begin ); @ruby_begin_block_child_type = @ruby_token_empty_statement | @ruby_underscore_statement @@ -214,8 +204,7 @@ ruby_begin_block_child( ); ruby_begin_block_def( - unique int id: @ruby_begin_block, - int loc: @location ref + unique int id: @ruby_begin_block ); case @ruby_binary.operator of @@ -251,8 +240,7 @@ ruby_binary_def( unique int id: @ruby_binary, int left: @ruby_underscore_expression ref, int operator: int ref, - int right: @ruby_underscore_expression ref, - int loc: @location ref + int right: @ruby_underscore_expression ref ); ruby_block_parameters( @@ -270,8 +258,7 @@ ruby_block_child( ); ruby_block_def( - unique int id: @ruby_block, - int loc: @location ref + unique int id: @ruby_block ); ruby_block_argument_child( @@ -280,8 +267,7 @@ ruby_block_argument_child( ); ruby_block_argument_def( - unique int id: @ruby_block_argument, - int loc: @location ref + unique int id: @ruby_block_argument ); ruby_block_parameter_name( @@ -290,8 +276,7 @@ ruby_block_parameter_name( ); ruby_block_parameter_def( - unique int id: @ruby_block_parameter, - int loc: @location ref + unique int id: @ruby_block_parameter ); @ruby_block_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier @@ -304,8 +289,7 @@ ruby_block_parameters_child( ); ruby_block_parameters_def( - unique int id: @ruby_block_parameters, - int loc: @location ref + unique int id: @ruby_block_parameters ); ruby_break_child( @@ -314,8 +298,7 @@ ruby_break_child( ); ruby_break_def( - unique int id: @ruby_break, - int loc: @location ref + unique int id: @ruby_break ); ruby_call_arguments( @@ -341,8 +324,7 @@ ruby_call_receiver( ruby_call_def( unique int id: @ruby_call, - int method: @ruby_call_method_type ref, - int loc: @location ref + int method: @ruby_call_method_type ref ); ruby_case_value( @@ -360,8 +342,7 @@ ruby_case_child( ); ruby_case_def( - unique int id: @ruby_case__, - int loc: @location ref + unique int id: @ruby_case__ ); #keyset[ruby_case_match, index] @@ -378,8 +359,7 @@ ruby_case_match_else( ruby_case_match_def( unique int id: @ruby_case_match, - int value: @ruby_underscore_statement ref, - int loc: @location ref + int value: @ruby_underscore_statement ref ); #keyset[ruby_chained_string, index] @@ -390,8 +370,7 @@ ruby_chained_string_child( ); ruby_chained_string_def( - unique int id: @ruby_chained_string, - int loc: @location ref + unique int id: @ruby_chained_string ); @ruby_class_name_type = @ruby_scope_resolution | @ruby_token_constant @@ -412,16 +391,14 @@ ruby_class_child( ruby_class_def( unique int id: @ruby_class, - int name: @ruby_class_name_type ref, - int loc: @location ref + int name: @ruby_class_name_type ref ); ruby_conditional_def( unique int id: @ruby_conditional, int alternative: @ruby_underscore_arg ref, int condition: @ruby_underscore_arg ref, - int consequence: @ruby_underscore_arg ref, - int loc: @location ref + int consequence: @ruby_underscore_arg ref ); @ruby_delimited_symbol_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content @@ -434,8 +411,7 @@ ruby_delimited_symbol_child( ); ruby_delimited_symbol_def( - unique int id: @ruby_delimited_symbol, - int loc: @location ref + unique int id: @ruby_delimited_symbol ); @ruby_destructured_left_assignment_child_type = @ruby_destructured_left_assignment | @ruby_rest_assignment | @ruby_underscore_lhs @@ -448,8 +424,7 @@ ruby_destructured_left_assignment_child( ); ruby_destructured_left_assignment_def( - unique int id: @ruby_destructured_left_assignment, - int loc: @location ref + unique int id: @ruby_destructured_left_assignment ); @ruby_destructured_parameter_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier @@ -462,8 +437,7 @@ ruby_destructured_parameter_child( ); ruby_destructured_parameter_def( - unique int id: @ruby_destructured_parameter, - int loc: @location ref + unique int id: @ruby_destructured_parameter ); @ruby_do_child_type = @ruby_token_empty_statement | @ruby_underscore_statement @@ -476,8 +450,7 @@ ruby_do_child( ); ruby_do_def( - unique int id: @ruby_do, - int loc: @location ref + unique int id: @ruby_do ); ruby_do_block_parameters( @@ -495,8 +468,7 @@ ruby_do_block_child( ); ruby_do_block_def( - unique int id: @ruby_do_block, - int loc: @location ref + unique int id: @ruby_do_block ); @ruby_element_reference_child_type = @ruby_block_argument | @ruby_hash_splat_argument | @ruby_pair | @ruby_splat_argument | @ruby_token_forward_argument | @ruby_underscore_expression @@ -510,8 +482,7 @@ ruby_element_reference_child( ruby_element_reference_def( unique int id: @ruby_element_reference, - int object: @ruby_underscore_primary ref, - int loc: @location ref + int object: @ruby_underscore_primary ref ); @ruby_else_child_type = @ruby_token_empty_statement | @ruby_underscore_statement @@ -524,8 +495,7 @@ ruby_else_child( ); ruby_else_def( - unique int id: @ruby_else, - int loc: @location ref + unique int id: @ruby_else ); @ruby_elsif_alternative_type = @ruby_else | @ruby_elsif @@ -542,8 +512,7 @@ ruby_elsif_consequence( ruby_elsif_def( unique int id: @ruby_elsif, - int condition: @ruby_underscore_statement ref, - int loc: @location ref + int condition: @ruby_underscore_statement ref ); @ruby_end_block_child_type = @ruby_token_empty_statement | @ruby_underscore_statement @@ -556,8 +525,7 @@ ruby_end_block_child( ); ruby_end_block_def( - unique int id: @ruby_end_block, - int loc: @location ref + unique int id: @ruby_end_block ); @ruby_ensure_child_type = @ruby_token_empty_statement | @ruby_underscore_statement @@ -570,14 +538,12 @@ ruby_ensure_child( ); ruby_ensure_def( - unique int id: @ruby_ensure, - int loc: @location ref + unique int id: @ruby_ensure ); ruby_exception_variable_def( unique int id: @ruby_exception_variable, - int child: @ruby_underscore_lhs ref, - int loc: @location ref + int child: @ruby_underscore_lhs ref ); @ruby_exceptions_child_type = @ruby_splat_argument | @ruby_underscore_arg @@ -590,14 +556,12 @@ ruby_exceptions_child( ); ruby_exceptions_def( - unique int id: @ruby_exceptions, - int loc: @location ref + unique int id: @ruby_exceptions ); ruby_expression_reference_pattern_def( unique int id: @ruby_expression_reference_pattern, - int value: @ruby_underscore_expression ref, - int loc: @location ref + int value: @ruby_underscore_expression ref ); ruby_find_pattern_class( @@ -615,8 +579,7 @@ ruby_find_pattern_child( ); ruby_find_pattern_def( - unique int id: @ruby_find_pattern, - int loc: @location ref + unique int id: @ruby_find_pattern ); @ruby_for_pattern_type = @ruby_left_assignment_list | @ruby_underscore_lhs @@ -625,8 +588,7 @@ ruby_for_def( unique int id: @ruby_for, int body: @ruby_do ref, int pattern: @ruby_for_pattern_type ref, - int value: @ruby_in ref, - int loc: @location ref + int value: @ruby_in ref ); @ruby_hash_child_type = @ruby_hash_splat_argument | @ruby_pair @@ -639,8 +601,7 @@ ruby_hash_child( ); ruby_hash_def( - unique int id: @ruby_hash, - int loc: @location ref + unique int id: @ruby_hash ); ruby_hash_pattern_class( @@ -658,14 +619,12 @@ ruby_hash_pattern_child( ); ruby_hash_pattern_def( - unique int id: @ruby_hash_pattern, - int loc: @location ref + unique int id: @ruby_hash_pattern ); ruby_hash_splat_argument_def( unique int id: @ruby_hash_splat_argument, - int child: @ruby_underscore_arg ref, - int loc: @location ref + int child: @ruby_underscore_arg ref ); ruby_hash_splat_parameter_name( @@ -674,8 +633,7 @@ ruby_hash_splat_parameter_name( ); ruby_hash_splat_parameter_def( - unique int id: @ruby_hash_splat_parameter, - int loc: @location ref + unique int id: @ruby_hash_splat_parameter ); @ruby_heredoc_body_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_heredoc_content | @ruby_token_heredoc_end @@ -688,8 +646,7 @@ ruby_heredoc_body_child( ); ruby_heredoc_body_def( - unique int id: @ruby_heredoc_body, - int loc: @location ref + unique int id: @ruby_heredoc_body ); @ruby_if_alternative_type = @ruby_else | @ruby_elsif @@ -706,27 +663,23 @@ ruby_if_consequence( ruby_if_def( unique int id: @ruby_if, - int condition: @ruby_underscore_statement ref, - int loc: @location ref + int condition: @ruby_underscore_statement ref ); ruby_if_guard_def( unique int id: @ruby_if_guard, - int condition: @ruby_underscore_expression ref, - int loc: @location ref + int condition: @ruby_underscore_expression ref ); ruby_if_modifier_def( unique int id: @ruby_if_modifier, int body: @ruby_underscore_statement ref, - int condition: @ruby_underscore_expression ref, - int loc: @location ref + int condition: @ruby_underscore_expression ref ); ruby_in_def( unique int id: @ruby_in, - int child: @ruby_underscore_arg ref, - int loc: @location ref + int child: @ruby_underscore_arg ref ); ruby_in_clause_body( @@ -743,8 +696,7 @@ ruby_in_clause_guard( ruby_in_clause_def( unique int id: @ruby_in_clause, - int pattern: @ruby_underscore_pattern_top_expr_body ref, - int loc: @location ref + int pattern: @ruby_underscore_pattern_top_expr_body ref ); @ruby_interpolation_child_type = @ruby_token_empty_statement | @ruby_underscore_statement @@ -757,8 +709,7 @@ ruby_interpolation_child( ); ruby_interpolation_def( - unique int id: @ruby_interpolation, - int loc: @location ref + unique int id: @ruby_interpolation ); ruby_keyword_parameter_value( @@ -768,8 +719,7 @@ ruby_keyword_parameter_value( ruby_keyword_parameter_def( unique int id: @ruby_keyword_parameter, - int name: @ruby_token_identifier ref, - int loc: @location ref + int name: @ruby_token_identifier ref ); @ruby_keyword_pattern_key_type = @ruby_string__ | @ruby_token_hash_key_symbol @@ -781,8 +731,7 @@ ruby_keyword_pattern_value( ruby_keyword_pattern_def( unique int id: @ruby_keyword_pattern, - int key__: @ruby_keyword_pattern_key_type ref, - int loc: @location ref + int key__: @ruby_keyword_pattern_key_type ref ); @ruby_lambda_body_type = @ruby_block | @ruby_do_block @@ -794,8 +743,7 @@ ruby_lambda_parameters( ruby_lambda_def( unique int id: @ruby_lambda, - int body: @ruby_lambda_body_type ref, - int loc: @location ref + int body: @ruby_lambda_body_type ref ); @ruby_lambda_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier @@ -808,8 +756,7 @@ ruby_lambda_parameters_child( ); ruby_lambda_parameters_def( - unique int id: @ruby_lambda_parameters, - int loc: @location ref + unique int id: @ruby_lambda_parameters ); @ruby_left_assignment_list_child_type = @ruby_destructured_left_assignment | @ruby_rest_assignment | @ruby_underscore_lhs @@ -822,8 +769,7 @@ ruby_left_assignment_list_child( ); ruby_left_assignment_list_def( - unique int id: @ruby_left_assignment_list, - int loc: @location ref + unique int id: @ruby_left_assignment_list ); ruby_method_parameters( @@ -842,8 +788,7 @@ ruby_method_child( ruby_method_def( unique int id: @ruby_method, - int name: @ruby_underscore_method_name ref, - int loc: @location ref + int name: @ruby_underscore_method_name ref ); @ruby_method_parameters_child_type = @ruby_block_parameter | @ruby_destructured_parameter | @ruby_hash_splat_parameter | @ruby_keyword_parameter | @ruby_optional_parameter | @ruby_splat_parameter | @ruby_token_forward_parameter | @ruby_token_hash_splat_nil | @ruby_token_identifier @@ -856,8 +801,7 @@ ruby_method_parameters_child( ); ruby_method_parameters_def( - unique int id: @ruby_method_parameters, - int loc: @location ref + unique int id: @ruby_method_parameters ); @ruby_module_name_type = @ruby_scope_resolution | @ruby_token_constant @@ -873,8 +817,7 @@ ruby_module_child( ruby_module_def( unique int id: @ruby_module, - int name: @ruby_module_name_type ref, - int loc: @location ref + int name: @ruby_module_name_type ref ); ruby_next_child( @@ -883,8 +826,7 @@ ruby_next_child( ); ruby_next_def( - unique int id: @ruby_next, - int loc: @location ref + unique int id: @ruby_next ); case @ruby_operator_assignment.operator of @@ -908,15 +850,13 @@ ruby_operator_assignment_def( unique int id: @ruby_operator_assignment, int left: @ruby_underscore_lhs ref, int operator: int ref, - int right: @ruby_underscore_expression ref, - int loc: @location ref + int right: @ruby_underscore_expression ref ); ruby_optional_parameter_def( unique int id: @ruby_optional_parameter, int name: @ruby_token_identifier ref, - int value: @ruby_underscore_arg ref, - int loc: @location ref + int value: @ruby_underscore_arg ref ); @ruby_pair_key_type = @ruby_string__ | @ruby_token_hash_key_symbol | @ruby_underscore_arg @@ -928,14 +868,12 @@ ruby_pair_value( ruby_pair_def( unique int id: @ruby_pair, - int key__: @ruby_pair_key_type ref, - int loc: @location ref + int key__: @ruby_pair_key_type ref ); ruby_parenthesized_pattern_def( unique int id: @ruby_parenthesized_pattern, - int child: @ruby_underscore_pattern_expr ref, - int loc: @location ref + int child: @ruby_underscore_pattern_expr ref ); @ruby_parenthesized_statements_child_type = @ruby_token_empty_statement | @ruby_underscore_statement @@ -948,16 +886,14 @@ ruby_parenthesized_statements_child( ); ruby_parenthesized_statements_def( - unique int id: @ruby_parenthesized_statements, - int loc: @location ref + unique int id: @ruby_parenthesized_statements ); @ruby_pattern_child_type = @ruby_splat_argument | @ruby_underscore_arg ruby_pattern_def( unique int id: @ruby_pattern, - int child: @ruby_pattern_child_type ref, - int loc: @location ref + int child: @ruby_pattern_child_type ref ); @ruby_program_child_type = @ruby_token_empty_statement | @ruby_token_uninterpreted | @ruby_underscore_statement @@ -970,8 +906,7 @@ ruby_program_child( ); ruby_program_def( - unique int id: @ruby_program, - int loc: @location ref + unique int id: @ruby_program ); @ruby_range_begin_type = @ruby_underscore_arg | @ruby_underscore_pattern_primitive @@ -996,16 +931,14 @@ case @ruby_range.operator of ruby_range_def( unique int id: @ruby_range, - int operator: int ref, - int loc: @location ref + int operator: int ref ); @ruby_rational_child_type = @ruby_token_float | @ruby_token_integer ruby_rational_def( unique int id: @ruby_rational, - int child: @ruby_rational_child_type ref, - int loc: @location ref + int child: @ruby_rational_child_type ref ); ruby_redo_child( @@ -1014,8 +947,7 @@ ruby_redo_child( ); ruby_redo_def( - unique int id: @ruby_redo, - int loc: @location ref + unique int id: @ruby_redo ); @ruby_regex_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content @@ -1028,8 +960,7 @@ ruby_regex_child( ); ruby_regex_def( - unique int id: @ruby_regex, - int loc: @location ref + unique int id: @ruby_regex ); ruby_rescue_body( @@ -1048,8 +979,7 @@ ruby_rescue_variable( ); ruby_rescue_def( - unique int id: @ruby_rescue, - int loc: @location ref + unique int id: @ruby_rescue ); @ruby_rescue_modifier_body_type = @ruby_underscore_arg | @ruby_underscore_statement @@ -1057,8 +987,7 @@ ruby_rescue_def( ruby_rescue_modifier_def( unique int id: @ruby_rescue_modifier, int body: @ruby_rescue_modifier_body_type ref, - int handler: @ruby_underscore_expression ref, - int loc: @location ref + int handler: @ruby_underscore_expression ref ); ruby_rest_assignment_child( @@ -1067,8 +996,7 @@ ruby_rest_assignment_child( ); ruby_rest_assignment_def( - unique int id: @ruby_rest_assignment, - int loc: @location ref + unique int id: @ruby_rest_assignment ); ruby_retry_child( @@ -1077,8 +1005,7 @@ ruby_retry_child( ); ruby_retry_def( - unique int id: @ruby_retry, - int loc: @location ref + unique int id: @ruby_retry ); ruby_return_child( @@ -1087,8 +1014,7 @@ ruby_return_child( ); ruby_return_def( - unique int id: @ruby_return, - int loc: @location ref + unique int id: @ruby_return ); @ruby_right_assignment_list_child_type = @ruby_splat_argument | @ruby_underscore_arg @@ -1101,8 +1027,7 @@ ruby_right_assignment_list_child( ); ruby_right_assignment_list_def( - unique int id: @ruby_right_assignment_list, - int loc: @location ref + unique int id: @ruby_right_assignment_list ); @ruby_scope_resolution_name_type = @ruby_token_constant | @ruby_token_identifier @@ -1116,14 +1041,12 @@ ruby_scope_resolution_scope( ruby_scope_resolution_def( unique int id: @ruby_scope_resolution, - int name: @ruby_scope_resolution_name_type ref, - int loc: @location ref + int name: @ruby_scope_resolution_name_type ref ); ruby_setter_def( unique int id: @ruby_setter, - int name: @ruby_token_identifier ref, - int loc: @location ref + int name: @ruby_token_identifier ref ); @ruby_singleton_class_child_type = @ruby_else | @ruby_ensure | @ruby_rescue | @ruby_token_empty_statement | @ruby_underscore_statement @@ -1137,8 +1060,7 @@ ruby_singleton_class_child( ruby_singleton_class_def( unique int id: @ruby_singleton_class, - int value: @ruby_underscore_arg ref, - int loc: @location ref + int value: @ruby_underscore_arg ref ); @ruby_singleton_method_object_type = @ruby_underscore_arg | @ruby_underscore_variable @@ -1160,14 +1082,12 @@ ruby_singleton_method_child( ruby_singleton_method_def( unique int id: @ruby_singleton_method, int name: @ruby_underscore_method_name ref, - int object: @ruby_singleton_method_object_type ref, - int loc: @location ref + int object: @ruby_singleton_method_object_type ref ); ruby_splat_argument_def( unique int id: @ruby_splat_argument, - int child: @ruby_underscore_arg ref, - int loc: @location ref + int child: @ruby_underscore_arg ref ); ruby_splat_parameter_name( @@ -1176,8 +1096,7 @@ ruby_splat_parameter_name( ); ruby_splat_parameter_def( - unique int id: @ruby_splat_parameter, - int loc: @location ref + unique int id: @ruby_splat_parameter ); @ruby_string_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content @@ -1190,8 +1109,7 @@ ruby_string_child( ); ruby_string_def( - unique int id: @ruby_string__, - int loc: @location ref + unique int id: @ruby_string__ ); #keyset[ruby_string_array, index] @@ -1202,8 +1120,7 @@ ruby_string_array_child( ); ruby_string_array_def( - unique int id: @ruby_string_array, - int loc: @location ref + unique int id: @ruby_string_array ); @ruby_subshell_child_type = @ruby_interpolation | @ruby_token_escape_sequence | @ruby_token_string_content @@ -1216,14 +1133,12 @@ ruby_subshell_child( ); ruby_subshell_def( - unique int id: @ruby_subshell, - int loc: @location ref + unique int id: @ruby_subshell ); ruby_superclass_def( unique int id: @ruby_superclass, - int child: @ruby_underscore_expression ref, - int loc: @location ref + int child: @ruby_underscore_expression ref ); #keyset[ruby_symbol_array, index] @@ -1234,8 +1149,7 @@ ruby_symbol_array_child( ); ruby_symbol_array_def( - unique int id: @ruby_symbol_array, - int loc: @location ref + unique int id: @ruby_symbol_array ); @ruby_then_child_type = @ruby_token_empty_statement | @ruby_underscore_statement @@ -1248,8 +1162,7 @@ ruby_then_child( ); ruby_then_def( - unique int id: @ruby_then, - int loc: @location ref + unique int id: @ruby_then ); @ruby_unary_operand_type = @ruby_parenthesized_statements | @ruby_underscore_expression | @ruby_underscore_simple_numeric @@ -1267,8 +1180,7 @@ case @ruby_unary.operator of ruby_unary_def( unique int id: @ruby_unary, int operand: @ruby_unary_operand_type ref, - int operator: int ref, - int loc: @location ref + int operator: int ref ); #keyset[ruby_undef, index] @@ -1279,8 +1191,7 @@ ruby_undef_child( ); ruby_undef_def( - unique int id: @ruby_undef, - int loc: @location ref + unique int id: @ruby_undef ); @ruby_unless_alternative_type = @ruby_else | @ruby_elsif @@ -1297,43 +1208,37 @@ ruby_unless_consequence( ruby_unless_def( unique int id: @ruby_unless, - int condition: @ruby_underscore_statement ref, - int loc: @location ref + int condition: @ruby_underscore_statement ref ); ruby_unless_guard_def( unique int id: @ruby_unless_guard, - int condition: @ruby_underscore_expression ref, - int loc: @location ref + int condition: @ruby_underscore_expression ref ); ruby_unless_modifier_def( unique int id: @ruby_unless_modifier, int body: @ruby_underscore_statement ref, - int condition: @ruby_underscore_expression ref, - int loc: @location ref + int condition: @ruby_underscore_expression ref ); ruby_until_def( unique int id: @ruby_until, int body: @ruby_do ref, - int condition: @ruby_underscore_statement ref, - int loc: @location ref + int condition: @ruby_underscore_statement ref ); ruby_until_modifier_def( unique int id: @ruby_until_modifier, int body: @ruby_underscore_statement ref, - int condition: @ruby_underscore_expression ref, - int loc: @location ref + int condition: @ruby_underscore_expression ref ); @ruby_variable_reference_pattern_name_type = @ruby_token_identifier | @ruby_underscore_nonlocal_variable ruby_variable_reference_pattern_def( unique int id: @ruby_variable_reference_pattern, - int name: @ruby_variable_reference_pattern_name_type ref, - int loc: @location ref + int name: @ruby_variable_reference_pattern_name_type ref ); ruby_when_body( @@ -1349,22 +1254,19 @@ ruby_when_pattern( ); ruby_when_def( - unique int id: @ruby_when, - int loc: @location ref + unique int id: @ruby_when ); ruby_while_def( unique int id: @ruby_while, int body: @ruby_do ref, - int condition: @ruby_underscore_statement ref, - int loc: @location ref + int condition: @ruby_underscore_statement ref ); ruby_while_modifier_def( unique int id: @ruby_while_modifier, int body: @ruby_underscore_statement ref, - int condition: @ruby_underscore_expression ref, - int loc: @location ref + int condition: @ruby_underscore_expression ref ); ruby_yield_child( @@ -1373,15 +1275,13 @@ ruby_yield_child( ); ruby_yield_def( - unique int id: @ruby_yield, - int loc: @location ref + unique int id: @ruby_yield ); ruby_tokeninfo( unique int id: @ruby_token, int kind: int ref, - string value: string ref, - int loc: @location ref + string value: string ref ); case @ruby_token.kind of @@ -1425,34 +1325,31 @@ case @ruby_token.kind of @ruby_ast_node_parent = @file | @ruby_ast_node #keyset[parent, parent_index] -ruby_ast_node_parent( - int child: @ruby_ast_node ref, +ruby_ast_node_info( + int node: @ruby_ast_node ref, int parent: @ruby_ast_node_parent ref, - int parent_index: int ref + int parent_index: int ref, + int loc: @location ref ); erb_comment_directive_def( unique int id: @erb_comment_directive, - int child: @erb_token_comment ref, - int loc: @location ref + int child: @erb_token_comment ref ); erb_directive_def( unique int id: @erb_directive, - int child: @erb_token_code ref, - int loc: @location ref + int child: @erb_token_code ref ); erb_graphql_directive_def( unique int id: @erb_graphql_directive, - int child: @erb_token_code ref, - int loc: @location ref + int child: @erb_token_code ref ); erb_output_directive_def( unique int id: @erb_output_directive, - int child: @erb_token_code ref, - int loc: @location ref + int child: @erb_token_code ref ); @erb_template_child_type = @erb_comment_directive | @erb_directive | @erb_graphql_directive | @erb_output_directive | @erb_token_content @@ -1465,15 +1362,13 @@ erb_template_child( ); erb_template_def( - unique int id: @erb_template, - int loc: @location ref + unique int id: @erb_template ); erb_tokeninfo( unique int id: @erb_token, int kind: int ref, - string value: string ref, - int loc: @location ref + string value: string ref ); case @erb_token.kind of @@ -1489,9 +1384,10 @@ case @erb_token.kind of @erb_ast_node_parent = @erb_ast_node | @file #keyset[parent, parent_index] -erb_ast_node_parent( - int child: @erb_ast_node ref, +erb_ast_node_info( + int node: @erb_ast_node ref, int parent: @erb_ast_node_parent ref, - int parent_index: int ref + int parent_index: int ref, + int loc: @location ref );