aboutsummaryrefslogtreecommitdiffstats
path: root/doc/syntax
Commit message (Collapse)AuthorAgeFilesLines
* Documentation improvements for Ruby corezverok2019-10-262-1/+45
| | | | | | | | | | | * Top-level `return`; * Documentation for comments syntax; * `rescue` inside blocks; * Enhance `Object#to_enum` docs; * Make `chomp:` option more obvious for `String#each_line` and `#lines`; * Enhance `Proc#>>` and `#<<` docs; * Enhance `Processs` class docs.
* Document the difference between expressions and statements [ci skip]Jeremy Evans2019-10-102-3/+65
| | | | | | | | | | | | 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]
* Add documentation regarding keyword argument separation [ci skip]Jeremy Evans2019-10-032-1/+97
|
* Minor updates to methods and calling_methods documentation [ci skip]Jeremy Evans2019-10-032-24/+32
|
* [DOC] DOT is not a part of a receiver [ci skip]Nobuyoshi Nakada2019-09-201-1/+1
| | | | [Feature #11297] [Feature #16123]
* Update NEWS and documents [ci skip]Nobuyoshi Nakada2019-09-202-3/+4
| | | | [Feature #11297] [Feature #16123]
* Use the word heredocs in Here Documents docsOlivier Lacan2019-08-041-1/+1
| | | | | | | | | | | | | | | | 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
* Document use of ensure and else at method level [ci skip]Jeremy Evans2019-07-191-0/+22
|
* Remove section on performance advantage of not using a block parameter [ci skip]Jeremy Evans2019-07-191-5/+0
| | | | | Improvements in Ruby 2.5 and 2.6 make this section no longer accurate.
* Remove mention of Proc.new with implicit block [ci skip]Jeremy Evans2019-07-191-4/+0
| | | | This support is now deprecated and will be removed in Ruby 3.
* Document evaluation order of arguments [ci skip]Jeremy Evans2019-07-191-0/+19
| | | | Fixes [Misc #8905]
* Document required keyword argument syntax [ci skip]Jeremy Evans2019-07-191-0/+11
| | | | Fixes [Bug #8952]
* Improve wording of Local Variables and eval sectionJeremy Evans2019-06-251-7/+7
| | | | As pointed out by nobu, "defined" should be used instead of "assigned".
* * remove trailing spaces.git2019-06-261-1/+1
|
* Document local variable interactions with evalJeremy Evans2019-06-251-0/+22
| | | | Fixes [Bug #13337]
* Fix typoMarcus Stollsteimer2019-05-031-1/+1
|
* Disallow also CR in here-doc identifierNobuyoshi Nakada2019-04-291-1/+1
| | | | | | * 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.
* parse.y: fix here-doc identifier with newlineNobuyoshi Nakada2019-04-291-0/+3
| | | | | | | | | | | | | | | * 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 ```
* Introduce beginless range [Feature#14799]mame2019-04-031-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update refinements docstenderlove2019-01-101-4/+2
| | | | | | 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
* Small improvement in refinements docsstomar2018-12-241-2/+2
| | | | | | | 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
* range.c: Documentation on endless ranges.marcandre2018-12-121-0/+1
| | | | | | 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
* [DOC] rational and imaginary literals [ci skip]nobu2018-11-171-0/+27
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Improve safe navigation operator's docs [Misc #15109]aycabta2018-10-201-4/+23
| | | | | | * 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
* [DOC] Refinements on modules are allowedhsbt2018-01-301-2/+1
| | | | | | From: Leo Correa <lcorr005@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix typos.hsbt2018-01-101-1/+1
| | | | | | | * 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
* doc/syntax/refinements.rdoc: fix typosstomar2017-12-081-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Specify refinement inheritance by Module#include.shugo2017-12-031-0/+23
| | | | | | [ruby-core:79880] [Bug #13271] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* refinements.rdoc: improve docsstomar2017-11-071-3/+4
| | | | | | | * 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
* doc/syntax/methods.rdoc: fix a misleading examplerhe2017-10-221-3/+3
| | | | | | 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
* * remove trailing spaces.svn2017-10-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Clarify return value for assignment methods.hsbt2017-10-211-1/+5
| | | | | | | | 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
* refinements.rdoc: [DOC] improved [Fix GH-1659]nobu2017-06-231-14/+14
| | | | | | | | | | | | * 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
* methods.rdoc: small improvementsstomar2017-03-291-9/+9
| | | | | | | * 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
* doc: Fix error for escape sequences in string literalsnormal2017-02-031-1/+1
| | | | | | | | | | | 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
* * doc/syntax/control_expressions.rdoc: Add missing 'as'hsbt2016-09-301-2/+2
| | | | | | [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
* Use https instead of http in some URLskazu2016-09-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* methods.rdoc: closing tagnobu2016-05-211-1/+1
| | | | | | | * 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
* * doc/syntax/calling_methods.rdoc: fix old operator for safe navigationhsbt2015-12-301-1/+1
| | | | | | 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
* * doc/syntax/*.rdoc: separated modifier at sentence.hsbt2015-12-189-53/+45
| | | | | | [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
* * doc/syntax/refinements.rdoc: remove outdated description.shugo2015-12-091-6/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: indented hereocnobu2015-12-071-0/+14
| | | | | | * parse.y: add heredoc <<~ syntax. [Feature #9098] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * doc/syntax/refinements.rdoc: update documentation to reflectshugo2015-11-181-26/+34
| | | | | | | 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
* * NEWS: [DOC] In the new safe call syntax, arguments are evaluatedknu2015-10-231-1/+1
| | | | | | | | 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
* Safe navigation operatornobu2015-10-221-0/+4
| | | | | | | | | | | | | * 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
* [DOC] Remove `\0` since it's aprt of octal notationknu2015-09-161-2/+1
| | | | | | A typo is fixed while at it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] `\0` is interpreted as NUL only if not followed by an octal digit.knu2015-09-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* literals.rdoc: add DEL [ci skip]nobu2015-09-161-0/+3
| | | | | | * 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
* [DOC] Revise the character literal part.knu2015-09-161-13/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] Document the full list of supported escape sequences in string literalsknu2015-09-161-2/+25
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e