Skip to content

Commit

Permalink
Add @autoreleasepool keyword to Objective-C lexer (#1424)
Browse files Browse the repository at this point in the history
This commit adds the `@autoreleasepool` keyword to the list recognised
by the Objective-C lexer.
  • Loading branch information
n-b committed Feb 11, 2020
1 parent e6dd5b5 commit 9a0f735
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rouge/lexers/objective_c/common.rb
Expand Up @@ -10,7 +10,7 @@ def at_keywords
@at_keywords ||= %w(
selector private protected public encode synchronized try
throw catch finally end property synthesize dynamic optional
interface implementation import
interface implementation import autoreleasepool
)
end

Expand Down
4 changes: 4 additions & 0 deletions spec/visual/samples/objective_c
Expand Up @@ -29,6 +29,10 @@

@end

@autoreleasepool {
NSString *string = [[NSString alloc] initWithUTF8String:"I will be autoreleased"];
}

double (^multiplyTwoValues)(double, double) = ^(double firstValue, double secondValue) {
return firstValue * secondValue;
};
Expand Down

0 comments on commit 9a0f735

Please sign in to comment.