151 Commits

Author SHA1 Message Date
Paolo Tranquilli
a18f1ef7cd Codegen: fix bug where stub rewriting globbles too much code 2023-11-23 17:14:32 +01:00
Paolo Tranquilli
ff529c34b4 Codegen: use re.escape 2023-11-23 09:37:44 +01:00
Paolo Tranquilli
369431125e Codegen: insert doc explaining _patch_class_qldoc 2023-11-22 10:26:04 +01:00
Paolo Tranquilli
f5633be837 Codegen: rename has_doc to has_qldoc 2023-11-22 10:19:36 +01:00
Paolo Tranquilli
418118fc89 Codegen: use more robust regex to patch qldocs 2023-11-22 10:11:05 +01:00
Paolo Tranquilli
30161b0f12 Codegen: patch customized stubs with QLdoc 2023-11-21 17:51:27 +01:00
Paolo Tranquilli
d659709695 Codegen: add render_str 2023-11-21 17:28:12 +01:00
Paolo Tranquilli
e40c53a340 Swift: add full docs to stub classes 2023-11-21 17:27:30 +01:00
Paolo Tranquilli
b4fd95bd6a Swift: move stub QLdocs to separate templates 2023-11-21 16:25:21 +01:00
Paolo Tranquilli
5b724a7aaf Swift: add QLdoc for Generated modules 2023-11-21 16:18:28 +01:00
Paolo Tranquilli
dcb2117b31 Swift: tweak generated doc comments 2023-11-09 12:12:07 +01:00
Paolo Tranquilli
ac838d72de Codegen: mark all generated files and classes as INTERNAL 2023-11-08 10:02:17 +01:00
Paolo Tranquilli
b7543f5dc7 Codegen: pass ql_internal to Stub 2023-11-08 09:54:21 +01:00
Paolo Tranquilli
10afa4381a Swift: add more doc strings to generated things 2023-11-07 16:29:03 +01:00
Paolo Tranquilli
02a2debe94 Codegen: fix python compatibility problem 2023-10-23 16:56:44 +02:00
Paolo Tranquilli
7cc20587ad Codegen: add @qltest.test_with
This allows to group together related AST classes to reuse the same
test source and extraction. For example this is useful for
`EnumDecl/EnumCaseDecl/EnumElementDecl`, where this is applied to.
2023-10-23 14:51:22 +02:00
Paolo Tranquilli
60b7d79fba Revert "Revert "Swift: use C++20 constraints and concepts to simplify code"" 2023-09-21 10:17:22 +02:00
Paolo Tranquilli
1daedd9fb6 Revert "Swift: use C++20 constraints and concepts to simplify code" 2023-08-21 17:40:15 +02:00
Paolo Tranquilli
7c764f3b50 Swift: use C++20 constraints and concepts to simplify code
This simplifies several instances of metaprogramming by leveraging
[constraints and concepts from C++20][1]. This:
* gets rid of `std::enable_if` by usage of `requires`, making it more
  readable and yield better compiler messages.
* uses `requires` instead of `static_assert` to enforce `TrapLabel`
  typing
* simplifies all compile-time tests for validity of a given expression
* uses some standard library concepts where possible
* generalizes and simplifies `SwiftLocationExtractor`

Notice that in order to use the `std::derived_from` concept, `virtual`
inheritance had to be added to the label tags, because diamond
inheritance is a problem otherwise. That's because
`std::derived_from<T, U>` requires that `T*` be convertible to `U*`,
which is false if there are multiple non-virtual inheritance paths from
`U` to `T`. As tags never get actually instantiated, there is no runtime
performance penalty in using `virtual` inheritance.

[1]: https://en.cppreference.com/w/cpp/language/constraints
2023-08-17 17:24:42 +02:00
Paolo Tranquilli
700e3d5e53 Codegen: rename ipa to synth 2023-06-07 09:12:39 +02:00
Nora Dimitrijević
2529312d1d Codegen: fix test.qlgen failure 2023-06-06 15:58:19 +02:00
Nora Dimitrijević
928da77d10 Merge branch 'main' into redsun82/swift-synth-properties 2023-06-06 15:34:02 +02:00
Paolo Tranquilli
cc271d682e Codegen: ignore synth properties in cppgen 2023-05-25 16:05:25 +02:00
Paolo Tranquilli
b09386a2c8 Codegen: ignore synth properties in Raw.qll 2023-05-25 16:05:12 +02:00
Paolo Tranquilli
00fb796f3b Codegen: ignore synth properties in dbschemegen 2023-05-25 16:05:12 +02:00
Paolo Tranquilli
d2c9847a79 Codegen: parse synth property modifier 2023-05-25 16:05:12 +02:00
Paolo Tranquilli
165ac3eeaa Codegen: define and propagate synth property flag 2023-05-25 16:05:12 +02:00
Paolo Tranquilli
242d263e8a Codegen: move ipa info from ql.Class to ql.Property 2023-05-25 16:05:11 +02:00
Paolo Tranquilli
b4edc92079 Swift: make hideability spread upward in the hierarchy 2023-05-23 12:45:18 +02:00
Paolo Tranquilli
a087fef335 Swift: implement @ql.hideable 2023-05-23 12:45:18 +02:00
Paolo Tranquilli
7dd18ff801 Swift: add @ql.hideable to schema loading 2023-05-23 12:45:18 +02:00
Paolo Tranquilli
de03bdc235 Swift: fix hidden AST getters
For consistency with the C/C++ QL library, getters of AST elements
within the hidden AST should not themselves skip other hidden AST
elements.
2023-05-22 09:57:48 +02:00
Kasper Svendsen
d346d1733e Swift: Make implicit this receivers explicit 2023-05-10 16:12:52 +02:00
Paolo Tranquilli
95248d17d1 Codegen: prepend .gitattributes entries with / 2023-05-05 10:08:44 +02:00
Paolo Tranquilli
436f2437ef Codegen: also mark generated .gitattributes as linguist-generated 2023-05-05 09:59:44 +02:00
Paolo Tranquilli
1155b97232 Codegen: mark generated checked in files as such 2023-05-05 09:29:16 +02:00
Paolo Tranquilli
89496a87df Codegen: add const overload of forEachLabel 2023-04-18 12:14:46 +02:00
Paolo Tranquilli
901db73d55 Merge pull request #12745 from github/redsun82/swift-logging
Swift: introduce usage of binlog
2023-04-17 15:23:29 +02:00
Paolo Tranquilli
edb355b47f Swift: add QLdoc for generated Raw and Synth modules 2023-04-17 09:38:26 +02:00
Paolo Tranquilli
abc0c7cf24 Swift: add trace logging of all trap emission 2023-04-03 11:47:24 +02:00
Paolo Tranquilli
92197bf9f2 Codegen: fix autopep8 pre-commit hook 2023-03-29 15:57:45 +02:00
Paolo Tranquilli
d7a3cb2d01 Codegen: implement set in ql test generation 2023-03-29 15:44:07 +02:00
Paolo Tranquilli
d5ee728657 Codegen: implement set in qlgen (excluding QL tests) 2023-03-29 15:44:07 +02:00
Paolo Tranquilli
00b59f83f2 Codegen: disallow child on set properties 2023-03-29 15:44:06 +02:00
Paolo Tranquilli
442e85099b Codegen: implement set in cppgen 2023-03-29 15:44:06 +02:00
Paolo Tranquilli
eef140c3fc Codegen: implement set in dbschemegen 2023-03-29 15:44:06 +02:00
Paolo Tranquilli
bba5d9dbd6 Codegen: add set to schema definitions 2023-03-29 15:44:06 +02:00
Geoffrey White
c2f6ee320f Swift: Add QLDoc to the Raw.qll file. 2023-03-10 17:43:30 +00:00
Paolo Tranquilli
1218145259 Codegen: update README.md files 2023-02-27 10:01:50 +01:00
Paolo Tranquilli
06a6450be4 Codegen: make --qltest-output optional 2023-02-27 09:46:48 +01:00