summaryrefslogtreecommitdiff
path: root/lib/rdoc/parser
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/rdoc] Fix polynominal backtrackingNobuyoshi Nakada2023-04-291-1/+1
| | | | | | Fix https://github.com/ruby/rdoc/pull/995 https://github.com/ruby/rdoc/commit/adfa7db5b9
* [ruby/rdoc] Fix RDoc::Parser::Ruby not being documentedÉtienne Barrié2023-02-211-3/+3
| | | | | | The calls to require prevent the class from being documented. https://github.com/ruby/rdoc/commit/76283fc42e
* [ruby/rdoc] Pull up handle_tab_width to RDoc::ParserNobuyoshi Nakada2022-11-272-26/+1
| | | | | | To share with the duplicate code in RDoc::Parser::Ruby#initialize. https://github.com/ruby/rdoc/commit/27829ac119
* [ruby/rdoc] Support attributes defined by `rb_struct_define`Nobuyoshi Nakada2022-06-281-1/+9
| | | | https://github.com/ruby/rdoc/commit/854b370763
* [ruby/rdoc] Parse also InitVM-prefixed functionsNobuyoshi Nakada2022-06-281-1/+1
| | | | | | Initialization depending on VM is separated. https://github.com/ruby/rdoc/commit/030d10fccd
* [ruby/rdoc] [DOC] Undocument internal constants [ci skip]Nobuyoshi Nakada2022-06-071-2/+2
| | | | https://github.com/ruby/rdoc/commit/6d7bf24bb8
* [ruby/rdoc] Allow boolean arguments to `rb_attr` and `rb_define_attr`Nobuyoshi Nakada2022-06-071-8/+13
| | | | | | | | | | Currently only literal `0` and `1` are accepted as `read`/`write` flags. This patch allows other boolean arguments, C macros (`FALSE`/`TRUE`), Ruby `VALUE`s (`Qfalse`/`Qtrue`), and C99 `bool`s (`false`/`true`), as well. https://github.com/ruby/rdoc/commit/169dc02e3c
* [ruby/rdoc] Fix full name of known classNobuyoshi Nakada2022-03-161-2/+3
| | | | | | | | | | | | | | Properly set the name of `File::Constants`, which is the only name with a namespace in `RDoc::KNOWN_CLASSES`, and fixes longstanding bug that `File::Constants` becomes `File::File::Constants`. When it is generated by `rb_file_const` in dir.c, `name` is set to the qualified name as same as `full_name`, and generated in the normal way in file.c later, already set `full_name` is cleared and `name` will be constructed from the enclosing namespace and the `name`. It will results in duplicated namespace, `File::File::Constants`. https://github.com/ruby/rdoc/commit/3a8d6df562
* [ruby/rdoc] Get rid of ruby-mode.el confusionsNobuyoshi Nakada2022-02-091-1/+2
| | | | https://github.com/ruby/rdoc/commit/63fac51198
* [ruby/rdoc] Skip parentheses on singleton class declarationSoutaro Matsumoto2022-02-091-1/+24
| | | | https://github.com/ruby/rdoc/commit/b6c6d4f978
* [ruby/rdoc] Support all struct definition functionsNobuyoshi Nakada2022-02-091-71/+61
| | | | | | | | Currently only `rb_struct_define_without_accessor` is supported by https://github.com/ruby/rdoc/pull/73. We should support other three functions too. https://github.com/ruby/rdoc/commit/d42288f06c
* [ruby/rdoc] feat: add support for :category: on C functionsMike Dalessio2021-10-161-0/+5
| | | | https://github.com/ruby/rdoc/commit/45c92005fe
* [ruby/rdoc] fix: comments in C files use the global markup optionMike Dalessio2021-10-161-1/+5
| | | | | | | | Previously, Parser::C comments all defaulted to "rdoc" format, even when the user had set a different default with the `--markup=<choice>` option. https://github.com/ruby/rdoc/commit/4643b08a26
* [ruby/rdoc] extract Comment creation in Parser::CMike Dalessio2021-10-161-9/+12
| | | | | | This is a prefactor for fixing comment format handling. https://github.com/ruby/rdoc/commit/a3d366feed
* [ruby/rdoc] Support ActiveSupport::Concern.includedaycabta2021-07-051-0/+18
| | | | | | | | ref. https://github.com/rails/rails/blob/168ddaa08a63cd956bb7c3ba10be1a7ae36d4ee2/activerecord/lib/active_record/core.rb#L9-L20 https://github.com/ruby/rdoc/commit/a2d651dade Co-authored-by: Fumiaki MATSUSHIMA <mtsmfm@gmail.com>
* [ruby/rdoc] Support iso-strict format in git-logNobuyoshi Nakada2021-01-251-3/+3
| | | | https://github.com/ruby/rdoc/commit/2a6c22da63
* [ruby/rdoc] Support other date formats in git-logNobuyoshi Nakada2021-01-251-3/+3
| | | | https://github.com/ruby/rdoc/commit/ad8cf37d72
* [ruby/rdoc] Skip non-date logs by git-logNobuyoshi Nakada2021-01-241-14/+22
| | | | | | | | | | `RDoc::Parser::ChangeLog` mis-parses ChangeLog generated by git-log, because of too heuristic `Time.parse`. For instance, "commit 8187228de0142d3ac7950b7d977c2849e934c637" results in "8187-08-16", that is, day 228 in the year 8187. https://github.com/ruby/rdoc/commit/9711e6f6d9
* [ruby/rdoc] Sort by CommitDate if availableNobuyoshi Nakada2021-01-241-3/+8
| | | | https://github.com/ruby/rdoc/commit/455715e930
* [ruby/rdoc] Add links to the commitsNobuyoshi Nakada2021-01-241-21/+86
| | | | https://github.com/ruby/rdoc/commit/1821628076
* [ruby/rdoc] Shorten commit hashesNobuyoshi Nakada2021-01-241-1/+1
| | | | https://github.com/ruby/rdoc/commit/5d3e153963
* [ruby/rdoc] Tweak log entry markdownNobuyoshi Nakada2021-01-241-1/+19
| | | | | | | * add 3 levels to headings * prefix commit log to labels to make unique IDs https://github.com/ruby/rdoc/commit/5074c13209
* [ruby/rdoc] Make each commit entries h3Nobuyoshi Nakada2021-01-241-6/+6
| | | | https://github.com/ruby/rdoc/commit/11eefb2ae9
* [ruby/rdoc] Support ChangeLog generated by `git log`Nobuyoshi Nakada2021-01-241-0/+35
| | | | https://github.com/ruby/rdoc/commit/5e0a123ca1
* Exclude parenthesized function declarations such as NORETURNNobuyoshi Nakada2020-12-111-1/+1
| | | | Fixes https://github.com/ruby/ruby/pull/3883
* [ruby/rdoc] Fix parsing of rb_define_module_underJeremy Evans2020-07-221-1/+1
| | | | | | Fixes Ruby Bug #15819 https://github.com/ruby/rdoc/commit/94a052d833
* [ruby/rdoc] Treat multiple Ruby methods calling the same C method as aliasesJeremy Evans2020-05-241-56/+22
| | | | | | | | | | | | | | | | | | | | Previously, only calls to rb_define_alias were treated as aliases. This treats calls to rb_define_method with the same C function as aliases, with the first function defined being the primary method. This move the dedup code from the C parser to AnyMethod, and has AnyMethod look in its aliases to find the call_seq. Switch the deduplication code to remove lines matching one of the other aliases, instead of only keeping lines matching the current alias. The previous approach could eliminate all call_seq lines in cases where no line matched. This was necessary to pass tests when call_seq does deduplication by default. The only change to the darkfish template is to not perform unnecessary work by deduplicating twice. https://github.com/ruby/rdoc/commit/0ead78616b
* [ruby/rdoc] Support newline in the middle of constant definitionaycabta2019-12-241-1/+1
| | | | https://github.com/ruby/rdoc/commit/74d3984324
* [ruby/rdoc] Treat Proc#call syntax sugar for constant correctlyaycabta2019-12-241-0/+4
| | | | https://github.com/ruby/rdoc/commit/957d041ae0
* Fix ghost method line noaycabta2019-11-281-4/+10
|
* lib/rdoc/parser/ruby.rb: Avoid `.chars.to_a.last`Yusuke Endoh2019-08-161-2/+2
| | | | | The code creates a lot of useless objects. Instead, using a regexp is shorter and faster.
* RDoc::Parser::C: Integrate do_classes and do_modules by one regexp matchYusuke Endoh2019-08-161-103/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The full scan of the C source code (`@content.scan`) is very slow. The old code invokes the scan six times in `do_classes` and `do_modules`. This change integrates the six scans into one by merging the regexps. The integrated regexp is a bit hard to maintain, but the speed up is significant: approx. 30 sec -> 20 sec in Ruby's `make rdoc`. In addition, this change omits `do_boot_defclass` unless the file name is `class.c`. `boot_defclass` is too specific to Ruby's source code, so RDoc should handle it as a special case. Before this change: TOTAL (pct) SAMPLES (pct) FRAME 858 (13.6%) 858 (13.6%) (garbage collection) 292 (4.6%) 264 (4.2%) RDoc::Parser::C#do_define_class 263 (4.2%) 250 (3.9%) RDoc::Parser::C#do_define_module 275 (4.3%) 241 (3.8%) RDoc::Parser::C#do_define_class_under 248 (3.9%) 237 (3.7%) RDoc::Parser::C#do_define_module_under 234 (3.7%) 234 (3.7%) RDoc::Parser::C#gen_body_table 219 (3.5%) 219 (3.5%) Ripper::Lexer#state_obj 217 (3.4%) 216 (3.4%) RDoc::Parser::C#do_struct_define_without_accessor 205 (3.2%) 205 (3.2%) RDoc::Parser::C#do_boot_defclass 205 (3.2%) 205 (3.2%) RDoc::Parser::C#do_singleton_class The six methods take approx. 22.2%. `do_define_class` (4.2%) + `do_define_class_under` (3.8%) + `do_define_module` (3,9$) + `do_define_module_under` (3.7%) + `do_struct_define_without_accessor` (3.4%) + `do_singleton_class` (3.2%) After this change, the methods are integrated to `do_classes_and_modules` which takes only 5.8%. TOTAL (pct) SAMPLES (pct) FRAME 812 (16.7%) 812 (16.7%) (garbage collection) 355 (7.3%) 284 (5.8%) RDoc::Parser::C#do_classes_and_modules 225 (4.6%) 225 (4.6%) RDoc::Parser::C#gen_body_table 429 (8.8%) 210 (4.3%) RDoc::Parser::RubyTools#get_tk 208 (4.3%) 208 (4.3%) RDoc::TokenStream#add_tokens
* [ruby/rdoc] Normalization of comment should check languageaycabta2019-07-262-10/+10
| | | | | | | | | RDoc::Text#normalize_comment that is included RDoc::Comment always remove Ruby style comment indicator "#" and C style comment indicator "/**/", but should check language and remove only the language's comment indicator. https://github.com/ruby/rdoc/commit/ca68ba1e73
* ripper_state_lex.rb: chomp CRNobuyoshi Nakada2019-06-071-1/+2
| | | | | | | | | * lib/rdoc/parser/ripper_state_lex.rb (RDoc::Parser::RipperStateLex): chomp newline, including CR, from here document terminator. Closes: ruby/rdoc#694 Closes: ruby/rdoc#697 Closes: ruby/rdoc#705
* [DOC] fix missing paren [ci skip]nobu2019-03-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] escape descriptions [ci skip]nobu2019-01-041-3/+3
| | | | | | Escape descriptions not to get parsed as directives. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] mark function names [ci skip]nobu2019-01-041-9/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] split a tag for each function name [ci skip]nobu2019-01-041-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] Fix close tags [ci skip]kazu2019-01-041-3/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc/parser/c.rb: ignore dynamically added methodsnobu2018-10-281-0/+1
| | | | | | | | | * lib/rdoc/parser/c.rb (RDoc::Parser::C#deduplicate_call_seq): skip dynamically added methods at runtime, because the class name is unknown and the defined methods are not accessible from that class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge rdoc-6.1.0.beta2aycabta2018-10-173-80/+84
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge rdoc-6.1.0.beta1.hsbt2018-08-272-116/+161
| | | | | | * https://github.com/ruby/rdoc/compare/v6.0.4...v6.1.0.beta1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge rdoc-6.0.4 from upstream.hsbt2018-05-081-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge RDoc 6.0.3 from upstream.hsbt2018-03-262-14/+41
| | | | | | | | It fixed the several bugs that was found after RDoc 6 releasing. From: SHIBATA Hiroshi <hsbt@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge rdoc-6.0.1.hsbt2017-12-231-0/+7
| | | | | | | | It fixes an installation error of activerecord. https://github.com/ruby/rdoc/issues/571 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge rdoc-6.0.0.beta4 from upstream.hsbt2017-11-279-70/+81
| | | | | | It version applied `frozen_string_literal: true` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge rdoc-6.0.0.beta3.hsbt2017-10-101-11/+10
| | | | | | | | | * It version introduced did you mean? feature for ri command: https://github.com/ruby/rdoc/pull/533 * Removed obbsoleted ruby_token.rbb. [Bug #13990][ruby-core:83180] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove an unused variable (sometimes it fails test).ko12017-09-141-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge rdoc-6.0.0.beta2 from upstream.hsbt2017-09-124-369/+1052
| | | | | | | * This version changed lexer used Ripper from lexer based IRB. see details: https://github.com/ruby/rdoc/pull/512 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge rdoc-6.0.0.beta1.hsbt2017-08-293-52/+16
| | | | | | | This version fixed strange behavior of ruby code parser. We will list all of impromovement to Changelog when 6.0.0 releasing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e