Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix builtins missing keywords issue in Matlab #2007

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions lib/rouge/lexers/matlab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ def self.keywords
)
end

# self-modifying method that loads the builtins file
def self.builtins
Kernel::load File.join(Lexers::BASE_DIR, 'matlab/keywords.rb')
builtins
end
require_relative "matlab/keywords"

state :root do
rule %r/\s+/m, Text # Whitespace
Expand Down
11 changes: 0 additions & 11 deletions lib/rouge/lexers/matlab/builtins.rb

This file was deleted.

6 changes: 4 additions & 2 deletions lib/rouge/lexers/matlab/keywords.rb

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions tasks/builtins/matlab.rake
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ module Rouge
yield ""
yield "module Rouge"
yield " module Lexers"
yield " def Matlab.builtins"
yield " @builtins ||= Set.new #{keywords.inspect}"
yield " class Matlab"
yield " def self.builtins"
yield " @builtins ||= Set.new #{keywords.inspect}"
yield " end"
yield " end"
yield " end"
yield "end"
yield ""
end
end
end
Expand Down