Changeset 0df6e65 in OpenModelica
- Timestamp:
- 2020-06-03T17:49:49+02:00 (4 years ago)
- Branches:
- Added-citation-metadata, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- 59c0cf1, afc001c8
- Parents:
- 58b509d7
- git-author:
- Per Östlund <perost86@…> (06/03/20 14:29:11)
- git-committer:
- perost <perost86@…> (06/03/20 17:49:49)
- Location:
- OMCompiler/Compiler/Util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
OMCompiler/Compiler/Util/Config.mo
r5c1cf16 r0df6e65 48 48 public 49 49 50 type LanguageStandard = enumeration('1.x', '2.x', '3.0', '3.1', '3.2', '3.3', latest)50 type LanguageStandard = enumeration('1.x', '2.x', '3.0', '3.1', '3.2', '3.3', '3.4', latest, '3.5', experimental) 51 51 "Defines the various modelica language versions that OMC can use."; 52 52 … … 451 451 output Integer outValue; 452 452 protected 453 constant Integer lookup[LanguageStandard] = array(10, 20, 30, 31, 32, 33, 1000);453 constant Integer lookup[LanguageStandard] = array(10, 20, 30, 31, 32, 33, 34, 1000, 1035, 9999); 454 454 algorithm 455 455 outValue := lookup[inStandard]; … … 467 467 case 32 then LanguageStandard.'3.2'; 468 468 case 33 then LanguageStandard.'3.3'; 469 case 34 then LanguageStandard.'3.4'; 469 470 case 1000 then LanguageStandard.latest; 471 case 1035 then LanguageStandard.'3.5'; 472 case 9999 then LanguageStandard.experimental; 470 473 end match; 471 474 end intLanguageStandard; … … 475 478 output String outString; 476 479 protected 477 constant String lookup[LanguageStandard] = array("1.x","2.x","3.0","3.1","3.2","3.3","3. 3" /*Change this to latest version if you add more versions!*/);480 constant String lookup[LanguageStandard] = array("1.x","2.x","3.0","3.1","3.2","3.3","3.4","3.4","3.5","experimental" /*Change this to latest version if you add more versions!*/); 478 481 algorithm 479 482 outString := lookup[inStandard]; … … 493 496 _ := matchcontinue(inLibraryName) 494 497 local 495 String version , new_std_str;498 String version; 496 499 LanguageStandard new_std; 497 Boolean show_warning;498 500 499 501 case _ … … 501 503 "Modelica" :: version :: _ := System.strtok(inLibraryName, " "); 502 504 new_std := versionStringToStd(version); 503 if new_std==current_std then 504 return;505 end if;506 setLanguageStandard(new_std); 507 show_warning := hasLanguageStandardChanged(current_std);508 new_std_str := languageStandardString(new_std);509 if show_warning then510 Error.addMessage(Error.CHANGED_STD_VERSION, {new_std_str, version});505 506 if new_std <> current_std then 507 setLanguageStandard(new_std); 508 509 if hasLanguageStandardChanged(current_std) then 510 Error.addMessage(Error.CHANGED_STD_VERSION, 511 {languageStandardString(new_std), version}); 512 end if; 511 513 end if; 512 514 then (); … … 545 547 case "3" :: "0" :: _ then LanguageStandard.'3.0'; 546 548 case "3" :: "1" :: _ then LanguageStandard.'3.1'; 549 //case "3" :: "2" :: "3" :: _ then LanguageStandard.'3.3'; 547 550 case "3" :: "2" :: _ then LanguageStandard.'3.2'; 548 551 case "3" :: "3" :: _ then LanguageStandard.'3.3'; … … 636 639 "@autor: adrpo 637 640 checks returns true if language standard is above or equal to Modelica 3.3" 638 output Boolean outRes; 639 protected 640 LanguageStandard std = getLanguageStandard(); 641 algorithm 642 outRes := intGe(languageStandardInt(std), 33); 641 output Boolean outRes = getLanguageStandard() >= LanguageStandard.'3.3'; 643 642 end synchronousFeaturesAllowed; 644 643 -
OMCompiler/Compiler/Util/Flags.mo
r2a7b5004 r0df6e65 595 595 constant ConfigFlag LANGUAGE_STANDARD = CONFIG_FLAG(8, "std", NONE(), EXTERNAL(), 596 596 ENUM_FLAG(1000, 597 {("1.x", 10), ("2.x", 20), ("3.0", 30), ("3.1", 31), ("3.2", 32), ("3.3", 33), ("latest",1000)}), 598 SOME(STRING_OPTION({"1.x", "2.x", "3.1", "3.2", "3.3", "latest"})), 597 {("1.x", 10), ("2.x", 20), ("3.0", 30), ("3.1", 31), ("3.2", 32), ("3.3", 33), 598 ("3.4", 34), ("latest",1000), ("3.5", 1035), ("experimental", 9999)}), 599 SOME(STRING_OPTION({"1.x", "2.x", "3.1", "3.2", "3.3", "3.4", "latest", "3.5", "experimental"})), 599 600 Gettext.gettext("Sets the language standard that should be used.")); 600 601
Note: See TracChangeset
for help on using the changeset viewer.