1
1
mirror of https://github.com/github/semantic.git synced 2024-11-25 11:04:00 +03:00

Define a helper to look up the mode for a given language.

This commit is contained in:
Rob Rix 2019-09-25 11:48:07 -04:00
parent b394bcd816
commit 44f9a11a62
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -12,6 +12,7 @@ module Data.Language
, languageToText
, PerLanguageModes(..)
, LanguageMode(..)
, modeForLanguage
) where
import Data.Aeson
@ -150,3 +151,8 @@ data LanguageMode
= ALaCarte
| Precise
deriving (Bounded, Enum, Eq, Ord, Read, Show)
modeForLanguage :: PerLanguageModes -> Language -> LanguageMode
modeForLanguage modes = \case
Python -> pythonMode modes
_ -> ALaCarte