Fix a bug where

Estimated hours taken: 0.25
Branches: main

Fix a bug where
	:- pragma foreign_code("C#", "static int foo = 0").
would generate the following code fragment:
	static int foo = 0;#line 15
and similarly for pragma foreign_decl.

This is tested in tests/hard_coded/typeclasses/impure_methods.m.

mlds_to_managed.m:
	For pragma foreign_code and foreign_decl output a "\n" after
	the code, so that any line number declaration occurs on a
	newline.
This commit is contained in:
Peter Ross
2002-11-28 13:05:20 +00:00
parent de9189f43b
commit 8317bef7f5

View File

@@ -253,7 +253,7 @@ generate_foreign_header_code(Lang, _ModuleName,
di, uo) is det -->
output_context(Lang, Context),
( { CodeLang = Lang } ->
io__write_string(Code)
io__write_string(Code), io__nl
;
{ sorry(this_file, "wrong foreign code") }
),
@@ -296,7 +296,7 @@ generate_foreign_code(Lang, _ModuleName,
di, uo) is det -->
output_context(Lang, Context),
( { Lang = CodeLang } ->
io__write_string(Code)
io__write_string(Code), io__nl
;
{ sorry(this_file, "wrong foreign code") }
),