lib/rouge/lexers/matlab.rb in rouge-3.8.0 vs lib/rouge/lexers/matlab.rb in rouge-3.9.0
- old
+ new
@@ -17,11 +17,13 @@
global if otherwise parfor persistent return spmd switch try while
)
end
def self.builtins
- load File.join(__dir__, 'matlab/builtins.rb')
- self.builtins
+ # Load Matlab keywords from separate YML file
+ @builtins ||= ::YAML.load_file(File.join(__dir__, 'matlab/builtins.yml')).tap do |a|
+ Set.new a
+ end
end
state :root do
rule %r/\s+/m, Text # Whitespace
rule %r([{]%.*?%[}])m, Comment::Multiline