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

missingsemicolons

by Brett Shoelson

 

28 Jun 2004 (Updated 17 Sep 2004)

Code covered by BSD License  

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

Download Now | 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
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com