[m-rev.] diff: accept special names in foreign_type pragmas

Peter Ross peter.ross at miscrit.be
Sat Feb 16 01:46:38 AEDT 2002


Hi,


===================================================================


Estimated hours taken: 0.5
Branches: main

compiler/prog_io_pragma.m:
    Accept the special names for the builtin IL types.

doc/reference_manual.texi:
    Document that we accept the special names.

Index: compiler/prog_io_pragma.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/prog_io_pragma.m,v
retrieving revision 1.42
diff -u -r1.42 prog_io_pragma.m
--- compiler/prog_io_pragma.m	30 Jan 2002 01:40:30 -0000	1.42
+++ compiler/prog_io_pragma.m	15 Feb 2002 14:44:22 -0000
@@ -232,6 +232,91 @@
 
 parse_il_type_name(String0, ErrorTerm, ForeignType) :-
 	( 
+		String0 = "bool"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "Boolean")))
+	;
+		String0 = "char"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "Char")))
+	;
+		String0 = "object"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "Object")))
+	;
+		String0 = "string"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "String")))
+	;
+		String0 = "float32"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "Single")))
+	;
+		String0 = "float64"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "Double")))
+	;
+		String0 = "int8"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "SByte")))
+	;
+		String0 = "int16"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "Int16")))
+	;
+		String0 = "int32"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "Int32")))
+	;
+		String0 = "int64"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "Int64")))
+	;
+		String0 = "natural int"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "IntPtr")))
+	;
+		String0 = "natural unsigned int"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "UIntPtr")))
+	;
+		( String0 = "typedref" ; String0 = "refany" )
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "TypedReference")))
+	;
+		String0 = "unsigned int8"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "Byte")))
+	;
+		String0 = "unsigned int16"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "UInt16")))
+	;
+		String0 = "unsigned int32"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "UInt32")))
+	;
+		String0 = "unsigned int64"
+	->
+		ForeignType = ok(il(value, "mscorlib",
+			qualified(unqualified("System"), "UInt64")))
+	;
 		string__append("class [", String1, String0),
 		string__sub_string_search(String1, "]", Index)
 	->
Index: doc/reference_manual.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
retrieving revision 1.239
diff -u -r1.239 reference_manual.texi
--- doc/reference_manual.texi	30 Jan 2002 01:40:34 -0000	1.239
+++ doc/reference_manual.texi	15 Feb 2002 14:44:35 -0000
@@ -5471,9 +5471,9 @@
 space between the class keyword and the assembly specifier.
 @c XXX we should handle whitespace better
 Value types which have a special name (such as @samp{int32}) can be
-named using their valuetype syntax; they will be marshalled using their
-special name (as is required by section 7.2 of Partition II of the ECMA
-CLI documentation).
+named using their valuetype syntax or their special name;
+they will be marshalled using their special name
+(as is required by section 7.2 of Partition II of the ECMA CLI documentation).
 
 For example:
 

--------------------------------------------------------------------------
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