<commit_before>module Oracles.Config.Setting (
    Setting (..), SettingList (..),
    setting, settingList, getSetting, getSettingList,
    targetPlatform, targetPlatforms, targetOs, targetOss, notTargetOs,
    targetArchs, windowsHost, notWindowsHost, ghcWithInterpreter,
    ghcEnableTablesNextToCode, ghcCanonVersion, cmdLineLengthLimit
    ) where

import Base
import Oracles.Config
import Stage

-- Each Setting comes from the system.config file, e.g. 'target-os = mingw32'.
-- setting TargetOs looks up the config file and returns "mingw32".
--
-- SettingList is used for multiple string values separated by spaces, such
-- as 'gmp-include-dirs = a b'.
-- settingList GmpIncludeDirs therefore returns a list of strings ["a", "b"].
data Setting = DynamicExtension
             | GhcMajorVersion
             | GhcMinorVersion
             | GhcPatchLevel
             | GhcSourcePath
             | HostArch
             | HostOs
             | ProjectVersion
             | ProjectVersionInt
             | TargetArch
             | TargetOs
             | TargetPlatformFull

data SettingList = ConfCcArgs Stage
                 | ConfCppArgs Stage
                 | ConfGccLinkerArgs Stage
                 | ConfLdLinkerArgs Stage
                 | GmpIncludeDirs
                 | GmpLibDirs
                 | IconvIncludeDirs
                 | IconvLibDirs

setting :: Setting -> Action String
setting key = askConfig $ case key of
    DynamicExtension   -> "dynamic-extension"
    GhcMajorVersion    -> "ghc-major-version"
    GhcMinorVersion    -> "ghc-minor-version"
    GhcPatchLevel      -> "ghc-patch-level"
    GhcSourcePath      -> "ghc-source-path"
    HostArch           -> "host-arch"
    HostOs             -> "host-os"
    ProjectVersion     -> "project-version"
    ProjectVersionInt  -> "project-version-int"
    TargetArch         -> "target-arch"<commit_msg>Add new configuration flags for generating Config.hs.<commit_after>module Oracles.Config.Setting (
    Setting (..), SettingList (..),
    setting, settingList, getSetting, getSettingList,
    targetPlatform, targetPlatforms, targetOs, targetOss, notTargetOs,
    targetArchs, windowsHost, notWindowsHost, ghcWithInterpreter,
    ghcEnableTablesNextToCode, ghcCanonVersion, cmdLineLengthLimit
    ) where

import Base
import Oracles.Config
import Stage

-- Each Setting comes from the system.config file, e.g. 'target-os = mingw32'.
-- setting TargetOs looks up the config file and returns "mingw32".
--
-- SettingList is used for multiple string values separated by spaces, such
-- as 'gmp-include-dirs = a b'.
-- settingList GmpIncludeDirs therefore returns a list of strings ["a", "b"].
data Setting = DynamicExtension
             | GhcMajorVersion
             | GhcMinorVersion
             | GhcPatchLevel
             | GhcVersion
             | GhcSourcePath
             | HostArch
             | HostOs
             | ProjectGitCommitId
             | ProjectName
             | ProjectVersion
             | ProjectVersionInt
             | ProjectPatchLevel
             | ProjectPatchLevel1
             | ProjectPatchLevel2
             | TargetArch
             | TargetOs
             | TargetPlatformFull

data SettingList = ConfCcArgs Stage
                 | ConfCppArgs Stage
                 | ConfGccLinkerArgs Stage
                 | ConfLdLinkerArgs Stage
                 | GmpIncludeDirs
                 | GmpLibDirs
                 | IconvIncludeDirs
                 | IconvLibDirs

setting :: Setting -> Action String
setting key = askConfig $ case key of
    DynamicExtension   -> "dynamic-extension"
    GhcMajorVersion    -> "ghc-major-version"
    GhcMinorVersion    -> "ghc-minor-version"
    GhcPatchLevel      -> "ghc-patch-level"
    GhcVersion         -> "ghc-version"
    GhcSourcePath      -> "ghc-source-path"
    HostArch           -> "host-arch"
    HostOs             -> "host-os"
    ProjectGitCommitId -> "project-git-commit-id"
    ProjectName        -> "project-name"
    ProjectVersion     -> "project-version"
    ProjectVersionInt  -> "project-version-int"
    ProjectPatchLevel  -> "project-patch-level"
    ProjectPatchLevel1 -> "project-patch-level1"
    ProjectPatchLevel2 -> "project-patch-level2"
    TargetArch         -> "target-arch"
{'fraction_non_alphanumeric': 0.08137094893914665, 'fraction_numerical': 0.0032641641408253674, 'mean_word_length': 2.0642857142857145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5260712', 'n_tokens_mistral': 1163, 'n_tokens_neox': 1150, 'n_words': 283}