Skip to content

Commit d95f533

Browse files
committed
Ruby: Add getLastChild to RegExpParent
1 parent 2d05ea3 commit d95f533

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ruby/ql/lib/codeql/ruby/regexp/RegExpTreeView.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ class RegExpParent extends TRegExpParent {
6363
/** Gets the number of child terms. */
6464
int getNumChild() { result = count(this.getAChild()) }
6565

66+
/** Gets the last child term of this element. */
67+
RegExpTerm getLastChild() { result = this.getChild(this.getNumChild() - 1) }
68+
6669
/**
6770
* Gets the name of a primary CodeQL class to which this regular
6871
* expression term belongs.

0 commit comments

Comments
 (0)