forked from lsegal/yard
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Ripper parser code into SourceParser and hook up handlers. Move …
…old parser into Legacy namespace. Still need to move handlers and rewrite handlers for new ripper AST
- Loading branch information
Showing
31 changed files
with
771 additions
and
941 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# encoding: utf-8 | ||
require 'benchmark' | ||
require File.dirname(__FILE__) + '/../lib/yard' | ||
require 'yard/parser/ruby/legacy/ruby_lex' | ||
|
||
class YARD::Parser::SourceParser | ||
def top_level_parse(statements) statements end | ||
end | ||
|
||
$files_yard = Dir[File.dirname(__FILE__) + '/../lib/**/*.rb'].map {|f| File.read(f) } | ||
$files_rip = Dir[File.dirname(__FILE__) + '/../lib/**/*.rb'].map {|f| [File.read(f), f] } | ||
|
||
TIMES = 2 | ||
Benchmark.bmbm do |x| | ||
x.report("yard-parser ") { TIMES.times { $files_yard.each {|f| YARD::Parser::Ruby::Legacy::StatementList.new(f) } } } | ||
x.report("rip-parser") { TIMES.times { $files_rip.each {|f| YARD::Parser::Ruby::RubyParser.parse(*f) } } } | ||
#x.report("old-ripper-parser") { $files.each {|f| OldRipper::RipperSexp.parse(f) } } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.