Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a672b2
commit c057936
Showing
11 changed files
with
197 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// name: End1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
model End1 | ||
Real x[3]; | ||
equation | ||
x[end] = 1; | ||
end End1; | ||
|
||
// Result: | ||
// class End1 | ||
// Real x[1]; | ||
// Real x[2]; | ||
// Real x[3]; | ||
// equation | ||
// x[3] = 1; | ||
// end End1; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// name: EndInvalid1 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
model EndInvalid1 | ||
Real x; | ||
equation | ||
x = end; | ||
end EndInvalid1; | ||
|
||
// Result: | ||
// Error processing file: EndInvalid1.mo | ||
// [flattening/modelica/scodeinst/EndInvalid1.mo:11:3-11:10:writable] Error: 'end' can not be used outside array subscripts. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// name: EndInvalid2 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
model EndInvalid2 | ||
Real x; | ||
equation | ||
x[end] = 1; | ||
end EndInvalid2; | ||
|
||
// Result: | ||
// Error processing file: EndInvalid2.mo | ||
// [flattening/modelica/scodeinst/EndInvalid2.mo:11:3-11:13:writable] Error: Wrong number of subscripts in x[end] (1 subscripts for 0 dimensions). | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// name: Subscript1.mo | ||
// name: Subscript1 | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// name: SubscriptTooMany1 | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model SubscriptTooMany1 | ||
Real x[3] = {1, 2, 3}; | ||
Real y = x[2, 2]; | ||
end SubscriptTooMany1; | ||
|
||
// Result: | ||
// Error processing file: SubscriptTooMany1.mo | ||
// [flattening/modelica/scodeinst/SubscriptTooMany1.mo:8:3-8:19:writable] Error: Wrong number of subscripts in x[2, 2] (2 subscripts for 1 dimensions). | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// name: SubscriptWrongType1 | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model SubscriptWrongType1 | ||
Real x[3] = {1, 2, 3}; | ||
Real y = x["1"]; | ||
end SubscriptWrongType1; | ||
|
||
// Result: | ||
// Error processing file: SubscriptWrongType1.mo | ||
// [flattening/modelica/scodeinst/SubscriptWrongType1.mo:8:3-8:18:writable] Error: Expression '"1"' has type String, expected type Integer. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// name: SubscriptWrongType2 | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model SubscriptWrongType2 | ||
type E = enumeration(one, two, three); | ||
Real x[E]; | ||
Real y = x[1]; | ||
end SubscriptWrongType2; | ||
|
||
// Result: | ||
// Error processing file: SubscriptWrongType2.mo | ||
// [flattening/modelica/scodeinst/SubscriptWrongType2.mo:9:3-9:16:writable] Error: Expression '1' has type Integer, expected type enumeration(one, two, three). | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// name: TypenameInvalid1 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model TypenameInvalid1 | ||
Boolean b[Boolean]; | ||
equation | ||
b = Boolean; | ||
end TypenameInvalid1; | ||
|
||
// Result: | ||
// Error processing file: TypenameInvalid1.mo | ||
// [flattening/modelica/scodeinst/TypenameInvalid1.mo:10:3-10:14:writable] Error: Type name 'Boolean' is not allowed in this context. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// name: TypenameInvalid2 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model TypenameInvalid2 | ||
type E = enumeration(one, two, three); | ||
Real x; | ||
equation | ||
x = E; | ||
end TypenameInvalid2; | ||
|
||
// Result: | ||
// Error processing file: TypenameInvalid2.mo | ||
// [flattening/modelica/scodeinst/TypenameInvalid2.mo:11:3-11:8:writable] Error: Type name 'E' is not allowed in this context. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// name: TypenameInvalid3 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model TypenameInvalid3 | ||
type E = enumeration(one, two, three); | ||
Real x[E] = E; | ||
end TypenameInvalid3; | ||
|
||
// Result: | ||
// Error processing file: TypenameInvalid3.mo | ||
// [flattening/modelica/scodeinst/TypenameInvalid3.mo:9:3-9:16:writable] Error: Type name 'E' is not allowed in this context. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |