diff options
author | Aria Shrimpton <me@aria.rip> | 2024-03-07 16:18:32 +0000 |
---|---|---|
committer | Aria Shrimpton <me@aria.rip> | 2024-03-07 16:18:32 +0000 |
commit | 5054797d2b48b802f31634f340592444d6d867f7 (patch) | |
tree | 52d578067c064f4236f66343a87b475ad97edb79 /src | |
parent | 8b9a33abc37f85a65db46f22de2ad6e8807cc24a (diff) |
workaround eager sorted vec problem
Diffstat (limited to 'src')
-rw-r--r-- | src/crates/library/src/eager_sorted_vector.rs | 6 | ||||
-rw-r--r-- | src/crates/primrose/src/selector.rs | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/crates/library/src/eager_sorted_vector.rs b/src/crates/library/src/eager_sorted_vector.rs index 0df0ab4..27d454b 100644 --- a/src/crates/library/src/eager_sorted_vector.rs +++ b/src/crates/library/src/eager_sorted_vector.rs @@ -167,7 +167,7 @@ impl<T: Ord> Indexable<T> for EagerSortedVec<T> { (cond [(null? xs) (cons xs null)] [else (cons xs (first xs))])) - (define (pre-first xs) (equal? xs (sort xs <))) + (define (pre-first xs) #t) (define (post-first xs r) (equal? r (op-first xs))) *ENDLIBSPEC*/ fn first(&self) -> Option<&T> { @@ -182,7 +182,7 @@ impl<T: Ord> Indexable<T> for EagerSortedVec<T> { (cond [(null? xs) (cons xs null)] [else (cons xs (last xs))])) - (define (pre-last xs) (equal? xs (sort xs <))) + (define (pre-last xs) #t) (define (post-last xs r) (equal? r (op-last xs))) *ENDLIBSPEC*/ fn last(&self) -> Option<&T> { @@ -198,7 +198,7 @@ impl<T: Ord> Indexable<T> for EagerSortedVec<T> { [(>= n (length xs)) (cons xs null)] [(< n 0) (cons xs null)] [else (cons xs (list-ref xs n))])) - (define (pre-nth xs) (equal? xs (sort xs <))) + (define (pre-nth xs) #t) (define (post-nth xs n r) (equal? r (op-nth xs n))) *ENDLIBSPEC*/ fn nth(&self, n: usize) -> Option<&T> { diff --git a/src/crates/primrose/src/selector.rs b/src/crates/primrose/src/selector.rs index fd6f294..944e558 100644 --- a/src/crates/primrose/src/selector.rs +++ b/src/crates/primrose/src/selector.rs @@ -120,11 +120,12 @@ impl ContainerSelector { .map(|t| t.extract_prop_desc()) .collect(); - let bounds: Vec<Description> = tags + let mut bounds: Vec<Description> = tags .iter() .filter(|t| t.is_bound_tag()) .flat_map(|t| t.extract_bound_descs()) .collect(); + bounds.sort(); let mut structs = Vec::new(); @@ -154,6 +155,7 @@ impl ContainerSelector { self.analyser.prop_specs().get(p).expect( &("Error: No property specification found for: ".to_string() + &p), ); + debug!("Checking bound {i}..."); gen_match_script( p, self.match_setup.get(i).unwrap(), |