|
@@ -7746,11 +7746,25 @@ TYPE
|
|
awaitStatement.SetCondition(condition);
|
|
awaitStatement.SetCondition(condition);
|
|
END VisitAwaitStatement;
|
|
END VisitAwaitStatement;
|
|
|
|
|
|
|
|
+ PROCEDURE CheckSystemImport(position: LONGINT);
|
|
|
|
+ VAR import: SyntaxTree.Import;
|
|
|
|
+ BEGIN
|
|
|
|
+ import := currentScope.ownerModule.moduleScope.firstImport;
|
|
|
|
+ WHILE(import # NIL) DO
|
|
|
|
+ IF (import.module = system.systemModule[Scanner.Lowercase]) OR (import.module = system.systemModule[Scanner.Uppercase]) THEN
|
|
|
|
+ RETURN;
|
|
|
|
+ END;
|
|
|
|
+ import := import.nextImport;
|
|
|
|
+ END;
|
|
|
|
+ Error(position, Diagnostics.Invalid, "forbidden code without system import");
|
|
|
|
+ END CheckSystemImport;
|
|
|
|
+
|
|
(** check and resolve code statement: do nothing, must be done by assembler
|
|
(** check and resolve code statement: do nothing, must be done by assembler
|
|
**)
|
|
**)
|
|
PROCEDURE VisitCode(code: SyntaxTree.Code);
|
|
PROCEDURE VisitCode(code: SyntaxTree.Code);
|
|
VAR i: LONGINT; statement: SyntaxTree.Statement;
|
|
VAR i: LONGINT; statement: SyntaxTree.Statement;
|
|
BEGIN
|
|
BEGIN
|
|
|
|
+ CheckSystemImport(code.position);
|
|
FOR i := 0 TO code.inRules.Length()-1 DO
|
|
FOR i := 0 TO code.inRules.Length()-1 DO
|
|
statement := code.inRules.GetStatement(i);
|
|
statement := code.inRules.GetStatement(i);
|
|
IF statement IS SyntaxTree.Assignment THEN
|
|
IF statement IS SyntaxTree.Assignment THEN
|
|
@@ -7921,6 +7935,9 @@ TYPE
|
|
ELSIF body.priority # NIL THEN
|
|
ELSIF body.priority # NIL THEN
|
|
Error(body.position,Diagnostics.Invalid,"priority flag not in active body");
|
|
Error(body.position,Diagnostics.Invalid,"priority flag not in active body");
|
|
END;
|
|
END;
|
|
|
|
+ IF body.code # NIL THEN
|
|
|
|
+ CheckSystemImport(body.position);
|
|
|
|
+ END;
|
|
StatementSequence(body.finally)
|
|
StatementSequence(body.finally)
|
|
END Body;
|
|
END Body;
|
|
|
|
|