[squeak-dev] FFI: FFI-Tools-mt.39.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Nov 18 09:11:33 UTC 2021
Marcel Taeumel uploaded a new version of FFI-Tools to project FFI:
http://source.squeak.org/FFI/FFI-Tools-mt.39.mcz
==================== Summary ====================
Name: FFI-Tools-mt.39
Author: mt
Time: 18 November 2021, 10:11:32.705318 am
UUID: bba023f8-43db-724a-918d-03f1eade608b
Ancestors: FFI-Tools-mt.38
Fixes regression in Shout that got introduced in May when support for having "function names without quotes" was added to FFI callout signatures.
=============== Diff against FFI-Tools-mt.38 ===============
Item was changed:
----- Method: SHParserST80>>parseExternalCall (in category '*FFI-Tools') -----
parseExternalCall
"0) First keyword of pragma e.g., <cdecl: ... module: ... error: ...>"
self addRangeType: #pragmaKeyword.
"1) Call flags such as 'threaded' "
[self scanNext.
((Smalltalk at: #ExternalFunction) callingConventionModifierFor: currentToken) notNil]
whileTrue.
"2) Return type"
self failUnless: currentToken notNil.
currentToken = 'const'
ifTrue: [self scanPast: #comment].
self scanPast: #externalCallType.
currentToken = '*'
ifTrue: [self scanPast: #externalCallTypePointerIndicator].
currentToken = '['
ifTrue: ["array types return"
self scanPast: #externalCallType.
[currentTokenFirst ~= $]]
whileTrue: [
self failUnless: currentTokenFirst isDigit.
self scanPast: #externalCallType].
self scanPast: #externalCallType].
"3) Function name or index"
currentTokenFirst isDigit
ifTrue: [self scanPast: #string]
ifFalse: [currentTokenFirst == $'
ifTrue: [self parseString]
+ ifFalse: [
+ self failUnless: currentToken notNil.
+ self scanPast: #string]].
- ifFalse: [self scanPast: #string]].
"4) Argument types"
self failUnless: currentTokenFirst == $(.
self scanPast: #leftParenthesis.
[currentTokenFirst ~= $)]
whileTrue: [
self failUnless: currentToken notNil.
currentToken = 'const'
ifTrue: [self scanPast: #comment]
ifFalse: [self scanPast: #externalCallType].
currentToken = '*'
ifTrue: [self scanPast: #externalCallTypePointerIndicator]].
self scanPast: #rightParenthesis.
"5) Module name"
currentToken = 'module:'
ifTrue: [
self scanPast: #pragmaKeyword.
self parseStringOrSymbol ].
"6) Error code"
currentToken = 'error:' ifTrue: [
self scanPast: #pragmaKeyword.
self currentTokenType == #name
ifTrue: [ self parseTemporary: #patternTempVar ]
ifFalse: [ self parseStringOrSymbol ] ].
self failUnless: currentToken = '>'.
self scanPast: #primitiveOrExternalCallEnd!
More information about the Squeak-dev
mailing list
|