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