Skip to content

Commit

Permalink
Added testcase for fully qualified import.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed Sep 13, 2017
1 parent 8e05bdf commit e8ef378
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
5 changes: 0 additions & 5 deletions openmodelica/parser/DotName.mo
Expand Up @@ -3,11 +3,6 @@ record R
end R;

class DotName
import .A;
import .A.B;
import a = .A;
import b = .A.B;
import .A.B.C.*;
constant .R r = .R(1.5);
.DotName.Real r2 = .DotName.r;
class R
Expand Down
5 changes: 0 additions & 5 deletions openmodelica/parser/DotName.mos
Expand Up @@ -16,11 +16,6 @@ list();
// end R;
//
// class DotName
// import .A;
// import .A.B;
// import a = .A;
// import b = .A.B;
// import .A.B.C.*;
// constant .R r = .R(1.5);
// .DotName.Real r2 = .DotName.r;
//
Expand Down
26 changes: 26 additions & 0 deletions openmodelica/parser/ImportFullyQualified.mo
@@ -0,0 +1,26 @@
// name: ImportFullyQualified
// keywords: import
// status: incorrect
//
// Checks that fully qualified imports are rejected.
//

package P
end P;

model ImportFullyQualified
import .P;
end ImportFullyQualified;

// Result:
// Error processing file: ImportFullyQualified.mo
// Failed to parse file: ImportFullyQualified.mo!
//
// [openmodelica/parser/ImportFullyQualified.mo:12:10-12:10:writable] Error: No viable alternative near token: .
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
// Failed to parse file: ImportFullyQualified.mo!
//
// Execution failed!
// endResult
1 change: 1 addition & 0 deletions openmodelica/parser/Makefile
Expand Up @@ -24,6 +24,7 @@ DotName.mos \
EmptyWithin.mo \
Identifier.mo \
IfElseIf.mo \
ImportFullyQualified.mo \
InvalidPartialFunction.mo \
MetaModelicaMatchElse.mo \
MetaModelicaStringOpModelicaLexer.mo \
Expand Down

0 comments on commit e8ef378

Please sign in to comment.