Add language support for PHP #35

Closed
wants to merge 1 commit into
from

2 participants

@bobthecow

It seems like there should be a simpler way to map languages to comment styles. Mebbe a shortcut definition for 'c-ish comments'?

@bobthecow

Maybe something like this?

C_ISH_COMMENT_STYLE = {
  :single => "//",
  :multi  => { :start => "/**", :middle => "*", :end => "*/" }
}
COMMENT_STYLES  = {
  "bash"          =>  { :single => "#", :multi => nil },
  "c"             =>  C_ISH_COMMENT_STYLE,
  "coffee-script" =>  {
    :single => "#",
    :multi  => { :start => "###", :middle => nil, :end => "###" }
  },
  "cpp"           =>  C_ISH_COMMENT_STYLE,
  "css"           =>  {
    :single => nil,
    :multi  => { :start => "/**", :middle => "*", :end => "*/" }
  },
  "java"          =>  C_ISH_COMMENT_STYLE,
  "js"            =>  C_ISH_COMMENT_STYLE,
  "lua"           =>  {
    :single => "--",
    :multi => nil
  },
  "php"           =>  C_ISH_COMMENT_STYLE,
  "python"        =>  {
    :single => "#",
    :multi  => { :start => '"""', :middle => nil, :end => '"""' }
  },
  "rb"            =>  {
    :single => "#",
    :multi  => { :start => '=begin', :middle => nil, :end => '=end' }
  },
  "scheme"        =>  { :single => ";;",  :multi => nil },
}
@mikewest mikewest added a commit that referenced this pull request Apr 19, 2011
@bobthecow bobthecow Adding PHP syntax.
Closes issue #35.
fe09cbe
@mikewest
Collaborator

I like it. Done.

@mikewest mikewest closed this Apr 19, 2011
@bobthecow

Great. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment