merico-dev / tree-sitter-objc

Tree-sitter parser for Objective-C
MIT License
16 stars 7 forks source link

Boxed literal #6

Closed ghost closed 3 years ago

ghost commented 3 years ago

This PR is trying to add at expression grammar for boxed values. String literal, number literal, char literal, array literal and dictionary literal are supported.

example code

NSString * a = @"Test";
NSNumber *fortyTwo = @42;
NSNumber *theLetterZ = @'Z';
NSArray *elements = @[ @[ @"H" ], @"He" ];
NSDictionary *dictionary = @{
    @"key" : @[]
};

Reference: https://clang.llvm.org/docs/ObjectiveCLiterals.html

CamilleTeruel commented 3 years ago

LGTM