CodeQL library for Ruby
codeql/ruby-all 0.8.15-dev (changelog, source)
Search

Module Control

Import path

import codeql.ruby.ast.Control

Classes

CaseExpr

A case statement. There are three forms of case statements:

ConditionalExpr

A conditional expression: if/unless (including expression-modifier variants), and ternary-if (?:) expressions.

ConditionalLoop

A loop using a condition expression. That is, a while or until loop, or their expression-modifier variants.

ControlExpr

A control expression that can be any of the following: - case - if/unless (including expression-modifier variants) - ternary-if (?:) - while/until (including expression-modifier variants) - for

ForExpr

A for loop. rb for val in 1..n sum += val end

IfExpr

An if or elsif expression. rb if x a += 1 elsif y a += 2 end

IfModifierExpr

An expression modified using if. rb foo if bar

InClause

An in clause of a case expression. rb case foo in [ a ] then a end

Loop

A loop. That is, a for loop, a while or until loop, or their expression-modifier variants.

MatchPattern

A one-line pattern match using the => operator. For example: rb foo => Point{ x:, y: }

TernaryIfExpr

A conditional expression using the ternary (?:) operator. rb (a > b) ? a : b

TestPattern

A one-line pattern match using the in operator. For example: rb foo in Point{ x:, y: }

UnlessExpr

An unless expression. rb unless x == 0 y /= x end

UnlessModifierExpr

An expression modified using unless. rb y /= x unless x == 0

UntilExpr

An until loop. rb until a >= b p a a += 1 end

UntilModifierExpr

An expression looped using the until modifier. rb foo until bar

WhenClause

A when branch of a case expression. rb case when a > b then x end

WhileExpr

A while loop. rb while a < b p a a += 2 end

WhileModifierExpr

An expression looped using the while modifier. rb foo while bar