mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02:00
Make {Unary,Binary}Operation a sub class of MethodCall
This commit is contained in:
@@ -8,29 +8,27 @@ private import internal.Operation
|
||||
*
|
||||
* This is the QL root class for all operations.
|
||||
*/
|
||||
class Operation extends Expr, TOperation {
|
||||
class Operation extends Expr instanceof OperationImpl {
|
||||
/** Gets the operator of this operation. */
|
||||
string getOperator() { none() }
|
||||
final string getOperator() { result = super.getOperatorImpl() }
|
||||
|
||||
/** Gets an operand of this operation. */
|
||||
Expr getAnOperand() { none() }
|
||||
final Expr getAnOperand() { result = super.getAnOperandImpl() }
|
||||
|
||||
override AstNode getAChild(string pred) {
|
||||
result = super.getAChild(pred)
|
||||
result = Expr.super.getAChild(pred)
|
||||
or
|
||||
pred = "getAnOperand" and result = this.getAnOperand()
|
||||
}
|
||||
}
|
||||
|
||||
/** A unary operation. */
|
||||
class UnaryOperation extends Operation, TUnaryOperation {
|
||||
class UnaryOperation extends Operation, MethodCall instanceof UnaryOperationImpl {
|
||||
/** Gets the operand of this unary operation. */
|
||||
Expr getOperand() { none() }
|
||||
|
||||
final override Expr getAnOperand() { result = this.getOperand() }
|
||||
final Expr getOperand() { result = super.getOperandImpl() }
|
||||
|
||||
final override AstNode getAChild(string pred) {
|
||||
result = super.getAChild(pred)
|
||||
result = Operation.super.getAChild(pred)
|
||||
or
|
||||
pred = "getOperand" and result = this.getOperand()
|
||||
}
|
||||
@@ -38,18 +36,8 @@ class UnaryOperation extends Operation, TUnaryOperation {
|
||||
final override string toString() { result = this.getOperator() + " ..." }
|
||||
}
|
||||
|
||||
private class UnaryOperationGenerated extends UnaryOperation, TUnaryOperation {
|
||||
private Ruby::Unary g;
|
||||
|
||||
UnaryOperationGenerated() { g = toGenerated(this) }
|
||||
|
||||
final override Expr getOperand() { toGenerated(result) = g.getOperand() }
|
||||
|
||||
final override string getOperator() { result = g.getOperator() }
|
||||
}
|
||||
|
||||
/** A unary logical operation. */
|
||||
class UnaryLogicalOperation extends UnaryOperationGenerated, TUnaryLogicalOperation { }
|
||||
class UnaryLogicalOperation extends UnaryOperation, TUnaryLogicalOperation { }
|
||||
|
||||
/**
|
||||
* A logical NOT operation, using either `!` or `not`.
|
||||
@@ -63,7 +51,7 @@ class NotExpr extends UnaryLogicalOperation, TNotExpr {
|
||||
}
|
||||
|
||||
/** A unary arithmetic operation. */
|
||||
class UnaryArithmeticOperation extends UnaryOperationGenerated, TUnaryArithmeticOperation { }
|
||||
class UnaryArithmeticOperation extends UnaryOperation, TUnaryArithmeticOperation { }
|
||||
|
||||
/**
|
||||
* A unary plus expression.
|
||||
@@ -92,10 +80,6 @@ class UnaryMinusExpr extends UnaryArithmeticOperation, TUnaryMinusExpr {
|
||||
* ```
|
||||
*/
|
||||
class SplatExpr extends UnaryOperation, TSplatExpr {
|
||||
final override Expr getOperand() { result = this.(SplatExprImpl).getOperandImpl() }
|
||||
|
||||
final override string getOperator() { result = "*" }
|
||||
|
||||
final override string getAPrimaryQlClass() { result = "SplatExpr" }
|
||||
}
|
||||
|
||||
@@ -110,10 +94,6 @@ class HashSplatExpr extends UnaryOperation, THashSplatExpr {
|
||||
|
||||
HashSplatExpr() { this = THashSplatExpr(g) }
|
||||
|
||||
final override Expr getOperand() { toGenerated(result) = g.getChild() }
|
||||
|
||||
final override string getOperator() { result = "**" }
|
||||
|
||||
final override string getAPrimaryQlClass() { result = "HashSplatExpr" }
|
||||
}
|
||||
|
||||
@@ -141,15 +121,11 @@ class DefinedExpr extends UnaryOperation, TDefinedExpr {
|
||||
}
|
||||
|
||||
/** A binary operation. */
|
||||
class BinaryOperation extends Operation, TBinaryOperation {
|
||||
final override Expr getAnOperand() {
|
||||
result = this.getLeftOperand() or result = this.getRightOperand()
|
||||
}
|
||||
|
||||
class BinaryOperation extends Operation, MethodCall instanceof BinaryOperationImpl {
|
||||
final override string toString() { result = "... " + this.getOperator() + " ..." }
|
||||
|
||||
override AstNode getAChild(string pred) {
|
||||
result = super.getAChild(pred)
|
||||
result = Operation.super.getAChild(pred)
|
||||
or
|
||||
pred = "getLeftOperand" and result = this.getLeftOperand()
|
||||
or
|
||||
@@ -157,28 +133,10 @@ class BinaryOperation extends Operation, TBinaryOperation {
|
||||
}
|
||||
|
||||
/** Gets the left operand of this binary operation. */
|
||||
Stmt getLeftOperand() { none() }
|
||||
final Stmt getLeftOperand() { result = super.getLeftOperandImpl() }
|
||||
|
||||
/** Gets the right operand of this binary operation. */
|
||||
Stmt getRightOperand() { none() }
|
||||
}
|
||||
|
||||
private class BinaryOperationReal extends BinaryOperation {
|
||||
private Ruby::Binary g;
|
||||
|
||||
BinaryOperationReal() { g = toGenerated(this) }
|
||||
|
||||
final override string getOperator() { result = g.getOperator() }
|
||||
|
||||
final override Stmt getLeftOperand() { toGenerated(result) = g.getLeft() }
|
||||
|
||||
final override Stmt getRightOperand() { toGenerated(result) = g.getRight() }
|
||||
}
|
||||
|
||||
abstract private class BinaryOperationSynth extends BinaryOperation {
|
||||
final override Stmt getLeftOperand() { synthChild(this, 0, result) }
|
||||
|
||||
final override Stmt getRightOperand() { synthChild(this, 1, result) }
|
||||
final Stmt getRightOperand() { result = super.getRightOperandImpl() }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,10 +154,6 @@ class AddExpr extends BinaryArithmeticOperation, TAddExpr {
|
||||
final override string getAPrimaryQlClass() { result = "AddExpr" }
|
||||
}
|
||||
|
||||
private class AddExprSynth extends AddExpr, BinaryOperationSynth, TAddExprSynth {
|
||||
final override string getOperator() { result = "+" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A subtract expression.
|
||||
* ```rb
|
||||
@@ -210,10 +164,6 @@ class SubExpr extends BinaryArithmeticOperation, TSubExpr {
|
||||
final override string getAPrimaryQlClass() { result = "SubExpr" }
|
||||
}
|
||||
|
||||
private class SubExprSynth extends SubExpr, BinaryOperationSynth, TSubExprSynth {
|
||||
final override string getOperator() { result = "-" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A multiply expression.
|
||||
* ```rb
|
||||
@@ -224,10 +174,6 @@ class MulExpr extends BinaryArithmeticOperation, TMulExpr {
|
||||
final override string getAPrimaryQlClass() { result = "MulExpr" }
|
||||
}
|
||||
|
||||
private class MulExprSynth extends MulExpr, BinaryOperationSynth, TMulExprSynth {
|
||||
final override string getOperator() { result = "*" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A divide expression.
|
||||
* ```rb
|
||||
@@ -238,10 +184,6 @@ class DivExpr extends BinaryArithmeticOperation, TDivExpr {
|
||||
final override string getAPrimaryQlClass() { result = "DivExpr" }
|
||||
}
|
||||
|
||||
private class DivExprSynth extends DivExpr, BinaryOperationSynth, TDivExprSynth {
|
||||
final override string getOperator() { result = "/" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A modulo expression.
|
||||
* ```rb
|
||||
@@ -252,10 +194,6 @@ class ModuloExpr extends BinaryArithmeticOperation, TModuloExpr {
|
||||
final override string getAPrimaryQlClass() { result = "ModuloExpr" }
|
||||
}
|
||||
|
||||
private class ModuloExprSynth extends ModuloExpr, BinaryOperationSynth, TModuloExprSynth {
|
||||
final override string getOperator() { result = "%" }
|
||||
}
|
||||
|
||||
/**
|
||||
* An exponent expression.
|
||||
* ```rb
|
||||
@@ -266,10 +204,6 @@ class ExponentExpr extends BinaryArithmeticOperation, TExponentExpr {
|
||||
final override string getAPrimaryQlClass() { result = "ExponentExpr" }
|
||||
}
|
||||
|
||||
private class ExponentExprSynth extends ExponentExpr, BinaryOperationSynth, TExponentExprSynth {
|
||||
final override string getOperator() { result = "**" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A binary logical operation.
|
||||
*/
|
||||
@@ -286,10 +220,6 @@ class LogicalAndExpr extends BinaryLogicalOperation, TLogicalAndExpr {
|
||||
final override string getAPrimaryQlClass() { result = "LogicalAndExpr" }
|
||||
}
|
||||
|
||||
private class LogicalAndExprSynth extends LogicalAndExpr, BinaryOperationSynth, TLogicalAndExprSynth {
|
||||
final override string getOperator() { result = "&&" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A logical OR operation, using either `or` or `||`.
|
||||
* ```rb
|
||||
@@ -301,10 +231,6 @@ class LogicalOrExpr extends BinaryLogicalOperation, TLogicalOrExpr {
|
||||
final override string getAPrimaryQlClass() { result = "LogicalOrExpr" }
|
||||
}
|
||||
|
||||
private class LogicalOrExprSynth extends LogicalOrExpr, BinaryOperationSynth, TLogicalOrExprSynth {
|
||||
final override string getOperator() { result = "||" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A binary bitwise operation.
|
||||
*/
|
||||
@@ -320,10 +246,6 @@ class LShiftExpr extends BinaryBitwiseOperation, TLShiftExpr {
|
||||
final override string getAPrimaryQlClass() { result = "LShiftExpr" }
|
||||
}
|
||||
|
||||
private class LShiftExprSynth extends LShiftExpr, BinaryOperationSynth, TLShiftExprSynth {
|
||||
final override string getOperator() { result = "<<" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A right-shift operation.
|
||||
* ```rb
|
||||
@@ -334,10 +256,6 @@ class RShiftExpr extends BinaryBitwiseOperation, TRShiftExpr {
|
||||
final override string getAPrimaryQlClass() { result = "RShiftExpr" }
|
||||
}
|
||||
|
||||
private class RShiftExprSynth extends RShiftExpr, BinaryOperationSynth, TRShiftExprSynth {
|
||||
final override string getOperator() { result = ">>" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A bitwise AND operation.
|
||||
* ```rb
|
||||
@@ -348,10 +266,6 @@ class BitwiseAndExpr extends BinaryBitwiseOperation, TBitwiseAndExpr {
|
||||
final override string getAPrimaryQlClass() { result = "BitwiseAndExpr" }
|
||||
}
|
||||
|
||||
private class BitwiseAndSynthExpr extends BitwiseAndExpr, BinaryOperationSynth, TBitwiseAndExprSynth {
|
||||
final override string getOperator() { result = "&" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A bitwise OR operation.
|
||||
* ```rb
|
||||
@@ -362,10 +276,6 @@ class BitwiseOrExpr extends BinaryBitwiseOperation, TBitwiseOrExpr {
|
||||
final override string getAPrimaryQlClass() { result = "BitwiseOrExpr" }
|
||||
}
|
||||
|
||||
private class BitwiseOrSynthExpr extends BitwiseOrExpr, BinaryOperationSynth, TBitwiseOrExprSynth {
|
||||
final override string getOperator() { result = "|" }
|
||||
}
|
||||
|
||||
/**
|
||||
* An XOR (exclusive OR) operation.
|
||||
* ```rb
|
||||
@@ -376,10 +286,6 @@ class BitwiseXorExpr extends BinaryBitwiseOperation, TBitwiseXorExpr {
|
||||
final override string getAPrimaryQlClass() { result = "BitwiseXorExpr" }
|
||||
}
|
||||
|
||||
private class BitwiseXorSynthExpr extends BitwiseXorExpr, BinaryOperationSynth, TBitwiseXorExprSynth {
|
||||
final override string getOperator() { result = "^" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A comparison operation. That is, either an equality operation or a
|
||||
* relational operation.
|
||||
@@ -531,21 +437,17 @@ class NoRegExpMatchExpr extends BinaryOperation, TNoRegExpMatchExpr {
|
||||
*
|
||||
* This is a QL base class for all assignments.
|
||||
*/
|
||||
class Assignment extends Operation, TAssignment {
|
||||
class Assignment extends Operation instanceof AssignmentImpl {
|
||||
/** Gets the left hand side of this assignment. */
|
||||
final Pattern getLeftOperand() { result = this.(AssignmentImpl).getLeftOperandImpl() }
|
||||
final Pattern getLeftOperand() { result = super.getLeftOperandImpl() }
|
||||
|
||||
/** Gets the right hand side of this assignment. */
|
||||
final Expr getRightOperand() { result = this.(AssignmentImpl).getRightOperandImpl() }
|
||||
|
||||
final override Expr getAnOperand() {
|
||||
result = this.getLeftOperand() or result = this.getRightOperand()
|
||||
}
|
||||
final Expr getRightOperand() { result = super.getRightOperandImpl() }
|
||||
|
||||
final override string toString() { result = "... " + this.getOperator() + " ..." }
|
||||
|
||||
override AstNode getAChild(string pred) {
|
||||
result = super.getAChild(pred)
|
||||
result = Operation.super.getAChild(pred)
|
||||
or
|
||||
pred = "getLeftOperand" and result = getLeftOperand()
|
||||
or
|
||||
@@ -560,21 +462,13 @@ class Assignment extends Operation, TAssignment {
|
||||
* ```
|
||||
*/
|
||||
class AssignExpr extends Assignment, TAssignExpr {
|
||||
final override string getOperator() { result = "=" }
|
||||
|
||||
final override string getAPrimaryQlClass() { result = "AssignExpr" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A binary assignment operation other than `=`.
|
||||
*/
|
||||
class AssignOperation extends Assignment, TAssignOperation {
|
||||
Ruby::OperatorAssignment g;
|
||||
|
||||
AssignOperation() { g = toGenerated(this) }
|
||||
|
||||
final override string getOperator() { result = g.getOperator() }
|
||||
}
|
||||
class AssignOperation extends Assignment instanceof AssignOperationImpl { }
|
||||
|
||||
/**
|
||||
* An arithmetic assignment operation: `+=`, `-=`, `*=`, `/=`, `**=`, and `%=`.
|
||||
|
||||
@@ -527,7 +527,7 @@ class TCall = TMethodCall or TYieldCall;
|
||||
|
||||
class TMethodCall =
|
||||
TMethodCallSynth or TIdentifierMethodCall or TScopeResolutionMethodCall or TRegularMethodCall or
|
||||
TElementReference or TSuperCall;
|
||||
TElementReference or TSuperCall or TUnaryOperation or TBinaryOperation;
|
||||
|
||||
class TSuperCall = TTokenSuperCall or TRegularSuperCall;
|
||||
|
||||
|
||||
@@ -1,47 +1,194 @@
|
||||
private import codeql.ruby.AST
|
||||
private import AST
|
||||
private import TreeSitter
|
||||
private import Call
|
||||
|
||||
class AssignmentImpl extends Operation, TAssignment {
|
||||
abstract AstNode getLeftOperandImpl();
|
||||
abstract class OperationImpl extends Expr, TOperation {
|
||||
abstract string getOperatorImpl();
|
||||
|
||||
abstract AstNode getRightOperandImpl();
|
||||
abstract Expr getAnOperandImpl();
|
||||
}
|
||||
|
||||
class AssignExprReal extends AssignmentImpl, AssignExpr, TAssignExprReal {
|
||||
private Ruby::Assignment g;
|
||||
|
||||
AssignExprReal() { this = TAssignExprReal(g) }
|
||||
|
||||
final override AstNode getLeftOperandImpl() { toGenerated(result) = g.getLeft() }
|
||||
|
||||
final override AstNode getRightOperandImpl() { toGenerated(result) = g.getRight() }
|
||||
}
|
||||
|
||||
class AssignExprSynth extends AssignmentImpl, AssignExpr, TAssignExprSynth {
|
||||
final override AstNode getLeftOperandImpl() { synthChild(this, 0, result) }
|
||||
|
||||
final override AstNode getRightOperandImpl() { synthChild(this, 1, result) }
|
||||
}
|
||||
|
||||
class AssignOperationImpl extends AssignmentImpl, AssignOperation {
|
||||
final override AstNode getLeftOperandImpl() { toGenerated(result) = g.getLeft() }
|
||||
|
||||
final override AstNode getRightOperandImpl() { toGenerated(result) = g.getRight() }
|
||||
}
|
||||
|
||||
abstract class SplatExprImpl extends SplatExpr {
|
||||
abstract class UnaryOperationImpl extends OperationImpl, MethodCallImpl, TUnaryOperation {
|
||||
abstract Expr getOperandImpl();
|
||||
|
||||
final override Expr getAnOperandImpl() { result = this.getOperandImpl() }
|
||||
|
||||
final override string getMethodNameImpl() { result = this.getOperatorImpl() }
|
||||
|
||||
final override AstNode getReceiverImpl() { result = this.getOperandImpl() }
|
||||
|
||||
final override Expr getArgumentImpl(int n) { none() }
|
||||
|
||||
final override int getNumberOfArgumentsImpl() { result = 0 }
|
||||
}
|
||||
|
||||
class SplatExprReal extends SplatExprImpl, TSplatExprReal {
|
||||
class UnaryOperationGenerated extends UnaryOperationImpl {
|
||||
private Ruby::Unary g;
|
||||
|
||||
UnaryOperationGenerated() { g = toGenerated(this) }
|
||||
|
||||
final override Expr getOperandImpl() { toGenerated(result) = g.getOperand() }
|
||||
|
||||
final override string getOperatorImpl() { result = g.getOperator() }
|
||||
}
|
||||
|
||||
class SplatExprReal extends UnaryOperationImpl, TSplatExprReal {
|
||||
private Ruby::SplatArgument g;
|
||||
|
||||
SplatExprReal() { this = TSplatExprReal(g) }
|
||||
|
||||
final override string getOperatorImpl() { result = "*" }
|
||||
|
||||
final override Expr getOperandImpl() { toGenerated(result) = g.getChild() }
|
||||
}
|
||||
|
||||
class SplatExprSynth extends SplatExprImpl, TSplatExprSynth {
|
||||
class SplatExprSynth extends UnaryOperationImpl, TSplatExprSynth {
|
||||
final override string getOperatorImpl() { result = "*" }
|
||||
|
||||
final override Expr getOperandImpl() { synthChild(this, 0, result) }
|
||||
}
|
||||
|
||||
class HashSplatExprImpl extends UnaryOperationImpl, THashSplatExpr {
|
||||
private Ruby::HashSplatArgument g;
|
||||
|
||||
HashSplatExprImpl() { this = THashSplatExpr(g) }
|
||||
|
||||
final override Expr getOperandImpl() { toGenerated(result) = g.getChild() }
|
||||
|
||||
final override string getOperatorImpl() { result = "**" }
|
||||
}
|
||||
|
||||
abstract class BinaryOperationImpl extends OperationImpl, MethodCallImpl, TBinaryOperation {
|
||||
abstract Stmt getLeftOperandImpl();
|
||||
|
||||
abstract Stmt getRightOperandImpl();
|
||||
|
||||
final override Expr getAnOperandImpl() {
|
||||
result = this.getLeftOperandImpl()
|
||||
or
|
||||
result = this.getRightOperandImpl()
|
||||
}
|
||||
|
||||
final override string getMethodNameImpl() { result = this.getOperatorImpl() }
|
||||
|
||||
final override AstNode getReceiverImpl() { result = this.getLeftOperandImpl() }
|
||||
|
||||
final override Expr getArgumentImpl(int n) { n = 0 and result = this.getRightOperandImpl() }
|
||||
|
||||
final override int getNumberOfArgumentsImpl() { result = 1 }
|
||||
}
|
||||
|
||||
class BinaryOperationReal extends BinaryOperationImpl {
|
||||
private Ruby::Binary g;
|
||||
|
||||
BinaryOperationReal() { g = toGenerated(this) }
|
||||
|
||||
final override string getOperatorImpl() { result = g.getOperator() }
|
||||
|
||||
final override Stmt getLeftOperandImpl() { toGenerated(result) = g.getLeft() }
|
||||
|
||||
final override Stmt getRightOperandImpl() { toGenerated(result) = g.getRight() }
|
||||
}
|
||||
|
||||
abstract class BinaryOperationSynth extends BinaryOperationImpl {
|
||||
final override Stmt getLeftOperandImpl() { synthChild(this, 0, result) }
|
||||
|
||||
final override Stmt getRightOperandImpl() { synthChild(this, 1, result) }
|
||||
}
|
||||
|
||||
class AddExprSynth extends BinaryOperationSynth, TAddExprSynth {
|
||||
final override string getOperatorImpl() { result = "+" }
|
||||
}
|
||||
|
||||
class SubExprSynth extends BinaryOperationSynth, TSubExprSynth {
|
||||
final override string getOperatorImpl() { result = "-" }
|
||||
}
|
||||
|
||||
class MulExprSynth extends BinaryOperationSynth, TMulExprSynth {
|
||||
final override string getOperatorImpl() { result = "*" }
|
||||
}
|
||||
|
||||
class DivExprSynth extends BinaryOperationSynth, TDivExprSynth {
|
||||
final override string getOperatorImpl() { result = "/" }
|
||||
}
|
||||
|
||||
class ModuloExprSynth extends BinaryOperationSynth, TModuloExprSynth {
|
||||
final override string getOperatorImpl() { result = "%" }
|
||||
}
|
||||
|
||||
class ExponentExprSynth extends BinaryOperationSynth, TExponentExprSynth {
|
||||
final override string getOperatorImpl() { result = "**" }
|
||||
}
|
||||
|
||||
class LogicalAndExprSynth extends BinaryOperationSynth, TLogicalAndExprSynth {
|
||||
final override string getOperatorImpl() { result = "&&" }
|
||||
}
|
||||
|
||||
class LogicalOrExprSynth extends BinaryOperationSynth, TLogicalOrExprSynth {
|
||||
final override string getOperatorImpl() { result = "||" }
|
||||
}
|
||||
|
||||
class LShiftExprSynth extends BinaryOperationSynth, TLShiftExprSynth {
|
||||
final override string getOperatorImpl() { result = "<<" }
|
||||
}
|
||||
|
||||
class RShiftExprSynth extends BinaryOperationSynth, TRShiftExprSynth {
|
||||
final override string getOperatorImpl() { result = ">>" }
|
||||
}
|
||||
|
||||
class BitwiseAndSynthExpr extends BinaryOperationSynth, TBitwiseAndExprSynth {
|
||||
final override string getOperatorImpl() { result = "&" }
|
||||
}
|
||||
|
||||
class BitwiseOrSynthExpr extends BinaryOperationSynth, TBitwiseOrExprSynth {
|
||||
final override string getOperatorImpl() { result = "|" }
|
||||
}
|
||||
|
||||
class BitwiseXorSynthExpr extends BinaryOperationSynth, TBitwiseXorExprSynth {
|
||||
final override string getOperatorImpl() { result = "^" }
|
||||
}
|
||||
|
||||
abstract class AssignmentImpl extends OperationImpl, TAssignment {
|
||||
abstract Pattern getLeftOperandImpl();
|
||||
|
||||
abstract Expr getRightOperandImpl();
|
||||
|
||||
final override Expr getAnOperandImpl() {
|
||||
result = this.getLeftOperandImpl()
|
||||
or
|
||||
result = this.getRightOperandImpl()
|
||||
}
|
||||
}
|
||||
|
||||
class AssignExprReal extends AssignmentImpl, TAssignExprReal {
|
||||
private Ruby::Assignment g;
|
||||
|
||||
AssignExprReal() { this = TAssignExprReal(g) }
|
||||
|
||||
final override string getOperatorImpl() { result = "=" }
|
||||
|
||||
final override Pattern getLeftOperandImpl() { toGenerated(result) = g.getLeft() }
|
||||
|
||||
final override Expr getRightOperandImpl() { toGenerated(result) = g.getRight() }
|
||||
}
|
||||
|
||||
class AssignExprSynth extends AssignmentImpl, TAssignExprSynth {
|
||||
final override string getOperatorImpl() { result = "=" }
|
||||
|
||||
final override Pattern getLeftOperandImpl() { synthChild(this, 0, result) }
|
||||
|
||||
final override Expr getRightOperandImpl() { synthChild(this, 1, result) }
|
||||
}
|
||||
|
||||
class AssignOperationImpl extends AssignmentImpl, TAssignOperation {
|
||||
Ruby::OperatorAssignment g;
|
||||
|
||||
AssignOperationImpl() { g = toGenerated(this) }
|
||||
|
||||
final override string getOperatorImpl() { result = g.getOperator() }
|
||||
|
||||
final override Pattern getLeftOperandImpl() { toGenerated(result) = g.getLeft() }
|
||||
|
||||
final override Expr getRightOperandImpl() { toGenerated(result) = g.getRight() }
|
||||
}
|
||||
|
||||
@@ -153,17 +153,6 @@ module Trees {
|
||||
final override predicate propagatesAbnormal(AstNode child) { none() }
|
||||
}
|
||||
|
||||
private class BinaryOperationTree extends StandardPostOrderTree, BinaryOperation {
|
||||
// Logical AND and OR are handled separately
|
||||
BinaryOperationTree() { not this instanceof BinaryLogicalOperation }
|
||||
|
||||
final override ControlFlowTree getChildElement(int i) {
|
||||
result = this.getLeftOperand() and i = 0
|
||||
or
|
||||
result = this.getRightOperand() and i = 1
|
||||
}
|
||||
}
|
||||
|
||||
private class BlockArgumentTree extends StandardPostOrderTree, BlockArgument {
|
||||
final override ControlFlowTree getChildElement(int i) { result = this.getValue() and i = 0 }
|
||||
}
|
||||
@@ -393,6 +382,12 @@ module Trees {
|
||||
}
|
||||
|
||||
private class CallTree extends StandardPostOrderTree, Call {
|
||||
CallTree() {
|
||||
// Logical operations are handled separately
|
||||
not this instanceof UnaryLogicalOperation and
|
||||
not this instanceof BinaryLogicalOperation
|
||||
}
|
||||
|
||||
override ControlFlowTree getChildElement(int i) { result = this.getArgument(i) }
|
||||
}
|
||||
|
||||
@@ -1087,13 +1082,6 @@ module Trees {
|
||||
final override ControlFlowTree getChildElement(int i) { result = this.getElement(i) }
|
||||
}
|
||||
|
||||
private class UnaryOperationTree extends StandardPostOrderTree, UnaryOperation {
|
||||
// Logical NOT is handled separately
|
||||
UnaryOperationTree() { not this instanceof NotExpr }
|
||||
|
||||
final override ControlFlowTree getChildElement(int i) { result = this.getOperand() and i = 0 }
|
||||
}
|
||||
|
||||
private class UndefStmtTree extends StandardPreOrderTree, UndefStmt {
|
||||
final override ControlFlowTree getChildElement(int i) { result = this.getMethodName(i) }
|
||||
}
|
||||
|
||||
@@ -7,13 +7,19 @@ callsWithArguments
|
||||
| calls.rb:14:1:14:11 | call to foo | foo | 0 | calls.rb:14:5:14:5 | 0 |
|
||||
| calls.rb:14:1:14:11 | call to foo | foo | 1 | calls.rb:14:8:14:8 | 1 |
|
||||
| calls.rb:14:1:14:11 | call to foo | foo | 2 | calls.rb:14:11:14:11 | 2 |
|
||||
| calls.rb:17:11:17:15 | ... + ... | + | 0 | calls.rb:17:15:17:15 | 1 |
|
||||
| calls.rb:21:3:21:7 | ... + ... | + | 0 | calls.rb:21:7:21:7 | 1 |
|
||||
| calls.rb:25:1:27:3 | call to bar | bar | 0 | calls.rb:25:9:25:13 | "foo" |
|
||||
| calls.rb:26:3:26:7 | ... + ... | + | 0 | calls.rb:26:7:26:7 | 1 |
|
||||
| calls.rb:36:3:36:16 | yield ... | (none) | 0 | calls.rb:36:9:36:11 | 100 |
|
||||
| calls.rb:36:3:36:16 | yield ... | (none) | 1 | calls.rb:36:14:36:16 | 200 |
|
||||
| calls.rb:54:1:54:14 | call to some_func | some_func | 0 | calls.rb:54:11:54:13 | call to foo |
|
||||
| calls.rb:55:1:55:17 | call to some_func | some_func | 0 | calls.rb:55:11:55:16 | call to foo |
|
||||
| calls.rb:58:1:58:5 | call to [] | [] | 0 | calls.rb:58:2:58:4 | call to foo |
|
||||
| calls.rb:59:1:59:8 | call to [] | [] | 0 | calls.rb:59:2:59:7 | call to foo |
|
||||
| calls.rb:66:6:66:7 | ... + ... | + | 0 | calls.rb:66:9:66:11 | call to bar |
|
||||
| calls.rb:67:6:67:7 | ... + ... | + | 0 | calls.rb:67:9:67:14 | call to bar |
|
||||
| calls.rb:85:1:85:12 | ... + ... | + | 0 | calls.rb:85:7:85:12 | call to bar |
|
||||
| calls.rb:234:1:234:8 | ...[...] | [] | 0 | calls.rb:234:5:234:7 | call to bar |
|
||||
| calls.rb:235:1:235:14 | ...[...] | [] | 0 | calls.rb:235:8:235:13 | call to bar |
|
||||
| calls.rb:266:1:266:9 | call to foo | foo | 0 | calls.rb:266:5:266:8 | &... |
|
||||
@@ -28,10 +34,14 @@ callsWithArguments
|
||||
| calls.rb:289:5:289:17 | call to super | super | 0 | calls.rb:289:11:289:11 | 1 |
|
||||
| calls.rb:289:5:289:17 | call to super | super | 1 | calls.rb:289:14:289:14 | 2 |
|
||||
| calls.rb:289:5:289:17 | call to super | super | 2 | calls.rb:289:17:289:17 | 3 |
|
||||
| calls.rb:290:17:290:21 | ... + ... | + | 0 | calls.rb:290:21:290:21 | 1 |
|
||||
| calls.rb:291:18:291:22 | ... * ... | * | 0 | calls.rb:291:22:291:22 | 2 |
|
||||
| calls.rb:292:5:292:30 | call to super | super | 0 | calls.rb:292:11:292:11 | 4 |
|
||||
| calls.rb:292:5:292:30 | call to super | super | 1 | calls.rb:292:14:292:14 | 5 |
|
||||
| calls.rb:292:22:292:28 | ... + ... | + | 0 | calls.rb:292:26:292:28 | 100 |
|
||||
| calls.rb:293:5:293:33 | call to super | super | 0 | calls.rb:293:11:293:11 | 6 |
|
||||
| calls.rb:293:5:293:33 | call to super | super | 1 | calls.rb:293:14:293:14 | 7 |
|
||||
| calls.rb:293:23:293:29 | ... + ... | + | 0 | calls.rb:293:27:293:29 | 200 |
|
||||
| calls.rb:311:1:311:7 | call to call | call | 0 | calls.rb:311:6:311:6 | 1 |
|
||||
| calls.rb:314:1:314:8 | call to foo= | foo= | 0 | calls.rb:314:1:314:8 | ... = ... |
|
||||
| calls.rb:315:1:315:6 | ...[...] | [] | 0 | calls.rb:315:5:315:5 | 0 |
|
||||
@@ -58,10 +68,12 @@ callsWithArguments
|
||||
| calls.rb:317:14:317:22 | call to [] | [] | 1 | calls.rb:317:18:317:18 | 2 |
|
||||
| calls.rb:317:14:317:22 | call to [] | [] | 2 | calls.rb:317:21:317:21 | 3 |
|
||||
| calls.rb:318:1:318:10 | call to count= | count= | 1 | calls.rb:318:12:318:13 | __synth__1 |
|
||||
| calls.rb:318:12:318:13 | ... + ... | + | 0 | calls.rb:318:15:318:15 | 1 |
|
||||
| calls.rb:319:1:319:6 | ...[...] | [] | 0 | calls.rb:319:5:319:5 | 0 |
|
||||
| calls.rb:319:1:319:6 | call to [] | [] | 0 | calls.rb:319:5:319:5 | __synth__1 |
|
||||
| calls.rb:319:1:319:6 | call to []= | []= | 0 | calls.rb:319:5:319:5 | __synth__1 |
|
||||
| calls.rb:319:1:319:6 | call to []= | []= | 2 | calls.rb:319:8:319:9 | __synth__2 |
|
||||
| calls.rb:319:8:319:9 | ... + ... | + | 0 | calls.rb:319:11:319:11 | 1 |
|
||||
| calls.rb:320:1:320:32 | ...[...] | [] | 0 | calls.rb:320:9:320:9 | 0 |
|
||||
| calls.rb:320:1:320:32 | ...[...] | [] | 1 | calls.rb:320:12:320:18 | call to baz |
|
||||
| calls.rb:320:1:320:32 | ...[...] | [] | 2 | calls.rb:320:21:320:31 | ... + ... |
|
||||
@@ -72,6 +84,8 @@ callsWithArguments
|
||||
| calls.rb:320:1:320:32 | call to []= | []= | 1 | calls.rb:320:12:320:18 | __synth__2 |
|
||||
| calls.rb:320:1:320:32 | call to []= | []= | 2 | calls.rb:320:21:320:31 | __synth__3 |
|
||||
| calls.rb:320:1:320:32 | call to []= | []= | 4 | calls.rb:320:34:320:35 | __synth__4 |
|
||||
| calls.rb:320:21:320:31 | ... + ... | + | 0 | calls.rb:320:31:320:31 | 1 |
|
||||
| calls.rb:320:34:320:35 | ... * ... | * | 0 | calls.rb:320:37:320:37 | 2 |
|
||||
callsWithReceiver
|
||||
| calls.rb:2:1:2:5 | call to foo | calls.rb:2:1:2:5 | self |
|
||||
| calls.rb:5:1:5:10 | call to bar | calls.rb:5:1:5:3 | Foo |
|
||||
@@ -79,8 +93,11 @@ callsWithReceiver
|
||||
| calls.rb:11:1:11:7 | call to bar | calls.rb:11:1:11:3 | 123 |
|
||||
| calls.rb:14:1:14:11 | call to foo | calls.rb:14:1:14:11 | self |
|
||||
| calls.rb:17:1:17:17 | call to foo | calls.rb:17:1:17:17 | self |
|
||||
| calls.rb:17:11:17:15 | ... + ... | calls.rb:17:11:17:11 | x |
|
||||
| calls.rb:20:1:22:3 | call to foo | calls.rb:20:1:22:3 | self |
|
||||
| calls.rb:21:3:21:7 | ... + ... | calls.rb:21:3:21:3 | x |
|
||||
| calls.rb:25:1:27:3 | call to bar | calls.rb:25:1:25:3 | 123 |
|
||||
| calls.rb:26:3:26:7 | ... + ... | calls.rb:26:3:26:3 | x |
|
||||
| calls.rb:46:1:46:3 | call to foo | calls.rb:46:1:46:3 | self |
|
||||
| calls.rb:47:1:47:6 | call to foo | calls.rb:47:1:47:1 | X |
|
||||
| calls.rb:50:2:50:4 | call to foo | calls.rb:50:2:50:4 | self |
|
||||
@@ -95,7 +112,9 @@ callsWithReceiver
|
||||
| calls.rb:59:2:59:7 | call to foo | calls.rb:59:2:59:2 | X |
|
||||
| calls.rb:62:8:62:10 | call to foo | calls.rb:62:8:62:10 | self |
|
||||
| calls.rb:63:8:63:13 | call to foo | calls.rb:63:8:63:8 | X |
|
||||
| calls.rb:66:6:66:7 | ... + ... | calls.rb:66:1:66:4 | var1 |
|
||||
| calls.rb:66:9:66:11 | call to bar | calls.rb:66:9:66:11 | self |
|
||||
| calls.rb:67:6:67:7 | ... + ... | calls.rb:67:1:67:4 | var1 |
|
||||
| calls.rb:67:9:67:14 | call to bar | calls.rb:67:9:67:9 | X |
|
||||
| calls.rb:70:8:70:10 | call to foo | calls.rb:70:8:70:10 | self |
|
||||
| calls.rb:70:13:70:18 | call to bar | calls.rb:70:13:70:13 | X |
|
||||
@@ -106,8 +125,11 @@ callsWithReceiver
|
||||
| calls.rb:82:7:82:9 | call to foo | calls.rb:82:7:82:9 | self |
|
||||
| calls.rb:82:12:82:17 | call to bar | calls.rb:82:12:82:12 | X |
|
||||
| calls.rb:85:1:85:3 | call to foo | calls.rb:85:1:85:3 | self |
|
||||
| calls.rb:85:1:85:12 | ... + ... | calls.rb:85:1:85:3 | call to foo |
|
||||
| calls.rb:85:7:85:12 | call to bar | calls.rb:85:7:85:7 | X |
|
||||
| calls.rb:88:1:88:4 | ! ... | calls.rb:88:2:88:4 | call to foo |
|
||||
| calls.rb:88:2:88:4 | call to foo | calls.rb:88:2:88:4 | self |
|
||||
| calls.rb:89:1:89:7 | ~ ... | calls.rb:89:2:89:7 | call to bar |
|
||||
| calls.rb:89:2:89:7 | call to bar | calls.rb:89:2:89:2 | X |
|
||||
| calls.rb:92:1:92:21 | call to foo | calls.rb:92:1:92:21 | self |
|
||||
| calls.rb:92:9:92:11 | call to bar | calls.rb:92:9:92:11 | self |
|
||||
@@ -223,17 +245,25 @@ callsWithReceiver
|
||||
| calls.rb:267:1:267:12 | call to foo | calls.rb:267:1:267:12 | self |
|
||||
| calls.rb:267:6:267:11 | call to bar | calls.rb:267:6:267:6 | X |
|
||||
| calls.rb:270:1:270:9 | call to foo | calls.rb:270:1:270:9 | self |
|
||||
| calls.rb:270:5:270:8 | * ... | calls.rb:270:6:270:8 | call to bar |
|
||||
| calls.rb:270:6:270:8 | call to bar | calls.rb:270:6:270:8 | self |
|
||||
| calls.rb:271:1:271:12 | call to foo | calls.rb:271:1:271:12 | self |
|
||||
| calls.rb:271:5:271:11 | * ... | calls.rb:271:6:271:11 | call to bar |
|
||||
| calls.rb:271:6:271:11 | call to bar | calls.rb:271:6:271:6 | X |
|
||||
| calls.rb:274:1:274:10 | call to foo | calls.rb:274:1:274:10 | self |
|
||||
| calls.rb:274:5:274:9 | ** ... | calls.rb:274:7:274:9 | call to bar |
|
||||
| calls.rb:274:7:274:9 | call to bar | calls.rb:274:7:274:9 | self |
|
||||
| calls.rb:275:1:275:13 | call to foo | calls.rb:275:1:275:13 | self |
|
||||
| calls.rb:275:5:275:12 | ** ... | calls.rb:275:7:275:12 | call to bar |
|
||||
| calls.rb:275:7:275:12 | call to bar | calls.rb:275:7:275:7 | X |
|
||||
| calls.rb:278:1:278:14 | call to foo | calls.rb:278:1:278:14 | self |
|
||||
| calls.rb:278:11:278:13 | call to bar | calls.rb:278:11:278:13 | self |
|
||||
| calls.rb:279:1:279:17 | call to foo | calls.rb:279:1:279:17 | self |
|
||||
| calls.rb:279:11:279:16 | call to bar | calls.rb:279:11:279:11 | X |
|
||||
| calls.rb:290:17:290:21 | ... + ... | calls.rb:290:17:290:17 | x |
|
||||
| calls.rb:291:18:291:22 | ... * ... | calls.rb:291:18:291:18 | x |
|
||||
| calls.rb:292:22:292:28 | ... + ... | calls.rb:292:22:292:22 | x |
|
||||
| calls.rb:293:23:293:29 | ... + ... | calls.rb:293:23:293:23 | x |
|
||||
| calls.rb:303:5:303:7 | call to foo | calls.rb:303:5:303:7 | self |
|
||||
| calls.rb:303:5:303:13 | call to super | calls.rb:303:5:303:7 | call to foo |
|
||||
| calls.rb:304:5:304:14 | call to super | calls.rb:304:5:304:8 | self |
|
||||
@@ -257,20 +287,24 @@ callsWithReceiver
|
||||
| calls.rb:316:22:316:27 | ...[...] | calls.rb:316:22:316:24 | call to foo |
|
||||
| calls.rb:316:22:316:27 | call to [] | calls.rb:316:22:316:27 | __synth__0 |
|
||||
| calls.rb:316:22:316:27 | call to []= | calls.rb:316:22:316:24 | call to foo |
|
||||
| calls.rb:316:31:316:42 | * ... | calls.rb:316:31:316:42 | [...] |
|
||||
| calls.rb:316:31:316:42 | call to [] | calls.rb:316:31:316:42 | Array |
|
||||
| calls.rb:317:1:317:1 | call to [] | calls.rb:317:1:317:1 | __synth__0 |
|
||||
| calls.rb:317:5:317:7 | call to foo | calls.rb:317:5:317:7 | self |
|
||||
| calls.rb:317:5:317:10 | ...[...] | calls.rb:317:5:317:7 | call to foo |
|
||||
| calls.rb:317:5:317:10 | call to [] | calls.rb:317:5:317:10 | __synth__0 |
|
||||
| calls.rb:317:5:317:10 | call to []= | calls.rb:317:5:317:7 | call to foo |
|
||||
| calls.rb:317:14:317:22 | * ... | calls.rb:317:14:317:22 | [...] |
|
||||
| calls.rb:317:14:317:22 | call to [] | calls.rb:317:14:317:22 | Array |
|
||||
| calls.rb:318:1:318:10 | call to count | calls.rb:318:1:318:4 | __synth__0 |
|
||||
| calls.rb:318:1:318:10 | call to count | calls.rb:318:1:318:4 | self |
|
||||
| calls.rb:318:1:318:10 | call to count= | calls.rb:318:1:318:4 | __synth__0 |
|
||||
| calls.rb:318:12:318:13 | ... + ... | calls.rb:318:1:318:10 | call to count |
|
||||
| calls.rb:319:1:319:3 | call to foo | calls.rb:319:1:319:3 | self |
|
||||
| calls.rb:319:1:319:6 | ...[...] | calls.rb:319:1:319:3 | call to foo |
|
||||
| calls.rb:319:1:319:6 | call to [] | calls.rb:319:1:319:3 | __synth__0 |
|
||||
| calls.rb:319:1:319:6 | call to []= | calls.rb:319:1:319:3 | __synth__0 |
|
||||
| calls.rb:319:8:319:9 | ... + ... | calls.rb:319:1:319:6 | call to [] |
|
||||
| calls.rb:320:1:320:3 | call to foo | calls.rb:320:1:320:3 | self |
|
||||
| calls.rb:320:1:320:7 | call to bar | calls.rb:320:1:320:3 | call to foo |
|
||||
| calls.rb:320:1:320:32 | ...[...] | calls.rb:320:1:320:7 | call to bar |
|
||||
@@ -280,6 +314,8 @@ callsWithReceiver
|
||||
| calls.rb:320:12:320:18 | call to baz | calls.rb:320:12:320:14 | call to foo |
|
||||
| calls.rb:320:21:320:23 | call to foo | calls.rb:320:21:320:23 | self |
|
||||
| calls.rb:320:21:320:27 | call to boo | calls.rb:320:21:320:23 | call to foo |
|
||||
| calls.rb:320:21:320:31 | ... + ... | calls.rb:320:21:320:27 | call to boo |
|
||||
| calls.rb:320:34:320:35 | ... * ... | calls.rb:320:1:320:32 | call to [] |
|
||||
callsWithBlock
|
||||
| calls.rb:17:1:17:17 | call to foo | calls.rb:17:5:17:17 | { ... } |
|
||||
| calls.rb:20:1:22:3 | call to foo | calls.rb:20:5:22:3 | do ... end |
|
||||
|
||||
@@ -42,6 +42,7 @@ break_ensure.rb:
|
||||
|
||||
# 3| ... > ...
|
||||
#-----| true -> break
|
||||
#-----| raise -> for ... in ...
|
||||
#-----| false -> if ...
|
||||
|
||||
# 3| element
|
||||
@@ -114,6 +115,7 @@ break_ensure.rb:
|
||||
# 16| ... > ...
|
||||
#-----| true -> break
|
||||
#-----| false -> if ...
|
||||
#-----| raise -> [ensure: raise] elements
|
||||
|
||||
# 16| element
|
||||
#-----| -> 0
|
||||
@@ -130,12 +132,18 @@ break_ensure.rb:
|
||||
# 19| [ensure: break] ensure ...
|
||||
#-----| break -> for ... in ...
|
||||
|
||||
# 19| [ensure: raise] ensure ...
|
||||
#-----| raise -> for ... in ...
|
||||
|
||||
# 20| if ...
|
||||
#-----| -> ensure ...
|
||||
|
||||
# 20| [ensure: break] if ...
|
||||
#-----| -> [ensure: break] ensure ...
|
||||
|
||||
# 20| [ensure: raise] if ...
|
||||
#-----| -> [ensure: raise] ensure ...
|
||||
|
||||
# 20| call to nil?
|
||||
#-----| false -> if ...
|
||||
#-----| true -> self
|
||||
@@ -144,36 +152,55 @@ break_ensure.rb:
|
||||
#-----| false -> [ensure: break] if ...
|
||||
#-----| true -> [ensure: break] self
|
||||
|
||||
# 20| [ensure: raise] call to nil?
|
||||
#-----| false -> [ensure: raise] if ...
|
||||
#-----| true -> [ensure: raise] self
|
||||
|
||||
# 20| elements
|
||||
#-----| -> call to nil?
|
||||
|
||||
# 20| [ensure: break] elements
|
||||
#-----| -> [ensure: break] call to nil?
|
||||
|
||||
# 20| [ensure: raise] elements
|
||||
#-----| -> [ensure: raise] call to nil?
|
||||
|
||||
# 20| then ...
|
||||
#-----| -> if ...
|
||||
|
||||
# 20| [ensure: break] then ...
|
||||
#-----| -> [ensure: break] if ...
|
||||
|
||||
# 20| [ensure: raise] then ...
|
||||
#-----| -> [ensure: raise] if ...
|
||||
|
||||
# 21| call to puts
|
||||
#-----| -> then ...
|
||||
|
||||
# 21| [ensure: break] call to puts
|
||||
#-----| -> [ensure: break] then ...
|
||||
|
||||
# 21| [ensure: raise] call to puts
|
||||
#-----| -> [ensure: raise] then ...
|
||||
|
||||
# 21| self
|
||||
#-----| -> "elements nil"
|
||||
|
||||
# 21| [ensure: break] self
|
||||
#-----| -> [ensure: break] "elements nil"
|
||||
|
||||
# 21| [ensure: raise] self
|
||||
#-----| -> [ensure: raise] "elements nil"
|
||||
|
||||
# 21| "elements nil"
|
||||
#-----| -> call to puts
|
||||
|
||||
# 21| [ensure: break] "elements nil"
|
||||
#-----| -> [ensure: break] call to puts
|
||||
|
||||
# 21| [ensure: raise] "elements nil"
|
||||
#-----| -> [ensure: raise] call to puts
|
||||
|
||||
# 27| enter m3
|
||||
#-----| -> elements
|
||||
|
||||
@@ -363,6 +390,7 @@ break_ensure.rb:
|
||||
|
||||
# 47| ... > ...
|
||||
#-----| false -> if ...
|
||||
#-----| raise -> [ensure: raise] element
|
||||
#-----| true -> self
|
||||
|
||||
# 47| element
|
||||
@@ -1109,12 +1137,12 @@ cfg.rb:
|
||||
# 62| call to []
|
||||
#-----| -> * ...
|
||||
|
||||
# 62| 1
|
||||
#-----| -> call to []
|
||||
|
||||
# 62| ...
|
||||
#-----| -> ...
|
||||
|
||||
# 62| 1
|
||||
#-----| -> call to []
|
||||
|
||||
# 62| __synth__0
|
||||
#-----| -> 1
|
||||
|
||||
@@ -2752,12 +2780,12 @@ desugar.rb:
|
||||
# 22| call to []
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 22| -1
|
||||
#-----| -> call to []
|
||||
|
||||
# 22| ...
|
||||
#-----| -> ...
|
||||
|
||||
# 22| -1
|
||||
#-----| -> call to []
|
||||
|
||||
# 22| __synth__0
|
||||
#-----| -> -1
|
||||
|
||||
@@ -2832,12 +2860,12 @@ desugar.rb:
|
||||
# 26| call to []
|
||||
#-----| -> * ...
|
||||
|
||||
# 26| 1
|
||||
#-----| -> call to []
|
||||
|
||||
# 26| ...
|
||||
#-----| -> ...
|
||||
|
||||
# 26| 1
|
||||
#-----| -> call to []
|
||||
|
||||
# 26| __synth__0
|
||||
#-----| -> 1
|
||||
|
||||
@@ -4254,6 +4282,7 @@ raise.rb:
|
||||
# 69| ... > ...
|
||||
#-----| false -> x
|
||||
#-----| true -> self
|
||||
#-----| raise -> [ensure: raise] self
|
||||
|
||||
# 69| x
|
||||
#-----| -> 2
|
||||
@@ -4276,6 +4305,7 @@ raise.rb:
|
||||
# 71| ... < ...
|
||||
#-----| false -> elsif ...
|
||||
#-----| true -> "x < 0"
|
||||
#-----| raise -> [ensure: raise] self
|
||||
|
||||
# 71| x
|
||||
#-----| -> 0
|
||||
@@ -4367,6 +4397,7 @@ raise.rb:
|
||||
# 82| ... > ...
|
||||
#-----| false -> x
|
||||
#-----| true -> self
|
||||
#-----| raise -> [ensure: raise] self
|
||||
|
||||
# 82| x
|
||||
#-----| -> 2
|
||||
@@ -4389,6 +4420,7 @@ raise.rb:
|
||||
# 84| ... < ...
|
||||
#-----| false -> elsif ...
|
||||
#-----| true -> "x < 0"
|
||||
#-----| raise -> [ensure: raise] self
|
||||
|
||||
# 84| x
|
||||
#-----| -> 0
|
||||
@@ -4496,6 +4528,7 @@ raise.rb:
|
||||
# 97| ... > ...
|
||||
#-----| false -> x
|
||||
#-----| true -> self
|
||||
#-----| raise -> [ensure: raise] self
|
||||
|
||||
# 97| x
|
||||
#-----| -> 2
|
||||
@@ -4518,6 +4551,7 @@ raise.rb:
|
||||
# 99| ... < ...
|
||||
#-----| false -> elsif ...
|
||||
#-----| true -> "x < 0"
|
||||
#-----| raise -> [ensure: raise] self
|
||||
|
||||
# 99| x
|
||||
#-----| -> 0
|
||||
|
||||
@@ -53,5 +53,6 @@
|
||||
| local_dataflow.rb:45:10:45:10 | 6 | local_dataflow.rb:45:3:45:10 | return |
|
||||
| local_dataflow.rb:49:3:53:3 | <captured> | local_dataflow.rb:50:18:50:18 | x |
|
||||
| local_dataflow.rb:50:8:50:13 | "next" | local_dataflow.rb:50:3:50:13 | next |
|
||||
| local_dataflow.rb:50:18:50:18 | [post] x | local_dataflow.rb:51:20:51:20 | x |
|
||||
| local_dataflow.rb:50:18:50:18 | x | local_dataflow.rb:51:20:51:20 | x |
|
||||
| local_dataflow.rb:51:9:51:15 | "break" | local_dataflow.rb:51:3:51:15 | break |
|
||||
|
||||
@@ -97,13 +97,19 @@ unresolvedCall
|
||||
| calls.rb:42:9:42:24 | call to singleton_m |
|
||||
| calls.rb:48:1:48:13 | call to singleton_m |
|
||||
| calls.rb:59:1:59:13 | call to singleton_m |
|
||||
| calls.rb:112:11:112:25 | ... < ... |
|
||||
| calls.rb:114:11:114:12 | ... + ... |
|
||||
| calls.rb:129:1:129:13 | call to [] |
|
||||
| calls.rb:129:48:129:59 | call to capitalize |
|
||||
| calls.rb:131:1:131:7 | call to [] |
|
||||
| calls.rb:133:1:133:7 | call to [] |
|
||||
| calls.rb:133:28:133:39 | call to capitalize |
|
||||
| calls.rb:135:1:135:8 | call to [] |
|
||||
| calls.rb:135:4:135:5 | - ... |
|
||||
| calls.rb:135:32:135:36 | call to abs |
|
||||
| hello.rb:20:16:20:26 | ... + ... |
|
||||
| hello.rb:20:16:20:34 | ... + ... |
|
||||
| hello.rb:20:16:20:40 | ... + ... |
|
||||
| private.rb:24:1:24:14 | call to private1 |
|
||||
| private.rb:25:1:25:14 | call to private2 |
|
||||
| private.rb:26:1:26:14 | call to private3 |
|
||||
|
||||
Reference in New Issue
Block a user