mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 01:43:35 +00:00
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:
@@ -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") }
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user