{-|
Module      : Htcc.CRules.Preprocessor.Core
Description : The preprocessor
Copyright   : (c) roki, 2019
License     : MIT
Maintainer  : falgon53@yahoo.co.jp
Stability   : experimental
Portability : POSIX

The preprocessor
-}
module Htcc.CRules.Preprocessor.Core (
    preprocess
) where

import           Htcc.Parser.ConstructionData.Scope.ManagedScope (ASTError)
import qualified Htcc.Tokenizer.Token                            as HT

-- | The function that executes a proprocess.
-- __NOTE__: This is not yet implemented.
preprocess :: [HT.TokenLC i] -> Either (ASTError i) [HT.TokenLC i]
preprocess :: [TokenLC i] -> Either (ASTError i) [TokenLC i]
preprocess = [TokenLC i] -> Either (ASTError i) [TokenLC i]
forall a b. b -> Either a b
Right ([TokenLC i] -> Either (ASTError i) [TokenLC i])
-> ([TokenLC i] -> [TokenLC i])
-> [TokenLC i]
-> Either (ASTError i) [TokenLC i]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (TokenLC i -> Bool) -> [TokenLC i] -> [TokenLC i]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> (TokenLC i -> Bool) -> TokenLC i -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Token i -> Bool
forall i. Token i -> Bool
HT.isTKMacro (Token i -> Bool) -> (TokenLC i -> Token i) -> TokenLC i -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TokenLC i -> Token i
forall a b. (a, b) -> b
snd)