From 0ef7c8f698e65c93f9ab6abbb01dc113cb5d1a7f Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Fri, 11 Jan 2013 00:07:29 +0200 Subject: [PATCH] Make most StandardTagParser methods private. Let the #hw method return it's original return value, which is the DocScanner class - then it chained with one of the DocScanner methods like #look or #match. The only exception being #default_value method which belongs to StandardTagParser and can't be therefore chained from #hw method - but that's just a one little exception we can live with. --- lib/jsduck/standard_tag_parser.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/jsduck/standard_tag_parser.rb b/lib/jsduck/standard_tag_parser.rb index a03019d3..e732f171 100644 --- a/lib/jsduck/standard_tag_parser.rb +++ b/lib/jsduck/standard_tag_parser.rb @@ -35,6 +35,8 @@ module JsDuck tag end + private + # matches {type} if possible and sets it on given tag hash. # Also checks for {optionality=} in type definition. def add_type(tag) @@ -68,7 +70,8 @@ module JsDuck if hw.match(/\[/) tag[:name] = hw.ident_chain if hw.match(/=/) - tag[:default] = hw.default_value + hw + tag[:default] = default_value end hw.match(/\]/) tag[:optional] = true @@ -143,7 +146,6 @@ module JsDuck def hw @ds.hw - self end end -- GitLab