mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02:00
Desugar compound assignments
This commit is contained in:
@@ -752,31 +752,25 @@ class HashLiteral extends Literal, THashLiteral {
|
||||
* ```
|
||||
*/
|
||||
class RangeLiteral extends Literal, TRangeLiteral {
|
||||
private Generated::Range g;
|
||||
|
||||
RangeLiteral() { this = TRangeLiteral(g) }
|
||||
|
||||
final override string getAPrimaryQlClass() { result = "RangeLiteral" }
|
||||
|
||||
/** Gets the begin expression of this range, if any. */
|
||||
final Expr getBegin() { toGenerated(result) = g.getBegin() }
|
||||
Expr getBegin() { none() }
|
||||
|
||||
/** Gets the end expression of this range, if any. */
|
||||
final Expr getEnd() { toGenerated(result) = g.getEnd() }
|
||||
Expr getEnd() { none() }
|
||||
|
||||
/**
|
||||
* Holds if the range is inclusive of the end value, i.e. uses the `..`
|
||||
* operator.
|
||||
*/
|
||||
final predicate isInclusive() { g instanceof @range_dotdot }
|
||||
predicate isInclusive() { none() }
|
||||
|
||||
/**
|
||||
* Holds if the range is exclusive of the end value, i.e. uses the `...`
|
||||
* operator.
|
||||
*/
|
||||
final predicate isExclusive() { g instanceof @range_dotdotdot }
|
||||
|
||||
final override string toString() { result = "_ " + g.getOperator() + " _" }
|
||||
predicate isExclusive() { none() }
|
||||
|
||||
final override AstNode getAChild(string pred) {
|
||||
result = super.getAChild(pred)
|
||||
@@ -785,6 +779,44 @@ class RangeLiteral extends Literal, TRangeLiteral {
|
||||
or
|
||||
pred = "getEnd" and result = this.getEnd()
|
||||
}
|
||||
|
||||
final override string toString() {
|
||||
exists(string op |
|
||||
this.isInclusive() and op = ".."
|
||||
or
|
||||
this.isExclusive() and op = "..."
|
||||
|
|
||||
result = "_ " + op + " _"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private class RangeLiteralReal extends RangeLiteral, TRangeLiteralReal {
|
||||
private Generated::Range g;
|
||||
|
||||
RangeLiteralReal() { this = TRangeLiteralReal(g) }
|
||||
|
||||
final override Expr getBegin() { toGenerated(result) = g.getBegin() }
|
||||
|
||||
final override Expr getEnd() { toGenerated(result) = g.getEnd() }
|
||||
|
||||
final override predicate isInclusive() { g instanceof @range_dotdot }
|
||||
|
||||
final override predicate isExclusive() { g instanceof @range_dotdotdot }
|
||||
}
|
||||
|
||||
private class RangeLiteralSynth extends RangeLiteral, TRangeLiteralSynth {
|
||||
private boolean inclusive;
|
||||
|
||||
RangeLiteralSynth() { this = TRangeLiteralSynth(_, _, inclusive) }
|
||||
|
||||
final override Expr getBegin() { result = TIntegerLiteralSynth(this, 0, _) }
|
||||
|
||||
final override Expr getEnd() { result = TIntegerLiteralSynth(this, 1, _) }
|
||||
|
||||
final override predicate isInclusive() { inclusive = true }
|
||||
|
||||
final override predicate isExclusive() { inclusive = false }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -91,12 +91,8 @@ class UnaryMinusExpr extends UnaryArithmeticOperation, TUnaryMinusExpr {
|
||||
* foo(*args)
|
||||
* ```
|
||||
*/
|
||||
class SplatExpr extends UnaryOperation, TSplatArgument {
|
||||
private Generated::SplatArgument g;
|
||||
|
||||
SplatExpr() { this = TSplatArgument(g) }
|
||||
|
||||
final override Expr getOperand() { toGenerated(result) = g.getChild() }
|
||||
class SplatExpr extends UnaryOperation, TSplatExpr {
|
||||
final override Expr getOperand() { result = this.(SplatExprImpl).getOperandImpl() }
|
||||
|
||||
final override string getOperator() { result = "*" }
|
||||
|
||||
@@ -109,10 +105,10 @@ class SplatExpr extends UnaryOperation, TSplatArgument {
|
||||
* foo(**options)
|
||||
* ```
|
||||
*/
|
||||
class HashSplatExpr extends UnaryOperation, THashSplatArgument {
|
||||
class HashSplatExpr extends UnaryOperation, THashSplatExpr {
|
||||
private Generated::HashSplatArgument g;
|
||||
|
||||
HashSplatExpr() { this = THashSplatArgument(g) }
|
||||
HashSplatExpr() { this = THashSplatExpr(g) }
|
||||
|
||||
final override Expr getOperand() { toGenerated(result) = g.getChild() }
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
private import codeql_ruby.AST
|
||||
private import codeql.Locations
|
||||
private import internal.AST
|
||||
private import internal.Pattern
|
||||
private import internal.TreeSitter
|
||||
private import internal.Variable
|
||||
|
||||
@@ -62,20 +63,9 @@ class VariablePattern extends Pattern, LhsExpr, TVariablePattern { }
|
||||
class TuplePattern extends Pattern, TTuplePattern {
|
||||
override string getAPrimaryQlClass() { result = "TuplePattern" }
|
||||
|
||||
private Generated::AstNode getChild(int i) {
|
||||
result = toGenerated(this).(Generated::DestructuredParameter).getChild(i)
|
||||
or
|
||||
result = toGenerated(this).(Generated::DestructuredLeftAssignment).getChild(i)
|
||||
or
|
||||
toGenerated(this) =
|
||||
any(Generated::LeftAssignmentList lal |
|
||||
if
|
||||
strictcount(int j | exists(lal.getChild(j))) = 1 and
|
||||
lal.getChild(0) instanceof Generated::DestructuredLeftAssignment
|
||||
then result = lal.getChild(0).(Generated::DestructuredLeftAssignment).getChild(i)
|
||||
else result = lal.getChild(i)
|
||||
)
|
||||
}
|
||||
private TuplePatternImpl getImpl() { result = toGenerated(this) }
|
||||
|
||||
private Generated::AstNode getChild(int i) { result = this.getImpl().getChildNode(i) }
|
||||
|
||||
/** Gets the `i`th pattern in this tuple pattern. */
|
||||
final Pattern getElement(int i) {
|
||||
@@ -96,9 +86,7 @@ class TuplePattern extends Pattern, TTuplePattern {
|
||||
* a, b, *rest, c, d = value
|
||||
* ```
|
||||
*/
|
||||
final int getRestIndex() {
|
||||
result = unique(int i | getChild(i) instanceof Generated::RestAssignment)
|
||||
}
|
||||
final int getRestIndex() { result = this.getImpl().getRestIndex() }
|
||||
|
||||
override Variable getAVariable() { result = this.getElement(_).getAVariable() }
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ private module Cached {
|
||||
} or
|
||||
THashKeySymbolLiteral(Generated::HashKeySymbol g) or
|
||||
THashLiteral(Generated::Hash g) or
|
||||
THashSplatArgument(Generated::HashSplatArgument g) or
|
||||
THashSplatExpr(Generated::HashSplatArgument g) or
|
||||
THashSplatParameter(Generated::HashSplatParameter g) or
|
||||
THereDoc(Generated::HeredocBeginning g) or
|
||||
TIdentifierMethodCall(Generated::Identifier g) { isIdentifierMethodCall(g) } or
|
||||
@@ -198,7 +198,10 @@ private module Cached {
|
||||
TParenthesizedExpr(Generated::ParenthesizedStatements g) or
|
||||
TRShiftExprReal(Generated::Binary g) { g instanceof @binary_ranglerangle } or
|
||||
TRShiftExprSynth(AST::AstNode parent, int i) { mkSynthChild(RShiftExprKind(), parent, i) } or
|
||||
TRangeLiteral(Generated::Range g) or
|
||||
TRangeLiteralReal(Generated::Range g) or
|
||||
TRangeLiteralSynth(AST::AstNode parent, int i, boolean inclusive) {
|
||||
mkSynthChild(RangeLiteralKind(inclusive), parent, i)
|
||||
} or
|
||||
TRationalLiteral(Generated::Rational g) or
|
||||
TRedoStmt(Generated::Redo g) or
|
||||
TRegexLiteral(Generated::Regex g) or
|
||||
@@ -232,7 +235,8 @@ private module Cached {
|
||||
TSingletonClass(Generated::SingletonClass g) or
|
||||
TSingletonMethod(Generated::SingletonMethod g) or
|
||||
TSpaceshipExpr(Generated::Binary g) { g instanceof @binary_langleequalrangle } or
|
||||
TSplatArgument(Generated::SplatArgument g) or
|
||||
TSplatExprReal(Generated::SplatArgument g) or
|
||||
TSplatExprSynth(AST::AstNode parent, int i) { mkSynthChild(SplatExprKind(), parent, i) } or
|
||||
TSplatParameter(Generated::SplatParameter g) or
|
||||
TStmtSequenceSynth(AST::AstNode parent, int i) { mkSynthChild(StmtSequenceKind(), parent, i) } or
|
||||
TStringArrayLiteral(Generated::StringArray g) or
|
||||
@@ -337,7 +341,7 @@ private module Cached {
|
||||
n = TGlobalVariableAccessReal(result, _) or
|
||||
n = THashKeySymbolLiteral(result) or
|
||||
n = THashLiteral(result) or
|
||||
n = THashSplatArgument(result) or
|
||||
n = THashSplatExpr(result) or
|
||||
n = THashSplatParameter(result) or
|
||||
n = THereDoc(result) or
|
||||
n = TIdentifierMethodCall(result) or
|
||||
@@ -367,7 +371,7 @@ private module Cached {
|
||||
n = TPair(result) or
|
||||
n = TParenthesizedExpr(result) or
|
||||
n = TRShiftExprReal(result) or
|
||||
n = TRangeLiteral(result) or
|
||||
n = TRangeLiteralReal(result) or
|
||||
n = TRationalLiteral(result) or
|
||||
n = TRedoStmt(result) or
|
||||
n = TRegexLiteral(result) or
|
||||
@@ -388,7 +392,7 @@ private module Cached {
|
||||
n = TSingletonClass(result) or
|
||||
n = TSingletonMethod(result) or
|
||||
n = TSpaceshipExpr(result) or
|
||||
n = TSplatArgument(result) or
|
||||
n = TSplatExprReal(result) or
|
||||
n = TSplatParameter(result) or
|
||||
n = TStringArrayLiteral(result) or
|
||||
n = TStringConcatenation(result) or
|
||||
@@ -458,10 +462,14 @@ private module Cached {
|
||||
or
|
||||
result = TMulExprSynth(parent, i)
|
||||
or
|
||||
result = TRangeLiteralSynth(parent, i, _)
|
||||
or
|
||||
result = TRShiftExprSynth(parent, i)
|
||||
or
|
||||
result = TSelfSynth(parent, i)
|
||||
or
|
||||
result = TSplatExprSynth(parent, i)
|
||||
or
|
||||
result = TStmtSequenceSynth(parent, i)
|
||||
or
|
||||
result = TSubExprSynth(parent, i)
|
||||
@@ -493,18 +501,11 @@ private module Cached {
|
||||
)
|
||||
}
|
||||
|
||||
private Location synthLocation(AST::AstNode n) {
|
||||
exists(Synthesis s, AST::AstNode parent, int i |
|
||||
s.child(parent, i, _, SomeLocation(result)) and
|
||||
n = getSynthChild(parent, i)
|
||||
)
|
||||
}
|
||||
|
||||
cached
|
||||
Location getLocation(AST::AstNode n) {
|
||||
result = synthLocation(n)
|
||||
synthLocation(n, result)
|
||||
or
|
||||
not exists(synthLocation(n)) and
|
||||
not synthLocation(n, _) and
|
||||
result = toGeneratedInclSynth(n).getLocation()
|
||||
}
|
||||
}
|
||||
@@ -538,9 +539,10 @@ class TSelf = TSelfReal or TSelfSynth;
|
||||
|
||||
class TExpr =
|
||||
TSelf or TArgumentList or TRescueClause or TRescueModifierExpr or TPair or TStringConcatenation or
|
||||
TCall or TBlockArgument or TSplatArgument or THashSplatArgument or TConstantAccess or
|
||||
TControlExpr or TWhenExpr or TLiteral or TCallable or TVariableAccess or TStmtSequence or
|
||||
TOperation or TSimpleParameter;
|
||||
TCall or TBlockArgument or TConstantAccess or TControlExpr or TWhenExpr or TLiteral or
|
||||
TCallable or TVariableAccess or TStmtSequence or TOperation or TSimpleParameter;
|
||||
|
||||
class TSplatExpr = TSplatExprReal or TSplatExprSynth;
|
||||
|
||||
class TStmtSequence =
|
||||
TBeginBlock or TEndBlock or TThen or TElse or TDo or TEnsure or TStringInterpolationComponent or
|
||||
@@ -586,7 +588,7 @@ class TOperation = TUnaryOperation or TBinaryOperation or TAssignment;
|
||||
|
||||
class TUnaryOperation =
|
||||
TUnaryLogicalOperation or TUnaryArithmeticOperation or TUnaryBitwiseOperation or TDefinedExpr or
|
||||
TSplatArgument or THashSplatArgument;
|
||||
TSplatExpr or THashSplatExpr;
|
||||
|
||||
class TUnaryLogicalOperation = TNotExpr;
|
||||
|
||||
@@ -624,6 +626,8 @@ class TBinaryBitwiseOperation =
|
||||
|
||||
class TLShiftExpr = TLShiftExprReal or TLShiftExprSynth;
|
||||
|
||||
class TRangeLiteral = TRangeLiteralReal or TRangeLiteralSynth;
|
||||
|
||||
class TRShiftExpr = TRShiftExprReal or TRShiftExprSynth;
|
||||
|
||||
class TBitwiseAndExpr = TBitwiseAndExprReal or TBitwiseAndExprSynth;
|
||||
|
||||
@@ -29,3 +29,19 @@ class AssignOperationImpl extends AssignmentImpl, AssignOperation {
|
||||
|
||||
final override AstNode getRightOperandImpl() { toGenerated(result) = g.getRight() }
|
||||
}
|
||||
|
||||
abstract class SplatExprImpl extends SplatExpr {
|
||||
abstract Expr getOperandImpl();
|
||||
}
|
||||
|
||||
class SplatExprReal extends SplatExprImpl, TSplatExprReal {
|
||||
private Generated::SplatArgument g;
|
||||
|
||||
SplatExprReal() { this = TSplatExprReal(g) }
|
||||
|
||||
final override Expr getOperandImpl() { toGenerated(result) = g.getChild() }
|
||||
}
|
||||
|
||||
class SplatExprSynth extends SplatExprImpl, TSplatExprSynth {
|
||||
final override Expr getOperandImpl() { synthChild(this, 0, result) }
|
||||
}
|
||||
|
||||
32
ql/src/codeql_ruby/ast/internal/Pattern.qll
Normal file
32
ql/src/codeql_ruby/ast/internal/Pattern.qll
Normal file
@@ -0,0 +1,32 @@
|
||||
private import codeql_ruby.AST
|
||||
private import AST
|
||||
private import TreeSitter
|
||||
|
||||
abstract class TuplePatternImpl extends Generated::AstNode {
|
||||
abstract Generated::AstNode getChildNode(int i);
|
||||
|
||||
final int getRestIndex() {
|
||||
result = unique(int i | this.getChildNode(i) instanceof Generated::RestAssignment)
|
||||
}
|
||||
}
|
||||
|
||||
class TuplePatternParameterImpl extends TuplePatternImpl, Generated::DestructuredParameter {
|
||||
override Generated::AstNode getChildNode(int i) { result = this.getChild(i) }
|
||||
}
|
||||
|
||||
class DestructuredLeftAssignmentImpl extends TuplePatternImpl, Generated::DestructuredLeftAssignment {
|
||||
override Generated::AstNode getChildNode(int i) { result = this.getChild(i) }
|
||||
}
|
||||
|
||||
class LeftAssignmentListImpl extends TuplePatternImpl, Generated::LeftAssignmentList {
|
||||
override Generated::AstNode getChildNode(int i) {
|
||||
this =
|
||||
any(Generated::LeftAssignmentList lal |
|
||||
if
|
||||
strictcount(int j | exists(lal.getChild(j))) = 1 and
|
||||
lal.getChild(0) instanceof Generated::DestructuredLeftAssignment
|
||||
then result = lal.getChild(0).(Generated::DestructuredLeftAssignment).getChild(i)
|
||||
else result = lal.getChild(i)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ private import AST
|
||||
private import TreeSitter
|
||||
private import codeql_ruby.ast.internal.Call
|
||||
private import codeql_ruby.ast.internal.Variable
|
||||
private import codeql_ruby.ast.internal.Pattern
|
||||
private import codeql_ruby.AST
|
||||
|
||||
/** A synthesized AST node kind. */
|
||||
@@ -18,7 +19,7 @@ newtype SynthKind =
|
||||
ExponentExprKind() or
|
||||
GlobalVariableAccessKind(GlobalVariable v) or
|
||||
InstanceVariableAccessKind(InstanceVariable v) or
|
||||
IntegerLiteralKind(int i) { i in [0 .. 1000] } or
|
||||
IntegerLiteralKind(int i) { i in [-1000 .. 1000] } or
|
||||
LShiftExprKind() or
|
||||
LocalVariableAccessRealKind(LocalVariableReal v) or
|
||||
LocalVariableAccessSynthKind(TLocalVariableSynth v) or
|
||||
@@ -29,7 +30,9 @@ newtype SynthKind =
|
||||
} or
|
||||
ModuloExprKind() or
|
||||
MulExprKind() or
|
||||
RangeLiteralKind(boolean inclusive) { inclusive in [false, true] } or
|
||||
RShiftExprKind() or
|
||||
SplatExprKind() or
|
||||
StmtSequenceKind() or
|
||||
SelfKind() or
|
||||
SubExprKind()
|
||||
@@ -118,8 +121,18 @@ private predicate assign(
|
||||
)
|
||||
}
|
||||
|
||||
/** Holds if synthesized node `n` should have location `l`. */
|
||||
predicate synthLocation(AstNode n, Location l) {
|
||||
exists(Synthesis s, AstNode parent, int i |
|
||||
s.child(parent, i, _, SomeLocation(l)) and
|
||||
n = getSynthChild(parent, i)
|
||||
)
|
||||
}
|
||||
|
||||
private SomeLocation getSomeLocation(AstNode n) {
|
||||
result = SomeLocation(toGenerated(n).getLocation())
|
||||
or
|
||||
result = SomeLocation(any(Location l | synthLocation(n, l)))
|
||||
}
|
||||
|
||||
private module ImplicitSelfSynthesis {
|
||||
@@ -550,3 +563,159 @@ private module AssignOperationDesugar {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private module CompoundAssignDesugar {
|
||||
/** An assignment where the left-hand side is a tuple pattern. */
|
||||
private class TupleAssignExpr extends AssignExpr {
|
||||
private TuplePattern tp;
|
||||
|
||||
pragma[nomagic]
|
||||
TupleAssignExpr() { tp = this.getLeftOperand() }
|
||||
|
||||
TuplePattern getTuplePattern() { result = tp }
|
||||
|
||||
pragma[nomagic]
|
||||
Pattern getElement(int i) { result = tp.getElement(i) }
|
||||
|
||||
pragma[nomagic]
|
||||
int getNumberOfElements() {
|
||||
toGenerated(tp) = any(TuplePatternImpl impl | result = count(impl.getChildNode(_)))
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
int getRestIndexOrNumberOfElements() {
|
||||
result = tp.getRestIndex()
|
||||
or
|
||||
toGenerated(tp) = any(TuplePatternImpl impl | not exists(impl.getRestIndex())) and
|
||||
result = this.getNumberOfElements()
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
SomeLocation getRightOperandLocation() { result = getSomeLocation(this.getRightOperand()) }
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
private predicate compoundAssignSynthesis(AstNode parent, int i, Child child, LocationOption l) {
|
||||
exists(TupleAssignExpr tae |
|
||||
parent = tae and
|
||||
i = -1 and
|
||||
child = SynthChild(StmtSequenceKind()) and
|
||||
l = NoneLocation()
|
||||
or
|
||||
exists(AstNode seq | seq = TStmtSequenceSynth(tae, -1) |
|
||||
parent = seq and
|
||||
i = 0 and
|
||||
child = SynthChild(AssignExprKind()) and
|
||||
l = tae.getRightOperandLocation()
|
||||
or
|
||||
exists(AstNode assign | assign = TAssignExprSynth(seq, 0) |
|
||||
parent = assign and
|
||||
i = 0 and
|
||||
child = SynthChild(LocalVariableAccessSynthKind(TLocalVariableSynth(tae, 0))) and
|
||||
l = tae.getRightOperandLocation()
|
||||
or
|
||||
parent = assign and
|
||||
i = 1 and
|
||||
child = SynthChild(SplatExprKind()) and
|
||||
l = tae.getRightOperandLocation()
|
||||
or
|
||||
parent = TSplatExprSynth(assign, 1) and
|
||||
i = 0 and
|
||||
child = RealChild(tae.getRightOperand()) and
|
||||
l = NoneLocation()
|
||||
)
|
||||
or
|
||||
exists(Pattern p, int j, int restIndex |
|
||||
p = tae.getElement(j) and
|
||||
restIndex = tae.getRestIndexOrNumberOfElements()
|
||||
|
|
||||
parent = seq and
|
||||
i = j + 1 and
|
||||
child = SynthChild(AssignExprKind()) and
|
||||
l = getSomeLocation(p)
|
||||
or
|
||||
exists(AstNode assign | assign = TAssignExprSynth(seq, j + 1) |
|
||||
parent = assign and
|
||||
i = 0 and
|
||||
child = RealChild(p) and
|
||||
l = NoneLocation()
|
||||
or
|
||||
parent = assign and
|
||||
i = 1 and
|
||||
child = SynthChild(MethodCallKind("[]", false, 1)) and
|
||||
l = getSomeLocation(p)
|
||||
or
|
||||
l = getSomeLocation(p) and
|
||||
(
|
||||
parent = TMethodCallSynth(assign, 1, _, _, _) and
|
||||
i = 0 and
|
||||
child = SynthChild(LocalVariableAccessSynthKind(TLocalVariableSynth(tae, 0)))
|
||||
or
|
||||
j < restIndex and
|
||||
parent = TMethodCallSynth(assign, 1, _, _, _) and
|
||||
i = 1 and
|
||||
child = SynthChild(IntegerLiteralKind(j))
|
||||
or
|
||||
j = restIndex and
|
||||
(
|
||||
parent = TMethodCallSynth(assign, 1, _, _, _) and
|
||||
i = 1 and
|
||||
child = SynthChild(RangeLiteralKind(true))
|
||||
or
|
||||
exists(AstNode call |
|
||||
call = TMethodCallSynth(assign, 1, _, _, _) and
|
||||
parent = TRangeLiteralSynth(call, 1, _)
|
||||
|
|
||||
i = 0 and
|
||||
child = SynthChild(IntegerLiteralKind(j))
|
||||
or
|
||||
i = 1 and
|
||||
child = SynthChild(IntegerLiteralKind(restIndex - tae.getNumberOfElements()))
|
||||
)
|
||||
)
|
||||
or
|
||||
j > restIndex and
|
||||
parent = TMethodCallSynth(assign, 1, _, _, _) and
|
||||
i = 1 and
|
||||
child = SynthChild(IntegerLiteralKind(j - tae.getNumberOfElements()))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* ```rb
|
||||
* x, *y, z = w
|
||||
* ```
|
||||
* desguars to
|
||||
*
|
||||
* ```rb
|
||||
* __synth__0 = *w;
|
||||
* x = __synth__0[0];
|
||||
* y = __synth__0[1..-2];
|
||||
* z = __synth__0[-1];
|
||||
* ```
|
||||
*/
|
||||
private class CompoundAssignSynthesis extends Synthesis {
|
||||
final override predicate child(AstNode parent, int i, Child child, LocationOption l) {
|
||||
compoundAssignSynthesis(parent, i, child, l)
|
||||
}
|
||||
|
||||
final override predicate localVariable(AstNode n, int i) {
|
||||
n instanceof TupleAssignExpr and
|
||||
i = 0
|
||||
}
|
||||
|
||||
final override predicate methodCall(string name, boolean setter, int arity) {
|
||||
name = "[]" and
|
||||
setter = false and
|
||||
arity = 1
|
||||
}
|
||||
|
||||
final override predicate excludeFromControlFlowTree(AstNode n) {
|
||||
n = any(TupleAssignExpr tae).getTuplePattern()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,7 +287,12 @@ module Trees {
|
||||
}
|
||||
|
||||
private class AssignExprTree extends StandardPostOrderTree, AssignExpr {
|
||||
AssignExprTree() { not this.getLeftOperand() instanceof MethodCall }
|
||||
AssignExprTree() {
|
||||
exists(Expr left | left = this.getLeftOperand() |
|
||||
left instanceof VariableAccess or
|
||||
left instanceof ConstantAccess
|
||||
)
|
||||
}
|
||||
|
||||
final override ControlFlowTree getChildNode(int i) {
|
||||
result = this.getLeftOperand() and i = 0
|
||||
|
||||
@@ -31,6 +31,82 @@ calls/calls.rb:
|
||||
# 315| getAnOperand/getRightOperand: [IntegerLiteral] 10
|
||||
# 315| getArgument: [IntegerLiteral] 0
|
||||
# 315| getStmt: [LocalVariableAccess] __synth__0
|
||||
# 316| [AssignExpr] ... = ...
|
||||
# 316| getDesugared: [StmtSequence] ...
|
||||
# 316| getStmt: [AssignExpr] ... = ...
|
||||
# 316| getAnOperand/getLeftOperand: [MethodCall] call to foo
|
||||
# 316| getDesugared: [StmtSequence] ...
|
||||
# 316| getStmt: [SetterMethodCall] call to foo=
|
||||
# 316| getReceiver: [Self] self
|
||||
# 316| getArgument: [AssignExpr] ... = ...
|
||||
# 316| getAnOperand/getRightOperand: [MethodCall] call to []
|
||||
# 316| getArgument: [IntegerLiteral] 0
|
||||
# 316| getReceiver: [LocalVariableAccess] __synth__0
|
||||
# 316| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__0
|
||||
# 316| getStmt: [LocalVariableAccess] __synth__0
|
||||
# 316| getStmt: [AssignExpr] ... = ...
|
||||
# 316| getDesugared: [StmtSequence] ...
|
||||
# 316| getStmt: [SetterMethodCall] call to bar=
|
||||
# 316| getReceiver: [Self] self
|
||||
# 316| getArgument: [AssignExpr] ... = ...
|
||||
# 316| getAnOperand/getRightOperand: [MethodCall] call to []
|
||||
# 316| getArgument: [RangeLiteral] _ .. _
|
||||
# 316| getBegin: [IntegerLiteral] 1
|
||||
# 316| getEnd: [IntegerLiteral] -2
|
||||
# 316| getReceiver: [LocalVariableAccess] __synth__0
|
||||
# 316| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__0
|
||||
# 316| getStmt: [LocalVariableAccess] __synth__0
|
||||
# 316| getAnOperand/getLeftOperand: [MethodCall] call to bar
|
||||
# 316| getStmt: [AssignExpr] ... = ...
|
||||
# 316| getDesugared: [StmtSequence] ...
|
||||
# 316| getStmt: [SetterMethodCall] call to []=
|
||||
# 316| getReceiver: [MethodCall] call to foo
|
||||
# 316| getReceiver: [Self] self
|
||||
# 316| getArgument: [AssignExpr] ... = ...
|
||||
# 316| getAnOperand/getRightOperand: [MethodCall] call to []
|
||||
# 316| getArgument: [IntegerLiteral] -1
|
||||
# 316| getReceiver: [LocalVariableAccess] __synth__0
|
||||
# 316| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__0
|
||||
# 316| getArgument: [IntegerLiteral] 4
|
||||
# 316| getStmt: [LocalVariableAccess] __synth__0
|
||||
# 316| getAnOperand/getLeftOperand: [ElementReference] ...[...]
|
||||
# 316| getStmt: [AssignExpr] ... = ...
|
||||
# 316| getAnOperand/getRightOperand: [SplatExpr] * ...
|
||||
# 316| getAnOperand/getOperand: [ArrayLiteral] [...]
|
||||
# 316| getElement: [IntegerLiteral] 1
|
||||
# 316| getElement: [IntegerLiteral] 2
|
||||
# 316| getElement: [IntegerLiteral] 3
|
||||
# 316| getElement: [IntegerLiteral] 4
|
||||
# 316| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__0
|
||||
# 317| [AssignExpr] ... = ...
|
||||
# 317| getDesugared: [StmtSequence] ...
|
||||
# 317| getStmt: [AssignExpr] ... = ...
|
||||
# 317| getAnOperand/getLeftOperand: [LocalVariableAccess] a
|
||||
# 317| getAnOperand/getRightOperand: [MethodCall] call to []
|
||||
# 317| getArgument: [IntegerLiteral] 0
|
||||
# 317| getReceiver: [LocalVariableAccess] __synth__0
|
||||
# 317| getStmt: [AssignExpr] ... = ...
|
||||
# 317| getDesugared: [StmtSequence] ...
|
||||
# 317| getStmt: [SetterMethodCall] call to []=
|
||||
# 317| getReceiver: [MethodCall] call to foo
|
||||
# 317| getReceiver: [Self] self
|
||||
# 317| getArgument: [AssignExpr] ... = ...
|
||||
# 317| getAnOperand/getRightOperand: [MethodCall] call to []
|
||||
# 317| getArgument: [RangeLiteral] _ .. _
|
||||
# 317| getBegin: [IntegerLiteral] 1
|
||||
# 317| getEnd: [IntegerLiteral] -1
|
||||
# 317| getReceiver: [LocalVariableAccess] __synth__0
|
||||
# 317| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__0
|
||||
# 317| getArgument: [IntegerLiteral] 5
|
||||
# 317| getStmt: [LocalVariableAccess] __synth__0
|
||||
# 317| getAnOperand/getLeftOperand: [ElementReference] ...[...]
|
||||
# 317| getStmt: [AssignExpr] ... = ...
|
||||
# 317| getAnOperand/getRightOperand: [SplatExpr] * ...
|
||||
# 317| getAnOperand/getOperand: [ArrayLiteral] [...]
|
||||
# 317| getElement: [IntegerLiteral] 1
|
||||
# 317| getElement: [IntegerLiteral] 2
|
||||
# 317| getElement: [IntegerLiteral] 3
|
||||
# 317| getAnOperand/getLeftOperand: [LocalVariableAccess] __synth__0
|
||||
# 318| [AssignAddExpr] ... += ...
|
||||
# 318| getDesugared: [StmtSequence] ...
|
||||
# 318| getStmt: [AssignExpr] ... = ...
|
||||
|
||||
@@ -4,6 +4,8 @@ blockArguments
|
||||
splatExpr
|
||||
| calls.rb:270:5:270:8 | * ... | calls.rb:270:6:270:8 | call to bar |
|
||||
| calls.rb:271:5:271:11 | * ... | calls.rb:271:6:271:11 | call to bar |
|
||||
| calls.rb:316:31:316:42 | * ... | calls.rb:316:31:316:42 | [...] |
|
||||
| calls.rb:317:14:317:22 | * ... | calls.rb:317:14:317:22 | [...] |
|
||||
hashSplatExpr
|
||||
| calls.rb:274:5:274:9 | ** ... | calls.rb:274:7:274:9 | call to bar |
|
||||
| calls.rb:275:5:275:12 | ** ... | calls.rb:275:7:275:12 | call to bar |
|
||||
|
||||
@@ -35,8 +35,19 @@ callsWithArguments
|
||||
| calls.rb:315:1:315:6 | ...[...] | [] | 0 | calls.rb:315:5:315:5 | 0 |
|
||||
| calls.rb:315:1:315:6 | call to []= | []= | 0 | calls.rb:315:5:315:5 | 0 |
|
||||
| calls.rb:315:1:315:6 | call to []= | []= | 1 | calls.rb:315:1:315:6 | ... = ... |
|
||||
| calls.rb:316:1:316:8 | call to [] | [] | 0 | calls.rb:316:1:316:8 | 0 |
|
||||
| calls.rb:316:1:316:8 | call to foo= | foo= | 0 | calls.rb:316:1:316:8 | ... = ... |
|
||||
| calls.rb:316:12:316:19 | call to [] | [] | 0 | calls.rb:316:12:316:19 | _ .. _ |
|
||||
| calls.rb:316:12:316:19 | call to bar= | bar= | 0 | calls.rb:316:12:316:19 | ... = ... |
|
||||
| calls.rb:316:22:316:27 | ...[...] | [] | 0 | calls.rb:316:26:316:26 | 4 |
|
||||
| calls.rb:316:22:316:27 | call to [] | [] | 0 | calls.rb:316:22:316:27 | -1 |
|
||||
| calls.rb:316:22:316:27 | call to []= | []= | 0 | calls.rb:316:26:316:26 | 4 |
|
||||
| calls.rb:316:22:316:27 | call to []= | []= | 1 | calls.rb:316:22:316:27 | ... = ... |
|
||||
| calls.rb:317:1:317:1 | call to [] | [] | 0 | calls.rb:317:1:317:1 | 0 |
|
||||
| calls.rb:317:5:317:10 | ...[...] | [] | 0 | calls.rb:317:9:317:9 | 5 |
|
||||
| calls.rb:317:5:317:10 | call to [] | [] | 0 | calls.rb:317:5:317:10 | _ .. _ |
|
||||
| calls.rb:317:5:317:10 | call to []= | []= | 0 | calls.rb:317:9:317:9 | 5 |
|
||||
| calls.rb:317:5:317:10 | call to []= | []= | 1 | calls.rb:317:5:317:10 | ... = ... |
|
||||
| calls.rb:318:1:318:10 | call to count= | count= | 1 | calls.rb:318:12:318:13 | __synth__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 |
|
||||
@@ -225,12 +236,21 @@ callsWithReceiver
|
||||
| calls.rb:315:1:315:3 | call to foo | calls.rb:315:1:315:3 | self |
|
||||
| calls.rb:315:1:315:6 | ...[...] | calls.rb:315:1:315:3 | call to foo |
|
||||
| calls.rb:315:1:315:6 | call to []= | calls.rb:315:1:315:3 | call to foo |
|
||||
| calls.rb:316:1:316:8 | call to [] | calls.rb:316:1:316:8 | __synth__0 |
|
||||
| calls.rb:316:1:316:8 | call to foo | calls.rb:316:1:316:4 | self |
|
||||
| calls.rb:316:1:316:8 | call to foo= | calls.rb:316:1:316:4 | self |
|
||||
| calls.rb:316:12:316:19 | call to [] | calls.rb:316:12:316:19 | __synth__0 |
|
||||
| calls.rb:316:12:316:19 | call to bar | calls.rb:316:12:316:15 | self |
|
||||
| calls.rb:316:12:316:19 | call to bar= | calls.rb:316:12:316:15 | self |
|
||||
| calls.rb:316:22:316:24 | call to foo | calls.rb:316:22:316:24 | self |
|
||||
| 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: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: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 |
|
||||
@@ -287,6 +307,10 @@ superCallsWithBlock
|
||||
setterCalls
|
||||
| calls.rb:314:1:314:8 | call to foo= |
|
||||
| calls.rb:315:1:315:6 | call to []= |
|
||||
| calls.rb:316:1:316:8 | call to foo= |
|
||||
| calls.rb:316:12:316:19 | call to bar= |
|
||||
| calls.rb:316:22:316:27 | call to []= |
|
||||
| calls.rb:317:5:317:10 | call to []= |
|
||||
| calls.rb:318:1:318:10 | call to count= |
|
||||
| calls.rb:319:1:319:6 | call to []= |
|
||||
| calls.rb:320:1:320:32 | call to []= |
|
||||
|
||||
@@ -870,7 +870,7 @@ cfg.rb:
|
||||
#-----| -> ... ? ... : ...
|
||||
|
||||
# 61| ... = ...
|
||||
#-----| -> x
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 61| C
|
||||
#-----| -> "constant"
|
||||
@@ -878,27 +878,87 @@ cfg.rb:
|
||||
# 61| "constant"
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 62| ... = ...
|
||||
# 62| ...
|
||||
#-----| -> pattern
|
||||
|
||||
# 62| (..., ...)
|
||||
#-----| -> 1
|
||||
# 62| ...
|
||||
#-----| -> ...
|
||||
|
||||
# 62| x
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 62| ... = ...
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 62| call to []
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 62| 0
|
||||
#-----| -> call to []
|
||||
|
||||
# 62| __synth__0
|
||||
#-----| -> 0
|
||||
|
||||
# 62| call to []
|
||||
#-----| -> * ...
|
||||
|
||||
# 62| 1
|
||||
#-----| -> call to []
|
||||
|
||||
# 62| __synth__0
|
||||
#-----| -> 1
|
||||
|
||||
# 62| ... = ...
|
||||
#-----| -> y
|
||||
|
||||
# 62| (..., ...)
|
||||
#-----| -> (..., ...)
|
||||
# 62| * ...
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 62| __synth__0
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 62| y
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 62| ... = ...
|
||||
#-----| -> z
|
||||
|
||||
# 62| call to []
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 62| 0
|
||||
#-----| -> call to []
|
||||
|
||||
# 62| __synth__0
|
||||
#-----| -> 0
|
||||
|
||||
# 62| z
|
||||
#-----| -> (..., ...)
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 62| ... = ...
|
||||
#-----| -> ...
|
||||
|
||||
# 62| call to []
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 62| 1
|
||||
#-----| -> call to []
|
||||
|
||||
# 62| __synth__0
|
||||
#-----| -> 1
|
||||
|
||||
# 62| [...]
|
||||
#-----| -> * ...
|
||||
|
||||
# 62| ... = ...
|
||||
#-----| -> x
|
||||
|
||||
# 62| * ...
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 62| __synth__0
|
||||
#-----| -> 1
|
||||
|
||||
# 62| 1
|
||||
#-----| -> 2
|
||||
|
||||
@@ -1514,8 +1574,8 @@ cfg.rb:
|
||||
#-----| -> ... rescue ...
|
||||
|
||||
# 136| ... / ...
|
||||
#-----| -> init
|
||||
#-----| raise -> self
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 136| 1
|
||||
#-----| -> 0
|
||||
@@ -1527,7 +1587,7 @@ cfg.rb:
|
||||
#-----| -> ... / ...
|
||||
|
||||
# 136| call to puts
|
||||
#-----| -> init
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 136| self
|
||||
#-----| -> "div by zero"
|
||||
@@ -1535,26 +1595,62 @@ cfg.rb:
|
||||
# 136| "div by zero"
|
||||
#-----| -> call to puts
|
||||
|
||||
# 138| ... = ...
|
||||
# 138| ...
|
||||
#-----| -> M
|
||||
|
||||
# 138| (..., ...)
|
||||
#-----| -> 1
|
||||
|
||||
# 138| init
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 138| ... = ...
|
||||
#-----| -> last
|
||||
|
||||
# 138| call to []
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 138| _ .. _
|
||||
#-----| -> call to []
|
||||
|
||||
# 138| __synth__0
|
||||
#-----| -> 0
|
||||
|
||||
# 138| 0
|
||||
#-----| -> -2
|
||||
|
||||
# 138| -2
|
||||
#-----| -> _ .. _
|
||||
|
||||
# 138| last
|
||||
#-----| -> (..., ...)
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 138| ... = ...
|
||||
#-----| -> ...
|
||||
|
||||
# 138| call to []
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 138| -1
|
||||
#-----| -> call to []
|
||||
|
||||
# 138| __synth__0
|
||||
#-----| -> -1
|
||||
|
||||
# 138| 1
|
||||
#-----| -> 2
|
||||
|
||||
# 138| ... = ...
|
||||
#-----| -> init
|
||||
|
||||
# 138| * ...
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 138| __synth__0
|
||||
#-----| -> 1
|
||||
|
||||
# 138| 2
|
||||
#-----| -> 3
|
||||
|
||||
# 138| 3
|
||||
#-----| -> ... = ...
|
||||
#-----| -> * ...
|
||||
|
||||
# 140| M
|
||||
#-----| -> Constant
|
||||
@@ -2370,7 +2466,7 @@ desugar.rb:
|
||||
#-----| -> ... + ...
|
||||
|
||||
# 21| enter m6
|
||||
#-----| -> x
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 21| m6
|
||||
#-----| -> m7
|
||||
@@ -2380,30 +2476,87 @@ desugar.rb:
|
||||
# 21| exit m6 (normal)
|
||||
#-----| -> exit m6
|
||||
|
||||
# 22| ... = ...
|
||||
# 22| x
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 22| ...
|
||||
#-----| -> exit m6 (normal)
|
||||
|
||||
# 22| (..., ...)
|
||||
#-----| -> 1
|
||||
|
||||
# 22| x
|
||||
# 22| ... = ...
|
||||
#-----| -> y
|
||||
|
||||
# 22| call to []
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 22| 0
|
||||
#-----| -> call to []
|
||||
|
||||
# 22| ...
|
||||
#-----| -> ...
|
||||
|
||||
# 22| __synth__0
|
||||
#-----| -> 0
|
||||
|
||||
# 22| y
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 22| ... = ...
|
||||
#-----| -> self
|
||||
|
||||
# 22| call to bar
|
||||
#-----| -> (..., ...)
|
||||
# 22| call to []
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 22| _ .. _
|
||||
#-----| -> call to []
|
||||
|
||||
# 22| __synth__0
|
||||
#-----| -> 1
|
||||
|
||||
# 22| 1
|
||||
#-----| -> -2
|
||||
|
||||
# 22| -2
|
||||
#-----| -> _ .. _
|
||||
|
||||
# 22| call to z
|
||||
#-----| -> call to bar
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 22| self
|
||||
#-----| -> call to z
|
||||
|
||||
# 22| [...]
|
||||
# 22| call to []
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 22| -1
|
||||
#-----| -> call to []
|
||||
|
||||
# 22| __synth__0
|
||||
#-----| -> -1
|
||||
|
||||
# 22| call to bar=
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 22| __synth__0
|
||||
#-----| -> ...
|
||||
|
||||
# 22| ... = ...
|
||||
#-----| -> call to bar=
|
||||
|
||||
# 22| __synth__0
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 22| [...]
|
||||
#-----| -> * ...
|
||||
|
||||
# 22| ... = ...
|
||||
#-----| -> x
|
||||
|
||||
# 22| * ...
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 22| __synth__0
|
||||
#-----| -> 1
|
||||
|
||||
# 22| 1
|
||||
#-----| -> 2
|
||||
|
||||
@@ -2417,7 +2570,7 @@ desugar.rb:
|
||||
#-----| -> [...]
|
||||
|
||||
# 25| enter m7
|
||||
#-----| -> x
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 25| m7
|
||||
#-----| -> @x
|
||||
@@ -2427,27 +2580,87 @@ desugar.rb:
|
||||
# 25| exit m7 (normal)
|
||||
#-----| -> exit m7
|
||||
|
||||
# 26| ... = ...
|
||||
# 26| x
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 26| ...
|
||||
#-----| -> exit m7 (normal)
|
||||
|
||||
# 26| (..., ...)
|
||||
# 26| ... = ...
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 26| call to []
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 26| 0
|
||||
#-----| -> call to []
|
||||
|
||||
# 26| ...
|
||||
#-----| -> ...
|
||||
|
||||
# 26| __synth__0
|
||||
#-----| -> 0
|
||||
|
||||
# 26| call to []
|
||||
#-----| -> * ...
|
||||
|
||||
# 26| 1
|
||||
#-----| -> call to []
|
||||
|
||||
# 26| __synth__0
|
||||
#-----| -> 1
|
||||
|
||||
# 26| x
|
||||
# 26| ... = ...
|
||||
#-----| -> y
|
||||
|
||||
# 26| (..., ...)
|
||||
#-----| -> (..., ...)
|
||||
# 26| * ...
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 26| __synth__0
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 26| y
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 26| ... = ...
|
||||
#-----| -> z
|
||||
|
||||
# 26| call to []
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 26| 0
|
||||
#-----| -> call to []
|
||||
|
||||
# 26| __synth__0
|
||||
#-----| -> 0
|
||||
|
||||
# 26| z
|
||||
#-----| -> (..., ...)
|
||||
#-----| -> __synth__0
|
||||
|
||||
# 26| ... = ...
|
||||
#-----| -> ...
|
||||
|
||||
# 26| call to []
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 26| 1
|
||||
#-----| -> call to []
|
||||
|
||||
# 26| __synth__0
|
||||
#-----| -> 1
|
||||
|
||||
# 26| [...]
|
||||
#-----| -> * ...
|
||||
|
||||
# 26| ... = ...
|
||||
#-----| -> x
|
||||
|
||||
# 26| * ...
|
||||
#-----| -> ... = ...
|
||||
|
||||
# 26| __synth__0
|
||||
#-----| -> 1
|
||||
|
||||
# 26| 1
|
||||
#-----| -> 2
|
||||
|
||||
|
||||
@@ -43,10 +43,12 @@ definition
|
||||
| scopes.rb:7:1:7:5 | ... = ... | scopes.rb:7:1:7:1 | a |
|
||||
| scopes.rb:9:9:18:3 | <captured> | scopes.rb:7:1:7:1 | a |
|
||||
| scopes.rb:11:4:11:9 | ... = ... | scopes.rb:7:1:7:1 | a |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:7:1:7:1 | a |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:13:7:13:7 | b |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:13:11:13:11 | c |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:13:14:13:14 | d |
|
||||
| scopes.rb:13:4:13:4 | ... = ... | scopes.rb:7:1:7:1 | a |
|
||||
| scopes.rb:13:7:13:7 | ... = ... | scopes.rb:13:7:13:7 | b |
|
||||
| scopes.rb:13:10:13:15 | ... = ... | scopes.rb:13:10:13:15 | __synth__0 |
|
||||
| scopes.rb:13:11:13:11 | ... = ... | scopes.rb:13:11:13:11 | c |
|
||||
| scopes.rb:13:14:13:14 | ... = ... | scopes.rb:13:14:13:14 | d |
|
||||
| scopes.rb:13:19:13:32 | ... = ... | scopes.rb:13:4:13:32 | __synth__0 |
|
||||
| scopes.rb:27:1:27:5 | ... = ... | scopes.rb:27:1:27:1 | x |
|
||||
| scopes.rb:42:2:42:9 | ... = ... | scopes.rb:42:2:42:4 | var |
|
||||
| scopes.rb:46:5:46:13 | ... = ... | scopes.rb:46:5:46:8 | var2 |
|
||||
@@ -128,10 +130,15 @@ read
|
||||
| scopes.rb:9:9:18:3 | <captured> | scopes.rb:7:1:7:1 | a | scopes.rb:10:9:10:9 | a |
|
||||
| scopes.rb:9:9:18:3 | <captured> | scopes.rb:7:1:7:1 | a | scopes.rb:11:4:11:4 | a |
|
||||
| scopes.rb:11:4:11:9 | ... = ... | scopes.rb:7:1:7:1 | a | scopes.rb:12:9:12:9 | a |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:7:1:7:1 | a | scopes.rb:14:9:14:9 | a |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:13:7:13:7 | b | scopes.rb:15:9:15:9 | b |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:13:11:13:11 | c | scopes.rb:16:9:16:9 | c |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:13:14:13:14 | d | scopes.rb:17:9:17:9 | d |
|
||||
| scopes.rb:13:4:13:4 | ... = ... | scopes.rb:7:1:7:1 | a | scopes.rb:14:9:14:9 | a |
|
||||
| scopes.rb:13:7:13:7 | ... = ... | scopes.rb:13:7:13:7 | b | scopes.rb:15:9:15:9 | b |
|
||||
| scopes.rb:13:10:13:15 | ... = ... | scopes.rb:13:10:13:15 | __synth__0 | scopes.rb:13:11:13:11 | __synth__0 |
|
||||
| scopes.rb:13:10:13:15 | ... = ... | scopes.rb:13:10:13:15 | __synth__0 | scopes.rb:13:14:13:14 | __synth__0 |
|
||||
| scopes.rb:13:11:13:11 | ... = ... | scopes.rb:13:11:13:11 | c | scopes.rb:16:9:16:9 | c |
|
||||
| scopes.rb:13:14:13:14 | ... = ... | scopes.rb:13:14:13:14 | d | scopes.rb:17:9:17:9 | d |
|
||||
| scopes.rb:13:19:13:32 | ... = ... | scopes.rb:13:4:13:32 | __synth__0 | scopes.rb:13:4:13:4 | __synth__0 |
|
||||
| scopes.rb:13:19:13:32 | ... = ... | scopes.rb:13:4:13:32 | __synth__0 | scopes.rb:13:7:13:7 | __synth__0 |
|
||||
| scopes.rb:13:19:13:32 | ... = ... | scopes.rb:13:4:13:32 | __synth__0 | scopes.rb:13:10:13:15 | __synth__0 |
|
||||
| scopes.rb:27:1:27:5 | ... = ... | scopes.rb:27:1:27:1 | x | scopes.rb:28:8:28:8 | x |
|
||||
| scopes.rb:27:1:27:5 | ... = ... | scopes.rb:27:1:27:1 | x | scopes.rb:31:10:31:10 | x |
|
||||
| scopes.rb:27:1:27:5 | ... = ... | scopes.rb:27:1:27:1 | x | scopes.rb:34:7:34:7 | x |
|
||||
@@ -209,10 +216,12 @@ firstRead
|
||||
| scopes.rb:7:1:7:5 | ... = ... | scopes.rb:7:1:7:1 | a | scopes.rb:8:6:8:6 | a |
|
||||
| scopes.rb:9:9:18:3 | <captured> | scopes.rb:7:1:7:1 | a | scopes.rb:10:9:10:9 | a |
|
||||
| scopes.rb:11:4:11:9 | ... = ... | scopes.rb:7:1:7:1 | a | scopes.rb:12:9:12:9 | a |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:7:1:7:1 | a | scopes.rb:14:9:14:9 | a |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:13:7:13:7 | b | scopes.rb:15:9:15:9 | b |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:13:11:13:11 | c | scopes.rb:16:9:16:9 | c |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:13:14:13:14 | d | scopes.rb:17:9:17:9 | d |
|
||||
| scopes.rb:13:4:13:4 | ... = ... | scopes.rb:7:1:7:1 | a | scopes.rb:14:9:14:9 | a |
|
||||
| scopes.rb:13:7:13:7 | ... = ... | scopes.rb:13:7:13:7 | b | scopes.rb:15:9:15:9 | b |
|
||||
| scopes.rb:13:10:13:15 | ... = ... | scopes.rb:13:10:13:15 | __synth__0 | scopes.rb:13:11:13:11 | __synth__0 |
|
||||
| scopes.rb:13:11:13:11 | ... = ... | scopes.rb:13:11:13:11 | c | scopes.rb:16:9:16:9 | c |
|
||||
| scopes.rb:13:14:13:14 | ... = ... | scopes.rb:13:14:13:14 | d | scopes.rb:17:9:17:9 | d |
|
||||
| scopes.rb:13:19:13:32 | ... = ... | scopes.rb:13:4:13:32 | __synth__0 | scopes.rb:13:4:13:4 | __synth__0 |
|
||||
| scopes.rb:27:1:27:5 | ... = ... | scopes.rb:27:1:27:1 | x | scopes.rb:28:8:28:8 | x |
|
||||
| scopes.rb:42:2:42:9 | ... = ... | scopes.rb:42:2:42:4 | var | scopes.rb:44:5:44:7 | var |
|
||||
| scopes.rb:46:5:46:13 | ... = ... | scopes.rb:46:5:46:8 | var2 | scopes.rb:47:5:47:8 | var2 |
|
||||
@@ -280,10 +289,12 @@ lastRead
|
||||
| scopes.rb:7:1:7:5 | ... = ... | scopes.rb:7:1:7:1 | a | scopes.rb:8:6:8:6 | a |
|
||||
| scopes.rb:9:9:18:3 | <captured> | scopes.rb:7:1:7:1 | a | scopes.rb:11:4:11:4 | a |
|
||||
| scopes.rb:11:4:11:9 | ... = ... | scopes.rb:7:1:7:1 | a | scopes.rb:12:9:12:9 | a |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:7:1:7:1 | a | scopes.rb:14:9:14:9 | a |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:13:7:13:7 | b | scopes.rb:15:9:15:9 | b |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:13:11:13:11 | c | scopes.rb:16:9:16:9 | c |
|
||||
| scopes.rb:13:4:13:32 | ... = ... | scopes.rb:13:14:13:14 | d | scopes.rb:17:9:17:9 | d |
|
||||
| scopes.rb:13:4:13:4 | ... = ... | scopes.rb:7:1:7:1 | a | scopes.rb:14:9:14:9 | a |
|
||||
| scopes.rb:13:7:13:7 | ... = ... | scopes.rb:13:7:13:7 | b | scopes.rb:15:9:15:9 | b |
|
||||
| scopes.rb:13:10:13:15 | ... = ... | scopes.rb:13:10:13:15 | __synth__0 | scopes.rb:13:14:13:14 | __synth__0 |
|
||||
| scopes.rb:13:11:13:11 | ... = ... | scopes.rb:13:11:13:11 | c | scopes.rb:16:9:16:9 | c |
|
||||
| scopes.rb:13:14:13:14 | ... = ... | scopes.rb:13:14:13:14 | d | scopes.rb:17:9:17:9 | d |
|
||||
| scopes.rb:13:19:13:32 | ... = ... | scopes.rb:13:4:13:32 | __synth__0 | scopes.rb:13:10:13:15 | __synth__0 |
|
||||
| scopes.rb:27:1:27:5 | ... = ... | scopes.rb:27:1:27:1 | x | scopes.rb:37:5:37:5 | x |
|
||||
| scopes.rb:42:2:42:9 | ... = ... | scopes.rb:42:2:42:4 | var | scopes.rb:44:5:44:7 | var |
|
||||
| scopes.rb:46:5:46:13 | ... = ... | scopes.rb:46:5:46:8 | var2 | scopes.rb:47:5:47:8 | var2 |
|
||||
@@ -317,6 +328,9 @@ adjacentReads
|
||||
| parameters.rb:7:26:7:31 | pizzas | parameters.rb:7:26:7:31 | pizzas | parameters.rb:8:6:8:11 | pizzas | parameters.rb:11:14:11:19 | pizzas |
|
||||
| parameters.rb:25:15:25:18 | name | parameters.rb:25:15:25:18 | name | parameters.rb:25:40:25:43 | name | parameters.rb:26:8:26:11 | name |
|
||||
| scopes.rb:9:9:18:3 | <captured> | scopes.rb:7:1:7:1 | a | scopes.rb:10:9:10:9 | a | scopes.rb:11:4:11:4 | a |
|
||||
| scopes.rb:13:10:13:15 | ... = ... | scopes.rb:13:10:13:15 | __synth__0 | scopes.rb:13:11:13:11 | __synth__0 | scopes.rb:13:14:13:14 | __synth__0 |
|
||||
| scopes.rb:13:19:13:32 | ... = ... | scopes.rb:13:4:13:32 | __synth__0 | scopes.rb:13:4:13:4 | __synth__0 | scopes.rb:13:7:13:7 | __synth__0 |
|
||||
| scopes.rb:13:19:13:32 | ... = ... | scopes.rb:13:4:13:32 | __synth__0 | scopes.rb:13:7:13:7 | __synth__0 | scopes.rb:13:10:13:15 | __synth__0 |
|
||||
| scopes.rb:27:1:27:5 | ... = ... | scopes.rb:27:1:27:1 | x | scopes.rb:28:8:28:8 | x | scopes.rb:31:10:31:10 | x |
|
||||
| scopes.rb:27:1:27:5 | ... = ... | scopes.rb:27:1:27:1 | x | scopes.rb:31:10:31:10 | x | scopes.rb:34:7:34:7 | x |
|
||||
| scopes.rb:27:1:27:5 | ... = ... | scopes.rb:27:1:27:1 | x | scopes.rb:34:7:34:7 | x | scopes.rb:34:14:34:14 | x |
|
||||
|
||||
@@ -215,10 +215,16 @@ explicitWrite
|
||||
| scopes.rb:7:1:7:1 | a | scopes.rb:7:1:7:5 | ... = ... |
|
||||
| scopes.rb:11:4:11:4 | a | scopes.rb:11:4:11:9 | ... += ... |
|
||||
| scopes.rb:11:4:11:4 | a | scopes.rb:11:4:11:9 | ... = ... |
|
||||
| scopes.rb:13:4:13:4 | a | scopes.rb:13:4:13:4 | ... = ... |
|
||||
| scopes.rb:13:4:13:4 | a | scopes.rb:13:4:13:32 | ... = ... |
|
||||
| scopes.rb:13:7:13:7 | b | scopes.rb:13:4:13:32 | ... = ... |
|
||||
| scopes.rb:13:7:13:7 | b | scopes.rb:13:7:13:7 | ... = ... |
|
||||
| scopes.rb:13:10:13:15 | __synth__0 | scopes.rb:13:10:13:15 | ... = ... |
|
||||
| scopes.rb:13:11:13:11 | c | scopes.rb:13:4:13:32 | ... = ... |
|
||||
| scopes.rb:13:11:13:11 | c | scopes.rb:13:11:13:11 | ... = ... |
|
||||
| scopes.rb:13:14:13:14 | d | scopes.rb:13:4:13:32 | ... = ... |
|
||||
| scopes.rb:13:14:13:14 | d | scopes.rb:13:14:13:14 | ... = ... |
|
||||
| scopes.rb:13:19:13:32 | __synth__0 | scopes.rb:13:19:13:32 | ... = ... |
|
||||
| scopes.rb:21:1:21:7 | $global | scopes.rb:21:1:21:12 | ... = ... |
|
||||
| scopes.rb:24:1:24:6 | script | scopes.rb:24:1:24:11 | ... = ... |
|
||||
| scopes.rb:27:1:27:1 | x | scopes.rb:27:1:27:5 | ... = ... |
|
||||
@@ -334,6 +340,11 @@ readAccess
|
||||
| scopes.rb:10:9:10:9 | a |
|
||||
| scopes.rb:11:4:11:4 | a |
|
||||
| scopes.rb:12:9:12:9 | a |
|
||||
| scopes.rb:13:4:13:4 | __synth__0 |
|
||||
| scopes.rb:13:7:13:7 | __synth__0 |
|
||||
| scopes.rb:13:10:13:15 | __synth__0 |
|
||||
| scopes.rb:13:11:13:11 | __synth__0 |
|
||||
| scopes.rb:13:14:13:14 | __synth__0 |
|
||||
| scopes.rb:14:9:14:9 | a |
|
||||
| scopes.rb:15:9:15:9 | b |
|
||||
| scopes.rb:16:9:16:9 | c |
|
||||
|
||||
@@ -54,7 +54,9 @@
|
||||
| scopes.rb:4:4:4:4 | a |
|
||||
| scopes.rb:7:1:7:1 | a |
|
||||
| scopes.rb:9:14:9:14 | x |
|
||||
| scopes.rb:13:4:13:32 | __synth__0 |
|
||||
| scopes.rb:13:7:13:7 | b |
|
||||
| scopes.rb:13:10:13:15 | __synth__0 |
|
||||
| scopes.rb:13:11:13:11 | c |
|
||||
| scopes.rb:13:14:13:14 | d |
|
||||
| scopes.rb:24:1:24:6 | script |
|
||||
|
||||
Reference in New Issue
Block a user