Skip to content

Commit 78ad9d6

Browse files
committed
Address comments
1 parent e382d6d commit 78ad9d6

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

ruby/ql/lib/codeql/ruby/ast/Control.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ class MatchPattern extends Expr, TMatchPattern {
557557
/**
558558
* Gets the expression being compared, if any. For example, `foo` in the following example.
559559
* ```rb
560-
* case foo => Point{ x:, y: }
560+
* foo => Point{ x:, y: }
561561
* ```
562562
*/
563563
final Expr getValue() { toGenerated(result) = g.getValue() }
@@ -598,13 +598,13 @@ class TestPattern extends Expr, TTestPattern {
598598
/**
599599
* Gets the expression being compared, if any. For example, `foo` in the following example.
600600
* ```rb
601-
* case foo in Point{ x:, y: }
601+
* foo in Point{ x:, y: }
602602
* ```
603603
*/
604604
final Expr getValue() { toGenerated(result) = g.getValue() }
605605

606606
/**
607-
* Gets the pattern in this `=>` expression. In the
607+
* Gets the pattern in this `in` expression. In the
608608
* following example, the pattern is `Point{ x:, y: }`.
609609
* ```rb
610610
* foo in Point{ x:, y: }

ruby/ql/lib/codeql/ruby/ast/internal/AST.qll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private module Cached {
133133
TDo(Ruby::Do g) or
134134
TDoBlock(Ruby::DoBlock g) { not g.getParent() instanceof Ruby::Lambda } or
135135
TElementReference(Ruby::ElementReference g) or
136-
TElse(Ruby::Else g) or
136+
TElseReal(Ruby::Else g) or
137137
TElseSynth(Ast::AstNode parent, int i) { mkSynthChild(ElseKind(), parent, i) } or
138138
TElsif(Ruby::Elsif g) or
139139
TEmptyStmt(Ruby::EmptyStatement g) or
@@ -355,10 +355,10 @@ private module Cached {
355355
TBraceBlockReal or TBreakStmt or TCaseEqExpr or TCaseExpr or TCaseMatchReal or
356356
TCharacterLiteral or TClassDeclaration or TClassVariableAccessReal or TComplementExpr or
357357
TComplexLiteral or TDefinedExpr or TDelimitedSymbolLiteral or TDestructuredLeftAssignment or
358-
TDestructuredParameter or TDivExprReal or TDo or TDoBlock or TElementReference or TElse or
359-
TElsif or TEmptyStmt or TEncoding or TEndBlock or TEnsure or TEqExpr or TExponentExprReal or
360-
TFalseLiteral or TFile or TFindPattern or TFloatLiteral or TForExpr or TForwardParameter or
361-
TForwardArgument or TGEExpr or TGTExpr or TGlobalVariableAccessReal or
358+
TDestructuredParameter or TDivExprReal or TDo or TDoBlock or TElementReference or
359+
TElseReal or TElsif or TEmptyStmt or TEncoding or TEndBlock or TEnsure or TEqExpr or
360+
TExponentExprReal or TFalseLiteral or TFile or TFindPattern or TFloatLiteral or TForExpr or
361+
TForwardParameter or TForwardArgument or TGEExpr or TGTExpr or TGlobalVariableAccessReal or
362362
THashKeySymbolLiteral or THashLiteral or THashPattern or THashSplatExpr or
363363
THashSplatNilParameter or THashSplatParameter or THereDoc or TIdentifierMethodCall or
364364
TIfReal or TIfModifierExpr or TInClauseReal or TInstanceVariableAccessReal or
@@ -445,7 +445,7 @@ private module Cached {
445445
n = TDoBlock(result) or
446446
n = TDo(result) or
447447
n = TElementReference(result) or
448-
n = TElse(result) or
448+
n = TElseReal(result) or
449449
n = TElsif(result) or
450450
n = TEmptyStmt(result) or
451451
n = TEncoding(result) or
@@ -703,7 +703,7 @@ class TConstantAccess =
703703
TTokenConstantAccess or TScopeResolutionConstantAccess or TNamespace or
704704
TConstantReadAccessSynth or TConstantWriteAccessSynth;
705705

706-
class TControlExpr = TConditionalExpr or TCaseExpr or TCaseMatchReal or TCaseMatchSynth or TLoop;
706+
class TControlExpr = TConditionalExpr or TCaseExpr or TCaseMatch or TLoop;
707707

708708
class TConditionalExpr =
709709
TIfExpr or TUnlessExpr or TIfModifierExpr or TUnlessModifierExpr or TTernaryIfExpr;
@@ -729,7 +729,7 @@ class TExpr =
729729
class TSplatExpr = TSplatExprReal or TSplatExprSynth;
730730

731731
class TStmtSequence =
732-
TBeginBlock or TEndBlock or TThen or TElse or TElseSynth or TDo or TEnsure or
732+
TBeginBlock or TEndBlock or TThen or TElseReal or TElseSynth or TDo or TEnsure or
733733
TStringInterpolationComponent or TBlock or TBodyStmt or TParenthesizedExpr or
734734
TStmtSequenceSynth;
735735

ruby/ql/lib/codeql/ruby/ast/internal/Expr.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ class Then extends StmtSequence, TThen {
1919
final override string toString() { result = "then ..." }
2020
}
2121

22-
class Else extends StmtSequence, TElse {
22+
class Else extends StmtSequence, TElseReal {
2323
private Ruby::Else g;
2424

25-
Else() { this = TElse(g) }
25+
Else() { this = TElseReal(g) }
2626

2727
override Stmt getStmt(int n) { toGenerated(result) = g.getChild(n) }
2828

0 commit comments

Comments
 (0)