Changeset 145 for branches/easy compiler/USourceExecutor.pas
- Timestamp:
- Jan 17, 2018, 1:11:56 PM (7 years ago)
- Location:
- branches/easy compiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/easy compiler
- Property svn:ignore
-
old new 2 2 *.exe 3 3 *.lps 4 heaptrclog.trc
-
- Property svn:ignore
-
branches/easy compiler/USourceExecutor.pas
r144 r145 12 12 TInputEvent = function: string of object; 13 13 14 { TExecutorVariable } 15 14 16 TExecutorVariable = class 15 17 Variable: TSourceVariable; 16 18 Value: TSourceValue; 19 destructor Destroy; override; 17 20 end; 18 21 … … 39 42 40 43 implementation 44 45 { TExecutorVariable } 46 47 destructor TExecutorVariable.Destroy; 48 begin 49 Value.Free; 50 inherited Destroy; 51 end; 41 52 42 53 … … 110 121 if Name = 'print' then begin 111 122 if Assigned(FOnOutput) then begin 112 Value := ReadValueReference( Parameters[0]);123 Value := ReadValueReference(TSourceReference(Parameters[0])); 113 124 if Value is TSourceValueString then 114 125 FOnOutput(TSourceValueString(Value).Value) … … 120 131 if Name = 'println' then begin 121 132 if Assigned(FOnOutput) then begin 122 Value := ReadValueReference( Parameters[0]);133 Value := ReadValueReference(TSourceReference(Parameters[0])); 123 134 if Value is TSourceValueString then 124 135 FOnOutput(TSourceValueString(Value).Value + LineEnding) … … 130 141 if Name = 'inputln' then begin 131 142 if Assigned(FOnInput) then begin 132 Variable := ReadVarReference( Parameters[0]);143 Variable := ReadVarReference(TSourceReference(Parameters[0])); 133 144 ExecutorVar := Variables.Search(Variable); 134 145 if ExecutorVar.Value is TSourceValueString then begin … … 147 158 end else 148 159 if Name = 'assign' then begin 149 Variable := ReadVarReference( Parameters[0]);150 Value := ReadValueReference( Parameters[1]);160 Variable := ReadVarReference(TSourceReference(Parameters[0])); 161 Value := ReadValueReference(TSourceReference(Parameters[1])); 151 162 ExecutorVar := Variables.Search(Variable); 152 163 if not Assigned(ExecutorVar) then begin … … 159 170 end else 160 171 if Name = 'increment' then begin 161 Variable := ReadVarReference( Parameters[0]);162 Value := ReadValueReference( Parameters[1]);172 Variable := ReadVarReference(TSourceReference(Parameters[0])); 173 Value := ReadValueReference(TSourceReference(Parameters[1])); 163 174 ExecutorVar := Variables.Search(Variable); 164 175 if not Assigned(ExecutorVar) then raise Exception.Create('Variable not found');
Note:
See TracChangeset
for help on using the changeset viewer.