Skip to content
Richard Braakman edited this page Mar 1, 2024 · 11 revisions

These are some development branches that weren't merged yet because of various problems.

different-titles

This branch aims to detect cases of feeding a duchy to an iterator that expects a county scope, or using a county where a barony was expected. It does it by splitting Scopes::LandedTitle into five smaller scope types (one for each tier), and making LandedTitle itself the combination of those types.

Unfortunately this mostly finds false positives, because of cases like a list of titles where titles of various tiers are thrown together. The ScopeContext tries to narrow that down to a single scope type, meaning in this case a single rank.

Before this can be merged, ScopeContext will have to be smarter about deliberately multi-typed lists, or else get some special case handling for the LandedTitle subtypes.

scope-context-maker

This branch is an experiment for making it easier to base ScopeContext on a field's key. It involves passing a closure instead of a &mut ScopeContext to the Validator functions. However, to keep the number of functions from exploding, it adds a ScopeContextMaker trait that can take either such a closure, or an &mut ScopeContext, or a Scopes for the same function, and it either makes a new ScopeContext or passes down the received one.

Unfortunately I haven't found a way to make this work with the type system. I tried implementing the trait specifically for the &mut version of ScopeContext, but that still makes the borrow checker think the sc is being consumed by the call.

Before this can be merged, I need a solution to the types problem.

cached-parse

This branch is a work in progress for caching the output of the pdx parser and serializing/deserializing it instead of parsing the same files again. The idea is to skip both the work of parsing and the I/O of loading the source files. The serialized files are expected to be smaller, so less I/O.

Unfortunately, so far it only gives about a 5% speedup, which is not worth introducing the complexity of a cache.

test-windows

This branch is not meant for merging. It is used by .github/workflows/test-windows.yml to make builds for Windows, so that they can be tested by contributors before a release is made.

Clone this wiki locally