rocco-obb 0.6 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rocco.rb +8 -4
- data/rocco.gemspec +1 -1
- metadata +3 -3
data/lib/rocco.rb
CHANGED
@@ -108,7 +108,11 @@ class Rocco
|
|
108
108
|
elsif @options[:language] != defaults[:language]
|
109
109
|
@options[:comment_chars] = generate_comment_chars()
|
110
110
|
end
|
111
|
-
|
111
|
+
if !@options[:comment_chars][:single].kind_of?(String)
|
112
|
+
@comment_pattern = Regexp.new("^\\s*#{@options[:comment_chars][:single]}\s?")
|
113
|
+
else
|
114
|
+
@comment_pattern = Regexp.new("#{@options[:comment_chars][:single]}|#{@options[:comment_chars][:multi]}")
|
115
|
+
end
|
112
116
|
|
113
117
|
@sections = highlight(split(parse(@data)))
|
114
118
|
end
|
@@ -173,15 +177,15 @@ class Rocco
|
|
173
177
|
"cpp" => { :single => "//", :multi => { :start => "/**", :middle => "*", :end => "*/" } },
|
174
178
|
"java" => { :single => "//", :multi => { :start => "/**", :middle => "*", :end => "*/" } },
|
175
179
|
"js" => { :single => "//", :multi => { :start => "/**", :middle => "*", :end => "*/" } },
|
176
|
-
"php" => { :single => "
|
180
|
+
"php" => { :single => "\s\/\/([^\n]*)", :multi => "\/\*\*(.*?)\*{1,2}\/" },
|
177
181
|
"lua" => { :single => "--", :multi => nil },
|
178
182
|
"python" => { :single => "#", :multi => { :start => '"""', :middle => nil, :end => '"""' } },
|
179
183
|
"ruby" => { :single => "#", :multi => nil },
|
180
184
|
"scheme" => { :single => ";;", :multi => nil },
|
181
185
|
}
|
182
|
-
|
186
|
+
|
183
187
|
if comment_styles[language]
|
184
|
-
comment_styles[language]
|
188
|
+
comment_styles[language]
|
185
189
|
else
|
186
190
|
@options[:comment_chars]
|
187
191
|
end
|
data/rocco.gemspec
CHANGED
metadata
CHANGED