Add AstNode::isSynthesized()

This commit is contained in:
Nick Rolfe
2021-04-30 11:58:45 +01:00
parent e87bf57bc5
commit fdccd5da7e

View File

@@ -64,4 +64,16 @@ class AstNode extends TAstNode {
*/
cached
AstNode getAChild(string pred) { none() }
/**
* Holds if this node was synthesized to represent an implicit AST node not
* present in the source code. In the following example method call, the
* receiver is an implicit `self` reference, for which there is a synthesized
* `Self` node.
*
* ```rb
* foo(123)
* ```
*/
predicate isSynthesized() { this instanceof TImplicitSelf }
}