Skip to content

Commit

Permalink
split Node into newtypes of Item, ItemSummary and ExternalCrate WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
StuartHarris committed Dec 7, 2024
1 parent b9caf63 commit fbe6b6b
Show file tree
Hide file tree
Showing 6 changed files with 456 additions and 419 deletions.
10 changes: 8 additions & 2 deletions crux_cli/src/codegen/filter.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
use ascent::ascent;

use super::node::Node;
use super::node::{Node, Summary};

ascent! {
pub struct Filter;

// ------- facts ------------------
relation node(Node);
relation summary(Summary);

// ------- rules ------------------

relation has_summary(Node, Summary);
has_summary(n, s) <-- node(n), summary(s), if n.has_summary(s);

relation is_struct(Node);
is_struct(s) <-- node(s), if s.is_struct();

Expand Down Expand Up @@ -68,7 +72,9 @@ ascent! {
is_enum(effect),
node(effect_impl),
if effect_impl.is_impl_for(effect, "Effect"),
if app.is_in_same_module_as(effect),
has_summary(app, app_summary),
has_summary(effect, effect_summary),
if app_summary.in_same_module_as(effect_summary),
type_of(effect_ffi_item, effect_ffi),
if effect_impl.has_associated_item(effect_ffi_item, "Ffi");

Expand Down
Loading

0 comments on commit fbe6b6b

Please sign in to comment.