Skip to content

Commit

Permalink
Revert "Implement a guessing nqp::isttyfh on the JVM (the JVM doesn't…
Browse files Browse the repository at this point in the history
… allow us to implement a fully correct version)."

This reverts commit bbf2eaf.

It breaks the build on the JVM
  • Loading branch information
coke committed Nov 19, 2015
1 parent cb57d0d commit 9bb99ed
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 27 deletions.
2 changes: 0 additions & 2 deletions src/vm/jvm/QAST/Compiler.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -2077,8 +2077,6 @@ QAST::OperationsJAST.map_classlib_core_op('eoffh', $TYPE_OPS, 'eoffh', [$RT_OBJ]
QAST::OperationsJAST.map_classlib_core_op('closefh', $TYPE_OPS, 'closefh', [$RT_OBJ], $RT_OBJ, :tc);
QAST::OperationsJAST.map_classlib_core_op('closefh_i', $TYPE_OPS, 'closefhi', [$RT_OBJ], $RT_INT, :tc);

QAST::OperationsJAST.map_classlib_core_op('isttyfh', $TYPE_OPS, 'isttyfh', [$RT_OBJ], $RT_INT, :tc);

QAST::OperationsJAST.map_classlib_core_op('chmod', $TYPE_OPS, 'chmod', [$RT_STR, $RT_INT], $RT_INT, :tc);
QAST::OperationsJAST.map_classlib_core_op('unlink', $TYPE_OPS, 'unlink', [$RT_STR], $RT_INT, :tc);
QAST::OperationsJAST.map_classlib_core_op('rmdir', $TYPE_OPS, 'rmdir', [$RT_STR], $RT_INT, :tc);
Expand Down
6 changes: 1 addition & 5 deletions src/vm/jvm/runtime/org/perl6/nqp/io/StandardReadHandle.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.perl6.nqp.runtime.ExceptionHandling;
import org.perl6.nqp.runtime.ThreadContext;

public class StandardReadHandle implements IIOClosable, IIOEncodable, IIOSyncReadable, IIOInteractive, IIOPossiblyTTY {
public class StandardReadHandle implements IIOClosable, IIOEncodable, IIOSyncReadable, IIOInteractive {
private InputStream is;
private BufferedReader br;
private ConsoleReader cr;
Expand Down Expand Up @@ -118,8 +118,4 @@ public synchronized String readlineInteractive(ThreadContext tc, String prompt)
public boolean eof(ThreadContext tc) {
return eof;
}

public boolean isTTY(ThreadContext tc) {
return System.console() != null;
}
}
6 changes: 1 addition & 5 deletions src/vm/jvm/runtime/org/perl6/nqp/io/StandardWriteHandle.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.perl6.nqp.runtime.ExceptionHandling;
import org.perl6.nqp.runtime.ThreadContext;

public class StandardWriteHandle implements IIOClosable, IIOSeekable, IIOEncodable, IIOSyncWritable, IIOPossiblyTTY {
public class StandardWriteHandle implements IIOClosable, IIOSeekable, IIOEncodable, IIOSyncWritable {
private PrintStream ps;
private CharsetEncoder enc;
private CharsetDecoder dec;
Expand Down Expand Up @@ -65,8 +65,4 @@ public long say(ThreadContext tc, String s) {
public void flush(ThreadContext tc) {
ps.flush();
}

public boolean isTTY(ThreadContext tc) {
return System.console() != null;
}
}
15 changes: 0 additions & 15 deletions src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
import org.perl6.nqp.io.IIOSeekable;
import org.perl6.nqp.io.IIOSyncReadable;
import org.perl6.nqp.io.IIOSyncWritable;
import org.perl6.nqp.io.IIOPossiblyTTY;
import org.perl6.nqp.io.ProcessHandle;
import org.perl6.nqp.io.ProcessChannel;
import org.perl6.nqp.io.ServerSocketHandle;
Expand Down Expand Up @@ -814,20 +813,6 @@ public static long closefhi(SixModelObject obj, ThreadContext tc) {
return -1;
}

public static long isttyfh(SixModelObject obj, ThreadContext tc) {
if (obj instanceof IOHandleInstance) {
IOHandleInstance h = (IOHandleInstance)obj;
if (h.handle instanceof IIOPossiblyTTY)
return ((IIOPossiblyTTY)h.handle).isTTY(tc) ? 1 : 0;
else
return 0;
}
else {
die_s("isttyfh requires an object with the IOHandle REPR", tc);
}
return -1;
}

public static Set<PosixFilePermission> modeToPosixFilePermission(long mode) {
Set<PosixFilePermission> perms = EnumSet.noneOf(PosixFilePermission.class);
if ((mode & 0001) != 0) perms.add(PosixFilePermission.OTHERS_EXECUTE);
Expand Down

0 comments on commit 9bb99ed

Please sign in to comment.