bundle method

ASTCompilation bundle(
  1. HTSource source, {
  2. bool errorHandled = false,
})

Process the import declaration within several sources, generate a single ASTCompilation for HTCompiler to compile.

Implementation

ASTCompilation bundle(HTSource source, {bool errorHandled = false}) {
  final compilation = bundler.bundle(
    source: source,
    parser: _currentParser,
    normalizePath: config.normalizeImportPath,
    debugPerformance: config.debugPerformance,
  );
  if (compilation.errors.isNotEmpty) {
    for (final error in compilation.errors) {
      if (errorHandled) {
        throw error;
      } else {
        interpreter.processError(error);
      }
    }
  }
  return compilation;
}