From b952977d532e31237d6e6d98e3c0038b65ca5871 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 9 Oct 2009 04:46:41 -0500 Subject: [PATCH] help.markup: long links don't show stack effect for parsing words and symbols --- basis/help/markup/markup.factor | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/basis/help/markup/markup.factor b/basis/help/markup/markup.factor index 845092fa03..ea64df3edc 100644 --- a/basis/help/markup/markup.factor +++ b/basis/help/markup/markup.factor @@ -5,7 +5,8 @@ combinators definitions definitions.icons effects fry generic hashtables help.stylesheet help.topics io io.styles kernel make math namespaces parser present prettyprint prettyprint.stylesheet quotations see sequences sets slots -sorting splitting strings vectors vocabs vocabs.loader words ; +sorting splitting strings vectors vocabs vocabs.loader words +words.symbol ; FROM: prettyprint.sections => with-pprint ; IN: help.markup @@ -181,12 +182,23 @@ GENERIC: link-long-text ( topic -- ) M: topic link-long-text [ article-title ] keep write-link ; +GENERIC: link-effect? ( word -- ? ) + +M: parsing-word link-effect? drop f ; +M: symbol link-effect? drop f ; +M: word link-effect? drop t ; + +: $effect ( effect -- ) + effect>string stack-effect-style get format ; + M: word link-long-text dup presented associate [ [ article-name link-style get format ] - [ drop bl ] - [ stack-effect effect>string stack-effect-style get format ] - tri + [ + dup link-effect? [ + bl stack-effect $effect + ] [ drop ] if + ] bi ] with-nesting ; : >topic ( obj -- topic ) dup topic? [ >link ] unless ;