Skip to content

Commit 554a72e

Browse files
dietmarwbeutlich
andauthored
Add Modelica language (#1061)
* Add Modelica language * tests/data/Modelica.mo: Correct number of comment lines. Co-authored-by: Thomas Beutlich <[email protected]> --------- Co-authored-by: Thomas Beutlich <[email protected]>
1 parent 099092f commit 554a72e

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

languages.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,12 @@
971971
"quotes": [["\\\"", "\\\""]],
972972
"extensions": ["mlt"]
973973
},
974+
"Modelica": {
975+
"line_comment": ["//"],
976+
"multi_line_comments": [["/*", "*/"]],
977+
"quotes": [["\\\"", "\\\""]],
978+
"extensions": ["mo", "mos"]
979+
},
974980
"ModuleDef": {
975981
"name": "Module-Definition",
976982
"extensions": ["def"],

tests/data/Modelica.mo

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// 21 lines 13 code 5 comments 3 blanks
2+
block Add "Output the sum of the two inputs"
3+
extends Interfaces.SI2SO;
4+
5+
/*
6+
parameter section
7+
*/
8+
parameter Real k1=+1 "Gain of input signal 1";
9+
parameter Real k2=+1 "Gain of input signal 2";
10+
11+
// equation section
12+
equation
13+
y = k1*u1 + k2*u2;
14+
annotation (
15+
Documentation(info="<html>
16+
<p>
17+
Some documentation.
18+
</p>
19+
</html>"));
20+
21+
end Add;

0 commit comments

Comments
 (0)