Loading lib/jsduck/aggregator.rb +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ module JsDuck # Merges new class-doc into old one. def merge_classes(old, new) [:extends, :xtype, :singleton, :private].each do |tag| [:extends, :xtype, :singleton, :private, :alternateClassName].each do |tag| old[tag] = old[tag] || new[tag] end old[:doc] = old[:doc].length > 0 ? old[:doc] : new[:doc] Loading lib/jsduck/doc_parser.rb +11 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,8 @@ module JsDuck at_member elsif look(/@author\b/) at_author elsif look(/@docauthor\b/) at_docauthor elsif look(/@var\b/) at_var elsif look(/@static\b/) Loading Loading @@ -237,6 +239,15 @@ module JsDuck skip_white end # matches @docauthor some name ... newline def at_docauthor match(/@docauthor/) add_tag(:docauthor) skip_horiz_white @current_tag[:name] = @input.scan(/.*$/) skip_white end # Used to match @private, @ignore, @hide, ... def boolean_at_tag(regex, propname) match(regex) Loading lib/jsduck/js_parser.rb +33 −2 Original line number Diff line number Diff line Loading @@ -205,6 +205,12 @@ module JsDuck if look("extend", ":", :string) cfg[:extend] = ext_define_extend found = true elsif look("alternateClassName", ":", '[') cfg[:alternateClassName] = ext_define_alternate_class_names found = true elsif look("alternateClassName", ":", :string) cfg[:alternateClassName] = ext_define_alternate_class_name found = true elsif look("mixins", ":", "{") cfg[:mixins] = ext_define_mixins found = true Loading @@ -231,6 +237,28 @@ module JsDuck match("extend", ":", :string) end # <ext-define-alternate-class-name> := "alternateClassName" ":" <string> def ext_define_alternate_class_name match("alternateClassName", ":", :string) end # <ext-define-alternate-class-name> := "alternateClassName" ":" <string> def ext_define_alternate_class_names match("alternateClassName", ":", "[") strs = [] while look(:string) strs << match(:string) match(",") if look(",") end if look("]") match("]") strs else false end end # <ext-define-mixins> := "mixins" ":" "{" [ <ident> ":" <string> ","? ]* "}" def ext_define_mixins match("mixins", ":", "{") Loading @@ -246,14 +274,17 @@ module JsDuck # <array-of-strings> := "[" [ <string> ","? ]* "]" def array_of_strings match("[") strs = [] while look(:string) match(:string) strs << match(:string) match(",") if look(",") end if look("]") match("]") true strs else false end Loading lib/jsduck/merger.rb +1 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ module JsDuck :doc => detect_doc(docs), :extends => detect_extends(doc_map, code), :mixins => detect_mixins(doc_map, code), :alternateClassName => code[:alternateClassName], :xtype => detect_xtype(doc_map), :author => detect_author(doc_map), :singleton => !!doc_map[:singleton], Loading Loading
lib/jsduck/aggregator.rb +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ module JsDuck # Merges new class-doc into old one. def merge_classes(old, new) [:extends, :xtype, :singleton, :private].each do |tag| [:extends, :xtype, :singleton, :private, :alternateClassName].each do |tag| old[tag] = old[tag] || new[tag] end old[:doc] = old[:doc].length > 0 ? old[:doc] : new[:doc] Loading
lib/jsduck/doc_parser.rb +11 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,8 @@ module JsDuck at_member elsif look(/@author\b/) at_author elsif look(/@docauthor\b/) at_docauthor elsif look(/@var\b/) at_var elsif look(/@static\b/) Loading Loading @@ -237,6 +239,15 @@ module JsDuck skip_white end # matches @docauthor some name ... newline def at_docauthor match(/@docauthor/) add_tag(:docauthor) skip_horiz_white @current_tag[:name] = @input.scan(/.*$/) skip_white end # Used to match @private, @ignore, @hide, ... def boolean_at_tag(regex, propname) match(regex) Loading
lib/jsduck/js_parser.rb +33 −2 Original line number Diff line number Diff line Loading @@ -205,6 +205,12 @@ module JsDuck if look("extend", ":", :string) cfg[:extend] = ext_define_extend found = true elsif look("alternateClassName", ":", '[') cfg[:alternateClassName] = ext_define_alternate_class_names found = true elsif look("alternateClassName", ":", :string) cfg[:alternateClassName] = ext_define_alternate_class_name found = true elsif look("mixins", ":", "{") cfg[:mixins] = ext_define_mixins found = true Loading @@ -231,6 +237,28 @@ module JsDuck match("extend", ":", :string) end # <ext-define-alternate-class-name> := "alternateClassName" ":" <string> def ext_define_alternate_class_name match("alternateClassName", ":", :string) end # <ext-define-alternate-class-name> := "alternateClassName" ":" <string> def ext_define_alternate_class_names match("alternateClassName", ":", "[") strs = [] while look(:string) strs << match(:string) match(",") if look(",") end if look("]") match("]") strs else false end end # <ext-define-mixins> := "mixins" ":" "{" [ <ident> ":" <string> ","? ]* "}" def ext_define_mixins match("mixins", ":", "{") Loading @@ -246,14 +274,17 @@ module JsDuck # <array-of-strings> := "[" [ <string> ","? ]* "]" def array_of_strings match("[") strs = [] while look(:string) match(:string) strs << match(:string) match(",") if look(",") end if look("]") match("]") true strs else false end Loading
lib/jsduck/merger.rb +1 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ module JsDuck :doc => detect_doc(docs), :extends => detect_extends(doc_map, code), :mixins => detect_mixins(doc_map, code), :alternateClassName => code[:alternateClassName], :xtype => detect_xtype(doc_map), :author => detect_author(doc_map), :singleton => !!doc_map[:singleton], Loading