Prolint doesn't see function definition

Project:Prolint Issue Tracker
Component:Code
Category:bug report
Priority:critical
Assigned:jurjen
Status:closed
Description

Prolint doesn't find the definition of a function inside a do...end block. Therefore i get false positives on rule Tablename... this is unexpected. Since we use the results of Prolint to determine whether an object can be checked in to RoundTable or not, i can't complete the object to which this problem applies.

Example:

if test = true then
do:
function MyFunction returns logical
(input cTest as character):
end function.
end.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jurjen's picture

#1

Assigned to:Anonymous» jurjen

Ok, bug confirmed. Thanks Onno!

The bug is that Prolint.p searches all internal procedures and functions (procedure BuildProcedureList in prolint.p) but it only looks at direct children of the program_root. I did not expect to find functions or internal procedures as children of executable statements, so the procedure does not look at that level.
I can fix that, but it will slow down the procedure a bit.

Perhaps we should also have a new Prolint rule that says that you are defining a function/ip inside an executable statement.


jurjen's picture

#2

Status:active» fixed

Fixed. Prolint will now correctly find the function that was defined inside the code_block.

Also: added a new rule (nestedfunc) that barfs because you have defined a function inside a code_block. So you are still not off the hook, Onno! :-)


#3

Status:fixed» closed