Skip to content

Commit

Permalink
Merge branch 'refactoring'
Browse files Browse the repository at this point in the history
  • Loading branch information
nishimura committed Jul 9, 2016
2 parents f3ecb76 + 53aafc2 commit fe8a97d
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 34 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ use Laiz\Parsec;
use function Laiz\Parsec\parse;
use function Laiz\Parsec\str;

Parsec\Char\load();

$parser = str('abc');

$ret = parse($parser, "Test", "abcdef");
Expand All @@ -45,9 +43,6 @@ use function Laiz\Parsec\char;
use function Laiz\Parsec\str;
use function Laiz\Parsec\eof;

Parsec\Char\load();
Parsec\Combinator\load();

$alnum = satisfy(function($s){
return ctype_alnum($s);
});
Expand Down Expand Up @@ -105,9 +100,6 @@ use function Laiz\Parsec\parserReturn;
use function Laiz\Parsec\sepEndBy;
use function Laiz\Parsec\Show\show;

Parsec\Char\load();
Parsec\Combinator\load();

class Attr
{
public $name;
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@

"autoload": {
"psr-4": { "Laiz\\Parsec\\": "src/" },
"files": [ "src/functions.php", "src/fast.php" ]
"files": [
"src/functions.php",
"src/fast.php",
"src/char.php",
"src/combinator.php"
]
},
"autoload-dev": {
"psr-4": { "Laiz\\Test\\Parsec\\": "test/" }
Expand Down
13 changes: 0 additions & 13 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,19 +402,6 @@ function modifyState(...$args)
}


//============================================================
// Function loader
//============================================================
namespace Laiz\Parsec\Char;
function load(){
require_once __DIR__ . '/char.php';
}

namespace Laiz\Parsec\Combinator;
function load(){
require_once __DIR__ . '/combinator.php';
}

//============================================================
// Type Classes
//============================================================
Expand Down
3 changes: 0 additions & 3 deletions test/BugfixTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
use function Laiz\Parsec\optional;


Parsec\Char\load();
Parsec\Combinator\load();

class BugfixTest extends \PHPUnit_Framework_TestCase
{
public function testCombinatorBind()
Expand Down
3 changes: 0 additions & 3 deletions test/ParserCombinatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
use function Laiz\Func\Alternative\aor;
use function Laiz\Func\Functor\fmap;

Parsec\Char\load();
Parsec\Combinator\load();

class ParserCombinatorTest extends \PHPUnit_Framework_TestCase
{
public function testUnconsArray()
Expand Down
2 changes: 0 additions & 2 deletions test/ParserStateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
use function Laiz\Parsec\putState;
use function Laiz\Parsec\modifyState;

Parsec\Char\load();

class ParserStateTest extends \PHPUnit_Framework_TestCase
{
public function testGetState()
Expand Down
2 changes: 0 additions & 2 deletions test/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
use function Laiz\Func\Alternative\aor;
use function Laiz\Func\Monoid\mappend;

Parsec\Char\load();

class ParserTest extends \PHPUnit_Framework_TestCase
{
public function testUnconsArray()
Expand Down
2 changes: 0 additions & 2 deletions test/TextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
use function Laiz\Parsec\Show\show;
use function Laiz\Func\Either\Right;

Parsec\Char\load();

class TextTest extends \PHPUnit_Framework_TestCase
{
public function testParserInFix()
Expand Down

0 comments on commit fe8a97d

Please sign in to comment.