Skip to content

Commit 866ff7b

Browse files
committed
Replace Generated module with Ruby
1 parent 02bf895 commit 866ff7b

22 files changed

Lines changed: 451 additions & 467 deletions

ql/src/codeql_ruby/ast/Call.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class ElementReference extends MethodCall, TElementReference {
150150
* ```
151151
*/
152152
class YieldCall extends Call, TYieldCall {
153-
Generated::Yield g;
153+
Ruby::Yield g;
154154

155155
YieldCall() { this = TYieldCall(g) }
156156

@@ -180,7 +180,7 @@ class SuperCall extends MethodCall, TSuperCall {
180180
* ```
181181
*/
182182
class BlockArgument extends Expr, TBlockArgument {
183-
private Generated::BlockArgument g;
183+
private Ruby::BlockArgument g;
184184

185185
BlockArgument() { this = TBlockArgument(g) }
186186

ql/src/codeql_ruby/ast/Constant.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ class ConstantAccess extends Expr, TConstantAccess {
4747
}
4848

4949
private class TokenConstantAccess extends ConstantAccess, TTokenConstantAccess {
50-
private Generated::Constant g;
50+
private Ruby::Constant g;
5151

5252
TokenConstantAccess() { this = TTokenConstantAccess(g) }
5353

5454
final override string getName() { result = g.getValue() }
5555
}
5656

5757
private class ScopeResolutionConstantAccess extends ConstantAccess, TScopeResolutionConstantAccess {
58-
private Generated::ScopeResolution g;
59-
private Generated::Constant constant;
58+
private Ruby::ScopeResolution g;
59+
private Ruby::Constant constant;
6060

6161
ScopeResolutionConstantAccess() { this = TScopeResolutionConstantAccess(g, constant) }
6262

ql/src/codeql_ruby/ast/Control.qll

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class IfExpr extends ConditionalExpr, TIfExpr {
111111
}
112112

113113
private class If extends IfExpr, TIf {
114-
private Generated::If g;
114+
private Ruby::If g;
115115

116116
If() { this = TIf(g) }
117117

@@ -125,7 +125,7 @@ private class If extends IfExpr, TIf {
125125
}
126126

127127
private class Elsif extends IfExpr, TElsif {
128-
private Generated::Elsif g;
128+
private Ruby::Elsif g;
129129

130130
Elsif() { this = TElsif(g) }
131131

@@ -149,7 +149,7 @@ private class Elsif extends IfExpr, TElsif {
149149
* ```
150150
*/
151151
class UnlessExpr extends ConditionalExpr, TUnlessExpr {
152-
private Generated::Unless g;
152+
private Ruby::Unless g;
153153

154154
UnlessExpr() { this = TUnlessExpr(g) }
155155

@@ -207,7 +207,7 @@ class UnlessExpr extends ConditionalExpr, TUnlessExpr {
207207
* ```
208208
*/
209209
class IfModifierExpr extends ConditionalExpr, TIfModifierExpr {
210-
private Generated::IfModifier g;
210+
private Ruby::IfModifier g;
211211

212212
IfModifierExpr() { this = TIfModifierExpr(g) }
213213

@@ -242,7 +242,7 @@ class IfModifierExpr extends ConditionalExpr, TIfModifierExpr {
242242
* ```
243243
*/
244244
class UnlessModifierExpr extends ConditionalExpr, TUnlessModifierExpr {
245-
private Generated::UnlessModifier g;
245+
private Ruby::UnlessModifier g;
246246

247247
UnlessModifierExpr() { this = TUnlessModifierExpr(g) }
248248

@@ -277,7 +277,7 @@ class UnlessModifierExpr extends ConditionalExpr, TUnlessModifierExpr {
277277
* ```
278278
*/
279279
class TernaryIfExpr extends ConditionalExpr, TTernaryIfExpr {
280-
private Generated::Conditional g;
280+
private Ruby::Conditional g;
281281

282282
TernaryIfExpr() { this = TTernaryIfExpr(g) }
283283

@@ -309,7 +309,7 @@ class TernaryIfExpr extends ConditionalExpr, TTernaryIfExpr {
309309
}
310310

311311
class CaseExpr extends ControlExpr, TCaseExpr {
312-
private Generated::Case g;
312+
private Ruby::Case g;
313313

314314
CaseExpr() { this = TCaseExpr(g) }
315315

@@ -379,7 +379,7 @@ class CaseExpr extends ControlExpr, TCaseExpr {
379379
* ```
380380
*/
381381
class WhenExpr extends Expr, TWhenExpr {
382-
private Generated::When g;
382+
private Ruby::When g;
383383

384384
WhenExpr() { this = TWhenExpr(g) }
385385

@@ -465,7 +465,7 @@ class ConditionalLoop extends Loop, TConditionalLoop {
465465
* ```
466466
*/
467467
class WhileExpr extends ConditionalLoop, TWhileExpr {
468-
private Generated::While g;
468+
private Ruby::While g;
469469

470470
WhileExpr() { this = TWhileExpr(g) }
471471

@@ -495,7 +495,7 @@ class WhileExpr extends ConditionalLoop, TWhileExpr {
495495
* ```
496496
*/
497497
class UntilExpr extends ConditionalLoop, TUntilExpr {
498-
private Generated::Until g;
498+
private Ruby::Until g;
499499

500500
UntilExpr() { this = TUntilExpr(g) }
501501

@@ -522,7 +522,7 @@ class UntilExpr extends ConditionalLoop, TUntilExpr {
522522
* ```
523523
*/
524524
class WhileModifierExpr extends ConditionalLoop, TWhileModifierExpr {
525-
private Generated::WhileModifier g;
525+
private Ruby::WhileModifier g;
526526

527527
WhileModifierExpr() { this = TWhileModifierExpr(g) }
528528

@@ -548,7 +548,7 @@ class WhileModifierExpr extends ConditionalLoop, TWhileModifierExpr {
548548
* ```
549549
*/
550550
class UntilModifierExpr extends ConditionalLoop, TUntilModifierExpr {
551-
private Generated::UntilModifier g;
551+
private Ruby::UntilModifier g;
552552

553553
UntilModifierExpr() { this = TUntilModifierExpr(g) }
554554

@@ -576,7 +576,7 @@ class UntilModifierExpr extends ConditionalLoop, TUntilModifierExpr {
576576
* ```
577577
*/
578578
class ForExpr extends Loop, TForExpr {
579-
private Generated::For g;
579+
private Ruby::For g;
580580

581581
ForExpr() { this = TForExpr(g) }
582582

ql/src/codeql_ruby/ast/Expr.qll

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ class Self extends Expr, TSelf {
3737
* ```
3838
*/
3939
class ArgumentList extends Expr, TArgumentList {
40-
private Generated::AstNode g;
40+
private Ruby::AstNode g;
4141

4242
ArgumentList() { this = TArgumentList(g) }
4343

4444
/** Gets the `i`th element in this argument list. */
4545
Expr getElement(int i) {
4646
toGenerated(result) in [
47-
g.(Generated::ArgumentList).getChild(i), g.(Generated::RightAssignmentList).getChild(i)
47+
g.(Ruby::ArgumentList).getChild(i), g.(Ruby::RightAssignmentList).getChild(i)
4848
]
4949
}
5050

@@ -92,7 +92,7 @@ private class StmtSequenceSynth extends StmtSequence, TStmtSequenceSynth {
9292
}
9393

9494
private class Then extends StmtSequence, TThen {
95-
private Generated::Then g;
95+
private Ruby::Then g;
9696

9797
Then() { this = TThen(g) }
9898

@@ -102,7 +102,7 @@ private class Then extends StmtSequence, TThen {
102102
}
103103

104104
private class Else extends StmtSequence, TElse {
105-
private Generated::Else g;
105+
private Ruby::Else g;
106106

107107
Else() { this = TElse(g) }
108108

@@ -112,7 +112,7 @@ private class Else extends StmtSequence, TElse {
112112
}
113113

114114
private class Do extends StmtSequence, TDo {
115-
private Generated::Do g;
115+
private Ruby::Do g;
116116

117117
Do() { this = TDo(g) }
118118

@@ -122,7 +122,7 @@ private class Do extends StmtSequence, TDo {
122122
}
123123

124124
private class Ensure extends StmtSequence, TEnsure {
125-
private Generated::Ensure g;
125+
private Ruby::Ensure g;
126126

127127
Ensure() { this = TEnsure(g) }
128128

@@ -138,28 +138,28 @@ private class Ensure extends StmtSequence, TEnsure {
138138
*/
139139
class BodyStmt extends StmtSequence, TBodyStmt {
140140
// Not defined by dispatch, as it should not be exposed
141-
private Generated::AstNode getChild(int i) {
142-
result = any(Generated::Method g | this = TMethod(g)).getChild(i)
141+
private Ruby::AstNode getChild(int i) {
142+
result = any(Ruby::Method g | this = TMethod(g)).getChild(i)
143143
or
144-
result = any(Generated::SingletonMethod g | this = TSingletonMethod(g)).getChild(i)
144+
result = any(Ruby::SingletonMethod g | this = TSingletonMethod(g)).getChild(i)
145145
or
146-
exists(Generated::Lambda g | this = TLambda(g) |
147-
result = g.getBody().(Generated::DoBlock).getChild(i) or
148-
result = g.getBody().(Generated::Block).getChild(i)
146+
exists(Ruby::Lambda g | this = TLambda(g) |
147+
result = g.getBody().(Ruby::DoBlock).getChild(i) or
148+
result = g.getBody().(Ruby::Block).getChild(i)
149149
)
150150
or
151-
result = any(Generated::DoBlock g | this = TDoBlock(g)).getChild(i)
151+
result = any(Ruby::DoBlock g | this = TDoBlock(g)).getChild(i)
152152
or
153-
result = any(Generated::Program g | this = TToplevel(g)).getChild(i) and
154-
not result instanceof Generated::BeginBlock
153+
result = any(Ruby::Program g | this = TToplevel(g)).getChild(i) and
154+
not result instanceof Ruby::BeginBlock
155155
or
156-
result = any(Generated::Class g | this = TClassDeclaration(g)).getChild(i)
156+
result = any(Ruby::Class g | this = TClassDeclaration(g)).getChild(i)
157157
or
158-
result = any(Generated::SingletonClass g | this = TSingletonClass(g)).getChild(i)
158+
result = any(Ruby::SingletonClass g | this = TSingletonClass(g)).getChild(i)
159159
or
160-
result = any(Generated::Module g | this = TModuleDeclaration(g)).getChild(i)
160+
result = any(Ruby::Module g | this = TModuleDeclaration(g)).getChild(i)
161161
or
162-
result = any(Generated::Begin g | this = TBeginExpr(g)).getChild(i)
162+
result = any(Ruby::Begin g | this = TBeginExpr(g)).getChild(i)
163163
}
164164

165165
final override Stmt getStmt(int n) {
@@ -218,7 +218,7 @@ class BodyStmt extends StmtSequence, TBodyStmt {
218218
* ```
219219
*/
220220
class ParenthesizedExpr extends StmtSequence, TParenthesizedExpr {
221-
private Generated::ParenthesizedStatements g;
221+
private Ruby::ParenthesizedStatements g;
222222

223223
ParenthesizedExpr() { this = TParenthesizedExpr(g) }
224224

@@ -240,7 +240,7 @@ class ParenthesizedExpr extends StmtSequence, TParenthesizedExpr {
240240
* ```
241241
*/
242242
class Pair extends Expr, TPair {
243-
private Generated::Pair g;
243+
private Ruby::Pair g;
244244

245245
Pair() { this = TPair(g) }
246246

@@ -289,7 +289,7 @@ class Pair extends Expr, TPair {
289289
* end
290290
*/
291291
class RescueClause extends Expr, TRescueClause {
292-
private Generated::Rescue g;
292+
private Ruby::Rescue g;
293293

294294
RescueClause() { this = TRescueClause(g) }
295295

@@ -357,7 +357,7 @@ class RescueClause extends Expr, TRescueClause {
357357
* ```
358358
*/
359359
class RescueModifierExpr extends Expr, TRescueModifierExpr {
360-
private Generated::RescueModifier g;
360+
private Ruby::RescueModifier g;
361361

362362
RescueModifierExpr() { this = TRescueModifierExpr(g) }
363363

@@ -398,7 +398,7 @@ class RescueModifierExpr extends Expr, TRescueModifierExpr {
398398
* ```
399399
*/
400400
class StringConcatenation extends Expr, TStringConcatenation {
401-
private Generated::ChainedString g;
401+
private Ruby::ChainedString g;
402402

403403
StringConcatenation() { this = TStringConcatenation(g) }
404404

0 commit comments

Comments
 (0)