Skip to content

Commit

Permalink
Режим интерпретации: стек открытых переменных располагается в начале (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazdaywik committed Aug 11, 2016
1 parent 3f8cdf4 commit 90663a2
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/compiler/LowLevelRASL.sref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//FROM LibraryEx
$EXTERN Map, Fetch, Max, Inc, Compare;
$EXTERN Map, Fetch, Max, Inc, Compare, MapReduce;

//FROM Library
$EXTERN Add, StrFromInt;
Expand Down Expand Up @@ -478,7 +478,6 @@ Function-Interpret {
<PrepareInterpretCommands e.Commands>
(#CmdFinRAA)
>
0 /* начальная глубина */
>
(#CmdiRunInterpret);
}
Expand Down Expand Up @@ -952,16 +951,21 @@ OutlineConstants {
}

PrepareOpenEStack {
(#CmdiEStart e.VarInfo) e.Commands s.Depth =
(#CmdiEStart e.VarInfo) <PrepareOpenEStack e.Commands <Inc s.Depth>>;

(#CmdiOnFailGoTo s.Offset) e.Commands s.Depth =
(#CmdiOnFailGoTo s.Offset) <PrepareOpenEStack e.Commands <Inc s.Depth>>;
e.Commands =
<MapReduce
{
(#CmdiReserveStack s.Depth) (#CmdiEStart e.VarInfo) =
(#CmdiReserveStack <Inc s.Depth>) (#CmdiEStart e.VarInfo);

t.OtherCommand e.Commands s.Depth =
t.OtherCommand <PrepareOpenEStack e.Commands s.Depth>;
(#CmdiReserveStack s.Depth) (#CmdiOnFailGoTo s.Offset) =
(#CmdiReserveStack <Inc s.Depth>) (#CmdiOnFailGoTo s.Offset);

s.Depth = (#CmdiReserveStack s.Depth);
(#CmdiReserveStack s.Depth) t.OtherCommand =
(#CmdiReserveStack s.Depth) t.OtherCommand;
}
(#CmdiReserveStack 0)
e.Commands
>;
}

Function-Direct {
Expand Down

0 comments on commit 90663a2

Please sign in to comment.