Skip to content
Snippets Groups Projects
Commit d8b5b750 authored by http://jayferd.us/'s avatar http://jayferd.us/
Browse files

resolve the guessing conflicts between matlab and objc

parent 47c06064
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -8,7 +8,7 @@ module Rouge
mimetypes 'text/x-matlab', 'application/x-matlab'
 
def self.analyze_text(text)
return 0.51 if text.match(/^\s*% /) # % comments are a dead giveaway
return 0.4 if text.match(/^\s*% /) # % comments are a dead giveaway
end
 
def self.keywords
Loading
Loading
Loading
Loading
@@ -27,7 +27,7 @@ module Rouge
end
 
def self.analyze_text(text)
return 1 if text =~ /@(end|implementation|protocol)\b/
return 1 if text =~ /@(end|implementation|protocol|property)\b/
 
id = /[a-z$_][a-z0-9$_]*/i
return 0.4 if text =~ %r(
Loading
Loading
Loading
Loading
@@ -5,20 +5,13 @@ describe Rouge::Lexers::Matlab do
include Support::Guessing
 
it 'guesses by filename' do
assert_guess :filename => 'foo.m'
assert_guess :filename => 'foo.m', :source => '% comment'
end
 
it 'guesses by mimetype' do
assert_guess :mimetype => 'text/x-matlab'
assert_guess :mimetype => 'application/x-matlab'
end
it 'guesses by source' do
assert_guess :source => <<-source
% Comments start with a percent sign.
sin(x)
source
end
end
end
 
Loading
Loading
@@ -5,7 +5,7 @@ describe Rouge::Lexers::ObjectiveC do
include Support::Guessing
 
it 'guesses by filename' do
assert_guess :filename => 'foo.m'
assert_guess :filename => 'foo.m', :source => '@property'
end
 
it 'guesses by mimetype' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment