Ignore:
Timestamp:
Nov 9, 2009, 10:02:35 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Parsování.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Void/UCompilator.pas

    r11 r12  
    4949  with Model, Module, BeginEnd do begin
    5050    if Parser.TokenType = ttWhiteSpace then begin
     51      Parser.ParseNextToken;
    5152    end else
    5253    if Parser.TokenType = ttIdentifier then begin
     
    6667        ParseBeginEnd;
    6768      end;
    68     end;
     69    end else Parser.ParseNextToken;
    6970  end;
    7071end;
     
    7677  Variable: TVariable;
    7778begin
     79  Parser.ParseNextToken;
     80  if Parser.TokenType <> ttWhiteSpace then DoError('Expected white space');
     81  Parser.ParseNextToken;
     82  if Parser.TokenType <> ttIdentifier then DoError('Expected identifier');
    7883  repeat
    79     Parser.ParseNextToken;
    80     if Parser.TokenType <> ttWhiteSpace then DoError('Expected white space');
    81     Parser.ParseNextToken;
    82     if Parser.TokenType <> ttIdentifier then DoError('Expected identifier');
    8384    VariableName := Parser.TokenValue;
    8485    Parser.ParseNextToken;
     
    133134  Value: string;
    134135begin
    135   with Model, Module, BeginEnd do begin
     136  Parser.ParseNextToken;
     137  with Model, Module, BeginEnd do repeat
    136138    if Parser.TokenType = ttWhiteSpace then begin
    137139    end else
    138140    if Parser.TokenType = ttIdentifier then begin
     141      if Parser.TokenValue = 'end' then Break;
    139142      CommandName := Parser.TokenValue;
    140143      begin
     
    186189      if Parser.TokenType <> ttWhiteSpace then DoError('Expected white space');
    187190    end else DoError('Expected identifier');
    188   end;
     191    Parser.ParseNextToken;
     192  until False;
     193  Parser.ParseNextToken;
    189194end;
    190195
Note: See TracChangeset for help on using the changeset viewer.