-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug fix: dynamic invocation with bool might fail
- Loading branch information
Showing
17 changed files
with
657 additions
and
514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
build/* | ||
*.ipr | ||
*.iws | ||
out/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package lt.repl; | ||
|
||
import sun.misc.Signal; | ||
import sun.misc.SignalHandler; | ||
|
||
/** | ||
* handle ctrl-c (INT) event | ||
*/ | ||
public class CtrlCHandlerImpl implements CtrlCHandler { | ||
private Runnable alert = null; | ||
private ExitCallback exitCallback = null; | ||
private final IO io; | ||
private int count; | ||
|
||
public CtrlCHandlerImpl(IO io) { | ||
this.io = io; | ||
} | ||
|
||
@Override | ||
public void setExitCallback(final ExitCallback exitCallback) { | ||
this.exitCallback = exitCallback; | ||
} | ||
|
||
@Override | ||
public void setAlert(Runnable alert) { | ||
this.alert = alert; | ||
} | ||
|
||
@Override | ||
public void handle() { | ||
++count; | ||
if (count == 2) { | ||
io.out.println(); | ||
exitCallback.exit(); | ||
} else { | ||
io.out.println("\n(To exit, press ^C again or type :q)"); | ||
if (alert != null) { | ||
alert.run(); | ||
} | ||
new Thread(new Runnable() { | ||
@Override | ||
public void run() { | ||
try { | ||
Thread.sleep(1000); | ||
} catch (InterruptedException e) { | ||
e.printStackTrace(io.err); | ||
} | ||
count = 0; | ||
} | ||
}).run(); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.