[m-rev.] diff: mlds_to_managed foreign_code and foreign_decl bug fix.
Peter Ross
pro at missioncriticalit.com
Fri Nov 29 00:05:52 AEDT 2002
Hi,
===================================================================
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.
Index: mlds_to_managed.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_managed.m,v
retrieving revision 1.4
diff -u -r1.4 mlds_to_managed.m
--- mlds_to_managed.m 1 Jul 2002 09:03:53 -0000 1.4
+++ mlds_to_managed.m 28 Nov 2002 12:59:47 -0000
@@ -253,7 +253,7 @@
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 @@
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") }
),
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list