1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

11 commits

Author SHA1 Message Date
zverok
281b350058 Add pattern matching documentation
Add separate doc/syntax/pattern_matching.rdoc, add
link to control_expressions.rdoc.

The documentation is "reverse-engineered" from Ruby 2.7
behavior and early preview presentations, and corrected
by pattern-matching feature author @k-tsj.
2020-02-24 00:28:13 +09:00
Jeremy Evans
29c1e9a0d4 Document the difference between expressions and statements [ci skip]
In the grammar, all expressions are statements, but not all
statements are expressions.  Some parts of the grammar accept
expressions and not other types of statements, which causes
similar looking code to parse differently due to operator
precedence.

Mostly from Dan0042 (Daniel DeLorme).

Fixes [Bug #16092]
2019-10-10 13:45:19 -07:00
hsbt
377f69e4fe * doc/syntax/control_expressions.rdoc: Add missing 'as'
[ci skip][fix GH-1448] Patch by @jsyeo

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-30 09:43:24 +00:00
hsbt
4f94cb43fc * doc/syntax/*.rdoc: separated modifier at sentence.
[ci skip][fix GH-1121] Patch by @clandry94

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18 03:39:49 +00:00
hsbt
f266d21f65 * doc/syntax/control_expressions.rdoc: fix a missing "a"
[fix GH-888][ci skip] Patch by @riffraff

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-08 06:06:03 +00:00
drbrain
1be8ac57ab * doc/syntax/control_expressions.rdoc: Added ? : ternary if
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-17 00:08:53 +00:00
drbrain
038c535e18 * doc/syntax/control_expressions.rdoc (Flip-Flop): Added a section on
the flip-flop.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-16 22:50:54 +00:00
drbrain
9ceb50972f * doc/syntax/control_expressions.rdoc (if Expressions): Fixed markup
error.  Fixes #235 on github by FlyingFoX.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-16 22:00:02 +00:00
drbrain
a06f22f915 * doc/syntax/control_expressions.rdoc: Omit optional "then" for if and
unless expressions.  Improved description of "a if a = 0.zero?"
  NameError.  Note that "do" for for loop is optional.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-15 18:54:54 +00:00
drbrain
d902101b32 * doc/syntax/control_expressions.rdoc (redo Statement): Added note
about retry.
	* doc/syntax/exceptions.rdoc:  Added retry statement


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-15 18:06:24 +00:00
drbrain
e071e13068 * doc/syntax/control_expressions.rdoc: Added description of control
expressions in ruby.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-15 06:55:43 +00:00