Skip to content

Commit

Permalink
Merge #975: add context notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton-Latukha authored Jul 18, 2021
2 parents 03902a3 + 9dfec2b commit f92a283
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Nix/Context.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Nix.Expr.Types.Annotated ( SrcSpan
)
import Nix.Utils ( Has(..) )

-- 2021-07-18: NOTE: It should be Options -> Scopes -> Frames -> Source(span)
data Context m t = Context
{ scopes :: Scopes m t
, source :: SrcSpan
Expand Down
2 changes: 2 additions & 0 deletions src/Nix/Convert.hs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ instance ( Convertible e t f m
(M.lookup "outPath" s)
_ -> stub

-- 2021-07-18: NOTE: There may be cases where conversion wrongly marks the content to have a context.
-- See: https://github.com/haskell-nix/hnix/pull/958#issuecomment-881949183 thread.
fromValue = fromMayToValue $ TString HasContext

instance Convertible e t f m
Expand Down
2 changes: 2 additions & 0 deletions src/Nix/String.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import Nix.Expr.Types ( VarName(..)

-- ** Context

-- 2021-07-18: NOTE: it should be ContextFlavor -> Varname.
-- | A Nix 'StringContext' ...
data StringContext =
StringContext
Expand Down Expand Up @@ -104,6 +105,7 @@ type WithStringContext = WithStringContextT Identity

-- ** NixString

-- 2021-07-18: NOTE: It should be Context -> Contents.
data NixString =
NixString
{ nsContents :: !Text
Expand Down

0 comments on commit f92a283

Please sign in to comment.