Ignore:
Timestamp:
Aug 4, 2010, 4:10:35 PM (14 years ago)
Author:
george
Message:

Fixed parsing array range error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DelphiToC/Analyze/UPascalParser.pas

    r36 r37  
    66
    77uses
    8   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
     8  SysUtils, Variants, Classes, Graphics, Controls, Forms,
    99  Dialogs, StdCtrls, UPascalSource, FileUtil;
    1010
     
    183183var
    184184  I: Integer;
    185 //  II: Integer;
     185  II: Integer;
    186186  J: Integer;
    187187const
    188188  SpecChar: set of char = [';', '.', ',', ':', '(', ')', '[', ']', '+', '-', '/', '*',
    189189    '^', '=', '<' , '>' , '@'];
    190   DoubleSpecChar : array[1..7] of string = (':=', '..', '<=', '>=', '<>', '+=', '-=');
     190  DoubleSpecChar : array[0..6] of string = (':=', '..', '<=', '>=', '<>', '+=', '-=');
    191191begin
    192192  Result := '';
     
    217217    if (Text[J] in SpecChar) then begin
    218218      if (Text[J + 1] in SpecChar) then begin
    219         for I := 0 to High(DoubleSpecChar) do
    220           if Copy(Text, J, 2) = DoubleSpecChar[I] then begin
     219        for II := 0 to High(DoubleSpecChar) do
     220          if Copy(Text, J, 2) = DoubleSpecChar[II] then begin
    221221            Result := Copy(Text, J, 2);
    222222            Inc(J, 2);
     
    549549begin
    550550  with Parser do begin
    551     if NextCode = 'program' then ParseProgram(Parser)
    552     else if NextCode = 'unit' then ParseUnit(Parser)
     551    if NextCode = 'program' then
     552      ParseProgram(Parser)
     553    else if NextCode = 'unit' then
     554      ParseUnit(Parser)
    553555    else ParseProgram(Parser);
    554556  end;
Note: See TracChangeset for help on using the changeset viewer.