A lightweight objective-c-to-lua converter written in javascript. It focuses only on objective-c instead of lua's crazy grammar.
It's easy to use.
clone
ordownload
this project- run
oc2lua-beta.html
in your browser - copy your objective-c code to the left textbox
- press
convert
- the converted lua code will appear on the right textbox.
-
Method convert bug fixed.
-
Support convert method define:
- (void)viewDidLoad {
}
- Add convert error alert.
- Support
C
function now.
-
Support
NSString
now. -
Support
BOOL
now. -
Support
if
now. -
.
grammar bug fixed. -
for loop
bug fixed.
Of course, but in order to be compatible without alibaba's wax framework, a little modification is required.
It's not perfect yet.
- Quick operation of
NSDictionary
andNSArray
are not supported:
NSMutableArray *arr;
NSMutableDictionary *dic;
//these operation are not supported:
id obj1 = arr[1];
id obj2 = dic[@"objkey1"];
dic[@"objkey2"] = obj1;
- You can only use
for
for loops like these:
for(type name = value1; name < value2; type++) {
}
for(type name = value1; name < value2; type--) {
}
for(type *value in array) {
}
Thank sherlock for his front-end styles.