[squeak-dev] FFI | <apicall ...> <cdecl ...> styling: Tools or Kernel?

Marcel Taeumel marcel.taeumel at hpi.de
Mon Jun 15 07:49:38 UTC 2020


Hi Jakob.

Or did you mean a fall-back in the FFI-Kernel package? Well, you can always disable styling.

Well, if you cannot save/compile the source anyway, it makes no sense to implement a fallback in Shout for arbitrary stuff in a pragma.

Best,
Marcel
Am 15.06.2020 09:35:18 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
Hi Jakob.

> Could we have a fallback implementation

Hmm... not a robust one. The current fallback is to parse the standard keyword pattern: <foo: 42 bar: 'huh' baz: #hmm>

As soon as a custom pragma parser comes into play --- like the one for FFI calls --- you can only "fail" as a Shout parser if you come across an unexpected token.

Well, when parsing pragmas, we could implement a different kind of #fail. We could look for the next > and try to finish parsing the pragma. This would only work if there is no other > in the middle ... #> and '>' are fine, I suppose.

Best,
Marcel
Am 14.06.2020 23:46:48 schrieb Jakob Reschke <forums.jakob at resfarm.de>:
Hi Marcel,

Could we have a fallback implementation in Tools that just ignores/does not highlight the contents of any <...> at the top of the method?

And if you load the appropriate tools package for your feature (FFI), then you get better styling for the constructs it supplies.

Kind regards,
Jakob


Am So., 14. Juni 2020 um 08:29 Uhr schrieb Marcel Taeumel <marcel.taeumel at hpi.de [mailto:marcel.taeumel at hpi.de]>:

Hi all!

I just extracted FFI-specific code for pragma styling into the FFI-Tools package.

I am not sure whether this is good, because now you *have to* load that FFI-Tools package to browse method sources with FFI pragmas having Shout enabled. So, that's a change. All my other additions to FFI-Tools have been new so far.

Having FFI-Pools and FFI-Kernel only lets you compile this method:


After installing FFI-Tools, you get this experience:


Here is another take on package organization for the Squeak FFI project:
http://forum.world.st/FFI-FFI-Pools-mt-19-mcz-tp5117611p5117643.html [http://forum.world.st/FFI-FFI-Pools-mt-19-mcz-tp5117611p5117643.html]


Please share your thoughts on this matter :-)

Best,
Marcel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200615/e7701945/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 3508 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200615/e7701945/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 4912 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200615/e7701945/attachment-0001.png>


More information about the Squeak-dev mailing list