From 66ce7c582587768452ad91fea29f83ec77eb19bd Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Wed, 23 Jan 2013 19:45:55 +0200 Subject: [PATCH] Rename Tag::Tag#parse to #parse_doc. So it's clear that it's parsing the documentation. This way it's also clear that it goes along with the #process_doc method. --- lib/jsduck/doc/parser.rb | 2 +- lib/jsduck/tag/alias.rb | 2 +- lib/jsduck/tag/aside.rb | 2 +- lib/jsduck/tag/author.rb | 2 +- lib/jsduck/tag/boolean_tag.rb | 2 +- lib/jsduck/tag/cfg.rb | 2 +- lib/jsduck/tag/class.rb | 2 +- lib/jsduck/tag/class_list_tag.rb | 4 ++-- lib/jsduck/tag/constructor.rb | 2 +- lib/jsduck/tag/css_var.rb | 2 +- lib/jsduck/tag/deprecated_tag.rb | 2 +- lib/jsduck/tag/enum.rb | 2 +- lib/jsduck/tag/event.rb | 2 +- lib/jsduck/tag/extends.rb | 2 +- lib/jsduck/tag/ftype.rb | 2 +- lib/jsduck/tag/inheritdoc.rb | 2 +- lib/jsduck/tag/markdown.rb | 2 +- lib/jsduck/tag/member.rb | 2 +- lib/jsduck/tag/method.rb | 2 +- lib/jsduck/tag/override.rb | 2 +- lib/jsduck/tag/param.rb | 2 +- lib/jsduck/tag/preventable.rb | 2 +- lib/jsduck/tag/property.rb | 2 +- lib/jsduck/tag/ptype.rb | 2 +- lib/jsduck/tag/return.rb | 2 +- lib/jsduck/tag/since.rb | 2 +- lib/jsduck/tag/tag.rb | 4 ++-- lib/jsduck/tag/throws.rb | 2 +- lib/jsduck/tag/type.rb | 2 +- lib/jsduck/tag/xtype.rb | 2 +- 30 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/jsduck/doc/parser.rb b/lib/jsduck/doc/parser.rb index 297402eb..7a1687e1 100644 --- a/lib/jsduck/doc/parser.rb +++ b/lib/jsduck/doc/parser.rb @@ -85,7 +85,7 @@ module JsDuck elsif tag = TagRegistry.get_by_pattern(name) match(/\w+/) - tags = tag.parse(self) + tags = tag.parse_doc(self) if tags.is_a?(Hash) add_tag(tags) elsif tags.is_a?(Array) diff --git a/lib/jsduck/tag/alias.rb b/lib/jsduck/tag/alias.rb index 0e0892c5..28026262 100644 --- a/lib/jsduck/tag/alias.rb +++ b/lib/jsduck/tag/alias.rb @@ -13,7 +13,7 @@ module JsDuck::Tag # For backwards compatibility decide whether the @alias was used # as @inheritdoc (@alias used to have the meaning of @inheritdoc # before) or as a real Ext4 style alias definition. - def parse(p) + def parse_doc(p) if p.look(/\s+([\w.]+)?#\w+/) parse_as_inheritdoc(p) else diff --git a/lib/jsduck/tag/aside.rb b/lib/jsduck/tag/aside.rb index 9fe49339..8d44753c 100644 --- a/lib/jsduck/tag/aside.rb +++ b/lib/jsduck/tag/aside.rb @@ -9,7 +9,7 @@ module JsDuck::Tag @html_position = :top end - def parse(p) + def parse_doc(p) { :tagname => :aside, :type => aside_type(p), diff --git a/lib/jsduck/tag/author.rb b/lib/jsduck/tag/author.rb index 409abec0..c30718fa 100644 --- a/lib/jsduck/tag/author.rb +++ b/lib/jsduck/tag/author.rb @@ -8,7 +8,7 @@ module JsDuck::Tag # @author Name of Author ... # Everything until the end of line gets just ignored. - def parse(p) + def parse_doc(p) p.match(/.*$/) end end diff --git a/lib/jsduck/tag/boolean_tag.rb b/lib/jsduck/tag/boolean_tag.rb index 068f7c7c..82676293 100644 --- a/lib/jsduck/tag/boolean_tag.rb +++ b/lib/jsduck/tag/boolean_tag.rb @@ -12,7 +12,7 @@ module JsDuck::Tag end # Parses just the name of the tag. - def parse(p) + def parse_doc(p) {:tagname => @key} end diff --git a/lib/jsduck/tag/cfg.rb b/lib/jsduck/tag/cfg.rb index addcefa6..e5741334 100644 --- a/lib/jsduck/tag/cfg.rb +++ b/lib/jsduck/tag/cfg.rb @@ -10,7 +10,7 @@ module JsDuck::Tag end # @cfg {Type} [name=default] (required) ... - def parse(p) + def parse_doc(p) tag = p.standard_tag({:tagname => :cfg, :type => true, :name => true}) tag[:optional] = false if parse_required(p) tag[:doc] = :multiline diff --git a/lib/jsduck/tag/class.rb b/lib/jsduck/tag/class.rb index f192d375..0f51e034 100644 --- a/lib/jsduck/tag/class.rb +++ b/lib/jsduck/tag/class.rb @@ -8,7 +8,7 @@ module JsDuck::Tag end # @class name - def parse(p) + def parse_doc(p) { :tagname => :class, :name => p.hw.ident_chain, diff --git a/lib/jsduck/tag/class_list_tag.rb b/lib/jsduck/tag/class_list_tag.rb index 4cf1b43f..ab1a65ce 100644 --- a/lib/jsduck/tag/class_list_tag.rb +++ b/lib/jsduck/tag/class_list_tag.rb @@ -8,11 +8,11 @@ module JsDuck::Tag # @tagname classname1 classname2 ... # # Subclasses need to define the @patterns and @key fields for the - # #parse and #process_doc methods to work. Plus @ext_define_pattern + # #parse_doc and #process_doc methods to work. Plus @ext_define_pattern # and @ext_define_default for the #parse_ext_define to work. # class ClassListTag < Tag - def parse(p) + def parse_doc(p) { :tagname => @key, :classes => classname_list(p), diff --git a/lib/jsduck/tag/constructor.rb b/lib/jsduck/tag/constructor.rb index 02470b08..e459e1fb 100644 --- a/lib/jsduck/tag/constructor.rb +++ b/lib/jsduck/tag/constructor.rb @@ -8,7 +8,7 @@ module JsDuck::Tag end # @constructor - def parse(p) + def parse_doc(p) {:tagname => :constructor, :doc => :multiline} end diff --git a/lib/jsduck/tag/css_var.rb b/lib/jsduck/tag/css_var.rb index 1a001a04..630e1ac9 100644 --- a/lib/jsduck/tag/css_var.rb +++ b/lib/jsduck/tag/css_var.rb @@ -9,7 +9,7 @@ module JsDuck::Tag end # @var {Type} [name=default] ... - def parse(p) + def parse_doc(p) p.standard_tag({:tagname => :css_var, :type => true, :name => true}) end diff --git a/lib/jsduck/tag/deprecated_tag.rb b/lib/jsduck/tag/deprecated_tag.rb index a3a873e9..4ac1adc5 100644 --- a/lib/jsduck/tag/deprecated_tag.rb +++ b/lib/jsduck/tag/deprecated_tag.rb @@ -13,7 +13,7 @@ module JsDuck::Tag end end - def parse(p) + def parse_doc(p) { :tagname => @key, :version => p.hw.match(/[0-9.]+/), diff --git a/lib/jsduck/tag/enum.rb b/lib/jsduck/tag/enum.rb index 3905f728..134e3bb1 100644 --- a/lib/jsduck/tag/enum.rb +++ b/lib/jsduck/tag/enum.rb @@ -8,7 +8,7 @@ module JsDuck::Tag end # @enum {Type} [name=default] ... - def parse(p) + def parse_doc(p) enum = p.standard_tag({:tagname => :enum, :type => true, :name => true}) # @enum is a special case of class, so we also generate a class diff --git a/lib/jsduck/tag/event.rb b/lib/jsduck/tag/event.rb index dd2ffae0..993d890f 100644 --- a/lib/jsduck/tag/event.rb +++ b/lib/jsduck/tag/event.rb @@ -9,7 +9,7 @@ module JsDuck::Tag end # @event name ... - def parse(p) + def parse_doc(p) { :tagname => :event, :name => p.hw.ident, diff --git a/lib/jsduck/tag/extends.rb b/lib/jsduck/tag/extends.rb index 57edd9b9..460e92eb 100644 --- a/lib/jsduck/tag/extends.rb +++ b/lib/jsduck/tag/extends.rb @@ -11,7 +11,7 @@ module JsDuck::Tag end # @extends classname - def parse(p) + def parse_doc(p) { :tagname => :extends, :extends => p.hw.ident_chain, diff --git a/lib/jsduck/tag/ftype.rb b/lib/jsduck/tag/ftype.rb index 20de2297..0fbb199f 100644 --- a/lib/jsduck/tag/ftype.rb +++ b/lib/jsduck/tag/ftype.rb @@ -7,7 +7,7 @@ module JsDuck::Tag end # @ftype name - def parse(p) + def parse_doc(p) { :tagname => :aliases, :name => parse_alias_shorthand(p, "feature") diff --git a/lib/jsduck/tag/inheritdoc.rb b/lib/jsduck/tag/inheritdoc.rb index 5f0a5dd7..2feac786 100644 --- a/lib/jsduck/tag/inheritdoc.rb +++ b/lib/jsduck/tag/inheritdoc.rb @@ -9,7 +9,7 @@ module JsDuck::Tag end # @inheritdoc class.name#static-type-member - def parse(p) + def parse_doc(p) parse_as_inheritdoc(p) end diff --git a/lib/jsduck/tag/markdown.rb b/lib/jsduck/tag/markdown.rb index d78b2c9b..d713deb2 100644 --- a/lib/jsduck/tag/markdown.rb +++ b/lib/jsduck/tag/markdown.rb @@ -7,7 +7,7 @@ module JsDuck::Tag end # @markdown - def parse(p) + def parse_doc(p) # Just completely ignore this tag. end end diff --git a/lib/jsduck/tag/member.rb b/lib/jsduck/tag/member.rb index e861a02e..f8f96592 100644 --- a/lib/jsduck/tag/member.rb +++ b/lib/jsduck/tag/member.rb @@ -10,7 +10,7 @@ module JsDuck::Tag end # @member classname - def parse(p) + def parse_doc(p) { :tagname => :owner, :owner => p.hw.ident_chain, diff --git a/lib/jsduck/tag/method.rb b/lib/jsduck/tag/method.rb index 09803912..8db7ac4b 100644 --- a/lib/jsduck/tag/method.rb +++ b/lib/jsduck/tag/method.rb @@ -10,7 +10,7 @@ module JsDuck::Tag end # @method name ... - def parse(p) + def parse_doc(p) { :tagname => :method, :name => p.hw.ident, diff --git a/lib/jsduck/tag/override.rb b/lib/jsduck/tag/override.rb index 55870ca3..858a3afd 100644 --- a/lib/jsduck/tag/override.rb +++ b/lib/jsduck/tag/override.rb @@ -10,7 +10,7 @@ module JsDuck::Tag end # @override nameOfOverride - def parse(p) + def parse_doc(p) if classname = p.hw.ident_chain { :tagname => :override, diff --git a/lib/jsduck/tag/param.rb b/lib/jsduck/tag/param.rb index 6cc07946..502321b0 100644 --- a/lib/jsduck/tag/param.rb +++ b/lib/jsduck/tag/param.rb @@ -9,7 +9,7 @@ module JsDuck::Tag end # @param {Type} [name=default] (optional) ... - def parse(p) + def parse_doc(p) tag = p.standard_tag({:tagname => :param, :type => true, :name => true}) tag[:optional] = true if parse_optional(p) tag[:doc] = :multiline diff --git a/lib/jsduck/tag/preventable.rb b/lib/jsduck/tag/preventable.rb index 6b484865..36e1126a 100644 --- a/lib/jsduck/tag/preventable.rb +++ b/lib/jsduck/tag/preventable.rb @@ -14,7 +14,7 @@ module JsDuck::Tag # @preventable is optionally followed by some method name, but we # don't document it. - def parse(p) + def parse_doc(p) p.match(/.*$/) {:tagname => :preventable} end diff --git a/lib/jsduck/tag/property.rb b/lib/jsduck/tag/property.rb index 37dbf39a..7351472a 100644 --- a/lib/jsduck/tag/property.rb +++ b/lib/jsduck/tag/property.rb @@ -10,7 +10,7 @@ module JsDuck::Tag end # @property {Type} [name=default] ... - def parse(p) + def parse_doc(p) tag = p.standard_tag({:tagname => :property, :type => true, :name => true}) tag[:doc] = :multiline tag diff --git a/lib/jsduck/tag/ptype.rb b/lib/jsduck/tag/ptype.rb index 19937d4f..dcc8d314 100644 --- a/lib/jsduck/tag/ptype.rb +++ b/lib/jsduck/tag/ptype.rb @@ -7,7 +7,7 @@ module JsDuck::Tag end # @ptype name - def parse(p) + def parse_doc(p) { :tagname => :aliases, :name => parse_alias_shorthand(p, "plugin") diff --git a/lib/jsduck/tag/return.rb b/lib/jsduck/tag/return.rb index 6f64547f..c58cc3c0 100644 --- a/lib/jsduck/tag/return.rb +++ b/lib/jsduck/tag/return.rb @@ -9,7 +9,7 @@ module JsDuck::Tag end # @return {Type} return.name ... - def parse(p) + def parse_doc(p) tag = p.standard_tag({:tagname => :return, :type => true}) tag[:name] = subproperty_name(p) tag[:doc] = :multiline diff --git a/lib/jsduck/tag/since.rb b/lib/jsduck/tag/since.rb index 5c157525..7fa6b8a0 100644 --- a/lib/jsduck/tag/since.rb +++ b/lib/jsduck/tag/since.rb @@ -9,7 +9,7 @@ module JsDuck::Tag @html_position = :bottom end - def parse(p) + def parse_doc(p) { :tagname => :since, :version => p.hw.match(/.*$/).strip, diff --git a/lib/jsduck/tag/tag.rb b/lib/jsduck/tag/tag.rb index ea491af4..3e9448c8 100644 --- a/lib/jsduck/tag/tag.rb +++ b/lib/jsduck/tag/tag.rb @@ -23,7 +23,7 @@ module JsDuck::Tag # the documentation following this tag will get added to the :doc # field of the tag and will later be accessible in #process_doc # method. - def parse(p) + def parse_doc(p) end # Defines the symbol under which the tag data is stored in final @@ -31,7 +31,7 @@ module JsDuck::Tag attr_reader :key # Gets called with the resulting class/member hash and array of - # @tag data that was generated by #parse. Also a hash with + # @tag data that was generated by #parse_doc. Also a hash with # position information {:filename, :linenr} is passed in. # # It can then add a new field to the class/member hash or diff --git a/lib/jsduck/tag/throws.rb b/lib/jsduck/tag/throws.rb index 5bfa9e30..89d3fd33 100644 --- a/lib/jsduck/tag/throws.rb +++ b/lib/jsduck/tag/throws.rb @@ -8,7 +8,7 @@ module JsDuck::Tag end # @throws {Type} ... - def parse(p) + def parse_doc(p) tag = p.standard_tag({:tagname => :throws, :type => true}) tag[:doc] = :multiline tag diff --git a/lib/jsduck/tag/type.rb b/lib/jsduck/tag/type.rb index d0544ad8..4713219c 100644 --- a/lib/jsduck/tag/type.rb +++ b/lib/jsduck/tag/type.rb @@ -12,7 +12,7 @@ module JsDuck::Tag # The presence of @type implies that we are dealing with property. # ext-doc allows type name to be either inside curly braces or # without them at all. - def parse(p) + def parse_doc(p) tag = p.standard_tag({:tagname => :type, :type => true}) tag[:type] = curlyless_type(p) unless tag[:type] tag diff --git a/lib/jsduck/tag/xtype.rb b/lib/jsduck/tag/xtype.rb index 7108ee9f..a00ee1fc 100644 --- a/lib/jsduck/tag/xtype.rb +++ b/lib/jsduck/tag/xtype.rb @@ -9,7 +9,7 @@ module JsDuck::Tag end # @xtype name - def parse(p) + def parse_doc(p) { :tagname => :aliases, :name => parse_alias_shorthand(p, "widget") -- GitLab