Guest User

Untitled

a guest
Jun 23rd, 2011
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1.  
  2. // File manipulation
  3. $load 'rosella/core.pbc';
  4. $load 'rosella/filesystem.pbc';
  5.  
  6. // Eria base library
  7. $load 'EriaParser.pbc';
  8. $load 'X364.pbc';
  9.  
  10.  
  11. class EriaCompiler{
  12.  
  13. var x364;
  14.  
  15. function EriaCompiler(){
  16. x364 = new X364();
  17. }
  18.  
  19. function exploreModule(string path){
  20.  
  21. var dir = new Rosella.FileSystem.Directory(path);
  22.  
  23. var contents = dir.get_subdirectories();
  24.  
  25. for (var file in contents) {
  26. compileModule(file);
  27. }
  28.  
  29. }
  30.  
  31. function compileModule(var dir){
  32.  
  33. print(x364.FOREGROUND_CYAN, x364.BOLD);
  34. print("Compiling module : ");
  35. say(x364.RESET, dir.short_name());
  36.  
  37. exploreSource(dir);
  38.  
  39. print("\n");
  40. }
  41.  
  42. function exploreSource(var candidate){
  43.  
  44. var files = candidate.get_files();
  45. for (var file in files) {
  46. compileSource(file);
  47. }
  48.  
  49. var folders = candidate.get_subdirectories();
  50. for (var folder in folders) {
  51. exploreSource(folder);
  52. }
  53.  
  54. }
  55.  
  56.  
  57. function compileSource(var file){
  58.  
  59. print(x364.FOREGROUND_BLUE," → Compiling source : ");
  60. print(x364.RESET);
  61. print(file.short_name());
  62. say(x364.RESET);
  63. test();
  64. }
  65.  
  66. }
Advertisement
Add Comment
Please, Sign In to add comment