Changeset 3eae525 in OpenModelica
- Timestamp:
- 2021-11-26T17:34:24+01:00 (2 years ago)
- Branches:
- maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- 6ec8257, b3681ace
- Parents:
- da94d68a
- git-author:
- perost <perost86@…> (11/26/21 17:34:24)
- git-committer:
- GitHub <noreply@…> (11/26/21 17:34:24)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
OMCompiler/Compiler/NFFrontEnd/NFFlatModel.mo
r4fb12f37 r3eae525 53 53 import MetaModelica.Dangerous.listReverseInPlace; 54 54 import Util; 55 import Prefixes = NFPrefixes; 56 import NFPrefixes.Visibility; 55 57 56 58 import FlatModel = NFFlatModel; … … 214 216 protected 215 217 FlatModel flat_model = flatModel; 218 Visibility visibility = Visibility.PUBLIC; 216 219 algorithm 217 220 s := IOStream.append(s, "class '" + flat_model.name + "'\n"); … … 232 235 233 236 for v in flat_model.variables loop 237 if visibility <> Variable.visibility(v) then 238 visibility := Variable.visibility(v); 239 s := IOStream.append(s, Prefixes.visibilityString(visibility)); 240 s := IOStream.append(s, "\n"); 241 end if; 242 234 243 s := Variable.toFlatStream(v, " ", printBindingTypes, s); 235 244 s := IOStream.append(s, ";\n"); 236 245 end for; 237 238 s := IOStream.append(s, "public\n");239 246 240 247 if not listEmpty(flat_model.initialEquations) then -
OMCompiler/Compiler/NFFrontEnd/NFVariable.mo
rb90fb73 r3eae525 163 163 end variability; 164 164 165 function visibility 166 input Variable variable; 167 output Visibility visibility = variable.visibility; 168 end visibility; 169 165 170 function isEmptyArray 166 171 input Variable variable; … … 317 322 s := IOStream.append(s, indent); 318 323 319 if var.visibility == Visibility.PROTECTED then320 s := IOStream.append(s, "protected ");321 else322 s := IOStream.append(s, "public ");323 end if;324 325 324 s := Component.Attributes.toFlatStream(var.attributes, var.ty, s, ComponentRef.isSimple(var.name)); 326 325 s := IOStream.append(s, Type.toFlatString(var.ty)); -
testsuite/flattening/modelica/scodeinst/CombineSubscripts3.mo
rf6468ae r3eae525 22 22 // Result: 23 23 // class 'CombineSubscripts3' 24 // public Real[3] 'b.p'; 25 // public Real[3, 4] 'b.x'; 26 // public 24 // Real[3] 'b.p'; 25 // Real[3, 4] 'b.x'; 27 26 // equation 28 27 // for 'i' in 1:3 loop -
testsuite/openmodelica/flatmodelica/SD.mo
r4fb12f37 r3eae525 44 44 // Result: 45 45 // class 'SD' 46 // public parameter Integer 'N' = 3; 47 // public parameter Real[3] 'p' = {1.0, 1.5, 2.0}; 48 // public Real[3] 'c.c.f'; 49 // public Real[3] 'c.c.e'; 50 // public Real[3, {3, 4, 5}] 'c.x'; 51 // public parameter Real[3] 'c.p' = 'p'[:]; 52 // public parameter Integer[3] 'c.N' = {3, 4, 5}; 53 // public parameter Real 's.p' = 3.0; 54 // public Real 's.c.e'; 55 // public Real 's.c.f'; 56 // public 46 // parameter Integer 'N' = 3; 47 // parameter Real[3] 'p' = {1.0, 1.5, 2.0}; 48 // Real[3] 'c.c.f'; 49 // Real[3] 'c.c.e'; 50 // Real[3, {3, 4, 5}] 'c.x'; 51 // parameter Real[3] 'c.p' = 'p'[:]; 52 // parameter Integer[3] 'c.N' = {3, 4, 5}; 53 // parameter Real 's.p' = 3.0; 54 // Real 's.c.e'; 55 // Real 's.c.f'; 57 56 // equation 58 57 // 'c.x'[:,1] = 'c.c.e'[:];
Note: See TracChangeset
for help on using the changeset viewer.