diff options
Diffstat (limited to 'src/boot/ast.boot')
-rw-r--r-- | src/boot/ast.boot | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/boot/ast.boot b/src/boot/ast.boot index e8973230..c83e95c6 100644 --- a/src/boot/ast.boot +++ b/src/boot/ast.boot @@ -1214,7 +1214,7 @@ genTypeAlias(head,body) == -- `writeonly', or `readwrite'. $NativeSimpleDataTypes == - '(char byte int + '(char byte int pointer int8 uint8 int16 uint16 int32 uint32 @@ -1298,6 +1298,12 @@ nativeType t == unknownNativeTypeError t t = "float32" => nativeType "float" t = "float64" => nativeType "double" + t = "pointer" => + %hasFeature KEYWORD::GCL => "fixnum" + %hasFeature KEYWORD::ECL => KEYWORD::POINTER_-VOID + %hasFeature KEYWORD::SBCL => ["*",bfColonColon("SB-ALIEN","VOID")] + %hasFeature KEYWORD::CLISP => bfColonColon("FFI","C-POINTER") + unknownNativeTypeError t unknownNativeTypeError t -- composite, reference type. first t = "buffer" => @@ -1306,12 +1312,9 @@ nativeType t == %hasFeature KEYWORD::SBCL => ["*",nativeType second t] %hasFeature KEYWORD::CLISP => bfColonColon("FFI","C-POINTER") unknownNativeTypeError t - first t = "buffer" => - %hasFeature KEYWORD::GCL => "fixnum" - %hasFeature KEYWORD::ECL => KEYWORD::OBJECT - %hasFeature KEYWORD::SBCL => ["*",nativeType second t] - %hasFeature KEYWORD::CLISP => bfColonColon("FFI","C-POINTER") - unknownNativeTypeError t + first t = "pointer" => + -- we don't bother looking at what the pointer points to. + nativeType "pointer" unknownNativeTypeError t @@ -1338,7 +1341,7 @@ nativeArgumentType t == coreError '"missing modifier for argument type for a native function" -- Only 'pointer' and 'buffer' can be instantiated. not (c in '(buffer pointer)) => - coreError '"expect 'buffer' or 'pointer' type instance" + coreError '"expected 'buffer' or 'pointer' type instance" not (t' in $NativeSimpleDataTypes) => coreError '"expected simple native data type" nativeType second t @@ -1440,7 +1443,7 @@ genECLnativeTranslation(op,s,t,op') == y = "float" => '"->vector.self.sf" y = "double" => '"->vector.self.df" coreError '"unknown argument to buffer type constructor" - c = "pointer" => "" + c = "pointer" => '"" coreError '"unknown type constructor" genCLISPnativeTranslation(op,s,t,op') == @@ -1470,7 +1473,7 @@ genCLISPnativeTranslation(op,s,t,op') == unstableArgs := [[p,x,:y],:unstableArgs] -- The actual FFI declaration for the native call. Note that - -- parameter of non-simple datatype are described as being poinyers. + -- parameter of non-simple datatype are described as being pointers. foreignDecl := [bfColonColon("FFI","DEF-CALL-OUT"),n, [KEYWORD::NAME,SYMBOL_-NAME op'], |