 resolve = require("resolve")
 fs = require("fs")
 path = require("path")
-cp = require("child_process")
+cprocess = require("child_process")
+assert = require("assert")
 #===============================================================================
 mods = []
 filePathIndexesInMods = {}
 compileCommands = {}
-checkCode = (filePath) ->
+dummies = []
+checkCode = (filePath, isDummy = false) ->
     rawCodeType = path.extname(filePath).substr(1) # strip the leading "."
     rawCode = fs.readFileSync(filePath, {encoding: "utf8"})
     baseDirectory = path.dirname(filePath)
     code =
-        if rawCodeType == "js"
+        if isDummy
+            ""
+        else if rawCodeType == "js"
             rawCode
         else
-            cp.execSync(compileCommands[rawCodeType], {
+            cprocess.execSync(compileCommands[rawCodeType], {
                 encoding: "utf8"
                 input: rawCode
             })

                extensions: [".js", ".coffee"]
            })
            if not filePathIndexesInMods[newFilePath]?
                checkCode(newFilePath)
            mod.nameIndexes[requireString] ?= filePathIndexesInMods[newFilePath]
        if Array.isArray(node)
            node.forEach((m) -> checkTreeNode(m))

    if arg.indexOf("-c:") != -1
        compileCommands[arg.split(":")[1]] = args[i + 1]
        i += 2
    else if arg == "-d"
        assert(args[i + 1].search(/^(\/|\.\/|\.\.\/)/) == -1)
        dummies.push(args[i + 1])
        i += 2
    else
        assert(arg[0] != "-")
        file = arg
        i++
checkCode(path.resolve(file))
