[Prolint-cvs] SF.net SVN: prolint: [258] trunk/prolint/rules/findstate.p
Brought to you by:
johnallengreen,
jurjen
From: <ju...@us...> - 2006-03-12 21:43:50
|
Revision: 258 Author: jurjen Date: 2006-03-12 13:43:40 -0800 (Sun, 12 Mar 2006) ViewCVS: http://svn.sourceforge.net/prolint/?rev=258&view=rev Log Message: ----------- rule "findstate": when a buffer definition is not found in the procedure/function, then look for it in the Program_root level Modified Paths: -------------- trunk/prolint/rules/findstate.p Modified: trunk/prolint/rules/findstate.p =================================================================== --- trunk/prolint/rules/findstate.p 2006-03-12 17:48:30 UTC (rev 257) +++ trunk/prolint/rules/findstate.p 2006-03-12 21:43:40 UTC (rev 258) @@ -22,6 +22,9 @@ You should have received a copy of the GNU Lesser General Public License along with Prolint; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Feb 22, 2006 : Carl Verbiest + look for buffer definition in Program_root if not found in procedure -------------------------------------------------------------------------- */ @@ -149,14 +152,21 @@ DEFINE VARIABLE childnode AS INTEGER NO-UNDO. DEFINE VARIABLE found AS LOGICAL NO-UNDO. + DEFINE VARIABLE parentblocktypes AS CHARACTER NO-UNDO. + ASSIGN recordname = buffername parentnode = parserGetHandle() blocknode = parserGetHandle() childnode = parserGetHandle() + parentblocktypes = "PROCEDURE,FUNCTION,Program_root". + +ExamineBlock: +DO WHILE not found and blocktype <> "Program_root":U: + blocktype = parserNodeParent(theNode, blocknode). - DO WHILE NOT (blocktype="PROCEDURE":U OR blocktype="FUNCTION":U OR blocktype="Program_root":U) : + DO WHILE LOOKUP (blocktype, parentblocktypes) = 0: blocktype = parserNodeParent(blocknode, blocknode). END. @@ -182,6 +192,9 @@ END. END. parserQueryClear ("findstatebuffer":U). + if blocktype = "Program_root":U then leave ExamineBlock. + parentblocktypes = "Program_root". +END. parserReleaseHandle(blocknode). parserReleaseHandle(childnode). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |