From 2472b40cb11ba1d1399d9657a1c335cb40241d30 Mon Sep 17 00:00:00 2001 From: Masataka Pocke Kuwabara Date: Sun, 26 Jan 2020 05:01:31 +0900 Subject: [PATCH] Fix Error token in common Objective-C module (#1406) Certain objects that were extracted from the Objective-C lexer in #1378 needed to be prefaced with a `base` variable. This included the token classes. This was not done for `Error`. This commit fixes that mistake. --- lib/rouge/lexers/objective_c/common.rb | 2 +- spec/visual/samples/objective_c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/rouge/lexers/objective_c/common.rb b/lib/rouge/lexers/objective_c/common.rb index c3620212ee..7a708949e7 100644 --- a/lib/rouge/lexers/objective_c/common.rb +++ b/lib/rouge/lexers/objective_c/common.rb @@ -44,7 +44,7 @@ def self.extended(base) elsif base.at_builtins.include? m[1] token base::Name::Builtin else - token Error + token base::Error end end diff --git a/spec/visual/samples/objective_c b/spec/visual/samples/objective_c index d6d70457c1..2f61c0d2ff 100644 --- a/spec/visual/samples/objective_c +++ b/spec/visual/samples/objective_c @@ -173,3 +173,6 @@ ViewController *controller = [[ViewController alloc] initWithDocument:document c builder.thumbnailBarMode = ThumbnailBarModeScrollable; builder.pageLabelEnabled = NO; }]]; + +// Invalid Objective-C keyword +@FOO