From 1eb7d098970742d66f93d9accc58db577aba8a73 Mon Sep 17 00:00:00 2001 From: jnthn Date: Thu, 3 Oct 2013 14:28:27 +0200 Subject: [PATCH] Add an nqp::flushfh op on Parrot. --- src/vm/parrot/QAST/Operations.nqp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/vm/parrot/QAST/Operations.nqp b/src/vm/parrot/QAST/Operations.nqp index 5b59b5038e..a9da22d736 100644 --- a/src/vm/parrot/QAST/Operations.nqp +++ b/src/vm/parrot/QAST/Operations.nqp @@ -1628,6 +1628,15 @@ QAST::Operations.add_core_op('sayfh', -> $qastcomp, $op { $op[0], $op[1] )) }); +QAST::Operations.add_core_op('flushfh', -> $qastcomp, $op { + if +$op.list != 1 { + nqp::die("The 'flushfh' op expects two operands"); + } + $qastcomp.as_post(QAST::Op.new( + :op('callmethod'), :name('flush'), + $op[0] + )) +}); QAST::Operations.add_core_op('readlinefh', -> $qastcomp, $op { if +$op.list != 1 { nqp::die("The 'readlinefh' op expects one operand");