Parse assumptions
This commit is contained in:
@@ -23,8 +23,6 @@ use strum::{EnumDiscriminants, EnumIter};
|
||||
|
||||
use crate::prelude::*;
|
||||
|
||||
// TODO: migrate AST logic (after redesigning grammar)
|
||||
|
||||
/// Retrieves, but does not parse, all top-level items in a file.
|
||||
// TODO: is `Vec` the most efficient to incrementally update here?
|
||||
#[salsa::tracked]
|
||||
@@ -186,14 +184,19 @@ pub fn import<'db>(db: &'db dyn Database, ast: AstNode) -> Import<'db> {
|
||||
pub struct Import<'db> {}
|
||||
|
||||
/// Parses [Assumption] from an [AstNode].
|
||||
// TODO: parse soft weights
|
||||
#[salsa::tracked]
|
||||
pub fn assumption<'db>(db: &'db dyn Database, ast: AstNode) -> Assumption<'db> {
|
||||
todo!()
|
||||
let body = rule_body(db, ast.expect_field(db, "body"));
|
||||
Assumption::new(db, body)
|
||||
}
|
||||
|
||||
/// An abstract assumption.
|
||||
#[salsa::tracked]
|
||||
pub struct Assumption<'db> {}
|
||||
pub struct Assumption<'db> {
|
||||
/// The assumption's rule body.
|
||||
pub body: RuleBody<'db>,
|
||||
}
|
||||
|
||||
/// Parses a rule body.
|
||||
// TODO: parallelize?
|
||||
|
||||
Reference in New Issue
Block a user