Skip to content

Commit

Permalink
Fix keywords loading issue in Matlab
Browse files Browse the repository at this point in the history
The issue is picked up via Dingus website.

NameError - uninitialized constant Rouge::Lexers::Matlab
  • Loading branch information
tancnle committed Oct 27, 2023
1 parent 1687d63 commit ebb7a2d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
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

0 comments on commit ebb7a2d

Please sign in to comment.