I just realised why Punctuation Removal extension isn’t doing what I’d hoped it would. It replaces the apostrophes I want to strip with blank spaces, rather than concatenating what was typed either side of the eliminated apostrophes.
I tried hacking the i6 to do what I want (because it looks like it’s probably uncomplicated) but it’s not elementary if you have no i6 skills (raises hand) as the code is set up to expect a replacement character.
I can think of hacks that would normally work to dance around this, but they’re partly not available to me because I have no player’s snippet to fiddle with, due to extensions I’m using. Plus, why hack when there’s probably a real I6 answer? I’m hoping someone I6y could tweak this inclusion for me to achieve what I’m after. Thanks much.
[ SingleQuoteStripping i;
for (i = WORDSIZE : i <= (buffer-->0)+(WORDSIZE-1) : i++) {
if ((buffer->i) == 39)
{ buffer->i = ' ';
}
}
VM_Tokenise(buffer, parse);
];
So this is untested, since I broke my I7 installation and haven’t been able to fix it yet, but I think this should work.
[ SingleQuoteStripping i offset ;
offset = 0;
for(i=WORDSIZE : i+offset<=(buffer-->0)+(WORDSIZE-1) : i++){
buffer->i = buffer->(i+offset); ! Copy the character back `offset` positions
if((buffer->i) == 39){ ! 39 is the code for a single quote
offset++; ! We've removed a character
i--; ! Go back one, so we'll write over this position again
}
}
(buffer-->0) -= offset; ! buffer-->0 holds the length
VM_Tokenise(buffer, parse); ! Re-run the tokenizer now that we changed the buffer
];