code: boolean addNewSourceAst(JsAst ast) {
      CompilerInput oldInput = getInput(ast.getInputId());
      if (oldInput != null) {
        throw new IllegalStateException(
            "Input already exists: " + ast.getInputId().getIdName());
      }
      Node newRoot = checkNotNull(ast.getAstRoot(this));
      getRoot().getLastChild().addChildToBack(newRoot);
  
      CompilerInput newInput = new CompilerInput(ast);
  
      // TODO(tylerg): handle this for multiple modules at some point.
      JSModule firstModule = Iterables.getFirst(getModules(), null);
      if (firstModule.getName().equals(JSModule.STRONG_MODULE_NAME)) {
        firstModule.add(newInput);
      }
  
      putCompilerInput(ast.getInputId(), newInput);
  
      return true;
    }
docs: Add a new source input dynamically. Intended for incremental compilation.
  <p>
  If the new source input doesn't parse, it will not be added, and a false
  will be returned.
  
  @param ast the JS Source to add.
  @return true if the source was added successfully, false otherwise.
  @throws IllegalStateException if an input for this ast already exists.