code: private static Collection<String> parseRequires(String code, boolean addClosureBase) {
      ErrorManager errorManager = new LoggerErrorManager(logger);
      JsFileParser parser = new JsFileParser(errorManager);
      DependencyInfo deps =
          parser.parseFile("<unknown path>", "<unknown path>", code);
      List<String> requires = new ArrayList<>();
      if (addClosureBase) {
        requires.add(CLOSURE_BASE_PROVIDE);
      }
      requires.addAll(deps.getRequiredSymbols());
      errorManager.generateReport();
      return requires;
    }
docs: Parses a block of code for goog.require statements and extracts the required symbols.