From 4cf4ed40e515b2de988145aea2eb30f74679389e Mon Sep 17 00:00:00 2001 From: skalogryz Date: Mon, 26 Jan 2009 20:59:20 +0000 Subject: [PATCH] + fixed endless loop for last preprocessor directive, noted by Josef Ryan. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@676 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- bindings/pascocoa/parser/ObjCParserTypes.pas | 4 ++-- bindings/pascocoa/parser/objcparser.pas | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bindings/pascocoa/parser/ObjCParserTypes.pas b/bindings/pascocoa/parser/ObjCParserTypes.pas index 0d0078e62..206186846 100755 --- a/bindings/pascocoa/parser/ObjCParserTypes.pas +++ b/bindings/pascocoa/parser/ObjCParserTypes.pas @@ -956,7 +956,8 @@ begin if s = '#define' then df := TCPrepDefine.Create(nil) else if s = '#include' then df := TCPrepInclude.Create(nil) else if s = '#else' then df := TCPrepInclude.Create(nil) - else if s = '#endif' then df := TCPrepEndif.Create(nil) + else if s = '#endif' then + df := TCPrepEndif.Create(nil) else if (s = '#if') or (s = '#elif') or (s = '#ifdef') or (s = '#ifndef') then df := TCPrepIf.Create(nil) else if s = '#pragma' then df := TCPrepPragma.Create(nil) else df := nil; @@ -1773,7 +1774,6 @@ var begin Result := false; if not AParser.FindNextToken(_Directive, tt) then begin - AParser.Index := AParser.TokenPos; AParser.SetError('precompiler directive not found'); Exit; end; diff --git a/bindings/pascocoa/parser/objcparser.pas b/bindings/pascocoa/parser/objcparser.pas index 7544f58b8..28b7ff4eb 100755 --- a/bindings/pascocoa/parser/objcparser.pas +++ b/bindings/pascocoa/parser/objcparser.pas @@ -161,6 +161,8 @@ begin try parser.Buf := s; try + parser.UsePrecompileEntities := false; + parser.UseCommentEntities := false; parser.OnPrecompile := prec.OnPrecompile; parser.OnComment := prec.OnComment; parser.IgnoreTokens.AddStrings(ConvertSettings.IgnoreTokens);