Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
b2program
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
b2program
Commits
101f55fb
Commit
101f55fb
authored
2 years ago
by
Cookiebowser
Browse files
Options
Downloads
Patches
Plain Diff
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
!28
Rust support
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
btypes_primitives/src/main/rust/btypes/src/bobject.rs
+11
-3
11 additions, 3 deletions
btypes_primitives/src/main/rust/btypes/src/bobject.rs
src/main/resources/de/hhu/stups/codegenerator/RustTemplate.stg
+2
-1
2 additions, 1 deletion
...ain/resources/de/hhu/stups/codegenerator/RustTemplate.stg
with
13 additions
and
4 deletions
btypes_primitives/src/main/rust/btypes/src/bobject.rs
+
11
−
3
View file @
101f55fb
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
{}
This diff is collapsed.
Click to expand it.
src/main/resources/de/hhu/stups/codegenerator/RustTemplate.stg
+
2
−
1
View file @
101f55fb
...
@@ -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) ::= <<
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment