Skip to content

Commit

Permalink
Add API to provide "logic" typecode (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
tirix authored Mar 13, 2022
1 parent 228c431 commit 1343089
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1322,11 +1322,19 @@ impl Grammar {
}

/// Returns the provable typecode for this grammar
/// (for set.mm, that is `|-`)
#[must_use]
pub const fn provable_typecode(&self) -> TypeCode {
self.provable_type
}

/// Returns the logic typecode for this grammar
/// (for set.mm, that is `wff`)
#[must_use]
pub const fn logic_typecode(&self) -> TypeCode {
self.logic_type
}

/// Lists the contents of the grammar's parse table. This can be used for debugging.
pub fn dump(&self, db: &Database) {
println!("Grammar tree has {:?} nodes.", self.nodes.len());
Expand Down

0 comments on commit 1343089

Please sign in to comment.