Commit Graph

17 Commits

Author SHA1 Message Date
Giacomo Vercesi 90ea42b695 model/_util.py: move into tupletree.py
Move the contents of `model/_util.py` into `tupletree.py` as it's
model-agnostic and used by all generated Python tuple-tree wrappers.
2023-09-14 15:44:32 +02:00
Alessandro Di Federico 247879f7fc model::Type::ID: switch to progressive IDs
This commit switches `model::Type::ID` from being a GUID to be a
progressive number, in order to make things easier for humans.

On top of this, this commit introduces the following changes:

* TypeCopier: import all the necessary PrimitiveTypes and improve
  handling of CustomName.
* Move Kind as the last field of the key of each TupleTree type used in
  an `UpcastablePointer`.
* Update the ground truth of tests to ignore the `CustomName` in favor
  of focusing on `OriginalName`.
* Increase adoption of `model::Binary::makeType`, equivalent to
  `Binary.recordNewType(makeType<model::*Type>())`.
2023-08-23 16:14:04 +02:00
Giacomo Vercesi 3a006422d3 typescript/python model wrappers: fix structure
Change the way the python and typescript model wrappers handle
attributes in struct fields. Now all fields are populated and none of
the use `None`.
2023-07-21 09:34:00 +02:00
Giacomo Vercesi 152a624f47 revng.model: drop last version autodetection
revng.model.__init__ would dynamically import the latest version of
the model when imported, however this would break IDE hints as the
classes would not be properly detected. Instead we now manually
specify the last version in the __init__.py file.
2022-07-22 15:07:14 +02:00
Giacomo Vercesi 116d965117 revng.model: implement kw_only
Implement a constructor override for model classes that checks that the
constructor does not have positional arguments passed to it. This can
be dropped post-3.10 since it is implemented natively by kw_only.
2022-07-22 14:56:15 +02:00
Giacomo Vercesi 2329201ba1 revng.model: import contents of MetaAddress
This allows to have all the classes needed for model manipulation to
be available with `from revng.model import *`.
2022-07-22 14:56:15 +02:00
Giacomo Vercesi 018518d783 revng.model: remove tags from dumper
Tags in the yaml have been deprecated for a while, remove them from
being outputted from YAML dumper.
2022-07-22 14:56:15 +02:00
Giacomo Vercesi bbce0b33e5 revng-check-conventions: introduce isort 2022-04-20 09:57:08 +02:00
Giacomo Vercesi 46821cee5f revng-check-conventions: introduce mypy 2022-04-20 09:57:01 +02:00
Giacomo Vercesi 31a836e48c revng-check-conventions: introduce flake8 2022-04-20 09:56:44 +02:00
Giacomo Vercesi d81dc49809 revng-check-conventions: license check 2022-04-20 09:55:18 +02:00
Giacomo Vercesi a2b5dbb1dc TupleTreeGenerator: autogenerate Kind 2022-04-08 17:36:59 +02:00
Giacomo Vercesi 039f7db93e model::*: ensure Kind -> Class correspondence 2022-04-08 17:31:05 +02:00
Filippo Cremonese 70a460c46a TupleTreeGenerator: use dataclasses
Give up on pydantic.
2022-03-22 17:52:02 +01:00
Alessandro Di Federico 9608b337c6 Python formatting: switch to black 22 2022-03-02 15:40:27 +01:00
Filippo Cremonese 7f7a222410 python-model: handle importing multiple versions 2022-02-23 18:03:36 +01:00
Filippo Cremonese 09a995ba51 python-model: generate from jsonschema 2022-02-23 18:03:35 +01:00