summaryrefslogtreecommitdiff
path: root/doc/syntax
AgeCommit message (Collapse)Author
2019-10-10Document the difference between expressions and statements [ci skip]Jeremy Evans
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-03Add documentation regarding keyword argument separation [ci skip]Jeremy Evans
2019-10-03Minor updates to methods and calling_methods documentation [ci skip]Jeremy Evans
2019-09-20[DOC] DOT is not a part of a receiver [ci skip]Nobuyoshi Nakada
[Feature #11297] [Feature #16123]
2019-09-20Update NEWS and documents [ci skip]Nobuyoshi Nakada
[Feature #11297] [Feature #16123]
2019-08-04Use the word heredocs in Here Documents docsOlivier Lacan
Two advantages: - higher relevance of the extremely common word "heredocs" which may help people find this page when searching for "ruby heredocs" - the anchor link becomes `#label-Here+Documents+-28heredocs-29`, which is ugly due to the parentheses but includes the word "heredocs" in the URL to this section If anyone knows a way to prevent RDoc from turning invalid characters into ugly and meaningless ASCII codes, I'm listening. I don't want to break existing anchor links but RDoc should really ignore these characters or turn them into dashes. Closes: https://github.com/ruby/ruby/pull/2103
2019-07-19Document use of ensure and else at method level [ci skip]Jeremy Evans
2019-07-19Remove section on performance advantage of not using a block parameter [ci skip]Jeremy Evans
Improvements in Ruby 2.5 and 2.6 make this section no longer accurate.
2019-07-19Remove mention of Proc.new with implicit block [ci skip]Jeremy Evans
This support is now deprecated and will be removed in Ruby 3.
2019-07-19Document evaluation order of arguments [ci skip]Jeremy Evans
Fixes [Misc #8905]
2019-07-19Document required keyword argument syntax [ci skip]Jeremy Evans
Fixes [Bug #8952]
2019-06-25Improve wording of Local Variables and eval sectionJeremy Evans
As pointed out by nobu, "defined" should be used instead of "assigned".
2019-06-26* remove trailing spaces.git
2019-06-25Document local variable interactions with evalJeremy Evans
Fixes [Bug #13337]
2019-05-03Fix typoMarcus Stollsteimer
2019-04-29Disallow also CR in here-doc identifierNobuyoshi Nakada
* parse.y (heredoc_identifier): CR in here-document identifier might or might not result in a syntax error, by the EOL code. make a syntax error regardless of the EOL code.
2019-04-29parse.y: fix here-doc identifier with newlineNobuyoshi Nakada
* parse.y (heredoc_identifier): quoted here-document identifier must end within the same line. the only corner case that here-document identifier can contain a newline is that the closing qoute is placed at the beginning of the next line, and has been warned since 2.4. ```ruby <<"EOS " # warning: here document identifier ends with a newline EOS ```
2019-04-03Introduce beginless range [Feature#14799]mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-10Update refinements docstenderlove
Co-Authored-By: Vladimir Dementyev <dementiev.vm@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-24Small improvement in refinements docsstomar
Move general statement about refinements of modules from example to the top of the document. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12range.c: Documentation on endless ranges.marcandre
Based on patch by Victor Shepelev [DOC] [#7552] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-17[DOC] rational and imaginary literals [ci skip]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20Improve safe navigation operator's docs [Misc #15109]aycabta
* doc/syntax/calling_methods.rdoc: Add Safe navigation operator section. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30[DOC] Refinements on modules are allowedhsbt
From: Leo Correa <lcorr005@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-10Fix typos.hsbt
* doc/contributors.rdoc: pathces -> patches. * doc/syntax/refinements.rdoc: exmaple -> example. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-08doc/syntax/refinements.rdoc: fix typosstomar
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-03Specify refinement inheritance by Module#include.shugo
[ruby-core:79880] [Bug #13271] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07refinements.rdoc: improve docsstomar
* doc/syntax/refinements.rdoc: [DOC] fix typos and grammar and remove superfluous "for the first time". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22doc/syntax/methods.rdoc: fix a misleading examplerhe
As a bonus, wrap a long line added by r60295. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Clarify return value for assignment methods.hsbt
https://github.com/ruby/ruby/pull/1682 Patch by @sos4nt [fix GH-1682] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-23refinements.rdoc: [DOC] improved [Fix GH-1659]nobu
* doc/syntax/refinements.rdocrefinements.rdoc: grammatical correction and code highlighting improved * doc/syntax/refinements.rdocrefinements.rdoc: Fixnum replaced with Integer and Integer with Numeric Author: Shiva Bhusal <shivabhusal@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-29methods.rdoc: small improvementsstomar
* doc/syntax/methods.rdoc: [DOC] small improvements: fix some typos, grammar, punctuation, consistently use capitalized "Ruby". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-03doc: Fix error for escape sequences in string literalsnormal
Backslash goes first in escape sequences, so it must be "any other character following a backslash is interpreted as ...", while the doc says "...followed by...". Author: Marcus Stollsteimer <sto.mar@web.de> [ruby-core:79418] [Bug #13190] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-30* doc/syntax/control_expressions.rdoc: Add missing 'as'hsbt
[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-11Use https instead of http in some URLskazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21methods.rdoc: closing tagnobu
* doc/syntax/methods.rdoc (Method Names): add proper closing tag. [Fix GH-1356] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-30* doc/syntax/calling_methods.rdoc: fix old operator for safe navigationhsbt
operator. [ci skip][fix GH-1182] Patch by @dougo git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18* doc/syntax/*.rdoc: separated modifier at sentence.hsbt
[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-09* doc/syntax/refinements.rdoc: remove outdated description.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07parse.y: indented hereocnobu
* parse.y: add heredoc <<~ syntax. [Feature #9098] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-18* doc/syntax/refinements.rdoc: update documentation to reflectshugo
recent changes. [ci skip] [ruby-core:71466] [Misc #11681] Patch by James Adam git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23* NEWS: [DOC] In the new safe call syntax, arguments are evaluatedknu
only if a call is made. * doc/syntax/calling_methods.rdoc: Fix a typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-22Safe navigation operatornobu
* compile.c (iseq_peephole_optimize): peephole optimization for branchnil jumps. * compile.c (iseq_compile_each): generate save navigation operator code. * insns.def (branchnil): new opcode to pop the tos and branch if it is nil. * parse.y (NEW_QCALL, call_op, parser_yylex): parse token '.?'. [Feature #11537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-16[DOC] Remove `\0` since it's aprt of octal notationknu
A typo is fixed while at it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-16[DOC] `\0` is interpreted as NUL only if not followed by an octal digit.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-16literals.rdoc: add DEL [ci skip]nobu
* doc/syntax/literals.rdoc (Strings): [DOC] add DEL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-16[DOC] Revise the character literal part.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-16[DOC] Document the full list of supported escape sequences in string literalsknu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-16literals.rdoc: fix typosnobu
* doc/syntax/literals.rdoc (Strings): fix typos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e