mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-10 09:12:46 +08:00
Replaced RegExp method parser with recursive descent
Summary: public This diff replaces the RegEx module method parser with a handwritten recursive descent parser that's faster and easier to maintain. The new parser is ~8 times faster when tested on the UIManager.managerChildren() method, and uses ~1/10 as much RAM. The new parser also supports lightweight generics, and is more tolerant of white space. (This means that you now can – and should – use types like `NSArray<NSString *> *` for your exported properties and method arguments, instead of `NSStringArray`). Reviewed By: jspahrsummers Differential Revision: D2736636 fb-gh-sync-id: f6a11431935fa8acc8ac36f3471032ec9a1c8490
This commit is contained in:
committed by
facebook-github-bot-4
parent
ce7c0b735f
commit
88ac40666c
@@ -10,15 +10,10 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RCTBridgeMethod.h"
|
||||
#import "RCTNullability.h"
|
||||
|
||||
@class RCTBridge;
|
||||
|
||||
typedef NS_ENUM(NSUInteger, RCTNullability) {
|
||||
RCTNullabilityUnspecified,
|
||||
RCTNullable,
|
||||
RCTNonnullable,
|
||||
};
|
||||
|
||||
@interface RCTMethodArgument : NSObject
|
||||
|
||||
@property (nonatomic, copy, readonly) NSString *type;
|
||||
@@ -32,7 +27,7 @@ typedef NS_ENUM(NSUInteger, RCTNullability) {
|
||||
@property (nonatomic, readonly) Class moduleClass;
|
||||
@property (nonatomic, readonly) SEL selector;
|
||||
|
||||
- (instancetype)initWithObjCMethodName:(NSString *)objCMethodName
|
||||
- (instancetype)initWithMethodSignature:(NSString *)objCMethodName
|
||||
JSMethodName:(NSString *)JSMethodName
|
||||
moduleClass:(Class)moduleClass NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user