~alcinnz/haskell-stylist

ref: b26bb3d190dcd3f81b5acc6c288afc3645dc1420 haskell-stylist/Stylish/Parse/Utils.hs -rw-r--r-- 408 bytes
b26bb3d1 — Adrian Cochrane Implement basic parser. TODO test. 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Stylish.Parse.Utils(
        concatP, capture, skipSpace
    ) where

import Data.CSS.Syntax.Tokens

concatP join left right tokens = (join x y, remainder)
    where (x, tokens') = left tokens
        (y, remainder) = right tokens'

capture cb token:tokens = (token:captured, tokens')
    where (captured, tokens') = cb tokens

skipSpace Whitespace:tokens = skipSpace tokens
skipSpace tokens = tokens