Add Modelica language (#1061)

* Add Modelica language

* tests/data/Modelica.mo: Correct number of comment lines.

Co-authored-by: Thomas Beutlich <modelica@tbeu.de>

---------

Co-authored-by: Thomas Beutlich <modelica@tbeu.de>
This commit is contained in:
Dietmar Winkler 2024-08-16 13:03:24 +02:00 committed by GitHub
parent 099092fa1b
commit 554a72e44a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 0 deletions

View file

@ -971,6 +971,12 @@
"quotes": [["\\\"", "\\\""]],
"extensions": ["mlt"]
},
"Modelica": {
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
"quotes": [["\\\"", "\\\""]],
"extensions": ["mo", "mos"]
},
"ModuleDef": {
"name": "Module-Definition",
"extensions": ["def"],

21
tests/data/Modelica.mo Normal file
View file

@ -0,0 +1,21 @@
// 21 lines 13 code 5 comments 3 blanks
block Add "Output the sum of the two inputs"
extends Interfaces.SI2SO;
/*
parameter section
*/
parameter Real k1=+1 "Gain of input signal 1";
parameter Real k2=+1 "Gain of input signal 2";
// equation section
equation
y = k1*u1 + k2*u2;
annotation (
Documentation(info="<html>
<p>
Some documentation.
</p>
</html>"));
end Add;