Code covered by the BSD License  

Highlights from
missingsemicolons

Be the first to rate this file! 0 Downloads (last 30 days) File Size: 3.34 KB File ID: #5365

missingsemicolons

by Brett Shoelson

 

28 Jun 2004 (Updated 17 Sep 2004)

Helps locate output-producing lines of code that are missing semicolons.

| Watch this File

File Information
Description

LINEVALS = MISSINGSEMICOLONS(TARGETFILES, SUPPRESS_SUBDIR_EVAL)

Returns in 'linevals' a structure containing the line numbers and offending strings of lines that are likely candidates for missing terminal semicolon. Lines commencing with keywords that typically do not produce an output at the command line (e.g., 'if', 'return', 'continue', etc.) are skipped.

TARGETFILES: Input may be either a string indicating a path to a SINGLE mfile (e.g., 'aviplayer.m', 'c:\brett\targetfiless\aviplayer.m'),
a DIRECTORY of files (eg. dir('*.m')), OR a PATH to the target directory. If a directory is input, the program examines all files in the directory AND, by default, subdirectories, compiling in a single structure the individual output for each file. To suppress inclusion of subdirectories, enter 1 for the optional second argument.

Note that I owe a debt of gratitude to Peter Acklam for this one; the program calls (and thus requires the download of) his mlstripcomments.m program, in his "MATLAB Comment Stripping Toolbox."

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
% MATLAB Comment Stripping Toolbox

MATLAB release MATLAB 6.5 (R13)
Other requirements Uses regular expressions; will not work in versions earlier than 6.5. Also, requires download of "MATLAB Comment Stripping Toolbox" from MATLAB Central.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
17 Sep 2004

Fixes a call to mlstripcommentsfile(). If you previously downloaded missingsemicolons.m, you can update with the new submission or simply change line 97 to:
mlstripcommentsfile(fname,'mstmpfile.m');

Tag Activity for this File
Tag Applied By Date/Time
path Brett Shoelson 22 Oct 2008 07:25:23
directories Brett Shoelson 22 Oct 2008 07:25:23
files Brett Shoelson 22 Oct 2008 07:25:23
missing Brett Shoelson 22 Oct 2008 07:25:23
forgotten Brett Shoelson 22 Oct 2008 07:25:23
semicolon Brett Shoelson 22 Oct 2008 07:25:23
suppress Brett Shoelson 22 Oct 2008 07:25:23
output Brett Shoelson 22 Oct 2008 07:25:23

Contact us at files@mathworks.com