ruby-changes:32907
From: nagachika <ko1@a...>
Date: Sun, 16 Feb 2014 01:03:14 +0900 (JST)
Subject: [ruby-changes:32907] nagachika:r44986 (ruby_2_0_0): merge revision(s) r44696: [Backport #9429]
nagachika 2014-02-16 01:03:04 +0900 (Sun, 16 Feb 2014) New Revision: 44986 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44986 Log: merge revision(s) r44696: [Backport #9429] * lib/racc/rdoc/grammar.en.rdoc: [DOC] Correct grammar and typos Patch by Giorgos Tsiftsis [Bug #9429] [ci skip] Modified directories: branches/ruby_2_0_0/ Modified files: branches/ruby_2_0_0/ChangeLog branches/ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc branches/ruby_2_0_0/version.h Index: ruby_2_0_0/ChangeLog =================================================================== --- ruby_2_0_0/ChangeLog (revision 44985) +++ ruby_2_0_0/ChangeLog (revision 44986) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1 +Sun Feb 16 01:02:32 2014 Zachary Scott <e@z...> + + * lib/racc/rdoc/grammar.en.rdoc: [DOC] Correct grammar and typos + Patch by Giorgos Tsiftsis [Bug #9429] [ci skip] + Sun Feb 16 01:00:45 2014 Zachary Scott <e@z...> * lib/open-uri.rb: [DOC] use lower case version of core classes, same Index: ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc =================================================================== --- ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc (revision 44985) +++ ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc (revision 44986) @@ -4,14 +4,12 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc#L4 == Class Block and User Code Block -There's two block on toplevel. -one is 'class' block, another is 'user code' block. 'user code' block MUST -places after 'class' block. +There are two blocks on toplevel. One is 'class' block, another is 'user code' +block. 'user code' block MUST be placed after 'class' block. -== Comment +== Comments -You can insert comment about all places. Two style comment can be used, -Ruby style (#.....) and C style (/*......*/) . +You can insert comments about all places. Two style comments can be used, Ruby style '#.....' and C style '/\*......*\/'. == Class Block @@ -19,19 +17,19 @@ The class block is formed like this: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc#L17 class CLASS_NAME [precedance table] - [token declearations] - [expected number of S/R conflict] + [token declarations] + [expected number of S/R conflicts] [options] [semantic value convertion] [start rule] rule GRAMMARS -CLASS_NAME is a name of parser class. -This is the name of generating parser class. +CLASS_NAME is a name of parser class. This is the name of generating parser +class. -If CLASS_NAME includes '::', Racc outputs module clause. -For example, writing "class M::C" causes creating the code bellow: +If CLASS_NAME includes '::', Racc outputs module clause. For example, writing +"class M::C" causes creating the code bellow: module M class C @@ -42,8 +40,8 @@ For example, writing "class M::C" causes https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc#L40 == Grammar Block -The grammar block discripts grammar which is able -to be understood by parser. Syntax is: +The grammar block describes grammar which is able to be understood by parser. +Syntax is: (token): (token) (token) (token).... (action) @@ -59,28 +57,27 @@ to be understood by parser. Syntax is: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc#L57 Note that you cannot use '%' string, here document, '%r' regexp in action. -Actions can be omitted. -When it is omitted, '' (empty string) is used. +Actions can be omitted. When it is omitted, '' (empty string) is used. -A return value of action is a value of left side value ($$). -It is value of result, or returned value by "return" statement. +A return value of action is a value of left side value ($$). It is value of +result, or returned value by `return` statement. Here is an example of whole grammar block. rule - goal: definition ruls source { result = val } + goal: definition rules source { result = val } definition: /* none */ { result = [] } | definition startdesig { result[0] = val[1] } | definition - precrule # this line continue from upper line + precrule # this line continues from upper line { result[1] = val[1] } startdesig: START TOKEN -You can use following special local variables in action. +You can use the following special local variables in action: * result ($$) @@ -92,8 +89,7 @@ An array of value of right-hand side (rh https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc#L89 * _values (...$-2,$-1,$0) -A stack of values. -DO NOT MODIFY this stack unless you know what you are doing. +A stack of values. DO NOT MODIFY this stack unless you know what you are doing. == Operator Precedance @@ -107,9 +103,9 @@ To designate this block: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc#L103 right '=' preclow -`right' is yacc's %right, `left' is yacc's %left. +`right` is yacc's %right, `left` is yacc's %left. -`=' + (symbol) means yacc's %prec: +`=` + (symbol) means yacc's %prec: prechigh nonassoc UMINUS @@ -136,22 +132,22 @@ Racc has bison's "expect" directive. https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc#L132 : : -This directive declears "expected" number of shift/reduce conflict. -If "expected" number is equal to real number of conflicts, -racc does not print confliction warning message. +This directive declares "expected" number of shift/reduce conflicts. If +"expected" number is equal to real number of conflicts, Racc does not print +conflict warning message. == Declaring Tokens -By declaring tokens, you can avoid many meanless bugs. -If decleared token does not exist/existing token does not decleared, -Racc output warnings. Declearation syntax is: +By declaring tokens, you can avoid many meaningless bugs. If declared token +does not exist or existing token does not decleared, Racc output warnings. +Declaration syntax is: token TOKEN_NAME AND_IS_THIS ALSO_THIS_IS AGAIN_AND_AGAIN THIS_IS_LAST == Options -You can write options for racc command in your racc file. +You can write options for Racc command in your Racc file. options OPTION OPTION ... @@ -159,19 +155,19 @@ Options are: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc#L155 * omit_action_call -omit empty action call or not. +omits empty action call or not. * result_var -use/does not use local variable "result" +uses local variable "result" or not. -You can use 'no_' prefix to invert its meanings. +You can use 'no_' prefix to invert their meanings. == Converting Token Symbol Token symbols are, as default, - * naked token string in racc file (TOK, XFILE, this_is_token, ...) + * naked token string in Racc file (TOK, XFILE, this_is_token, ...) --> symbol (:TOK, :XFILE, :this_is_token, ...) * quoted string (':', '.', '(', ...) --> same string (':', '.', '(', ...) @@ -185,7 +181,7 @@ Here is an example: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc#L181 end We can use almost all ruby value can be used by token symbol, -except 'false' and 'nil'. These are causes unexpected parse error. +except 'false' and 'nil'. These cause unexpected parse error. If you want to use String as token symbol, special care is required. For example: @@ -202,12 +198,10 @@ For example: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc#L198 start real_target -This statement will not be used forever, I think. - == User Code Block -"User Code Block" is a Ruby source code which is copied to output. -There are three user code block, "header" "inner" and "footer". +"User Code Block" is a Ruby source code which is copied to output. There are +three user code blocks, "header" "inner" and "footer". Format of user code is like this: @@ -221,6 +215,5 @@ Format of user code is like this: https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/racc/rdoc/grammar.en.rdoc#L215 : : -If four '-' exist on line head, -racc treat it as beginning of user code block. -A name of user code must be one word. +If four '-' exist on line head, Racc treat it as beginning of user code block. +The name of user code block must be one word. Index: ruby_2_0_0/version.h =================================================================== --- ruby_2_0_0/version.h (revision 44985) +++ ruby_2_0_0/version.h (revision 44986) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1 #define RUBY_VERSION "2.0.0" #define RUBY_RELEASE_DATE "2014-02-16" -#define RUBY_PATCHLEVEL 420 +#define RUBY_PATCHLEVEL 421 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 2 Property changes on: ruby_2_0_0 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r44696 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/