Skip to content

Commit 52ed9b4

Browse files
committed
merge revision(s) 44696: [Backport ruby#9429]
* lib/racc/rdoc/grammar.en.rdoc: [DOC] Correct grammar and typos Patch by Giorgos Tsiftsis [Bug ruby#9429] [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@45117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 8f7b410 commit 52ed9b4

File tree

3 files changed

+43
-45
lines changed

3 files changed

+43
-45
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Sat Feb 22 15:07:58 2014 Zachary Scott <[email protected]>
2+
3+
* lib/racc/rdoc/grammar.en.rdoc: [DOC] Correct grammar and typos
4+
Patch by Giorgos Tsiftsis [Bug #9429] [ci skip]
5+
16
Sat Feb 22 15:06:32 2014 Zachary Scott <[email protected]>
27

38
* lib/open-uri.rb: [DOC] use lower case version of core classes, same

lib/racc/rdoc/grammar.en.rdoc

Lines changed: 37 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,32 @@
44

55
== Class Block and User Code Block
66

7-
There's two block on toplevel.
8-
one is 'class' block, another is 'user code' block. 'user code' block MUST
9-
places after 'class' block.
7+
There are two blocks on toplevel. One is 'class' block, another is 'user code'
8+
block. 'user code' block MUST be placed after 'class' block.
109

11-
== Comment
10+
== Comments
1211

13-
You can insert comment about all places. Two style comment can be used,
14-
Ruby style (#.....) and C style (/*......*/) .
12+
You can insert comments about all places. Two style comments can be used, Ruby style '#.....' and C style '/\*......*\/'.
1513

1614
== Class Block
1715

1816
The class block is formed like this:
1917

2018
class CLASS_NAME
2119
[precedance table]
22-
[token declearations]
23-
[expected number of S/R conflict]
20+
[token declarations]
21+
[expected number of S/R conflicts]
2422
[options]
2523
[semantic value convertion]
2624
[start rule]
2725
rule
2826
GRAMMARS
2927

30-
CLASS_NAME is a name of parser class.
31-
This is the name of generating parser class.
28+
CLASS_NAME is a name of parser class. This is the name of generating parser
29+
class.
3230

33-
If CLASS_NAME includes '::', Racc outputs module clause.
34-
For example, writing "class M::C" causes creating the code bellow:
31+
If CLASS_NAME includes '::', Racc outputs module clause. For example, writing
32+
"class M::C" causes creating the code bellow:
3533

3634
module M
3735
class C
@@ -42,8 +40,8 @@ For example, writing "class M::C" causes creating the code bellow:
4240

4341
== Grammar Block
4442

45-
The grammar block discripts grammar which is able
46-
to be understood by parser. Syntax is:
43+
The grammar block describes grammar which is able to be understood by parser.
44+
Syntax is:
4745

4846
(token): (token) (token) (token).... (action)
4947

@@ -59,28 +57,27 @@ to be understood by parser. Syntax is:
5957

6058
Note that you cannot use '%' string, here document, '%r' regexp in action.
6159

62-
Actions can be omitted.
63-
When it is omitted, '' (empty string) is used.
60+
Actions can be omitted. When it is omitted, '' (empty string) is used.
6461

65-
A return value of action is a value of left side value ($$).
66-
It is value of result, or returned value by "return" statement.
62+
A return value of action is a value of left side value ($$). It is value of
63+
result, or returned value by `return` statement.
6764

6865
Here is an example of whole grammar block.
6966

7067
rule
71-
goal: definition ruls source { result = val }
68+
goal: definition rules source { result = val }
7269

7370
definition: /* none */ { result = [] }
7471
| definition startdesig { result[0] = val[1] }
7572
| definition
76-
precrule # this line continue from upper line
73+
precrule # this line continues from upper line
7774
{
7875
result[1] = val[1]
7976
}
8077

8178
startdesig: START TOKEN
8279

83-
You can use following special local variables in action.
80+
You can use the following special local variables in action:
8481

8582
* result ($$)
8683

@@ -92,8 +89,7 @@ An array of value of right-hand side (rhs).
9289

9390
* _values (...$-2,$-1,$0)
9491

95-
A stack of values.
96-
DO NOT MODIFY this stack unless you know what you are doing.
92+
A stack of values. DO NOT MODIFY this stack unless you know what you are doing.
9793

9894
== Operator Precedence
9995

@@ -107,9 +103,9 @@ To designate this block:
107103
right '='
108104
preclow
109105

110-
`right' is yacc's %right, `left' is yacc's %left.
106+
`right` is yacc's %right, `left` is yacc's %left.
111107

112-
`=' + (symbol) means yacc's %prec:
108+
`=` + (symbol) means yacc's %prec:
113109

114110
prechigh
115111
nonassoc UMINUS
@@ -136,42 +132,42 @@ Racc has bison's "expect" directive.
136132
:
137133
:
138134

139-
This directive declears "expected" number of shift/reduce conflict.
140-
If "expected" number is equal to real number of conflicts,
141-
racc does not print confliction warning message.
135+
This directive declares "expected" number of shift/reduce conflicts. If
136+
"expected" number is equal to real number of conflicts, Racc does not print
137+
conflict warning message.
142138

143139
== Declaring Tokens
144140

145-
By declaring tokens, you can avoid many meanless bugs.
146-
If decleared token does not exist/existing token does not decleared,
147-
Racc output warnings. Declearation syntax is:
141+
By declaring tokens, you can avoid many meaningless bugs. If declared token
142+
does not exist or existing token does not decleared, Racc output warnings.
143+
Declaration syntax is:
148144

149145
token TOKEN_NAME AND_IS_THIS
150146
ALSO_THIS_IS AGAIN_AND_AGAIN THIS_IS_LAST
151147

152148
== Options
153149

154-
You can write options for racc command in your racc file.
150+
You can write options for Racc command in your Racc file.
155151

156152
options OPTION OPTION ...
157153

158154
Options are:
159155

160156
* omit_action_call
161157

162-
omit empty action call or not.
158+
omits empty action call or not.
163159

164160
* result_var
165161

166-
use/does not use local variable "result"
162+
uses local variable "result" or not.
167163

168-
You can use 'no_' prefix to invert its meanings.
164+
You can use 'no_' prefix to invert their meanings.
169165

170166
== Converting Token Symbol
171167

172168
Token symbols are, as default,
173169

174-
* naked token string in racc file (TOK, XFILE, this_is_token, ...)
170+
* naked token string in Racc file (TOK, XFILE, this_is_token, ...)
175171
--> symbol (:TOK, :XFILE, :this_is_token, ...)
176172
* quoted string (':', '.', '(', ...)
177173
--> same string (':', '.', '(', ...)
@@ -185,7 +181,7 @@ Here is an example:
185181
end
186182

187183
We can use almost all ruby value can be used by token symbol,
188-
except 'false' and 'nil'. These are causes unexpected parse error.
184+
except 'false' and 'nil'. These cause unexpected parse error.
189185

190186
If you want to use String as token symbol, special care is required.
191187
For example:
@@ -202,12 +198,10 @@ For example:
202198

203199
start real_target
204200

205-
This statement will not be used forever, I think.
206-
207201
== User Code Block
208202

209-
"User Code Block" is a Ruby source code which is copied to output.
210-
There are three user code block, "header" "inner" and "footer".
203+
"User Code Block" is a Ruby source code which is copied to output. There are
204+
three user code blocks, "header" "inner" and "footer".
211205

212206
Format of user code is like this:
213207

@@ -221,6 +215,5 @@ Format of user code is like this:
221215
:
222216
:
223217

224-
If four '-' exist on line head,
225-
racc treat it as beginning of user code block.
226-
A name of user code must be one word.
218+
If four '-' exist on line head, Racc treat it as beginning of user code block.
219+
The name of user code block must be one word.

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.1.1"
22
#define RUBY_RELEASE_DATE "2014-02-22"
3-
#define RUBY_PATCHLEVEL 61
3+
#define RUBY_PATCHLEVEL 62
44

55
#define RUBY_RELEASE_YEAR 2014
66
#define RUBY_RELEASE_MONTH 2

0 commit comments

Comments
 (0)