зеркало из https://github.com/github/ruby.git
Allow "do" after "for". Fix up css for standalone code window
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
13ebee7a9e
Коммит
129313378f
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
Wed May 26 13:59:17 2004 Dave Thomas <dave@pragprog.com>
|
||||||
|
|
||||||
|
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::skip_for_variable): Allow for
|
||||||
|
'do' after for statement
|
||||||
|
|
||||||
|
Wed May 26 13:56:03 2004 Dave Thomas <dave@pragprog.com>
|
||||||
|
|
||||||
|
* lib/rdoc/generators/html_generator.rb (Generators::MarkUp::style_url): Fix
|
||||||
|
relative path to code CSS file
|
||||||
|
|
||||||
Wed May 26 13:14:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Wed May 26 13:14:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* io.c (rb_io_init_copy): copy also positions. [ruby-talk:100910]
|
* io.c (rb_io_init_copy): copy also positions. [ruby-talk:100910]
|
||||||
|
|
|
@ -964,7 +964,7 @@ module Generators
|
||||||
values = {
|
values = {
|
||||||
'title' => CGI.escapeHTML(index_name),
|
'title' => CGI.escapeHTML(index_name),
|
||||||
'code' => code_body,
|
'code' => code_body,
|
||||||
'style_url' => style_url(path, @options.css),
|
'style_url' => style_url(file_path, @options.css),
|
||||||
'charset' => @options.charset
|
'charset' => @options.charset
|
||||||
}
|
}
|
||||||
template.write_html_on(f, values)
|
template.write_html_on(f, values)
|
||||||
|
|
|
@ -187,7 +187,9 @@ div.method-source-code {
|
||||||
div.method-source-code pre { color: #ffdead; overflow: hidden; }
|
div.method-source-code pre { color: #ffdead; overflow: hidden; }
|
||||||
|
|
||||||
/* --- Ruby keyword styles --------------------- */
|
/* --- Ruby keyword styles --------------------- */
|
||||||
/* (requires a hacked html_generator.rb to add more class-types) */
|
|
||||||
|
.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
|
||||||
|
|
||||||
.ruby-constant { color: #7fffd4; background: transparent; }
|
.ruby-constant { color: #7fffd4; background: transparent; }
|
||||||
.ruby-keyword { color: #00ffff; background: transparent; }
|
.ruby-keyword { color: #00ffff; background: transparent; }
|
||||||
.ruby-ivar { color: #eedd82; background: transparent; }
|
.ruby-ivar { color: #eedd82; background: transparent; }
|
||||||
|
@ -561,18 +563,13 @@ BODY = HEADER + %{
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
SRC_PAGE = XHTML_PREAMBLE + %{
|
SRC_PAGE = XHTML_PREAMBLE + %{
|
||||||
<!--
|
|
||||||
|
|
||||||
%title%
|
|
||||||
|
|
||||||
-->
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>%title%</title>
|
<title>%title%</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
|
<meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
|
||||||
<link rel="stylesheet" href="http://www.FaerieMUD.org/stylesheets/rdoc.css" type="text/css" />
|
<link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body class="standalone-code">
|
||||||
<pre>%code%</pre>
|
<pre>%code%</pre>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1675,7 +1675,15 @@ module RDoc
|
||||||
"line #{tk.line_no}" if $DEBUG
|
"line #{tk.line_no}" if $DEBUG
|
||||||
skip_optional_do_after_expression
|
skip_optional_do_after_expression
|
||||||
|
|
||||||
when TkCASE, TkDO, TkIF, TkUNLESS, TkBEGIN, TkFOR
|
# 'for' is trickier
|
||||||
|
when TkFOR
|
||||||
|
nest += 1
|
||||||
|
puts "FOUND #{tk.class} in #{container.name}, nest = #{nest}, " +
|
||||||
|
"line #{tk.line_no}" if $DEBUG
|
||||||
|
skip_for_variable
|
||||||
|
skip_optional_do_after_expression
|
||||||
|
|
||||||
|
when TkCASE, TkDO, TkIF, TkUNLESS, TkBEGIN
|
||||||
nest += 1
|
nest += 1
|
||||||
puts "Found #{tk.class} in #{container.name}, nest = #{nest}, " +
|
puts "Found #{tk.class} in #{container.name}, nest = #{nest}, " +
|
||||||
"line #{tk.line_no}" if $DEBUG
|
"line #{tk.line_no}" if $DEBUG
|
||||||
|
@ -2046,6 +2054,15 @@ module RDoc
|
||||||
res
|
res
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# skip the var [in] part of a 'for' statement
|
||||||
|
def skip_for_variable
|
||||||
|
skip_tkspace(false)
|
||||||
|
tk = get_tk
|
||||||
|
skip_tkspace(false)
|
||||||
|
tk = get_tk
|
||||||
|
unget_tk(tk) unless tk.kind_of?(TkIN)
|
||||||
|
end
|
||||||
|
|
||||||
# while, until, and for have an optional
|
# while, until, and for have an optional
|
||||||
def skip_optional_do_after_expression
|
def skip_optional_do_after_expression
|
||||||
skip_tkspace(false)
|
skip_tkspace(false)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче