--- a/Parser.st Fri May 05 13:40:31 2006 +0200
+++ b/Parser.st Fri May 05 14:44:23 2006 +0200
@@ -7108,7 +7108,7 @@
generateCallToExternalFunction:fn lineNr:lineNr virtualCPP:virtualCPP nonVirtualCPP:nonVirtualCPP
|args sel node|
- fn argumentTypes size ~~ methodArgNames size ifTrue:[
+ fn argumentTypes size ~~ (methodArgNames size + (nonVirtualCPP ifTrue:1 ifFalse:0)) ifTrue:[
self ignorableParseError:'number of method args does not match function arg list'.
].
@@ -7127,7 +7127,7 @@
args := (Array with:(self selfNode)) , args.
].
] ifFalse:[
- nonVirtualCPP ifTrue:[ self halt.
+ nonVirtualCPP ifTrue:[
args := (Array with:(self selfNode)) , args
].
sel := #(
@@ -7482,7 +7482,7 @@
|cParser callType
isVirtualCall isNonVirtualCall returnType functionName functionIndex argTypes moduleName type function
- typeFromSqueakTypeSpec parentized |
+ typeFromSqueakTypeSpec parentized thisType|
typeFromSqueakTypeSpec := [:tok | |e cls cType|
e := #(
@@ -7618,6 +7618,19 @@
argTypes := #()
].
+ isNonVirtualCall ifTrue:[
+ (classToCompileFor isSubclassOf:ExternalStructure) ifTrue:[
+ (thisType := classToCompileFor cType) isNil ifTrue:[
+ "/ self warning:'missing CType definition in ' , tok printString.
+ thisType := CType newStructType.
+ thisType name:(classToCompileFor nameWithoutPrefix).
+ thisType := CType pointerTypeClass new baseType:thisType.
+ ].
+ ].
+ thisType := thisType ? #pointer.
+ argTypes := (Array with:thisType) , argTypes.
+ ].
+
function := ExternalLibraryFunction
name:(functionName ? functionIndex)
module:moduleName
@@ -8585,7 +8598,7 @@
!Parser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.499 2006-05-05 11:40:31 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.500 2006-05-05 12:44:23 cg Exp $'
! !
Parser initialize!