Changeset 230 for branches/xpascal/Optimizer.pas
- Timestamp:
- Jun 26, 2023, 12:08:45 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/xpascal/Optimizer.pas
r224 r230 14 14 TOptimizer = class 15 15 private 16 procedure OptimizeNodes(SourceNodes: TSourceNode s; out NewNode: TSourceNode);16 procedure OptimizeNodes(SourceNodes: TSourceNodeList<TSourceNode>; out NewNode: TSourceNode); 17 17 procedure OptimizeNode(SourceNode: TSourceNode; out NewNode: TSourceNode); 18 18 public … … 24 24 implementation 25 25 26 resourcestring 27 SUnsupportedNodeType = 'Unsupported node type'; 28 26 29 { TOptimizer } 27 30 28 procedure TOptimizer.OptimizeNodes(SourceNodes: TSourceNode s; out31 procedure TOptimizer.OptimizeNodes(SourceNodes: TSourceNodeList<TSourceNode>; out 29 32 NewNode: TSourceNode); 30 33 var … … 38 41 SourceNodes[I] := TempNewNode; 39 42 end; 40 end else raise Exception.Create( 'Unsupported node type');43 end else raise Exception.Create(SUnsupportedNodeType); 41 44 end; 42 45 end; … … 56 59 if SourceNode = nil then begin 57 60 end else 58 if SourceNode is TSourceNode sthen begin59 OptimizeNodes(TSourceNode s(SourceNode), NewNode)61 if SourceNode is TSourceNodeList<TSourceNode> then begin 62 OptimizeNodes(TSourceNodeList<TSourceNode>(SourceNode), NewNode) 60 63 end else 61 64 if (ofReplaceRepeatUntilByWhileDo in Features) and (SourceNode is TRepeatUntil) then begin … … 109 112 end; 110 113 end else 111 raise Exception.Create( 'Unsupported node type');114 raise Exception.Create(SUnsupportedNodeType); 112 115 end; 113 116
Note:
See TracChangeset
for help on using the changeset viewer.