svenbarth
|
6d0c470a40
|
* check for unbound attributes inside classes (currently they are only allowed for published properties)
Note: no tests yet as sooner or later most will be dropped once extended RTTI is added
git-svn-id: trunk@42408 -
|
2019-07-12 22:08:10 +00:00 |
|
svenbarth
|
98b1b04951
|
* free unbound attributes
git-svn-id: trunk@42407 -
|
2019-07-12 22:08:07 +00:00 |
|
svenbarth
|
90bec938f6
|
* don't free the constructor call in trtti_attribute_list as that is already freed in the destructor of trtti_attribute
git-svn-id: trunk@42406 -
|
2019-07-12 22:08:04 +00:00 |
|
svenbarth
|
404b465c33
|
* allow custom attributes for all type declarations that are not a simple alias
+ added tests
git-svn-id: trunk@42405 -
|
2019-07-12 22:08:00 +00:00 |
|
svenbarth
|
80ebb98431
|
* correct identation (no code changes)
git-svn-id: trunk@42404 -
|
2019-07-12 22:07:57 +00:00 |
|
svenbarth
|
9dbd155131
|
* use two empty lines between method definitions (no code changes)
git-svn-id: trunk@42403 -
|
2019-07-12 22:07:54 +00:00 |
|
svenbarth
|
a72553eea2
|
* disable [...] syntax for procedure directives if modeswitch "prefixed attributes" is enabled; they conflict otherwise and it's not easily resolveable
+ added test
git-svn-id: trunk@42402 -
|
2019-07-12 22:07:50 +00:00 |
|
svenbarth
|
b945e66e28
|
* store attribute information in PPU; this is less important for the compiler, but more for e.g. Lazarus when dealing with binary only units
* increase ppu version
+ added test
* adjust ppudump to handle attributes as well
ToDo: output parameter nodes as well
git-svn-id: trunk@42401 -
|
2019-07-12 22:07:46 +00:00 |
|
svenbarth
|
8ce4f9606d
|
* explicitely store the procdef of the picked constructor of the attribute
git-svn-id: trunk@42400 -
|
2019-07-12 22:07:41 +00:00 |
|
svenbarth
|
dfb9fffcf9
|
+ add functions for syms and defs and write sub entries of the sym/def to PPU and loads them again
git-svn-id: trunk@42399 -
|
2019-07-12 22:07:38 +00:00 |
|
svenbarth
|
352ff5f82a
|
- symbolname field is no longer required
git-svn-id: trunk@42398 -
|
2019-07-12 22:07:34 +00:00 |
|
svenbarth
|
3a02393584
|
- remove functionality to get the code block when parsing again (let's open this pandora's box only when really needed...)
git-svn-id: trunk@42397 -
|
2019-07-12 22:07:31 +00:00 |
|
svenbarth
|
a64a8f8deb
|
- remove code to create an attribute using a synthetic function
git-svn-id: trunk@42396 -
|
2019-07-12 22:07:28 +00:00 |
|
svenbarth
|
402728239f
|
* trtti_attribute_list.bind already checks whether the dangling attribute list is assigned or not
git-svn-id: trunk@42395 -
|
2019-07-12 22:07:24 +00:00 |
|
svenbarth
|
ced3885dbb
|
* generate construction function for the attributes used in a unit using a more straight forward approach
ToDo: "collect" attributes of same type and same argument list and generate constructor only once for them
git-svn-id: trunk@42394 -
|
2019-07-12 22:07:20 +00:00 |
|
svenbarth
|
0b63e89ba2
|
* make the reference to the TCustomAttribute type global
git-svn-id: trunk@42393 -
|
2019-07-12 22:07:15 +00:00 |
|
svenbarth
|
d9d2515ada
|
* move binding of a dangling attribute list to a sym's/def's attribute list to a class procedure of trtti_attribute_list
git-svn-id: trunk@42392 -
|
2019-07-12 22:07:11 +00:00 |
|
svenbarth
|
5cea374255
|
* add a remark that's going to be important once extended RTTI is supported (Delphi programs crash if an attribute's constructor is used that does not have any extended RTTI)
git-svn-id: trunk@42391 -
|
2019-07-12 22:07:08 +00:00 |
|
svenbarth
|
71fa4d1fe2
|
* the RTTI of an attribute not only consists of the creation function, but also of the attribute's type, a pointer to the constructor and a data blob containing the constant parameters
+ added test
git-svn-id: trunk@42390 -
|
2019-07-12 22:07:05 +00:00 |
|
svenbarth
|
55d5bdc98d
|
+ add methods for the const nodes to directly emit their constant data to a constant builder
Note: reduce code duplication, especially for the tsetconstnode (with its descendant tcgsetconstnode)
git-svn-id: trunk@42389 -
|
2019-07-12 22:07:01 +00:00 |
|
svenbarth
|
f9cda608fa
|
* take a copy of the constructor assignment node (and free it together with the attribute)
git-svn-id: trunk@42388 -
|
2019-07-12 22:06:57 +00:00 |
|
svenbarth
|
d31dd4ac7b
|
* better check for a valid call node
git-svn-id: trunk@42387 -
|
2019-07-12 22:06:52 +00:00 |
|
svenbarth
|
8cd1f1973b
|
- remove unneeded local variable
git-svn-id: trunk@42386 -
|
2019-07-12 22:06:48 +00:00 |
|
svenbarth
|
affa9f9d9c
|
* to be on the safe side: don't include AttributeTable fields when cycling
git-svn-id: trunk@42385 -
|
2019-07-12 22:06:44 +00:00 |
|
svenbarth
|
99914b4279
|
* instead of collecting the raw parameters we need to collect the parameters as passed to the call as there might be type conversions involved
git-svn-id: trunk@42384 -
|
2019-07-12 22:06:41 +00:00 |
|
svenbarth
|
b5e6c0b98d
|
* ensure that any potentially created constructor call is freed if the attribute is not bound to a def or sym
git-svn-id: trunk@42383 -
|
2019-07-12 22:06:38 +00:00 |
|
svenbarth
|
0e04d9b4de
|
* store the parameter nodes in the attribute object as well (we need to write them to the RTTI as well as store them in the PPU)
git-svn-id: trunk@42382 -
|
2019-07-12 22:06:34 +00:00 |
|
svenbarth
|
3a20178d96
|
* fix code formatting (no code changes)
git-svn-id: trunk@42381 -
|
2019-07-12 22:06:31 +00:00 |
|
svenbarth
|
c214648224
|
+ add a test for overloaded attribute constructors
git-svn-id: trunk@42380 -
|
2019-07-12 22:06:28 +00:00 |
|
svenbarth
|
db37146f12
|
* rework code for parsing attributes to only allow constant expressions; Delphi only allows those as well and better we don't open *that* pandora's box just yet
git-svn-id: trunk@42379 -
|
2019-07-12 22:06:24 +00:00 |
|
svenbarth
|
ab2fa724ec
|
* fix code formatting (no code changes)
git-svn-id: trunk@42378 -
|
2019-07-12 22:06:20 +00:00 |
|
svenbarth
|
62c137a6d8
|
* check that we indeed have a type node and nothing else
* with a type node it's not necessary to check whether it's typedef is assigned
git-svn-id: trunk@42377 -
|
2019-07-12 22:06:16 +00:00 |
|
svenbarth
|
f1715ff337
|
* fix code formatting (no code changes)
git-svn-id: trunk@42376 -
|
2019-07-12 22:06:13 +00:00 |
|
svenbarth
|
3ad24c9db8
|
* as attributes can be part of any type they are best suited in a common part of TTypeData
git-svn-id: trunk@42375 -
|
2019-07-12 22:06:09 +00:00 |
|
svenbarth
|
a1b556d211
|
* considering that at least in theory every symbol and every def can carry RTTI attributes (Delphi only supports property and field symbols), move the rtti_attribute_list to tstoredsym/tstoreddef
git-svn-id: trunk@42374 -
|
2019-07-12 22:06:05 +00:00 |
|
svenbarth
|
de15025a47
|
* streamline retrieval of attributes (both in TypInfo and RTTI units)
git-svn-id: trunk@42373 -
|
2019-07-12 22:06:02 +00:00 |
|
svenbarth
|
5532ac3355
|
* fix test
git-svn-id: trunk@42372 -
|
2019-07-12 22:05:58 +00:00 |
|
svenbarth
|
e060a43d70
|
* rename TAttributeData to the more appropriate TAttributeTable
git-svn-id: trunk@42371 -
|
2019-07-12 22:05:55 +00:00 |
|
svenbarth
|
c17dafc2f9
|
* fix TClassData by including the AttributeTable at the right location
git-svn-id: trunk@42370 -
|
2019-07-12 22:05:51 +00:00 |
|
svenbarth
|
e296b26e9e
|
- remove unit info and related code again as that will be handled similar, but differently with dynamic packages
git-svn-id: trunk@42369 -
|
2019-07-12 22:05:47 +00:00 |
|
svenbarth
|
ee940c8270
|
* always write a class' reference to the attribute table, even if the unit does not have attributes
git-svn-id: trunk@42368 -
|
2019-07-12 22:05:42 +00:00 |
|
svenbarth
|
788d976f3a
|
* use a Word instead of a Byte for the attribute index (after all the compiler writes a Word to the count field)
git-svn-id: trunk@42367 -
|
2019-07-12 22:05:39 +00:00 |
|
svenbarth
|
5153a288dc
|
* it's more correct for GetPropAttribute to return a TCustomAttribute instead of a TObject
git-svn-id: trunk@42366 -
|
2019-07-12 22:05:33 +00:00 |
|
svenbarth
|
d137e06ade
|
* instead of embedding the attributes inside the class' and property's type data only store a reference to a table of attributes
git-svn-id: trunk@42365 -
|
2019-07-12 22:05:29 +00:00 |
|
svenbarth
|
38fad4b5cf
|
* also check for invalid attribute data in tests
git-svn-id: trunk@42364 -
|
2019-07-12 22:05:25 +00:00 |
|
svenbarth
|
ba413bcdfc
|
* fix typo
git-svn-id: trunk@42363 -
|
2019-07-12 22:05:21 +00:00 |
|
svenbarth
|
24c4b90343
|
* instead of declaring another type with a 'attribute' suffix, *search* for another type with a 'ATTRIBUTE' suffix (Delphi allows declaring both a TFoo and TFooAttribute in the same unit)
+ added test
git-svn-id: trunk@42362 -
|
2019-07-12 22:05:18 +00:00 |
|
svenbarth
|
869664c6da
|
* rename custom attributes related tests to something more sensible
git-svn-id: trunk@42361 -
|
2019-07-12 22:05:12 +00:00 |
|
svenbarth
|
ed5f19e7e3
|
* change boolean parameters for try_consume_unitsym to a set
git-svn-id: trunk@42360 -
|
2019-07-12 22:05:05 +00:00 |
|
svenbarth
|
39bab2dbcc
|
* rename trtti_attributesdef to trtti_attributes_list
git-svn-id: trunk@42359 -
|
2019-07-12 22:05:00 +00:00 |
|