From 9a0f7355ed77fbdb00d73b9542e06f958f50b425 Mon Sep 17 00:00:00 2001 From: Nicolas Bouilleaud Date: Tue, 11 Feb 2020 19:36:56 +0100 Subject: [PATCH] Add @autoreleasepool keyword to Objective-C lexer (#1424) This commit adds the `@autoreleasepool` keyword to the list recognised by the Objective-C lexer. --- lib/rouge/lexers/objective_c/common.rb | 2 +- spec/visual/samples/objective_c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/rouge/lexers/objective_c/common.rb b/lib/rouge/lexers/objective_c/common.rb index 7a708949e7..a0e69e7d5e 100644 --- a/lib/rouge/lexers/objective_c/common.rb +++ b/lib/rouge/lexers/objective_c/common.rb @@ -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 diff --git a/spec/visual/samples/objective_c b/spec/visual/samples/objective_c index 2f61c0d2ff..280dbcf911 100644 --- a/spec/visual/samples/objective_c +++ b/spec/visual/samples/objective_c @@ -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; };