lenaRB / crml-compiler

Implementation of the CRML to Modelica compiler supported by the ITEA3 EMBRACE project.
6 stars 7 forks source link

is or a built in operator or not? #19

Closed lenaRB closed 1 year ago

lenaRB commented 1 year ago
model OperatorExample2 is {
    // Definition of disjunction of two Booleans.
    Operator [ Boolean ] Boolean b1 or Boolean b2 = not (not b1 and not b2);
    // Example of function call
    Boolean b1 is external;
    Boolean b2 is external;
    Boolean b is b1 or b2;
};

but or is also defined in the specification as a built in operator, so it does not parse correctly, plus operator names should be in '', so the correct syntax is 'or' for a user defined operator

audrey-jardin commented 1 year ago

or was initially only a user-defined operator. It has now been added as a built-in operator for convenience.

lenaRB commented 1 year ago

the syntax for user operators should be between '' as we decided last spring, so you can have this example but the operator should be named 'or' it is the same for other user defined operators and templates

audrey-jardin commented 1 year ago

I forgot this...will update the corresponding examples tomorrow.