package JSON::XS::Sugar;
use base qw(Exporter);
# ABSTRACT: sugar for using JSON::XS
# right now the XS won't work on anything before this
use 5.014000;
use warnings;
use strict;
use Devel::CallCh
@EXPORT_OK;
use constant JSON_TRUE => Types::Serialiser::true;
push @EXPORT_OK, qw(JSON_TRUE);
use constant JSON_FALSE => Types::Serialiser::false;
push @EXPORT_OK, qw(JSON_FALSE);
## no critic (Su
types)
sub json_truth($) {
return $_[0] ? JSON_TRUE : JSON_FALSE;
}
push @EXPORT_OK, qw(json_truth);
push @EXPORT_OK, qw(
json_number
json_string
);
# load json_number, json_string from
gs = OPf_KIDS;
cUNOPx(my_op)->op_first = argop;
return my_op;
}
static OP *myck_entersub_json_number(pTHX_ OP *entersubop,
GV *namegv, SV *protosv)
{
OP *pushop, *argop;
entersubo
ing = NULL;
op_free(entersubop);
return gen_numify_op(argop);
}
static OP *myck_entersub_json_string(pTHX_ OP *entersubop,
GV *namegv, SV *protosv)
{
OP *pushop, *argop;
entersubo
MODULE = JSON::XS::Sugar PACKAGE = JSON::XS::Sugar
PROTOTYPES: DISABLE
BOOT:
{
XOP *xop;
CV *json_number_cv = get_cv("JSON::XS::Sugar::json_number", 0);
cv_set_call_checker(json_number_