mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 13:37:57 +03:00
Weird typos fixed.
This commit is contained in:
parent
dd726410ed
commit
c1e427688d
@ -17,11 +17,11 @@
|
||||
(list 'macro-log (list 'meta name "sig")))
|
||||
|
||||
(doc hide "Mark a binding as hidden, this will make it not print with the 'info' command.")
|
||||
(defmacro hide [name signature]
|
||||
(defmacro hide [name]
|
||||
(list 'meta-set! name "hide" true))
|
||||
|
||||
(doc private "Mark a binding as private, this will make it inaccessible from other modules.")
|
||||
(defmacro private [name signature]
|
||||
(defmacro private [name]
|
||||
(list 'meta-set! name "private" true))
|
||||
|
||||
(doc private? "Is this binding private?")
|
||||
|
19
src/Obj.hs
19
src/Obj.hs
@ -267,6 +267,13 @@ newtype MetaData = MetaData { getMeta :: Map.Map String XObj } deriving (Eq, Sho
|
||||
emptyMeta :: MetaData
|
||||
emptyMeta = (MetaData Map.empty)
|
||||
|
||||
metaIsTrue :: MetaData -> String -> Bool
|
||||
metaIsTrue metaData key =
|
||||
case Map.lookup "hidden" (getMeta metaData) of
|
||||
Just (XObj (Bol True) _ _) -> True
|
||||
_ -> False
|
||||
|
||||
|
||||
-- | Wraps and holds an XObj in an environment.
|
||||
data Binder = Binder { binderMeta :: MetaData, binderXObj :: XObj } deriving Eq
|
||||
|
||||
@ -282,11 +289,13 @@ showBinderIndented indent (name, Binder _ (XObj (Lst [XObj (Interface t paths) _
|
||||
replicate indent ' ' ++ name ++ " : " ++ show t ++ " = {\n " ++
|
||||
joinWith "\n " (map show paths) ++
|
||||
"\n" ++ replicate indent ' ' ++ "}"
|
||||
showBinderIndented indent (name, Binder _ xobj) =
|
||||
replicate indent ' ' ++ name ++
|
||||
-- " (" ++ show (getPath xobj) ++ ")" ++
|
||||
" : " ++ showMaybeTy (ty xobj)
|
||||
-- ++ " <" ++ getBinderDescription xobj ++ ">"
|
||||
showBinderIndented indent (name, Binder meta xobj) =
|
||||
if metaIsTrue meta "hidden"
|
||||
then ""
|
||||
else replicate indent ' ' ++ name ++
|
||||
-- " (" ++ show (getPath xobj) ++ ")" ++
|
||||
" : " ++ showMaybeTy (ty xobj)
|
||||
-- ++ " <" ++ getBinderDescription xobj ++ ">"
|
||||
|
||||
-- | Get a list of pairs from a deftype declaration.
|
||||
memberXObjsToPairs :: [XObj] -> [(String, Ty)]
|
||||
|
Loading…
Reference in New Issue
Block a user