Skip to content

Commit

Permalink
use identifiers instead of names in report for language
Browse files Browse the repository at this point in the history
  • Loading branch information
Kr0nox committed Aug 15, 2024
1 parent d42f404 commit c753a2b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private void writeOverview(JPlagResult result) {
missingComparisons);
OverviewReport overviewReport = new OverviewReport(REPORT_VIEWER_VERSION, folders.stream().map(File::getPath).toList(), // submissionFolderPath
baseCodePath, // baseCodeFolderPath
result.getOptions().language().getName(), // language
result.getOptions().language().getIdentifier(), // language
result.getOptions().fileSuffixes(), // fileExtensions
submissionNameToIdMap.entrySet().stream().collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey)), // submissionIds
submissionNameToNameToComparisonFileName, // result.getOptions().getMinimumTokenMatch(),
Expand Down
36 changes: 17 additions & 19 deletions report-viewer/src/model/Language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,26 @@
* Enum for the language parsers JPlag supports
*/
enum ParserLanguage {
JAVA = 'Javac based AST plugin',
PYTHON = 'Python3 Parser',
C = 'C Scanner',
CPP_OLD = 'C/C++ Scanner [basic markup]',
CPP = 'C++ Parser',
CPP_2 = 'C/C++ Parser',
C_SHARP = 'C# 6 Parser',
JAVA = 'java',
PYTHON = 'python3',
C = 'c',
CPP = 'cpp',
C_SHARP = 'csharp',
EMF_METAMODEL_DYNAMIC = 'emf-dynamic',
EMF_METAMODEL = 'EMF metamodel',
EMF_MODEL = 'EMF models (dynamically created token set)',
GO = 'Go Parser',
KOTLIN = 'Kotlin Parser',
R_LANG = 'R Parser',
RUST = 'Rust Language Module',
SCALA = 'Scala parser',
SCHEME = 'SchemeR4RS Parser [basic markup]',
SWIFT = 'Swift Parser',
TEXT = 'Text Parser (naive)',
SCXML = 'SCXML (Statechart XML)',
LLVM = 'LLVMIR Parser',
JAVASCRIPT = 'JavaScript',
TYPESCRIPT = 'Typescript Parser'
GO = 'go',
KOTLIN = 'kotlin',
R_LANG = 'rlang',
RUST = 'rust',
SCALA = 'scale',
SCHEME = 'scheme',
SWIFT = 'swift',
TEXT = 'text',
SCXML = 'scxml',
LLVM = 'llvmir',
JAVASCRIPT = 'javascript',
TYPESCRIPT = 'typescript'
}

type Language = ParserLanguage | 'unknown language'
Expand Down
2 changes: 1 addition & 1 deletion report-viewer/tests/unit/model/factories/ValidOptions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"language": "Javac based AST plugin",
"language": "java",
"min_token_match": 9,
"submission_directories": [
".\\files"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"jplag_version": { "major": 6, "minor": 0, "patch": 0 },
"submission_folder_path": ["files"],
"base_code_folder_path": "",
"language": "Javac based AST plugin",
"language": "java",
"file_extensions": [".java", ".JAVA"],
"submission_id_to_display_name": { "A": "A", "B": "B", "C": "C", "D": "D" },
"submission_ids_to_comparison_file_name": {
Expand Down

0 comments on commit c753a2b

Please sign in to comment.