diff options
author | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-01-05 15:12:53 +0000 |
---|---|---|
committer | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-01-05 15:12:53 +0000 |
commit | 9f29ed5a1c9d1b23e297454bac3f557e53b6087e (patch) | |
tree | 3b44919670a76a769ceaef00c5ce6f15788d006a /lib | |
parent | 0787d21f420cf54ba6d7c2aa8dcbf65a508d3bac (diff) |
Fix parsing where braces appear in method parameter list
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rdoc/README | 9 | ||||
-rw-r--r-- | lib/rdoc/options.rb | 15 | ||||
-rw-r--r-- | lib/rdoc/parsers/parse_rb.rb | 5 |
3 files changed, 22 insertions, 7 deletions
diff --git a/lib/rdoc/README b/lib/rdoc/README index 1b8671182f..0c10d0ea69 100644 --- a/lib/rdoc/README +++ b/lib/rdoc/README @@ -196,11 +196,12 @@ Options are: [<tt>--quiet</tt>] do not display progress messages -[<tt>--ri</tt> _and_ <tt>--ri-site</tt>] +[<tt>--ri</tt>, <tt>--ri-site</tt>, _and_ <tt>--ri-system</tt>] generate output than can be read by the _ri_ command-line tool. - By default --ri places its output in ~/.rdoc, and --ri-site in - $datadir/ri/<ver>/site. Both can be overridden with a subsequent - --op option. Both default directories are in ri's default search + By default --ri places its output in ~/.rdoc, --ri-site in + $datadir/ri/<ver>/site, and --ri-system in + $datadir/ri/<ver>/system. All can be overridden with a subsequent + --op option. All default directories are in ri's default search path. [<tt>--show-hash</tt>] diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb index ab99c18b86..0d99a5438e 100644 --- a/lib/rdoc/options.rb +++ b/lib/rdoc/options.rb @@ -198,6 +198,12 @@ class Options "stored in a site-wide directory, making them accessible\n"+ "to others, so special privileges are needed." ], + [ "--ri-system", "-Y", nil, + "generate output for use by 'ri.' The files are\n" + + "stored in a system-level directory, making them accessible\n"+ + "to others, so special privileges are needed. This option\n"+ + "is intended to be used during Ruby installations" ], + [ "--show-hash", "-H", nil, "A name of the form #name in a comment\n" + "is a possible hyperlink to an instance\n" + @@ -431,9 +437,14 @@ class Options when "--include" @rdoc_include.concat arg.split(/\s*,\s*/) - when "--ri", "--ri-site" + when "--ri", "--ri-site", "--ri-system" @generator_name = "ri" - @op_dir = opt == "--ri" ? RI::Paths::HOMEDIR : RI::Paths::SITEDIR + @op_dir = case opt + when "--ri" then RI::Paths::HOMEDIR + when "--ri-site" then RI::Paths::SITEDIR + when "--ri-system" then RI::Paths::SYSDIR + else fail opt + end setup_generator(generators) when "--tab-width" diff --git a/lib/rdoc/parsers/parse_rb.rb b/lib/rdoc/parsers/parse_rb.rb index b8044c119b..d050829915 100644 --- a/lib/rdoc/parsers/parse_rb.rb +++ b/lib/rdoc/parsers/parse_rb.rb @@ -1997,8 +1997,11 @@ module RDoc case tk when TkSEMICOLON break + when TkLBRACE + nest += 1 when TkRBRACE - break + nest -= 1 + break if nest <= 0 when TkLPAREN, TkfLPAREN nest += 1 when end_token |