Tom Hvitved
2077ba4a1f
Add SSA library
2021-01-27 10:39:19 +01:00
Tom Hvitved
ce74208317
Merge pull request #97 from github/hvitved/var-access-categorization
...
Categorize variable accesses into reads and (implicit or explicit) writes
2021-01-25 16:25:35 +01:00
Tom Hvitved
3a0c9a8104
CFG: Replace special parameters with their identifiers
...
For example, instead of including `**kwargs` in the CFG, we include `kwargs`.
This means that all variable accesses belonging to parameter definitions will
be included in the CFG.
2021-01-25 10:02:21 +01:00
Tom Hvitved
586885f066
Recognize blocks without parameters
2021-01-22 16:16:01 +01:00
Tom Hvitved
7e374c416a
Categorize variable accesses into reads and (implicit or explicit) writes
2021-01-22 13:17:26 +01:00
Nick Rolfe
ccd8a2aae6
Merge remote-tracking branch 'origin/main' into call_ast
2021-01-22 11:48:32 +00:00
Nick Rolfe
2e8d154f2b
Add AST classes and tests for method calls
2021-01-20 18:34:25 +00:00
Tom Hvitved
bf7eb022a0
CFG: Use manual toString()s for AstCfgNode when available
2021-01-20 19:15:03 +01:00
Tom Hvitved
34fe416a85
CFG: Fix bug in LogicalNotTree
2021-01-18 15:03:58 +01:00
Tom Hvitved
3f31775252
CFG: Add test for constant condition
2021-01-18 15:01:41 +01:00
Nick Rolfe
6d7efab820
Add ConditionalLoop base class
2021-01-08 12:20:08 +00:00
Nick Rolfe
6465c90a16
Rename IfOrElsifExpr to IfExpr; remove child classes
2021-01-08 11:53:15 +00:00
Nick Rolfe
36c7d3fe5b
Replace ConditionalExpr::get{Then,Else} with getBranch(boolean cond).
2021-01-07 17:32:41 +00:00
Nick Rolfe
f4abe7f4a1
Remove ThenExpr, ElseExpr, and DoExpr from public API
2021-01-07 15:56:31 +00:00
Nick Rolfe
7c503120ae
Add AST library for control expressions (conditionals and loops)
2021-01-05 16:08:33 +00:00
Arthur Baars
dc0de9132e
Add GlobalVariable
2020-12-21 11:01:46 +01:00
Nick Rolfe
c4ca537574
Merge pull request #75 from github/stmts_exprs
...
Add AST classes and tests for operations
2020-12-18 10:40:27 +00:00
Nick Rolfe
53fbfc369d
Make params test pass for now
...
- some toString improvements
- comment out getAPrimaryQlClass predicates that cause the test to fail
2020-12-18 10:13:13 +00:00
Nick Rolfe
4718de08b2
Address review feedback
2020-12-18 10:08:45 +00:00
Nick Rolfe
73798312b9
Add classes and tests for operations
2020-12-17 15:16:37 +00:00
Tom Hvitved
46fc17da58
CFG: Fix multiple abnormal successors
2020-12-17 11:15:17 +01:00
Tom Hvitved
1033b8610a
CFG: Add more tests
2020-12-17 11:14:10 +01:00
Arthur Baars
dd954ea943
CFG: correct flow for lambda bodies
...
Lambda bodies are parsed as nested do-blocks or normal blocks.
This is actually incorrect, as the body of a lambda can't have
parameters. However, we can "inline" such blocks to get the
desired control flow.
2020-12-17 10:04:01 +01:00
Arthur Baars
eafec4331b
CFG: add nodes for block arguments
2020-12-17 10:04:01 +01:00
Arthur Baars
d016e3cae0
CFG: methods are evaluated before their arguments
2020-12-17 10:04:01 +01:00
Arthur Baars
81c907a87a
CFG: fix BEGIN and END blocks
2020-12-17 10:04:01 +01:00
Arthur Baars
f2fd1c7931
CFG: make def nodes visible
2020-12-17 10:04:01 +01:00
Arthur Baars
bc47338b52
CFG: add test-case for conditional method declarations
2020-12-17 10:04:01 +01:00
Arthur Baars
fd14770542
CFG: drop getObject from flow of singleton method
2020-12-17 09:59:30 +01:00
Arthur Baars
8501e30b6a
CFG: fix linking heredoc start to heredoc body
2020-12-17 09:59:30 +01:00
Nick Rolfe
0518d51b51
Update CFG: call receiers are evaluated before arguments
2020-12-16 12:40:57 +00:00
Nick Rolfe
e98a84c8b5
Update CFG to match changes to Call/MethodCall
2020-12-16 12:01:30 +00:00
Tom Hvitved
9aadeedeb9
CFG: Model IfElsifAstNode in post-order
2020-12-15 17:00:12 +01:00
Tom Hvitved
bb88858633
CFG: Add test for nested ifs
2020-12-15 16:46:55 +01:00
Tom Hvitved
16c25f2a4c
CFG: Handle ensure blocks without body/rescues
2020-12-15 13:49:14 +01:00
Tom Hvitved
e784640cca
CFG: Add more test cases
2020-12-15 13:45:22 +01:00
Arthur Baars
5108b369e1
Merge pull request #64 from github/hvitved/cfg/rescue
...
Implement CFG logic for `rescue-ensure`
2020-12-15 11:43:14 +01:00
Tom Hvitved
a76e6848c7
CFG: Address more review comments
2020-12-14 20:45:57 +01:00
Tom Hvitved
89fb2f8498
CFG: Add @kind graph to Cfg.ql, and remove labels from ordinary successor edges
2020-12-14 11:00:26 +01:00
Tom Hvitved
b14a889f5f
CFG: Use MatchingCompletion for parameters with default values
2020-12-08 13:47:32 +01:00
Tom Hvitved
80a59a81ed
CFG: Use MatchingCompletion for patterns
2020-12-08 13:47:32 +01:00
Tom Hvitved
31b8d33a7c
CFG: Mark redo edges out of for loops
2020-12-08 13:47:32 +01:00
Tom Hvitved
b6ea5c5eab
CFG: Implement logic for rescue-ensure blocks
2020-12-08 13:47:32 +01:00
Nick Rolfe
3145b3dde7
Rename describeQlClass to getAPrimaryQlClass
2020-12-08 11:09:18 +00:00
Tom Hvitved
5a0376f67e
CFG: More tests
2020-12-08 11:06:15 +01:00
Arthur Baars
9390cf0401
CFG: add test case for if-in-case
2020-12-07 16:46:52 +01:00
Arthur Baars
024150b04b
CFG: hide 'begin'
2020-12-07 16:02:19 +01:00
Arthur Baars
2394b26636
CFG: skip Uninterpreted nodes
2020-12-07 13:11:21 +01:00
Arthur Baars
36f5a63c18
Improve handling of class, module, block and method
2020-12-07 13:11:21 +01:00
Arthur Baars
2124247d5e
CFG: add samples of all syntactical constructs to cfg.rb
2020-12-07 13:11:21 +01:00