Group
Extension

Matches 4

Pegex-JSON ( I/IN/INGY/Pegex-JSON-0.31.tar.gz, INGY, 2020; MetaCPAN )
Pegex-JSON/lib/Pegex/JSON.pm ( view source; MetaCPAN )
ackage Pegex::JSON;
BEGIN { $ENV{PERL_PEGEX_AUTO_COMPILE} = 'Pegex::JSON::Grammar' }
our $VERSION = '0.31';

use Pegex::Base;

use Pegex::Parser;
use Pegex::JSON::Grammar;
use Pegex::JSON::Data;

sub 
load {
    my ($self, $json) = @_;
    Pegex::Parser->new(
        grammar => Pegex::JSON::Grammar->new,
        receiver => Pegex::JSON::Data->new,
        # debug => 1,
    )->parse($json);
}

1;
Pegex-JSON ( I/IN/INGY/Pegex-JSON-0.31.tar.gz, INGY, 2020; MetaCPAN )
Pegex-JSON/lib/Pegex/JSON/Grammar.pm ( view source; MetaCPAN )
x::JSON::Grammar;
use Pegex::Base;
extends 'Pegex::Grammar';

use constant file => '../json-pgx/json.pgx';

sub make_tree {   # Generated/Inlined by Pegex::Grammar (0.73)
  {
    '+grammar' => 'json',

    '+include' => 'pegex-atoms',
    '+toprule' => 'json',
    '+version' => '0.0.1',
    '_' => {
      '.rgx' => qr/\G\s*/
    },
    'array' => {
      '.all' => [
        {
          '-skip' => 1
 qr/\G\s*\]\s*/
        }
      ]
    },
    'false' => {
      '.rgx' => qr/\Gfalse/
    },
    'json' => {
      '.all' => [
        {
          '.ref' => '_'
        },
        {
          '.ref' =
Pegex-JSON ( I/IN/INGY/Pegex-JSON-0.31.tar.gz, INGY, 2020; MetaCPAN )
Pegex-JSON/lib/Pegex/JSON/Data.pm ( view source; MetaCPAN )
package Pegex::JSON::Data;
use Pegex::Base;
extends 'Pegex::Tree';

use boolean;

sub got_json { shift @{(pop)} }

sub got_object { +{map @$_, @{(pop)}} }

my %escapes = (
    '"' => '"',
    '/' => "
ing {
    my $string = pop;
    $string =~ s/\\(["\/\\bfnrt])/$escapes{$1}/ge;
    # This handles JSON encoded Unicode surrogate pairs
    $string =~ s/\\u([0-9a-f]{4})\\u([0-9a-f]{4})/pack "U*", hex(
Pegex-JSON ( I/IN/INGY/Pegex-JSON-0.31.tar.gz, INGY, 2020; MetaCPAN )
Pegex-JSON/lib/Pegex/JSON.pod ( view source; MetaCPAN )
NAME

Pegex::JSON - Pegex Loader for JSON

=for html
<a href="https://travis-ci.org/ingydotnet/pegex-json-pm"><img src="https://travis-ci.org/ingydotnet/pegex-json-pm.png" alt="pegex-json-pm"></a>
<a 
et/pegex-json-pm?branch=master"><img src="https://coveralls.io/repos/ingydotnet/pegex-json-pm/badge.png" alt="pegex-json-pm"></a>

=head1 SYNOPSIS

    my $data = Pegex::JSON->new->load($json);

=head
1 DESCRIPTION

Pegex::JSON is a JSON parser written in Pegex.

=head1 SEE ALSO

=over

=item * L<Pegex>

=item * L<JSON>

=back

=head1 AUTHOR

Ingy döt Net <ingy@cpan.org>

=head1 COPYRIGHT

Copyrig

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.