Eliot Miranda uploaded a new version of Cog to project VM Maker: http://source.squeak.org/VMMaker/Cog-eem.355.mcz
==================== Summary ====================
Name: Cog-eem.355 Author: eem Time: 19 March 2019, 11:32:28.83444 am UUID: 01f63693-e404-47bf-86d9-f4520168093c Ancestors: Cog-eem.354
Deal with string arguments in cCode: => selector:_: editing.
=============== Diff against Cog-eem.354 ===============
Item was changed: ----- Method: CogScripts class>>processedCCodeCallFor: (in category 'plugin scripts') ----- processedCCodeCallFor: aCCodeString "Take a cCode: string containing a C call and answer a literal array encoding the parameter list with any casts moved to the back, for ease of generating self cCoerce: thing to: type.
'func(a,b)' => #(func #(a b)) '(type)func()' => #(func #() #(type)) 'func((type)a)') => #(func #(#(a #(type))))) " | argVec parameterList | + argVec := Compiler evaluate: '#(', (aCCodeString copyReplaceAll: $" asString with: $' asString), ')'. - argVec := Compiler evaluate: '#(', aCCodeString, ')'. [argVec size > 2 and: [argVec last == #';']] whileTrue: [argVec := argVec allButLast]. argVec last notEmpty ifTrue: [parameterList := (argVec last splitBy: #(#,)) collect: [:p| p size > 1 ifTrue: [{p last. p first}] ifFalse: [p first]]. argVec at: argVec size put: parameterList]. ^argVec first isArray ifTrue: [argVec allButFirst, {argVec first}] ifFalse: [argVec]!
vm-dev@lists.squeakfoundation.org