From 1343089943b17dcb77221ef412cd8286aec0a963 Mon Sep 17 00:00:00 2001 From: tirix <5831830+tirix@users.noreply.github.com> Date: Sun, 13 Mar 2022 14:05:17 +0800 Subject: [PATCH] Add API to provide "logic" typecode (#77) --- src/grammar.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/grammar.rs b/src/grammar.rs index c0976ff..916d202 100644 --- a/src/grammar.rs +++ b/src/grammar.rs @@ -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());