Commit Graph

4 Commits

Author SHA1 Message Date
Zoltan Somogyi
4865f11503 Update programming style. 2020-10-04 13:20:42 +11:00
Zoltan Somogyi
33eb3028f5 Clean up the tests in half the test directories.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the debugger tests,
    specify the new line numbers in .inp files and expect them in .exp files.
2015-02-14 20:14:03 +11:00
Julien Fischer
459847a064 Move the univ, maybe, pair and unit types from std_util into their own
Estimated hours taken: 18
Branches: main

Move the univ, maybe, pair and unit types from std_util into their own
modules.  std_util still contains the general purpose higher-order programming
constructs.

library/std_util.m:
	Move univ, maybe, pair and unit (plus any other related types
	and procedures) into their own modules.

library/maybe.m:
	New module.  This contains the maybe and maybe_error types and
	the associated procedures.

library/pair.m:
	New module.  This contains the pair type and associated procedures.

library/unit.m:
	New module. This contains the types unit/0 and unit/1.

library/univ.m:
	New module. This contains the univ type and associated procedures.

library/library.m:
	Add the new modules.

library/private_builtin.m:
	Update the declaration of the type_ctor_info struct for univ.

runtime/mercury.h:
	Update the declaration for the type_ctor_info struct for univ.

runtime/mercury_mcpp.h:
runtime/mercury_hlc_types.h:
	Update the definition of MR_Univ.

runtime/mercury_init.h:
	Fix a comment: ML_type_name is now exported from type_desc.m.

compiler/mlds_to_il.m:
	Update the the name of the module that defines univs (which are
	handled specially by the il code generator.)

library/*.m:
compiler/*.m:
browser/*.m:
mdbcomp/*.m:
profiler/*.m:
deep_profiler/*.m:
	Conform to the above changes.  Import the new modules where they
	are needed; don't import std_util where it isn't needed.

	Fix formatting in lots of modules.  Delete duplicate module
	imports.

tests/*:
	Update the test suite to confrom to the above changes.
2006-03-29 08:09:58 +00:00
Fergus Henderson
f2dcf99fed Add support for two new compiler options,
Estimated hours taken: 9
Branches: main

Add support for two new compiler options,
`--allow-stubs' and `--no-warn-stubs',
to allow execution of programs which are incomplete.

`--allow-stubs' delays the reporting of errors for procedures with no
clauses until run-time, instead issuing only a warning at compile time.
`--no-warn-stubs' allows even that warning to be supressed.

library/private_builtin.m:
	Add a new procedure no_clauses/1, for reporting the
	run-time error.

compiler/options.m:
	Add and document the new options.

compiler/typecheck.m:
	Implement the new options.  For procedures with no
	clauses, if `--allow-stubs' is enabled, generate a
	stub body which just calls no_clauses/1 or sorry/1.

compiler/hlds_pred.m:
	Add a new marker `stub', for procedures whose body is an
	automatically-generated stub.

compiler/purity.m:
compiler/det_analysis.m:
compiler/unused_args.m:
	Don't issue warnings for `stub' procedures.

NEWS:
doc/user_guide.texi:
	Document the new options.

doc/reference_manual.texi:
	Document that there must be at least one clause for each
	declared predicate or function, since as far as I can tell
	this was until now not explicitly stated in the reference
	manual.  Also document that implementations are permitted
	to provide a method of processing Mercury programs for
	which this error is not reported until runtime.

tests/warnings/Mmakefile:
tests/warnings/Mercury.options:
tests/warnings/warn_stubs.m:
tests/warnings/warn_stubs.exp:
tests/hard_coded/Mmakefile:
tests/hard_coded/Mercury.options:
tests/hard_coded/allow_stubs.m:
tests/hard_coded/allow_stubs.exp:
	Test the new features.
2003-02-21 01:57:38 +00:00