Files
mercury/tests/invalid/func_errors.err_exp
Mark Brown 8ae09930f8 Fix a bug reported by Doug Auclair.
Estimated hours taken: 5
Branches: main

Fix a bug reported by Doug Auclair.

library/ops.m:
	Change the Mercury arg priority to 999.  It was previously set to
	1201, which allowed arguments and list elements to be parsed the
	way we intended.  However, this had the unintended side effect that
	valid terms were written out using incorrect syntax.

library/parser.m:
	Place the workaround here, where arguments and list elements are
	read.

	Note that this is still technically buggy, because we effectively
	allow syntax which should be illegal according to the operator
	precedence table.  But the proper fix for this involves moving to
	a BNF style parser, so that is left for later work.

tests/hard_coded/Mmakefile:
	Run the term_io_test case twice, checking it against the expected
	output each time.  The first time it is run with the supplied input
	file.  The second time it is run with the expected output as input --
	this ensures that terms are read in the same way that they are
	written out.

tests/hard_coded/term_io_test.m:
	Read input from stdin rather than a fixed file.

tests/hard_coded/term_io_test.inp:
	Add additional input terms.

tests/hard_coded/term_io_test.exp:
tests/invalid/*.err_exp:
	Update the expected output for this and other test cases.
2006-03-07 01:03:46 +00:00

5 lines
389 B
Plaintext

func_errors.m:010: Error: some but not all arguments have modes: bar((int :: in), int).
func_errors.m:011: Error: function arguments have modes, but function result doesn't: baz((int :: in), (int :: in)).
func_errors.m:012: Error: function result has mode, but function arguments don't: quux(int, int).
func_errors.m:018: Error: some but not all arguments have modes: q((int :: in), int).