fmt and parser for positive set in grammar_separated
also slice with limit, implemented slice for system, changed print for slicing trace to not use unicode
This commit is contained in:
@ -2,12 +2,9 @@ use std::rc::Rc;
|
||||
use std::str::FromStr;
|
||||
use lalrpop_util::ParseError;
|
||||
|
||||
// use assert::{relabel, grouping};
|
||||
use rsprocess::{set, reaction, process, environment, system, label};
|
||||
use rsprocess::element::IdType;
|
||||
use rsprocess::element::{self, IdType};
|
||||
use rsprocess::translator::Translator;
|
||||
// use execution::presets;
|
||||
// use rsprocess::graph;
|
||||
use crate::custom_error;
|
||||
|
||||
grammar(translator: &mut Translator);
|
||||
@ -197,6 +194,16 @@ pub Set: set::Set = {
|
||||
.collect::<Vec<_>>())
|
||||
};
|
||||
|
||||
pub PositiveSet: set::PositiveSet = {
|
||||
<s: Separated_Empty<"{", PositiveLiteral, ",", "}">> =>
|
||||
set::PositiveSet::from(s)
|
||||
};
|
||||
|
||||
PositiveLiteral: (element::IdType, element::IdState) = {
|
||||
"+" <t: Literal> => (translator.encode(t), element::IdState::Positive),
|
||||
"-" <t: Literal> => (translator.encode(t), element::IdState::Negative),
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// ReactionParser
|
||||
|
||||
Reference in New Issue
Block a user