Commit Graph

19 Commits

Author SHA1 Message Date
Mikolaj Wielgus 9664f1a31a fix: get rid of some indeterminism by using B-trees instead of hash maps
I have replaced all instances of `HashMap<...>` with `BTreeMap<...>`,
of `HashSet<...>` with `BTreeSet<...>`, and all the uses of the `Hash`
trait with `Ord`.

I have done a few manual tests and found the behavior to be
deterministic between the GUI application launches. However, undoing an
autoroute command and then manually executing it once again continues to
produce variable results. I suppose this is because of some bug in the
code where edits are applied. Hence, the issue

https://codeberg.org/topola/topola/issues/46

is only partially resolved.
2025-01-04 01:56:00 +01:00
Alain Emilia Anna Zscheile 53b964b865 feat: implement bounding box selection (#139)
Fixes #138

Reviewed-on: https://codeberg.org/topola/topola/pulls/139
Co-authored-by: Alain Emilia Anna Zscheile <fogti+devel@ytrizja.de>
Co-committed-by: Alain Emilia Anna Zscheile <fogti+devel@ytrizja.de>
2025-01-02 22:12:11 +00:00
Mikolaj Wielgus 44c30caafe chore(licensing): add REUSE license headers to `**.{rs,md,toml}` files
I ran the following command in Fish shell:

```
reuse annotate --skip-unrecognised --copyright="Topola contributors" --license="MIT" **.{rs,md,toml}
```

The choice of year 2024 in the copyright statements is intentional.
2024-12-29 22:47:00 +01:00
Alain Emilia Anna Zscheile ba41ff6837 refactor: get rid of unnecessary bounds on struct generics 2024-12-12 16:38:26 +01:00
Alain Emilia Anna Zscheile 81a6ec22d0 refactor(specctra-core): merge common.rs into lib.rs 2024-12-12 06:59:03 +00:00
Alain Emilia Anna Zscheile ae006173ce chore(specctra-core/read): remove unnecessary bound from ListTokenizer 2024-12-12 06:59:03 +00:00
Alain Emilia Anna Zscheile 3e7526bcc6 chore(specctra-core): remove unused stuff 2024-12-12 06:59:03 +00:00
Alain Emilia Anna Zscheile 7737aaf0cc refactor(specctra-core/read): inline expect_leaf into only callsite 2024-12-12 06:59:03 +00:00
Alain Emilia Anna Zscheile ca012a8c13 refactor(specctra-core/read): inline expect_* functions from ListToken into InputToken 2024-12-12 06:59:03 +00:00
Alain Emilia Anna Zscheile 81c0de1f91 refactor(specctra-core/read): implement read_named via read_optional 2024-12-12 06:59:03 +00:00
Alain Emilia Anna Zscheile 50ef279286 refactor(specctra-core/read): reuse String::read_dsn where possible 2024-12-12 06:59:03 +00:00
Alain Emilia Anna Zscheile 5e54453433 refactor(specctra-core/read): accept multiple possible names anywhere
Previously, some methods handled items/lists with multiple allowed names,
and some only allowed a single name. As the overhead of always handling
multiple names isn't that large, do that everywhere and make the overall
API more streamlined in the process.
2024-12-12 06:59:03 +00:00
Alain Emilia Anna Zscheile e90449b75e refactor(specctra-core/read): use macro to produce repetitive impl ReadDsn via FromStr 2024-12-12 06:59:03 +00:00
Alain Emilia Anna Zscheile 5f4496ffce refactor(specctra-core/read): align read_optional to be like read_array_with_alias 2024-12-12 06:59:03 +00:00
Alain Emilia Anna Zscheile 8fb9bfc0e6 feat(specctra-core/error): separate errors for expected leaf / end-of-list 2024-12-12 06:59:03 +00:00
Alain Emilia Anna Zscheile 9e0bdb5bc7 refactor: various further refactorings (#128)
These optimize out unnecessary code duplication, reserve vector capacity beforehand by leveraging `Iterator`s and avoid unnecessary double-lookups into HashMaps.

Reviewed-on: https://codeberg.org/topola/topola/pulls/128
Co-authored-by: Alain Emilia Anna Zscheile <fogti+devel@ytrizja.de>
Co-committed-by: Alain Emilia Anna Zscheile <fogti+devel@ytrizja.de>
2024-12-11 14:13:21 +00:00
Alain Emilia Anna Zscheile cbf99e0a6e feat(specctra-core-fuzz): actually test roundtrip through serialization+parsing 2024-12-06 14:38:09 +01:00
Alain Emilia Anna Zscheile e381731475 feat(specctra-core/write): get rid of unnecessary restrictions on method args 2024-12-06 14:38:09 +01:00
Alain Emilia Anna Zscheile 0fe23c9c71 build: put `specctra` module into separate crate 2024-12-06 14:38:00 +01:00