Safe Haskell | None |
---|
Provides searching of source code files and language identification.
Language identification is required in order to detect any inconsistencies (e.g. combining Java and C), and to tag submissions.
Java also requires identifying which file provides the main method.
- parseFilter :: [String] -> Maybe ([FilePath], [FilePath])
- findFiles :: IO [FilePath]
- determineLanguage :: [FilePath] -> Maybe KattisLanguage
- findMainClass :: ([FilePath], KattisLanguage) -> IO (Maybe FilePath)
- languageKattisName :: KattisLanguage -> ByteString
- languageContentType :: KattisLanguage -> ByteString
Documentation
parseFilter :: [String] -> Maybe ([FilePath], [FilePath])Source
Parse an argument list from the +file1 -file2 style into two lists of file paths (included and ignored files).
determineLanguage :: [FilePath] -> Maybe KattisLanguageSource
Determine source code language by studying file extensions. There is an implicit priority ordering, since C is a subset of C++.
findMainClass :: ([FilePath], KattisLanguage) -> IO (Maybe FilePath)Source
Locate main class based on source file contents. C++ and C solutions do not need to be specified, returns an empty string.
In the Java case all souce code files are parsed. All occurences of a main method defined with public static void are located.
Will return Nothing
if result is ambiguous.
languageKattisName :: KattisLanguage -> ByteStringSource
Determine Kattis language string identifier.
languageContentType :: KattisLanguage -> ByteStringSource
Determine content type of submission language.