Permalink
Browse files

Some small stylistic changes.

  • Loading branch information...
1 parent 42bf62f commit a155bafc7bf520d0ba3397b0471c5531ecfb50b6 John MacFarlane committed Dec 21, 2011
Showing with 3 additions and 9 deletions.
  1. +3 −9 Text/Highlighting/Kate/Common.hs
@@ -105,21 +105,15 @@ pFirstNonSpace :: KateParser ()
pFirstNonSpace = do
rest <- getInput
prevNonspace <- fromState synStPrevNonspace
- if prevNonspace
- then mzero
- else case rest of
- (c:_) | not (isSpace c) -> return ()
- _ -> mzero
+ guard $ not $ prevNonspace || null rest || isSpace (head rest)
currentColumn :: GenParser tok st Column
-currentColumn = getPosition >>= return . sourceColumn
+currentColumn = sourceColumn `fmap` getPosition
pColumn :: Column -> GenParser tok st ()
pColumn col = do
curCol <- currentColumn
- if col == (curCol - 1) -- parsec's columns start with 1
- then return ()
- else fail $ "Not column " ++ show col
+ guard $ col == (curCol - 1) -- parsec's columns start with 1
pGetCapture :: Int -> KateParser String
pGetCapture capNum = do

0 comments on commit a155baf

Please sign in to comment.