Skip to content

Instantly share code, notes, and snippets.

@daboe01
daboe01 / gist:aa73239c3d76111151b04e3e0a33d2eb
Created June 24, 2018 11:47
perl script to convert gnustep code to cappuccino
#!/usr/bin/perl
use IO::All;
my $io = io $ARGV[0];
my $filecontent= $io->slurp();
$filecontent =~s/\breturn\b/0return/ogs;
$filecontent =~s/NS([a-zA-Z0-9_]+)(\s*)\*/CP$1$2/ogs;
$filecontent =~s/NS([a-zA-Z0-9_]+)/CP$1/ogs;
$filecontent =~s/([a-zA-Z0-9_]) \)/$1)/ogs;
$filecontent =~s/([a-zA-Z_][a-zA-Z0-9_]*)\s+\*([a-zA-Z_][a-zA-Z0-9]*)\s*=/$1 $2 =/ogs;
@import <Foundation/CPObject.j>
@import <Foundation/CPAttributedString.j>
var _regexColors;
@implementation ColorizingTextView : KVOCPText
{
}