From 0c3ffe4f457d7622ae38ace6f5f11154964fa9d8 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 3 Dec 2009 11:38:21 +0000 Subject: [PATCH] codetools: added example file for methodjumping git-svn-id: trunk@22943 - --- .gitattributes | 1 + .../codetools/examples/methodjumping.pas | 4 ++-- .../examples/scanexamples/methodjump1.pas | 20 +++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 components/codetools/examples/scanexamples/methodjump1.pas diff --git a/.gitattributes b/.gitattributes index d572a746ff..cfd28379a3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -483,6 +483,7 @@ components/codetools/examples/scanexamples/emptymethods1.pas svneol=native#text/ components/codetools/examples/scanexamples/getcontextexample.pas svneol=native#text/plain components/codetools/examples/scanexamples/identcomplexample.pas svneol=native#text/plain components/codetools/examples/scanexamples/indentation.pas svneol=native#text/plain +components/codetools/examples/scanexamples/methodjump1.pas svneol=native#text/plain components/codetools/examples/scanexamples/missingh2pasdirectives.pas svneol=native#text/plain components/codetools/examples/scanexamples/modemacpas.pas svneol=native#text/plain components/codetools/examples/scanexamples/overloadedfunction.pas svneol=native#text/plain diff --git a/components/codetools/examples/methodjumping.pas b/components/codetools/examples/methodjumping.pas index 53c4d97a1a..debc0c8533 100644 --- a/components/codetools/examples/methodjumping.pas +++ b/components/codetools/examples/methodjumping.pas @@ -37,11 +37,11 @@ var NewX, NewY, NewTopLine: integer; RevertableJump: boolean; begin - ExpandedFilename:=ExpandFileNameUTF8('scanexamples/tgeneric2.pas'); + ExpandedFilename:=ExpandFileNameUTF8('scanexamples/methodjump1.pas'); CodeBuf:=CodeToolBoss.LoadFile(ExpandedFilename,true,false); if CodeBuf=nil then raise Exception.Create('failed loading '+ExpandedFilename); - if CodeToolBoss.JumpToMethod(CodeBuf,3,15,NewCode,NewX,NewY,NewTopLine, + if CodeToolBoss.JumpToMethod(CodeBuf,14,10,NewCode,NewX,NewY,NewTopLine, RevertableJump) then writeln(NewCode.Filename,' ',NewX,',',NewY,' TopLine=',NewTopLine, diff --git a/components/codetools/examples/scanexamples/methodjump1.pas b/components/codetools/examples/scanexamples/methodjump1.pas new file mode 100644 index 0000000000..01244410e9 --- /dev/null +++ b/components/codetools/examples/scanexamples/methodjump1.pas @@ -0,0 +1,20 @@ +unit methodjump1; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils; + +procedure DoSomething; + +implementation + +procedure DoSomething; +begin + +end; + +end. +