From 5054797d2b48b802f31634f340592444d6d867f7 Mon Sep 17 00:00:00 2001 From: Aria Shrimpton Date: Thu, 7 Mar 2024 16:18:32 +0000 Subject: workaround eager sorted vec problem --- src/crates/library/src/eager_sorted_vector.rs | 6 +++--- src/crates/primrose/src/selector.rs | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/crates') 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 Indexable for EagerSortedVec { (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 Indexable for EagerSortedVec { (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 Indexable for EagerSortedVec { [(>= 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 = tags + let mut bounds: Vec = 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(), -- cgit v1.2.3