Commit Graph

56 Commits

Author SHA1 Message Date
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
Arthur Baars
97d0220ffd CFG: Model nodes with simple flow 2020-12-07 13:11:21 +01:00
Arthur Baars
97fab0d18b Assignments evaluate right-hand-side first 2020-12-07 13:11:21 +01:00
Arthur Baars
22fd8908c5 Use private imports
No need to have everyting re-export the entire AST
2020-12-03 19:13:05 +01:00
Tom Hvitved
d50f5cc785 Address review comments 2020-12-01 15:14:14 +01:00
Tom Hvitved
9820dcb363 Generate VariableAccesses also for defining accesses 2020-12-01 14:39:41 +01:00
Tom Hvitved
bde9f59e0e Introduce Parameter::getAVariable() 2020-12-01 13:18:06 +01:00
Tom Hvitved
311a0b6b20 Mark more AST predicates as final 2020-12-01 10:24:33 +01:00
Nick Rolfe
baf29ae56b Add qldoc comment and isOptional predicate to KeywordParameter 2020-11-30 13:42:02 +00:00
Tom Hvitved
c0dd89122c Handle parameters with overlapping names 2020-11-28 19:23:08 +01:00
Tom Hvitved
58baa33a3f Various changes to user-facing library
- Remove `abstract` classes from public API.
- Align `Variable.qll` with rest of library.
- Introduce `Callable` class.
- Make `Pattern` class cover everything that can be on the LHS of an assignment
  and in a pattern (except special parameters such as `**param`).
2020-11-27 17:07:03 +01:00
Tom Hvitved
59d45de118 Move AST files into ast folder 2020-11-27 14:45:15 +01:00
Tom Hvitved
00f3daabfe Rename Variables.qll to Variable.qll 2020-11-27 14:39:20 +01:00
Nick Rolfe
c598dc6b5c Initial work on user-facing AST library 2020-11-26 13:45:45 +00:00
Arthur Baars
bc5d7a3b74 Change modelling of Parameters 2020-11-24 19:22:40 +01:00
Arthur Baars
c745978ebb Fix inconsistent variable references 2020-11-24 19:22:40 +01:00