mod declaration;
mod desugar;
mod error;
mod inliner;
mod logic;
mod primitive;
mod program;
mod segment;
pub use error::{DirectiveKind, ParseError};
pub use declaration::Relation;
pub use logic::{
AggregationOperator, ArithmeticOperator, BuiltinOperator, ComparisonOperator, FlowLogRule,
};
pub use primitive::{ConstType, DataType};
pub(crate) use primitive::{TypeId, TypeRegistry};
pub use program::Program;
pub(crate) use logic::{
Aggregation, Arithmetic, Atom, AtomArg, BuiltinCall, ComparisonExpr, Factor, FnCall, HeadArg,
IterativeDirective, LoopCondition, LoopConnective, Predicate,
};
pub(crate) use segment::Segment;
use crate::common::{FileId, Span};
use pest::iterators::Pair;
use pest_derive::Parser;
#[derive(Parser)]
#[grammar = "parser/grammar.pest"]
pub(crate) struct FlowLogParser;
pub(crate) trait Lexeme: Sized {
fn from_parsed_rule(parsed_rule: Pair<Rule>, file: FileId) -> Result<Self, ParseError>;
}
pub(crate) fn span_of(pair: &Pair<Rule>, file: FileId) -> Span {
let s = pair.as_span();
Span::new(file, s.start() as u32, s.end() as u32)
}
pub(crate) fn type_ref_name(pair: &Pair<Rule>) -> String {
pair.as_str().trim().to_string()
}