ormolu-0.1.2.0: A formatter for Haskell source code

Safe Haskell | Safe
Language | Haskell2010

Ormolu.Processing.Cpp

Description

Support for CPP.

Synopsis

- data State
  - = Outside
  - | InConditional
  - | InContinuation
- processLine :: String -> State -> (String, State)
- unmaskLine :: Text -> Text

# Documentation

data State Source #

State of the CPP processor.

Constructors

Outside | Outside of CPP directives
InConditional | In a conditional expression
InContinuation | In a continuation (after `\`)

#### Instances

Instances details

Eq State Source # |
Instance details Defined in Ormolu.Processing.Cpp Methods (==) :: State -> State -> Bool Source # (/=) :: State -> State -> Bool Source #
Show State Source # |
Instance details Defined in Ormolu.Processing.Cpp Methods showsPrec :: Int -> State -> ShowS Source # show :: State -> String Source # showList :: [State] -> ShowS Source #

processLine :: String -> State -> (String, State) Source #

Automatically mask the line when needed and update the `State`.

unmaskLine :: Text -> Text Source #

If the given line is masked, unmask it. Otherwise return the line unchanged.