diff --git a/generator/src/ql_gen.rs b/generator/src/ql_gen.rs index 58362c23ecb..a9a276fd9f6 100644 --- a/generator/src/ql_gen.rs +++ b/generator/src/ql_gen.rs @@ -95,7 +95,11 @@ pub fn create_ast_node_class<'a>(ast_node: &'a str, ast_node_parent: &'a str) -> name: "concat", vars: vec![], range: None, - expr: Box::new(ql::Expression::Pred("getAPrimaryQlClass", vec![])), + expr: Box::new(ql::Expression::Dot( + Box::new(ql::Expression::Var("this")), + "getAPrimaryQlClass", + vec![], + )), second_expr: Some(Box::new(ql::Expression::String(","))), }), ), @@ -146,7 +150,11 @@ pub fn create_token_class<'a>(token_type: &'a str, tokeninfo: &'a str) -> ql::Cl formal_parameters: vec![], body: ql::Expression::Equals( Box::new(ql::Expression::Var("result")), - Box::new(ql::Expression::Pred("getValue", vec![])), + Box::new(ql::Expression::Dot( + Box::new(ql::Expression::Var("this")), + "getValue", + vec![], + )), ), }; ql::Class { diff --git a/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll b/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll index d054d15b675..da02db918db 100644 --- a/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll +++ b/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll @@ -28,7 +28,7 @@ module Ruby { string getAPrimaryQlClass() { result = "???" } /** Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs. */ - string getPrimaryQlClasses() { result = concat(getAPrimaryQlClass(), ",") } + string getPrimaryQlClasses() { result = concat(this.getAPrimaryQlClass(), ",") } } /** A token. */ @@ -40,7 +40,7 @@ module Ruby { override Location getLocation() { ruby_tokeninfo(this, _, _, result) } /** Gets a string representation of this element. */ - override string toString() { result = getValue() } + override string toString() { result = this.getValue() } /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Token" } @@ -1881,7 +1881,7 @@ module Erb { string getAPrimaryQlClass() { result = "???" } /** Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs. */ - string getPrimaryQlClasses() { result = concat(getAPrimaryQlClass(), ",") } + string getPrimaryQlClasses() { result = concat(this.getAPrimaryQlClass(), ",") } } /** A token. */ @@ -1893,7 +1893,7 @@ module Erb { override Location getLocation() { erb_tokeninfo(this, _, _, result) } /** Gets a string representation of this element. */ - override string toString() { result = getValue() } + override string toString() { result = this.getValue() } /** Gets the name of the primary QL class for this element. */ override string getAPrimaryQlClass() { result = "Token" }