-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
31 lines (26 loc) · 1.02 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/**
* This file is part of PPC.
*
* © Julien Bianchi <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace jubianchi\PPC;
use jubianchi\PPC\Stream\Char;
use jubianchi\PPC\Stream\File;
use function jubianchi\PPC\Combinators\debug;
use function jubianchi\PPC\Parsers\json;
require_once __DIR__.'/vendor/autoload.php';
require_once __DIR__.'/parsers/json.php';
$stream = new Char(file_get_contents(__DIR__.'/resources/composer.json'));
//$stream = new File(__DIR__.'/resources/composer.json');
//$stream = new CharStream('"foo": "bar", "bar": "baz", "boo": false');
//$stream = new CharStream('{"foo": false, "bar": "baz", "boo": false}');
//$stream = new CharStream('["foo", true, false]');
//$stream = new CharStream('{"foo": false, "bar": "baz", "boo": ["foo", true, false], "bee": null, "bii": ""}');
//$stream = new CharStream('"foo"');
$parser = json();
var_dump($parser($stream)->result());