Changeset 49 for branches/DelphiToC/Analyze/UPascalParser.pas
- Timestamp:
- Aug 9, 2010, 2:24:24 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DelphiToC/Analyze/UPascalParser.pas
r48 r49 10 10 11 11 type 12 TOnErrorMessage = procedure (Text: string ) of object;12 TOnErrorMessage = procedure (Text: string; Position: TPoint) of object; 13 13 14 14 TTokenType = (ttNone, ttIdentifier, ttConstantNumber, ttConstantString, … … 85 85 begin 86 86 if Assigned(FOnErrorMessage) then 87 FOnErrorMessage(Format(Text, Arguments) );87 FOnErrorMessage(Format(Text, Arguments), CodePosition); 88 88 end; 89 89 … … 172 172 procedure TBaseParser.Init; 173 173 begin 174 CodePosition := Point(1, 1); 174 175 CurrentChar := #0; 175 176 PreviousChar := #0; … … 201 202 Break; 202 203 end; 204 203 205 if FNextTokenType = ttNone then begin 204 206 if IsWhiteSpace(CurrentChar) then FNextTokenType := ttWhiteSpace … … 262 264 263 265 if FNextTokenType <> ttNone then begin 266 // Update cursor position 267 Inc(CodePosition.X); 268 if (CurrentChar = #13) then begin 269 CodePosition.X := 1; 270 Inc(CodePosition.Y); 271 end; 272 264 273 Inc(CodeStreamPosition); 265 274 PreviousChar := CurrentChar;
Note:
See TracChangeset
for help on using the changeset viewer.