Fixed implicit mobility to work in the (C++, at least) backend
This commit is contained in:
parent
5301b83148
commit
4e6b166696
|
@ -1506,6 +1506,7 @@ cgenAssign m [v] (A.ExpressionList _ [e])
|
||||||
A.Chan A.DirInput _ _ -> doAssign v e
|
A.Chan A.DirInput _ _ -> doAssign v e
|
||||||
A.Chan A.DirOutput _ _ -> doAssign v e
|
A.Chan A.DirOutput _ _ -> doAssign v e
|
||||||
A.List _ -> call genListAssign v e
|
A.List _ -> call genListAssign v e
|
||||||
|
A.Mobile (A.List _) -> call genListAssign v e
|
||||||
_ -> call genMissingC $ formatCode "assignment of type %" t
|
_ -> call genMissingC $ formatCode "assignment of type %" t
|
||||||
where
|
where
|
||||||
doAssign :: A.Variable -> A.Expression -> CGen ()
|
doAssign :: A.Variable -> A.Expression -> CGen ()
|
||||||
|
|
|
@ -278,8 +278,8 @@ instance ShowRain A.Type where
|
||||||
ao :: Bool -> String
|
ao :: Bool -> String
|
||||||
ao b = if b then "any" else "one"
|
ao b = if b then "any" else "one"
|
||||||
showRainM A.Time = tell ["time"]
|
showRainM A.Time = tell ["time"]
|
||||||
-- Mobility is not explicit in Rain:
|
-- Mobility is not explicit in Rain, but we should indicate it:
|
||||||
showRainM (A.Mobile t) = showRainM t
|
showRainM (A.Mobile t) = tell ["<mobile>"] >> showRainM t
|
||||||
showRainM (A.List t) = tell ["["] >> showRainM t >> tell ["]"]
|
showRainM (A.List t) = tell ["["] >> showRainM t >> tell ["]"]
|
||||||
showRainM (A.UnknownVarType en)
|
showRainM (A.UnknownVarType en)
|
||||||
= do tell ["(inferred type for: "]
|
= do tell ["(inferred type for: "]
|
||||||
|
@ -431,7 +431,6 @@ instance ShowRain A.Expression where
|
||||||
showRainM (A.ExprConstr _ (A.RepConstr _ _ r e))
|
showRainM (A.ExprConstr _ (A.RepConstr _ _ r e))
|
||||||
= tell ["["] >> showRainM e >> tell ["|"] >> showRainM r >> tell ["]"]
|
= tell ["["] >> showRainM e >> tell ["|"] >> showRainM r >> tell ["]"]
|
||||||
|
|
||||||
|
|
||||||
instance ShowOccam A.Formal where
|
instance ShowOccam A.Formal where
|
||||||
showOccamM (A.Formal am t n) = (maybeVal am)
|
showOccamM (A.Formal am t n) = (maybeVal am)
|
||||||
>> (showOccamM t)
|
>> (showOccamM t)
|
||||||
|
|
|
@ -360,11 +360,20 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
//If you dereference both sides, you get a proper copy-assignment:
|
//If you dereference both sides, you get a proper copy-assignment:
|
||||||
inline void operator=(const derefTockList& _rhs)
|
inline void operator=(const derefTockList& _rhs)
|
||||||
{
|
{
|
||||||
ref->data = _rhs.ref->data;
|
ref->data = _rhs.ref->data;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
inline operator tockList<T>()
|
||||||
|
{
|
||||||
|
tockList<T> x;
|
||||||
|
x.data = ref->data;
|
||||||
|
return x;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
derefTockList operator*()
|
derefTockList operator*()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user