Skip to content

Commit

Permalink
Correct location annotation for parenthesized expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
expipiplus1 committed Oct 16, 2020
1 parent 820499d commit 2846105
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Nix/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import Data.Char ( isAlpha
, isSpace
)
import Data.Data ( Data(..) )
import Data.Fix ( Fix(..) )
import Data.Functor
import Data.Functor.Identity
import Data.HashSet ( HashSet )
Expand Down Expand Up @@ -196,7 +197,7 @@ nixNull :: Parser NExprLoc
nixNull = annotateLocation1 (mkNullF <$ reserved "null" <?> "null")

nixParens :: Parser NExprLoc
nixParens = parens nixToplevelForm <?> "parens"
nixParens = annotateLocation1 (stripAnn . unFix <$> (parens nixToplevelForm <?> "parens"))

nixList :: Parser NExprLoc
nixList = annotateLocation1 (brackets (NList <$> many nixTerm) <?> "list")
Expand Down

0 comments on commit 2846105

Please sign in to comment.