Skip to content

Commit fdccd5d

Browse files
committed
Add AstNode::isSynthesized()
1 parent e87bf57 commit fdccd5d

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

ql/src/codeql_ruby/AST.qll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,16 @@ class AstNode extends TAstNode {
6464
*/
6565
cached
6666
AstNode getAChild(string pred) { none() }
67+
68+
/**
69+
* Holds if this node was synthesized to represent an implicit AST node not
70+
* present in the source code. In the following example method call, the
71+
* receiver is an implicit `self` reference, for which there is a synthesized
72+
* `Self` node.
73+
*
74+
* ```rb
75+
* foo(123)
76+
* ```
77+
*/
78+
predicate isSynthesized() { this instanceof TImplicitSelf }
6779
}

0 commit comments

Comments
 (0)