[squeak-dev] FFI: FFI-Tools-mt.20.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jul 28 11:34:28 UTC 2020


Marcel Taeumel uploaded a new version of FFI-Tools to project FFI:
http://source.squeak.org/FFI/FFI-Tools-mt.20.mcz

==================== Summary ====================

Name: FFI-Tools-mt.20
Author: mt
Time: 28 July 2020, 1:34:28.035011 pm
UUID: f78c718c-8d1c-e141-a601-7e9bcf6d3978
Ancestors: FFI-Tools-mt.19

Adds parser hook for callback pragmas. Simplifies loading of FFI-Callback.

=============== Diff against FFI-Tools-mt.19 ===============

Item was added:
+ ----- Method: SHParserST80>>callback (in category '*FFI-Tools') -----
+ callback
+ 	<pragmaParser>
+ 	
+ 	self scanPast: #externalFunctionCallingConvention.	
+ 	
+ 	self scanPast: #externalCallType.
+ 	currentToken = '*' 
+ 		ifTrue: [self scanPast: #externalCallTypePointerIndicator].
+ 
+ 	currentTokenFirst == $( ifFalse: [^ self fail]. self scanNext.
+ 	currentTokenFirst == $* ifFalse: [^ self fail]. self scanNext.
+ 	currentTokenFirst == $) ifFalse: [^ self fail]. self scanNext.
+ 		
+ 	self failUnless: currentTokenFirst == $(.
+ 	self scanPast: #leftParenthesis.
+ 	[currentTokenFirst ~= $)] 
+ 		whileTrue: [
+ 			self failUnless: currentToken notNil.
+ 			self scanPast: #externalCallType.
+ 			currentToken = '*' 
+ 				ifTrue: [self scanPast: #externalCallTypePointerIndicator]].
+ 	self scanPast: #rightParenthesis.
+ 	currentToken = 'module:' 
+ 		ifTrue: [
+ 			self scanPast: #module.
+ 			self parseStringOrSymbol ].
+ 	currentToken = 'error:' ifTrue: [
+ 		self scanPast: #primitive. "there's no rangeType for error"
+ 		self currentTokenType == #name
+ 			ifTrue: [ self parseTemporary: #patternTempVar ]
+ 			ifFalse: [ self parseStringOrSymbol ] ].
+ 	self failUnless: currentToken = '>'.
+ 	self scanPast: #primitiveOrExternalCallEnd!



More information about the Squeak-dev mailing list