Merge pull request #14 from bennofs/assert-and-with
Add assert and with to parser
This commit is contained in:
commit
147624425d
|
@ -69,6 +69,8 @@ nixTerm = choice
|
|||
, nixList
|
||||
, nixLet
|
||||
, nixIf
|
||||
, nixAssert
|
||||
, nixWith
|
||||
, nixBool
|
||||
, nixNull
|
||||
, nixPath -- can be expensive due to back-tracking
|
||||
|
@ -117,6 +119,16 @@ nixIf = fmap Fix $ NIf
|
|||
<*> (whiteSpace *> reserved "then" *> nixApp)
|
||||
<*> (whiteSpace *> reserved "else" *> nixApp)
|
||||
|
||||
nixAssert :: Parser NExpr
|
||||
nixAssert = fmap Fix $ NAssert
|
||||
<$> (reserved "assert" *> nixApp)
|
||||
<*> (semi *> nixApp)
|
||||
|
||||
nixWith :: Parser NExpr
|
||||
nixWith = fmap Fix $ NWith
|
||||
<$> (reserved "with" *> nixApp)
|
||||
<*> (semi *> nixApp)
|
||||
|
||||
nixLambda :: Parser NExpr
|
||||
nixLambda = Fix <$> (NAbs <$> (try argExpr <?> "arguments") <*> nixApp)
|
||||
|
||||
|
|
Loading…
Reference in New Issue