Changeset 237
- Timestamp:
- 02/26/07 22:34:26 (2 years ago)
- Files:
-
- trunk/src/leds/LanguageD.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/leds/LanguageD.d
r230 r237 42 42 private import gtk.TreeIter; 43 43 private import gdk.Pixbuf; 44 private import gtk.GtkD; 44 45 private import image.XPM; 45 46 … … 603 604 //debug(flow ) System.writefln("CodeView.checkSintax 7"); 604 605 codeview.getWorkspace().getSystemConsole.print("Compile Command: \n" ~ compileCommand.toString() ~ "\n"); 605 606 Spawn spawn = new Spawn(compileCommand.toString()); 607 correct = spawn.commandLineSync()!=0; 606 SpawnWrapper sp = new SpawnWrapper(compileCommand.toString()); 607 sp.start(); 608 while(1 && GtkD.eventsPending()) { 609 GtkD.mainIteration(); 610 if (sp.getState() == Thread.TS.TERMINATED) { 611 break; 612 } 613 } 614 615 //Spawn spawn = new Spawn(compileCommand.toString()); 616 //correct = spawn.commandLineSync()!=0; 608 617 //debug(flow ) System.writefln("CodeView.checkSintax 8"); 609 codeview.getWorkspace().getSystemConsole.print("Compile Result:\n" ~ spawn.getOutputString() ~ "\n"); 610 checkSyntax( spawn.getOutputString(), spawn.getErrorString()); 618 codeview.getWorkspace().getSystemConsole.print("Compile Result:\n" ~ sp.outputstring ~ "\n"); 619 //checkSyntax( spawn.getOutputString(), spawn.getErrorString()); 620 checkSyntax( SpawnWrapper.outputstring, SpawnWrapper.errorstring); 611 621 //workspace.getStatusbar().addBackgroundProcess(); 612 622 //debug(flow ) System.writefln("CodeView.checkSintax 9"); 613 623 codeview.endSintaxCheck(); 624 625 // is there any reason we bother with this? 626 // otherwise we have to hang on for events pending. 627 return correct; 628 } 629 bool syntaxCorrect = false; 614 630 615 return correct; 631 private import std.thread; 632 class SpawnWrapper : Thread 633 { 634 char[] command;; 635 this(char[] cmd) 636 { 637 command = cmd; 638 } 639 static char[] errorstring = ""; 640 static char[] outputstring = ""; 641 642 int run() 643 { 644 Spawn spawn = new Spawn(command); 645 spawn.commandLineSync(); 646 setStrings(spawn); 647 return 1; 648 } 649 synchronized void setStrings(Spawn spawn) 650 { 651 652 SpawnWrapper.outputstring = spawn.getOutputString() ; 653 SpawnWrapper.errorstring =spawn.getErrorString(); 654 655 } 616 656 } 617 657
