1
0

RegFieldDesc: Prevent different RegField JSONS from overwriting eachother.

This commit is contained in:
Megan Wachs
2018-02-15 14:01:47 -08:00
parent 64d3731e45
commit b95f68447f
2 changed files with 12 additions and 2 deletions

View File

@ -139,7 +139,12 @@ trait GeneratorApp extends App with HasGeneratorUtilities {
object ElaborationArtefacts {
var files: Seq[(String, () => String)] = Nil
def add(extension: String, contents: => String) {
def add(extension: String, contents: => String) = {
files = (extension, () => contents) +: files
}
def contains(extension: String): Boolean = {
files.foldLeft(false)((t, s) => {s._1 == extension | t})
}
}