File/devutils/ddtpreproc.php.in

Description

ddtpreproc

Since Javascript does not seem to have variables similar to __FILE__ and __LINE__ from php, this script pre-processes .js files to patch in file and line numbers into all _ddt() calls.

After making an editing pass through the .js files, this script should be called to update the line numbers.

  • todo: handle multi-line comments.
  • todo: handle nested ");"
  • todo: distinguish between _ddt( $file, $line, $msg ) and _ddt( "file", "100", "message" );
  • copyright: DTLink, LLC 2005
  • author: Yermo Lamers
Functions
procDDT (line 148)

process _ddt() calls in a javascript file.

Adds in file and linenumber arguments to all _ddt() calls in a javascript file. Handles the case where no file and line info has been added (a fresh debug statement) and where ones are already present.

  • todo: handle rare case of multiple ddt() calls on a single line.
  • todo: improve ddt identification regex so that it handles embedded );
void procDDT (mixed $path)
rapply (line 74)

recursive apply

recurse through a directory looking for files that match the given expression and apply the given function.

void rapply (mixed $path, mixed $regex, mixed $function)
_ddt (line 56)

primitive ddt() placeholder.

edit this function to turn on debugging messages.

void _ddt (mixed $file, mixed $line, mixed $msg)

Documentation generated on Sat, 31 Dec 2005 14:56:52 -0500 by phpDocumentor 1.3.0RC3