Coder Social home page Coder Social logo

suninus / jspatchconvertor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bang590/jspatchconvertor

0.0 2.0 0.0 0 B

JSPatch Convertor is a tool that converts Objective-C code to JSPatch script automatically.

License: MIT License

CSS 0.30% HTML 0.44% JavaScript 97.76% ANTLR 1.50%

jspatchconvertor's Introduction

#JSPatch Convertor

JSPatch Convertor is a tool that converts Objective-C code to JSPatch script automatically.
( What's JSPatch? )

##Usage

Check out http://bang590.github.io/JSPatchConvertor

Please use Chrome or Safari.

#####Advice: You can also download Mac Application:

Click: https://github.com/DevSonw/JSPatchConvertor/blob/gh-pages/JSPatchConvertor.zip

##Supported

The Objective-C syntax below is supported to convert:

####Method declaration

- (void)requestUrl:(NSString *)url param:(NSDictionary *)dict {}
requestUrl_param: function(url, dict) {}

####Method calling

[[JPRequest alloc] initWithUrl:url param:dict];
JPRequest.alloc().initWithUrl_param(url, dict);

####Block syntax

[JPRquest handleCallback:^(id data, NSError *err) {}];
JPRquest.handleCallback(block('id,NSError*', function(data, err) {}));

####Variable declaration

NSString *str = @"content";
var str = "content";

####Getting/Setting Property

self.handler.successBlock(data);
self.handler.data = [[JPData alloc] init];
self.handler().successBlock()(data);
self.handler().setData(JPData.alloc().init());

####NSString / NSArray / nil ...

NSDictionary *dict = nil;
dict = @{
     @"arr": @[@(1), @"2"]
};
var dict = null;
dict = {
    "arr": [(1), "2"]
};

#Unsupported

JSPatch Convertor didn't support the Objective-C / C syntax below, you should modify it manually after converted:

  • Macro / constant variable / Enum
  • C function calling
  • GCD functions
  • Pointer / Struct
  • Getting / Setting private variable

jspatchconvertor's People

Contributors

bang590 avatar

Watchers

Qiang avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.