module Htcc.CRules.Preprocessor.Core (
preprocess
) where
import Htcc.Parser.ConstructionData.Scope.ManagedScope (ASTError)
import qualified Htcc.Tokenizer.Token as HT
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)