Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MIN Better error for vmode error

  • Loading branch information...
commit 6c458263ce7a6269bd0407c4f817d7d5be0e6bfc 1 parent 3350e24
@luispedro authored
Showing with 4 additions and 4 deletions.
  1. +1 −1  hex/Modes.lhs
  2. +3 −3 hex/Tokens.lhs
View
2  hex/Modes.lhs
@@ -139,7 +139,7 @@ vMode1' (OutputfontCommand fontinfo) =
If nothing matches, make the parser fail:
\begin{code}
-vMode1' _ = unexpected "not a vmode command"
+vMode1' c = unexpected (concat ["Expected a vmode command, got ", show c])
\end{code}
Now that we have dealt with vertical mode, we must deal with the horizontal.
View
6 hex/Tokens.lhs
@@ -197,10 +197,10 @@ emptyTokenStream TokenStream{charsource=st, state=s, queue=q} = null q && (isNot
Convert a sequence of \code{CharToken} into a \code{String}
\begin{code}
toksToStr :: [Token] -> [Char]
-toksToStr = map charof
+toksToStr = concatMap tos
where
- charof (CharToken (TypedChar c _)) = c
- charof _ = error "hex.Tokens.toksToStr.charof: Unexpected token"
+ tos (CharToken (TypedChar c _)) = [c]
+ tos (ControlSequence s) = "\\" ++ s
\end{code}
Please sign in to comment.
Something went wrong with that request. Please try again.