Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // File manipulation
- $load 'rosella/core.pbc';
- $load 'rosella/filesystem.pbc';
- // Eria base library
- $load 'EriaParser.pbc';
- $load 'X364.pbc';
- class EriaCompiler{
- var x364;
- function EriaCompiler(){
- x364 = new X364();
- }
- function exploreModule(string path){
- var dir = new Rosella.FileSystem.Directory(path);
- var contents = dir.get_subdirectories();
- for (var file in contents) {
- compileModule(file);
- }
- }
- function compileModule(var dir){
- print(x364.FOREGROUND_CYAN, x364.BOLD);
- print("Compiling module : ");
- say(x364.RESET, dir.short_name());
- exploreSource(dir);
- print("\n");
- }
- function exploreSource(var candidate){
- var files = candidate.get_files();
- for (var file in files) {
- compileSource(file);
- }
- var folders = candidate.get_subdirectories();
- for (var folder in folders) {
- exploreSource(folder);
- }
- }
- function compileSource(var file){
- print(x364.FOREGROUND_BLUE," → Compiling source : ");
- print(x364.RESET);
- print(file.short_name());
- say(x364.RESET);
- test();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment