# HG changeset patch # User jwe # Date 812716519 0 # Node ID 36477a20e8c8e3e7f1c9ec7422a05081cd6b2a88 # Parent 7f0a08d41c8421f56b29579c98d48804eb2fcd0b [project @ 1995-10-03 10:34:12 by jwe] diff -r 7f0a08d41c84 -r 36477a20e8c8 src/user-prefs.cc --- a/src/user-prefs.cc Tue Oct 03 10:30:23 1995 +0000 +++ b/src/user-prefs.cc Tue Oct 03 10:35:19 1995 +0000 @@ -515,6 +515,21 @@ } +// Generate warning if a statement in a function or script file is not +// terminated with a semicolon. Useful for checking scripts and +// functions that should only produce output using explicit printing +// statements. + +int +warn_missing_semicolon (void) +{ + user_pref.warn_missing_semicolon = + check_preference ("warn_missing_semicolon"); + + return 0; +} + + // Should whitespace in a literal matrix list be automatically // converted to commas and semicolons? // diff -r 7f0a08d41c84 -r 36477a20e8c8 src/variables.cc --- a/src/variables.cc Tue Oct 03 10:30:23 1995 +0000 +++ b/src/variables.cc Tue Oct 03 10:35:19 1995 +0000 @@ -1827,6 +1827,11 @@ 1.0, 0, warn_function_name_clash, "produce warning if function name conflicts with file name"); + DEFVAR ("warn_missing_semicolon", SBV_warn_missing_semicolon, + 0.0, 0, warn_missing_semicolon, + "produce a warning if a statement in a script or function file is +not terminated with a semicolon") + DEFVAR ("whitespace_in_literal_matrix", SBV_whitespace_in_literal_matrix, "", 0, whitespace_in_literal_matrix,