1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 13:51:44 +03:00

Add a field for a Java mode.

This commit is contained in:
Rob Rix 2019-09-27 19:06:19 -04:00
parent 1ec65b4858
commit ac0f15103f
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7
2 changed files with 12 additions and 4 deletions

View File

@ -143,14 +143,16 @@ textToLanguage = \case
_ -> Unknown
newtype PerLanguageModes = PerLanguageModes
{ pythonMode :: LanguageMode
data PerLanguageModes = PerLanguageModes
{ javaMode :: LanguageMode
, pythonMode :: LanguageMode
}
deriving (Eq, Ord, Show)
defaultLanguageModes :: PerLanguageModes
defaultLanguageModes = PerLanguageModes
{ pythonMode = ALaCarte
{ javaMode = ALaCarte
, pythonMode = ALaCarte
}
data LanguageMode
@ -160,5 +162,6 @@ data LanguageMode
modeForLanguage :: PerLanguageModes -> Language -> LanguageMode
modeForLanguage modes = \case
Java -> javaMode modes
Python -> pythonMode modes
_ -> ALaCarte

View File

@ -103,7 +103,12 @@ parseCommand = command "parse" (info parseArgumentsParser (progDesc "Generate pa
where
parseArgumentsParser = do
languageModes <- Language.PerLanguageModes
<$> option auto ( long "python-mode"
<$> option auto ( long "java-mode"
<> help "The AST representation to use for Java sources"
<> metavar "ALaCarte|Precise"
<> value Language.ALaCarte
<> showDefault)
<*> option auto ( long "python-mode"
<> help "The AST representation to use for Python sources"
<> metavar "ALaCarte|Precise"
<> value Language.ALaCarte