* Extract the enum Root.ExperimentNames.ExperimentName to a map
(mainImplFile)
| 68 | * Extract the enum Root.ExperimentNames.ExperimentName to a map |
| 69 | */ |
| 70 | function getExperimentNameEnum(mainImplFile) { |
| 71 | const mainAST = espree.parse(mainImplFile, parseOptions); |
| 72 | |
| 73 | let experimentNameEnum; |
| 74 | for (const node of mainAST.body) { |
| 75 | if (isEnumDeclaration(node, 'ExperimentName')) { |
| 76 | experimentNameEnum = node; |
| 77 | break; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | const map = new Map(); |
| 82 | if (!experimentNameEnum) { |
| 83 | return map; |
| 84 | } |
| 85 | for (const member of experimentNameEnum.declaration.members) { |
| 86 | map.set(member.id.name, member.initializer.value); |
| 87 | } |
| 88 | return map; |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * Determine if node is of the form Root.ExperimentNames.ExperimentName.NAME, and if so |
no test coverage detected