Implement a new `:- pragma source_file("<source file name>").' declaration,

Estimated hours taken: 3

Implement a new `:- pragma source_file("<source file name>").' declaration,
and a `#<line number>' directive, to make it more convenient to use
preprocessors or to use Mercury as a target language.

prog_data.m:
	Add `source_file' pragma.

make_hlds.m, module_qual.m:
	Ignore `pragma source_file' declarations.

mercury_to_mercury.m:
	Print `pragma source_file' declarations.
	Simplify a couple of unnecessarily complicated bits of code.

prog_io.m:
	Parse `source_file' pragmas.  When parsing items, check for them;
	handle `pragma source_file' declarations by keeping track of the
	source file name, and passing it to parser__parse_term/4.

	Also, change the "Error: module should start with a `:- module'
	declaration" message from an error to a warning.

	Also, fix the capitalization in a bunch of error messages:
	change from "Error: Blah" to "Error: blah".
This commit is contained in:
Fergus Henderson
1996-07-03 13:22:54 +00:00
parent dfff30fafb
commit 6ebe46c20a
5 changed files with 128 additions and 82 deletions

View File

@@ -87,8 +87,10 @@
% Predname, Arity
; obsolete(sym_name, int)
% Predname, Arity
; export(sym_name, list(mode), string).
; export(sym_name, list(mode), string)
% Predname, Modes, C function name.
; source_file(string).
% Source file name.
% For pragma c_code, there are two different calling conventions,
% one for C code that may recursively call Mercury code, and another