Ignore:
Timestamp:
Aug 19, 2006, 8:27:44 PM (19 years ago)
Author:
RBRi
Message:

more parser fixes and new unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NewView/CmdLineParameterUnit.pas

    r28 r29  
    325325     STATE_INSIDE_QUOTED = 3;
    326326     STATE_INSIDE_QUOTED_START_QUOTE = 4;
     327//     STATE_INSIDE_QUOTED_QUOTE_PROCESSED = 5;
    327328  VAR
    328329     i : Integer;
     
    377378                 begin
    378379                    tmpState := STATE_INSIDE_QUOTED;
    379                     tmpCurrentCommand := tmpCurrentCommand + tmpCurrentChar;
    380                  end;
     380//                    tmpState := STATE_INSIDE_QUOTED_QUOTE_PROCESSED;
     381                    tmpCurrentCommand := tmpCurrentCommand + tmpCurrentChar;
     382                 end;
     383//               STATE_INSIDE_QUOTED_QUOTE_PROCESSED :
     384//                    tmpState := STATE_INSIDE_QUOTED_START_QUOTE;
    381385               ELSE
    382386                    tmpState := STATE_START_QUOTE;
     
    410414                    tmpCurrentCommand := tmpCurrentCommand + tmpCurrentChar;
    411415                 end;
     416//               STATE_INSIDE_QUOTED_QUOTE_PROCESSED :
     417//                 begin
     418//                    tmpCurrentCommand := tmpCurrentCommand + tmpCurrentChar;
     419//                 end;
    412420               end;
    413421            end;
     
    421429          aResult.add(tmpCurrentCommand);
    422430       end;
     431     STATE_START_QUOTE :
     432       begin
     433          result := ERROR_UNMATCHED_QUOTE;
     434       end;
    423435     STATE_INSIDE_QUOTED_START_QUOTE :
    424436       begin
    425           aResult.add(tmpCurrentCommand);
     437          if (0 < length(tmpCurrentCommand)) then
     438          begin
     439            aResult.add(tmpCurrentCommand);
     440          end;
    426441       end;
     442     STATE_INSIDE_QUOTED :
     443       begin
     444          result := ERROR_UNMATCHED_QUOTE;
     445          if (0 < length(tmpCurrentCommand)) then
     446          begin
     447            aResult.add(tmpCurrentCommand);
     448          end;
     449       end;
     450//     STATE_INSIDE_QUOTED_QUOTE_PROCESSED :
     451//       begin
     452//          result := ERROR_UNMATCHED_QUOTE;
     453//          if (1 < length(tmpCurrentCommand)) then
     454//          begin
     455//            aResult.add(copy(tmpCurrentCommand, 1, length(tmpCurrentCommand)-0));
     456//          end
     457//       end;
    427458     ELSE
    428459       begin
    429460          result := ERROR_UNMATCHED_QUOTE;
    430           aResult.add(tmpCurrentCommand);
     461          if (0 < length(tmpCurrentCommand)) then
     462          begin
     463            aResult.add(tmpCurrentCommand);
     464          end;
    431465       end;
    432466     end;
Note: See TracChangeset for help on using the changeset viewer.