Skip to content

Commit

Permalink
добавлены заглушки под чеки (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
penachett committed Feb 22, 2021
1 parent 8eae031 commit da8ae0c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
38 changes: 38 additions & 0 deletions src/compiler/Checker-RepeatedVars.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

$ENTRY CheckRepeatedVars {
(e._ repeated repeated-maybe e._) (e.AST)
= <Prout 'full repeated vars search enabled'>;
(e._ repeated e._) (e.AST)
= <Prout 'repeated vars in assignments only search enabled'>;
(e._ repeated-maybe e._) (e.AST)
= <Prout 'repeated vars in last sentences only search enabled'>;
(e._) (e.AST) = <Prout 'no matched warningsIds, skipping repeated vars search'>;
= <Prout 'repeated vars empty args'>
}

CheckRepeatedInLastSentences {
= ;
}

CheckRepeatedInAssignments {
= ;
}

CreateRepeatedVariableWarning {
repeated t.SrcPos s.Mode e.Index
= (Warning
repeated
t.SrcPos
RepeatedVariable
s.Mode
e.Index
);
repeated-maybe t.SrcPos s.Mode e.Index
= (Warning
repeated-maybe
t.SrcPos
RepeatedVariableMaybe
s.Mode
e.Index
);
}
6 changes: 5 additions & 1 deletion src/compiler/Checker.ref
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ $EXTERN ExtractVariables-Expr;
*$FROM Checker-Screening
$EXTERN CheckScreening;

*$FROM Checker-RepeatedVars
$EXTERN CheckRepeatedVars;

$ENTRY CheckProgram {
(e.WarningIds) t.ErrorList e.AST
= <Reduce
Expand Down Expand Up @@ -127,7 +130,8 @@ FindErrors {
(<CheckDeclarations (e.WarningIds) e.Declarations>)
<Map &CheckFunctionBody e.FunctionBodies>
>
<CheckScreening (e.WarningIds) (e.AST)>;
<CheckScreening (e.WarningIds) (e.AST)>
<CheckRepeatedVars (e.WarningIds) (e.AST)>;
}

CheckPseudofunctions {
Expand Down

0 comments on commit da8ae0c

Please sign in to comment.