From 8317bef7f53dba1dd410ce68eb467478cd0f4ac3 Mon Sep 17 00:00:00 2001 From: Peter Ross Date: Thu, 28 Nov 2002 13:05:20 +0000 Subject: [PATCH] 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. --- compiler/mlds_to_managed.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/mlds_to_managed.m b/compiler/mlds_to_managed.m index 0d6095f81..13f1eb48c 100644 --- a/compiler/mlds_to_managed.m +++ b/compiler/mlds_to_managed.m @@ -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") } ),