Noir::HaskellCalleeExtractor
Inherits Noir::CalleeExtractorBase
Constants
BIND_CALL_REGEX = /(?:<-|=)\s*([a-z_][A-Za-z0-9_']*)(?=\s|$|\()/
BRANCH_CALL_REGEX = /(?:->|\bthen\b|\belse\b)\s*([a-z_][A-Za-z0-9_']*)(?=\s|$|\()/
DOLLAR_CALL_REGEX = /\$\s*([a-z_][A-Za-z0-9_']*)(?=\s|$|\()/
PAREN_CALL_REGEX = /[(,]\s*([a-z_][A-Za-z0-9_']*)(?=\s|$|\()/
QUALIFIED_CALL_REGEX = /(?<![A-Za-z0-9_'.])((?:[A-Z][A-Za-z0-9_']*\.)+[a-z_][A-Za-z0-9_']*)(?![A-Za-z0-9_'])/
No trailing \b on the captured name. \b after [A-Za-z0-9_']* is
redundant whenever the name ends in a word character (the greedy class
has already consumed every one of them), and it is unsatisfiable when
the name ends in a prime: \b would demand a word character after the
' while the lookahead demands whitespace / EOL / (. So the only
thing it ever did was force go' to backtrack down to go — or, with
the lookahead, fail to match at all.
RESERVED = Set {"as", "case", "class", "data", "default", "deriving", "do", "else", "family", "forall", "foreign", "hiding", "if", "import", "in", "infix", "infixl", "infixr", "instance", "let", "module", "newtype", "of", "qualified", "then", "type", "where", "return", "pure", "fmap", "map", "filter", "foldl", "foldr", "id", "const", "show", "read", "print", "putStrLn", "length", "null", "not", "and", "or", "maybe", "either", "fst", "snd"}
STATEMENT_CALL_REGEX = /^\s*([a-z_][A-Za-z0-9_']*)(?=\s|$|\()/