Commit Graph

126 Commits

Author SHA1 Message Date
Taus
e79ded9046 Add exclusions to Module consistency test 2021-06-19 12:41:16 +00:00
Taus
6d1dc24fa7 Autoformat 2021-06-19 12:36:10 +00:00
Taus
6bff0f48a2 Remove SuperAccess::getType()
This had a bad effect on our call resolution, so I'm reverting it for
now. We may want to diverge from the language specification here.
2021-06-19 12:17:17 +00:00
Taus
e3a4d3074c Exclude a few more paths from tests 2021-06-19 11:54:50 +00:00
Taus
815337dde1 Split up Aggregate properly
Previously, we had `Aggregate` and `ExprAggregate` as separate classes,
the latter of which representing aggregates that contain only an
expression.

This was a problem for the `rank` aggregate, as it inherited from
`Aggregate`, but _could_ also contain just an expression (even if this
is rather rare).

To fix this, I renamed `Aggregate` to `FullAggregate` (to make the
division clearer), and added a new type `Aggregate` that represents the
union of these two types. Now `Rank` can inherit from the new class
`Aggregate` and everything is dandy.
2021-06-19 11:50:50 +00:00
Taus
1e973f3681 Fix getType for aggregates
We were only including the `strict` variant of `count` and not any of
the other ones (spot the mistake!).

Also, `unique` was added as a recognised aggregate name.
2021-06-19 11:47:45 +00:00
Taus
0ff0aecb22 Add more getType overrides
Mainly adds ones for primitive types.

One peculiarity: the language specification states that the type of
`super` is the same as the type of `this`, and _not_ the type of
the superclass on which the method is actually accessed. This seems a
bit strange to me, so I thought I would highlight it specifically.

Also, I'm not entirely sure that the rules around type coercion for
the various binary operators are 100% correct.
2021-06-19 11:40:12 +00:00
Taus
35dccb5f3d Update to latest generator
Includes better QLDoc generation and better escaping in the generated
files (the latter has changed the dbscheme, so rebuilding databases will
be required).
2021-06-01 16:43:11 +00:00
Taus
9abe340a1f Fix getQLDoc compilation error 2021-05-31 08:55:27 +00:00
Taus
3cdc6a18ae Merge branch 'main' into dbscheme-and-qlpack-support 2021-05-31 10:50:39 +02:00
Taus
1cbcf40637 Simplify getAMember
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2021-05-31 10:26:50 +02:00
Erik Krogh Kristensen
4bbd06f51f improve performance of module resolution 2021-05-31 08:06:49 +00:00
Erik Krogh Kristensen
b3e23bcc31 improve performance of type resolution 2021-05-31 07:51:11 +00:00
Erik Krogh Kristensen
a286dc349a improve scope resolution performance 2021-05-31 07:46:51 +00:00
Erik Krogh Kristensen
18b6216f78 more improvements to printAst performance 2021-05-31 07:33:11 +00:00
Erik Krogh Kristensen
7d4611941a fix printAst performance 2021-05-30 21:42:15 +00:00
Erik Krogh Kristensen
a349fdd367 spaces in folder/file names are underscores in import names 2021-05-30 21:36:01 +00:00
Erik Krogh Kristensen
6c5e33e3d2 use qlpack existence to determine the root for imports 2021-05-30 21:30:11 +00:00
Taus
4e8157e3cb Autoformat 2021-05-30 17:53:38 +00:00
Taus
eaf6d8123d Add support for dbscheme and qlpack.yml
Currently the the YAML "parser" fails for some legacy files, but the
actual files appear to be parsed correctly.
2021-05-30 17:38:26 +00:00
Erik Krogh Kristensen
5c80716724 Merge branch 'main' into qldoc-nodes 2021-05-30 15:51:29 +00:00
Erik Krogh Kristensen
48170f5ce0 change multipleResolveCall to ignore aliases 2021-05-29 19:30:40 +00:00
Erik Krogh Kristensen
bd86ffb35b fix the arity of predicate aliases 2021-05-29 19:23:58 +00:00
Erik Krogh Kristensen
8dc3948221 support more types on aggregates 2021-05-29 19:23:58 +00:00
Erik Krogh Kristensen
068c57acdd add super calls to the callgraph 2021-05-29 19:23:58 +00:00
Erik Krogh Kristensen
2d86b13d44 add super nodes 2021-05-29 19:23:58 +00:00
Erik Krogh Kristensen
5dcc161f2d add getEnclosingPredicate utility predicate 2021-05-29 19:23:58 +00:00
Erik Krogh Kristensen
8ad05b778d add support for boolean literals 2021-05-29 19:23:58 +00:00
Taus
010bc39465 Fix tests
I'm not really a fan of `toString`s that don't indicate the type of the
object, so I added a reference to `getAPrimaryQlClass`. Hopefully this
should result in less noise in the diff.
2021-05-28 22:00:15 +00:00
Taus
9b0b4df181 Add getAModule and getANewType
Also removes `getAQLDocComment`, as those were already dangling off of
their respective successors in the file (and so should not dangle off
of the top level as well).
2021-05-28 21:44:41 +00:00
Taus
3280f02d6a Remove getAMember from getAChild
Adds `getAQLDocComment` for accessing those module members that are
simply QLDoc comments (apart from the one that applies to the module
itself, which is still accessed through `getQLDoc`.)
2021-05-28 21:12:02 +00:00
Taus
3a045ef4e5 Autogenerate QLDoc for TreeSitter.qll 2021-05-28 21:06:51 +00:00
Taus
64a53f8ba0 Add AST nodes for QLDoc 2021-05-28 17:11:02 +00:00
Erik Krogh Kristensen
fd8fd0b70e add ql/override-parameter-name 2021-05-28 14:59:44 +00:00
Erik Krogh Kristensen
0c61c9d2b2 adjust qldoc on printAst 2021-05-28 14:35:01 +00:00
Tom Hvitved
05d1788c1f Cache some predicates 2021-05-28 15:20:55 +02:00
Tom Hvitved
42df07c23a Merge pull request #27 from github/newtype-call
Resolve `newtype` constructor calls
2021-05-28 15:14:52 +02:00
Erik Krogh Kristensen
51230f6ee3 Merge pull request #25 from github/cleanup
cleanup
2021-05-28 15:07:16 +02:00
Tom Hvitved
8d245e6bc2 Resolve newtype constructor calls 2021-05-28 15:06:37 +02:00
Erik Krogh Kristensen
f15ad39181 format 2021-05-28 13:02:01 +00:00
Erik Krogh Kristensen
d171ace902 fix 2021-05-28 12:58:02 +00:00
Erik Krogh Kristensen
c3344d0734 cleanup 2021-05-28 12:50:33 +00:00
Taus
e89ed8a1f9 Reuse defined predicate arity 2021-05-28 12:40:45 +00:00
Taus
fa8efb6ca9 Make getParameter 0-indexed 2021-05-28 12:22:14 +00:00
Joe Farebrother
3945dbfa54 Support builtin predicates 2021-05-28 12:57:36 +01:00
Tom Hvitved
671628484b Merge pull request #24 from github/types
Resolve calls
2021-05-28 13:50:22 +02:00
Tom Hvitved
5112b49b94 Remove compilation warnings 2021-05-28 13:44:31 +02:00
Joe Farebrother
26d0e9df5d Add Missing Override query 2021-05-28 12:39:59 +01:00
Tom Hvitved
5975ee4932 Resolve calls 2021-05-28 13:39:21 +02:00
Taus
ac35f348c4 printAst edge labels and a bit of consistency 2021-05-28 11:33:06 +00:00