Skip to content
Snippets Groups Projects
Commit 101f55fb authored by Cookiebowser's avatar Cookiebowser
Browse files

fixed empty sets/relations not working if they dont have a type

parent 0b2af228
No related branches found
No related tags found
1 merge request!28Rust support
use std::hash::Hash; use std::hash::Hash;
use std::clone::Clone; use std::clone::Clone;
use std::fmt::Display; use std::fmt;
use crate::bboolean::{BBoolean, BBooleanT}; use crate::bboolean::{BBoolean, BBooleanT};
pub trait BObject: Eq + Hash + Ord + Clone + Display { pub trait BObject: Eq + Hash + Ord + Clone + fmt::Display {
fn is_struct(&self) -> BBoolean { BBoolean::new(false) } fn is_struct(&self) -> BBoolean { BBoolean::new(false) }
} }
#[derive(Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Dummy {}
impl fmt::Display for Dummy {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "None") }
}
impl BObject for Dummy {}
...@@ -19,6 +19,7 @@ use std::time::{Duration}; ...@@ -19,6 +19,7 @@ use std::time::{Duration};
use std::fmt; use std::fmt;
use rand::{thread_rng, Rng}; use rand::{thread_rng, Rng};
use btypes::butils; use btypes::butils;
use btypes::bobject;
use btypes::bboolean::{IntoBool, BBooleanT}; use btypes::bboolean::{IntoBool, BBooleanT};
<imports; separator="\n"> <imports; separator="\n">
<includedMachines; separator="\n"> <includedMachines; separator="\n">
...@@ -406,7 +407,7 @@ if_expression_predicate(predicate, ifThen, ifElse) ::= << ...@@ -406,7 +407,7 @@ if_expression_predicate(predicate, ifThen, ifElse) ::= <<
>> >>
set_enumeration(leftType, type, rightType, enums, isRelation) ::= << set_enumeration(leftType, type, rightType, enums, isRelation) ::= <<
<if(isRelation)>BRelation::new<else>BSet::new<endif>(vec![<enums; separator=", ">]) <if(isRelation)>BRelation<if(!type)>::\<bobject::Dummy, bobject::Dummy><endif><else>BSet<if(!type)>::\<bobject::Dummy><endif><endif>::new(vec![<enums; separator=", ">])
>> >>
seq_enumeration(type, elements) ::= << seq_enumeration(type, elements) ::= <<
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment