Skip to content

Instantly share code, notes, and snippets.

@bb
Created March 19, 2010 22:24
Show Gist options
  • Save bb/338261 to your computer and use it in GitHub Desktop.
Save bb/338261 to your computer and use it in GitHub Desktop.
diff --git a/lib/yard/parser/source_parser.rb b/lib/yard/parser/source_parser.rb
index dc389af..a8aacc9 100644
--- a/lib/yard/parser/source_parser.rb
+++ b/lib/yard/parser/source_parser.rb
@@ -221,6 +221,8 @@ module YARD
case (File.extname(filename)[1..-1] || "").downcase
when "c", "cpp", "cxx"
:c
+ when "java"
+ :java
else # when "rb", "rbx", "erb"
parser_type == :ruby18 ? :ruby18 : :ruby
end
@@ -234,6 +236,8 @@ module YARD
case parser_type
when :c
CParser.new(content, file).parse
+ when :java
+ JavaParser.parse(content, file)
when :ruby18
Ruby::Legacy::StatementList.new(content)
when :ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment