/* * There's one fairly important difference between mod resolution in rustc and what we do. * Given following code: * mod bar { mod a; } mod bar { mod b; } * We will merget this to mod bar { mod a; mod b; }, but rustc will error out. */ public static ModuleImport ParseImports(ICharStream stream) { var lexer = new ModuleLexer(stream); var tokens = new CommonTokenStream(lexer); var parser = new ModuleParser(tokens); BodyContext root = parser.body(); var imports = new ModuleImport(); TraverseForImports(root, imports); return imports; }
/* * There's one fairly important difference between mod resolution in rustc and what we do. * Given following code: * mod bar { mod a; } mod bar { mod b; } * We will merget this to mod bar { mod a; mod b; }, but rustc will error out. */ public static ModuleImport ParseImports(ICharStream stream) { var lexer = new ModuleLexer(stream); var tokens = new CommonTokenStream(lexer); var parser = new ModuleParser(tokens); BodyContext root = parser.body(); var imports = new ModuleImport(); TraverseForImports(root, imports); return(imports); }