summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEricMertens <>2017-05-19 17:10:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2017-05-19 17:10:00 (GMT)
commit47c833762162376d06502bfd62698e3e62d36b21 (patch)
treec2057e4e78c3acf91d70ead3902bddbc39e0d0f9
parentbcc6292356e8f2fa63abb794f13895160d789137 (diff)
version 0.6.2.10.6.2.1
-rw-r--r--CHANGELOG.md4
-rw-r--r--config-value.cabal2
-rw-r--r--src/Config.hs1
-rw-r--r--src/Config/LexerUtils.hs6
4 files changed, 8 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 62ca806..0baa19b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+0.6.2.1
+---
+* Fixed error output for unexpected floating point literal
+
0.6.2
---
* Nicer errors on unterminated inline lists and sections.
diff --git a/config-value.cabal b/config-value.cabal
index 2ec9a84..0e103b7 100644
--- a/config-value.cabal
+++ b/config-value.cabal
@@ -1,5 +1,5 @@
name: config-value
-version: 0.6.2
+version: 0.6.2.1
synopsis: Simple, layout-based value language similar to YAML or JSON
license: MIT
license-file: LICENSE
diff --git a/src/Config.hs b/src/Config.hs
index a63e0da..ce6450d 100644
--- a/src/Config.hs
+++ b/src/Config.hs
@@ -296,6 +296,7 @@ explainToken :: Token -> String
explainToken token =
case token of
T.Error e -> explainError e
+ T.Floating{} -> "parse error: unexpected floating-point literal"
T.Atom atom -> "parse error: unexpected atom: `" ++ Text.unpack atom ++ "`"
T.String str -> "parse error: unexpected string: " ++ show (Text.unpack str)
T.Bullet -> "parse error: unexpected bullet '*'"
diff --git a/src/Config/LexerUtils.hs b/src/Config/LexerUtils.hs
index cb48b62..846b6ce 100644
--- a/src/Config/LexerUtils.hs
+++ b/src/Config/LexerUtils.hs
@@ -6,13 +6,11 @@
module Config.LexerUtils where
import Data.Char (GeneralCategory(..), generalCategory, digitToInt,
- isAscii, isSpace, readLitChar, ord, isDigit)
-import Data.Monoid ((<>))
+ isAscii, isSpace, ord, isDigit)
import Data.Text (Text)
import Data.Word (Word8)
import Numeric (readInt)
import qualified Data.Text as Text
-import qualified Data.Text.Lazy as LText
import Config.Tokens
@@ -106,7 +104,7 @@ startString _ (Located posn text) _ = (InString posn text, [])
-- | Successfully terminate the current mode and emit tokens as needed
endMode :: Action
-endMode len (Located endPosn match) mode =
+endMode len (Located endPosn _) mode =
case mode of
InNormal -> (InNormal, [])
InCommentString _ st -> (st, [])