forked from tibbe/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parametrised parser with better errors
* Alternative API for parsing `Text` into `Template` which allows users to specify if they want brackets to be mandatory. Instead of simple location this API returns `ParseError` on failure. * Function `template` throws `ParseError`, instead of calling `error`. No other function in existing public API has (visibly) changed. Addresses issues tibbe#13 and tibbe#14
- Loading branch information
Showing
4 changed files
with
132 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{-# LANGUAGE NoImplicitPrelude #-} | ||
|
||
-- | 'Data.Text.Template.Internal.Template' parametrised parsing API with | ||
-- better error handling. | ||
module Data.Text.Template.Parse | ||
( ParseOptions(..) | ||
, parse | ||
|
||
-- * Parse Error | ||
, ParseError(..) | ||
, showTemplateError | ||
, showParseError | ||
, mkParseError | ||
, parseError | ||
) | ||
where | ||
|
||
import Data.Text.Template.Internal | ||
( ParseOptions(..) | ||
, ParseError(..) | ||
, showTemplateError | ||
, showParseError | ||
, mkParseError | ||
, parseError | ||
, parse | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters