Skip to content

Commit

Permalink
Merge pull request #28 from tirix/sts-tc
Browse files Browse the repository at this point in the history
Correct STS typecode for syntax definitions
  • Loading branch information
tirix authored Nov 12, 2023
2 parents fcd37d4 + bf8f09b commit 79043c6
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl ExpressionRenderer {
let nset = database.name_result();
let grammar = database.grammar_result();
let mut tokens = sref.math_iter();
let _typecode = nset.get_atom(&tokens.next().unwrap());
let typecode = nset.get_atom(&tokens.next().unwrap());
grammar
.parse_formula(
&mut tokens.map(|t| {
Expand All @@ -128,7 +128,7 @@ impl ExpressionRenderer {
})
}),
&grammar.typecodes(),
true,
typecode == grammar.provable_typecode(),
nset,
)
.map_err(|e| format!("Could not parse formula (GF): {}", e))
Expand All @@ -139,17 +139,10 @@ impl ExpressionRenderer {
&self,
formula: &Formula,
database: &Database,
use_provables: bool,
#[allow(unused_variables)] use_provables: bool,
) -> Result<String, String> {
match self {
ExpressionRenderer::Ascii => {
let s = format!("<pre>{}</pre>", formula.as_ref(database));
Ok(if use_provables {
s.replace("wff ", " |- ")
} else {
s
})
}
ExpressionRenderer::Ascii => Ok(format!("<pre>{}</pre>", formula.as_ref(database))),
ExpressionRenderer::Unicode(uni) => uni.render_formula(formula),
#[cfg(feature = "sts")]
ExpressionRenderer::Sts(sts) => sts.render_formula(formula, use_provables),
Expand Down

0 comments on commit 79043c6

Please sign in to comment.