-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5420af
commit 139d07a
Showing
8 changed files
with
101 additions
and
77 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
# NAME | ||
|
||
Pegex::JSONY - Pegex Loader for JSON | ||
|
||
# SYNOPSIS | ||
|
||
my $data = Pegex::JSON->new->load($json); | ||
|
||
# DESCRIPTION | ||
|
||
Pegex::JSON is a JSON parser written in Pegex. | ||
|
||
# SEE ALSO | ||
|
||
- [Pegex](http://search.cpan.org/perldoc?Pegex) | ||
- [JSON](http://search.cpan.org/perldoc?JSON) | ||
|
||
# AUTHOR | ||
|
||
Ingy döt Net (ingy) <ingy@cpan.org> | ||
|
||
# COPYRIGHT | ||
|
||
Copyright (c) 2011-2014 Ingy döt Net | ||
|
||
# LICENSE | ||
|
||
This library is free software and may be distributed under the same terms as | ||
perl itself. |
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 |
---|---|---|
@@ -1,36 +1,55 @@ | ||
## | ||
# name: Pegex::JSON | ||
# abstract: Pegex Parser for JSON | ||
# author: Ingy döt Net <ingy@cpan.org> | ||
# license: perl | ||
# copyright: 2011, 2012 | ||
# see: | ||
# - Pegex | ||
# - JSON | ||
package Pegex::JSON; | ||
# VERSION | ||
|
||
use 5.010; | ||
use Pegex::Base; | ||
|
||
use Pegex 0.21 (); | ||
use boolean 0.28 (); | ||
use Pegex::Parser; | ||
use Pegex::JSON::Grammar; | ||
use Pegex::JSON::Data; | ||
|
||
package Pegex::JSON; | ||
use Pegex::Base; | ||
extends 'Pegex::Module'; | ||
sub load { | ||
my ($self, $json) = @_; | ||
Pegex::Parser->new( | ||
grammar => Pegex::JSON::Grammar->new, | ||
receiver => Pegex::JSON::Data->new, | ||
)->parse($json); | ||
} | ||
|
||
require Pegex::JSON::Grammar; | ||
require Pegex::JSON::Data; | ||
1; | ||
|
||
our $VERSION = '0.16'; | ||
=encoding utf8 | ||
has grammar_class => 'Pegex::JSON::Grammar'; | ||
has receiver_class => 'Pegex::JSON::Data'; | ||
=head1 NAME | ||
1; | ||
Pegex::JSONY - Pegex Loader for JSON | ||
=head1 SYNOPSIS | ||
my $data = Pegex::JSON->parse($json); | ||
my $data = Pegex::JSON->new->load($json); | ||
=head1 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) <ingy@cpan.org> | ||
=head1 COPYRIGHT | ||
Copyright (c) 2011-2014 Ingy döt Net | ||
=head1 LICENSE | ||
This library is free software and may be distributed under the same terms as | ||
perl itself. |
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 was deleted.
Oops, something went wrong.
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