parent
c5d0f3ba43
commit
fe09cbe0e3
34
lib/rocco.rb
34
lib/rocco.rb
@ -208,48 +208,34 @@ class Rocco
|
||||
#
|
||||
# At the moment, we're only returning `:single`. Consider this
|
||||
# groundwork for block comment parsing.
|
||||
COMMENT_STYLES = {
|
||||
"bash" => { :single => "#", :multi => nil },
|
||||
"c" => {
|
||||
C_STYLE_COMMENTS = {
|
||||
:single => "//",
|
||||
:multi => { :start => "/**", :middle => "*", :end => "*/" },
|
||||
:heredoc => nil
|
||||
},
|
||||
}
|
||||
COMMENT_STYLES = {
|
||||
"bash" => { :single => "#", :multi => nil },
|
||||
"c" => C_STYLE_COMMENTS,
|
||||
"coffee-script" => {
|
||||
:single => "#",
|
||||
:multi => { :start => "###", :middle => nil, :end => "###" },
|
||||
:heredoc => nil
|
||||
},
|
||||
"cpp" => {
|
||||
:single => "//",
|
||||
:multi => { :start => "/**", :middle => "*", :end => "*/" },
|
||||
:heredoc => nil
|
||||
},
|
||||
"csharp" => {
|
||||
:single => "//",
|
||||
:multi => { :start => "/**", :middle => "*", :end => "*/" },
|
||||
:heredoc => nil
|
||||
},
|
||||
"cpp" => C_STYLE_COMMENTS,
|
||||
"csharp" => C_STYLE_COMMENTS,
|
||||
"css" => {
|
||||
:single => nil,
|
||||
:multi => { :start => "/**", :middle => "*", :end => "*/" },
|
||||
:heredoc => nil
|
||||
},
|
||||
"java" => {
|
||||
:single => "//",
|
||||
:multi => { :start => "/**", :middle => "*", :end => "*/" },
|
||||
:heredoc => nil
|
||||
},
|
||||
"js" => {
|
||||
:single => "//",
|
||||
:multi => { :start => "/**", :middle => "*", :end => "*/" },
|
||||
:heredoc => nil
|
||||
},
|
||||
"java" => C_STYLE_COMMENTS,
|
||||
"js" => C_STYLE_COMMENTS,
|
||||
"lua" => {
|
||||
:single => "--",
|
||||
:multi => nil,
|
||||
:heredoc => nil
|
||||
},
|
||||
"php" => C_STYLE_COMMENTS,
|
||||
"python" => {
|
||||
:single => "#",
|
||||
:multi => { :start => '"""', :middle => nil, :end => '"""' },
|
||||
|
Loading…
Reference in New Issue
Block a user