Check a single POD against a POD Request (#359)
This commit is contained in:
parent
c7b39f21f0
commit
f10a5adb41
11 changed files with 419 additions and 102 deletions
|
|
@ -2,8 +2,11 @@
|
|||
|
||||
use std::fmt::Write;
|
||||
|
||||
use crate::middleware::{
|
||||
CustomPredicate, CustomPredicateBatch, Predicate, StatementTmpl, StatementTmplArg, Value,
|
||||
use crate::{
|
||||
frontend::PodRequest,
|
||||
middleware::{
|
||||
CustomPredicate, CustomPredicateBatch, Predicate, StatementTmpl, StatementTmplArg, Value,
|
||||
},
|
||||
};
|
||||
|
||||
/// Trait for converting AST nodes to Podlang source code
|
||||
|
|
@ -122,6 +125,19 @@ impl PrettyPrint for Value {
|
|||
}
|
||||
}
|
||||
|
||||
impl PrettyPrint for PodRequest {
|
||||
fn fmt_podlang_with_indent(&self, w: &mut dyn Write, _indent: usize) -> std::fmt::Result {
|
||||
write!(w, "REQUEST(")?;
|
||||
for (i, template) in self.request_templates.iter().enumerate() {
|
||||
if i > 0 {
|
||||
write!(w, ", ")?;
|
||||
}
|
||||
template.fmt_podlang_with_indent(w, 4)?;
|
||||
}
|
||||
write!(w, ")")
|
||||
}
|
||||
}
|
||||
|
||||
fn fmt_predicate_definition(
|
||||
w: &mut dyn Write,
|
||||
predicate: &CustomPredicate,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue