diff --git a/lib/jsduck/doc_parser.rb b/lib/jsduck/doc_parser.rb index 105f2abdca5895409fc72abcb8aa39dcfaa4338d..12061a64773b13215e94d6010d279dd2f32c73b4 100644 --- a/lib/jsduck/doc_parser.rb +++ b/lib/jsduck/doc_parser.rb @@ -212,24 +212,8 @@ module JsDuck # matches @inheritdoc class.name#static-type-member def at_inheritdoc add_tag(:inheritdoc) - skip_horiz_white - - if look(@ident_chain_pattern) - @current_tag[:cls] = ident_chain - end - - if look(/#\w/) - match(/#/) - if look(/static-/) - @current_tag[:static] = true - match(/static-/) - end - if look(/(cfg|property|method|event|css_var|css_mixin)-/) - @current_tag[:type] = ident.to_sym - match(/-/) - end - @current_tag[:member] = ident - end + maybe_ident_chain(:cls) + maybe_member_reference end # @@ -315,6 +299,23 @@ module JsDuck end end + # matches a member reference: "#" "-" "-" + # setting the corresponding properties on @current_tag + def maybe_member_reference + if look(/#\w/) + match(/#/) + if look(/static-/) + @current_tag[:static] = true + match(/static-/) + end + if look(/(cfg|property|method|event|css_var|css_mixin)-/) + @current_tag[:type] = ident.to_sym + match(/-/) + end + @current_tag[:member] = ident + end + end + # Attempts to allow balanced braces in default value. # When the nested parsing doesn't finish at closing "]", # roll back to beginning and simply grab anything up to closing "]".