Commit Graph

85 Commits

Author SHA1 Message Date
Arthur Baars
bc55fa861e Merge pull request #114 from github/aibaars/fix-scopes
Correct the scope of class/method names etc.
2021-02-04 17:22:25 +01:00
Arthur Baars
bfc5ee3149 Correct the scope of class/method names etc. 2021-02-04 15:30:58 +01:00
Arthur Baars
2035bc4d3a AST: add ParenthesizedExpr 2021-02-04 11:51:05 +01:00
Nick Rolfe
c5fca0cb6b Add ModuleBase base class and combine class/module tests 2021-02-03 16:13:59 +00:00
Nick Rolfe
8976cc556a Update test to match removal of Module::getAClass() 2021-02-02 18:02:16 +00:00
Nick Rolfe
c667791bde Update expected test output to match toString() for classes and modules 2021-02-01 14:23:47 +00:00
Nick Rolfe
fbc1c5e8c0 Add test for Module 2021-02-01 14:23:47 +00:00
Nick Rolfe
86bb8a246b Add test for Class and SingletonClass 2021-02-01 14:23:47 +00:00
Arthur Baars
2921f72473 Implement class variables 2021-01-29 17:45:48 +01:00
Arthur Baars
341bc5c888 Implement instance variables 2021-01-29 16:09:44 +01:00
Tom Hvitved
f8790c81a8 Merge pull request #108 from github/hvitved/ssa
Add SSA library
2021-01-29 15:12:14 +01:00
Nick Rolfe
743e627a8d Test calls to methods named 'super' 2021-01-27 18:45:08 +00:00
Tom Hvitved
b9b4325b84 Add initial mapping of CFG nodes to AST nodes 2021-01-27 15:38:49 +01:00
Tom Hvitved
2077ba4a1f Add SSA library 2021-01-27 10:39:19 +01:00
Nick Rolfe
7ac46bf8f8 Add SuperCall class for calls to super 2021-01-26 18:08:46 +00: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