Skip to content

Commit

Permalink
♻️ Move the code from Verraes\Parsica to Parsica\Parsica namespace
Browse files Browse the repository at this point in the history
As part of moving the package to an organisation, we decided to move the
namespace to Parsica. Sorry if this would break your integration!

/cc @mathiasverraes
  • Loading branch information
turanct committed Feb 20, 2021
1 parent 5f8bf16 commit 4983664
Show file tree
Hide file tree
Showing 80 changed files with 335 additions and 335 deletions.
2 changes: 1 addition & 1 deletion benchmarks/JSONBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

use Verraes\Parsica\JSON\JSON as ParsicaJSON;
use Parsica\Parsica\JSON\JSON as ParsicaJSON;
use Json as BaseMaxJson;

class JSONBench
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"autoload": {
"psr-4": {
"Verraes\\Parsica\\": "src/"
"Parsica\\Parsica\\": "src/"
},
"files": [
"src/characters.php",
Expand Down
8 changes: 4 additions & 4 deletions docs/before.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
// This code is executed by UpToDocs before each code block
require_once __DIR__ . '/../vendor/autoload.php';

use Verraes\Parsica\Parser;
use Verraes\Parsica\ParserHasFailed;
use Verraes\Parsica\StringStream;
use function Verraes\Parsica\{alphaChar,
use Parsica\Parsica\Parser;
use Parsica\Parsica\ParserHasFailed;
use Parsica\Parsica\StringStream;
use function Parsica\Parsica\{alphaChar,
alphaNumChar,
atLeastOne,
between,
Expand Down
6 changes: 3 additions & 3 deletions docs/expressions.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
require_once __DIR__ . '/../vendor/autoload.php';


use Verraes\Parsica\Parser;
use function Verraes\Parsica\Expression\{binaryOperator,
use Parsica\Parsica\Parser;
use function Parsica\Parsica\Expression\{binaryOperator,
expression,
leftAssoc,
postfix,
prefix,
rightAssoc,
unaryOperator};
use function Verraes\Parsica\{atLeastOne, between, char, choice, digitChar, keepFirst, recursive, skipHSpace, string, alphaChar};
use function Parsica\Parsica\{atLeastOne, between, char, choice, digitChar, keepFirst, recursive, skipHSpace, string, alphaChar};
use function PHPUnit\Framework\{assertSame, assertEquals};

assert_options(ASSERT_ACTIVE, 1);
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ In a .php file, make sure the Composer autoloader is included:

Import parsers and combinators:

`use function Verraes\Parsica\char;`
`use function Parsica\Parsica\char;`

You can combine multiple imports in one statement:

`use function Verraes\Parsica\{between, char, atLeastOne, alphaChar};`
`use function Parsica\Parsica\{between, char, atLeastOne, alphaChar};`

Finally, add some code:

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial/05_mapping_to_objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Most of the parsers that come with Parsica, return strings as outputs.
```php
<?php
$parser = digitChar();
assertInstanceOf('Verraes\Parsica\Parser', $parser);
assertInstanceOf('Parsica\Parsica\Parser', $parser);

$result = $parser->tryString('1');
assertIsString('Verraes\Parsica\StringStream', $result->output());
assertIsString('Parsica\Parsica\StringStream', $result->output());
assertEquals('1', $result->output());
```

Expand Down
4 changes: 2 additions & 2 deletions src/Expression/BinaryOperator.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Expression;
namespace Parsica\Parsica\Expression;

use Verraes\Parsica\Parser;
use Parsica\Parsica\Parser;

/**
* @internal
Expand Down
4 changes: 2 additions & 2 deletions src/Expression/ExpressionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Expression;
namespace Parsica\Parsica\Expression;

use Verraes\Parsica\Parser;
use Parsica\Parsica\Parser;

/**
* @internal
Expand Down
18 changes: 9 additions & 9 deletions src/Expression/LeftAssoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Expression;
namespace Parsica\Parsica\Expression;

use Verraes\Parsica\Parser;
use Parsica\Parsica\Parser;
use function Cypress\Curry\curry;
use function Verraes\Parsica\choice;
use function Verraes\Parsica\collect;
use function Verraes\Parsica\Internal\FP\flip;
use function Verraes\Parsica\Internal\FP\foldl;
use function Verraes\Parsica\many;
use function Verraes\Parsica\map;
use function Verraes\Parsica\pure;
use function Parsica\Parsica\choice;
use function Parsica\Parsica\collect;
use function Parsica\Parsica\Internal\FP\flip;
use function Parsica\Parsica\Internal\FP\foldl;
use function Parsica\Parsica\many;
use function Parsica\Parsica\map;
use function Parsica\Parsica\pure;

/**
* @internal
Expand Down
10 changes: 5 additions & 5 deletions src/Expression/NonAssoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Expression;
namespace Parsica\Parsica\Expression;

use Verraes\Parsica\Parser;
use function Verraes\Parsica\choice;
use function Verraes\Parsica\collect;
use function Verraes\Parsica\map;
use Parsica\Parsica\Parser;
use function Parsica\Parsica\choice;
use function Parsica\Parsica\collect;
use function Parsica\Parsica\map;

/**
* @internal
Expand Down
10 changes: 5 additions & 5 deletions src/Expression/Postfix.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Expression;
namespace Parsica\Parsica\Expression;

use Verraes\Parsica\Parser;
use function Verraes\Parsica\choice;
use function Verraes\Parsica\keepFirst;
use function Verraes\Parsica\pure;
use Parsica\Parsica\Parser;
use function Parsica\Parsica\choice;
use function Parsica\Parsica\keepFirst;
use function Parsica\Parsica\pure;

/**
* @internal
Expand Down
8 changes: 4 additions & 4 deletions src/Expression/Prefix.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Expression;
namespace Parsica\Parsica\Expression;

use Verraes\Parsica\Parser;
use function Verraes\Parsica\choice;
use function Verraes\Parsica\pure;
use Parsica\Parsica\Parser;
use function Parsica\Parsica\choice;
use function Parsica\Parsica\pure;

/**
* @internal
Expand Down
18 changes: 9 additions & 9 deletions src/Expression/RightAssoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Expression;
namespace Parsica\Parsica\Expression;

use Verraes\Parsica\Parser;
use Parsica\Parsica\Parser;
use function Cypress\Curry\curry;
use function Verraes\Parsica\choice;
use function Verraes\Parsica\collect;
use function Verraes\Parsica\Internal\FP\foldr;
use function Verraes\Parsica\keepFirst;
use function Verraes\Parsica\many;
use function Verraes\Parsica\map;
use function Verraes\Parsica\pure;
use function Parsica\Parsica\choice;
use function Parsica\Parsica\collect;
use function Parsica\Parsica\Internal\FP\foldr;
use function Parsica\Parsica\keepFirst;
use function Parsica\Parsica\many;
use function Parsica\Parsica\map;
use function Parsica\Parsica\pure;

/**
* @internal
Expand Down
4 changes: 2 additions & 2 deletions src/Expression/UnaryOperator.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Expression;
namespace Parsica\Parsica\Expression;

use Verraes\Parsica\Parser;
use Parsica\Parsica\Parser;

/**
* @internal
Expand Down
8 changes: 4 additions & 4 deletions src/Expression/expression.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Expression;
namespace Parsica\Parsica\Expression;

use Verraes\Parsica\Internal\Assert;
use Verraes\Parsica\Parser;
use function Verraes\Parsica\Internal\FP\foldl;
use Parsica\Parsica\Internal\Assert;
use Parsica\Parsica\Parser;
use function Parsica\Parsica\Internal\FP\foldl;

/**
* Build an expression parser from a term parser and an expression table.
Expand Down
2 changes: 1 addition & 1 deletion src/Internal/Ascii.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Internal;
namespace Parsica\Parsica\Internal;

/**
* @internal
Expand Down
4 changes: 2 additions & 2 deletions src/Internal/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Internal;
namespace Parsica\Parsica\Internal;

use InvalidArgumentException;
use Verraes\Parsica\Parser;
use Parsica\Parsica\Parser;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion src/Internal/EndOfStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Internal;
namespace Parsica\Parsica\Internal;


final class EndOfStream extends \Exception
Expand Down
2 changes: 1 addition & 1 deletion src/Internal/FP.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Internal\FP;
namespace Parsica\Parsica\Internal\FP;

/**
* Swaps the arguments of the callable, returning a callable.
Expand Down
14 changes: 7 additions & 7 deletions src/Internal/Fail.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Internal;
namespace Parsica\Parsica\Internal;

use BadMethodCallException;
use Verraes\Parsica\Parser;
use Verraes\Parsica\ParseResult;
use Verraes\Parsica\ParserHasFailed;
use Verraes\Parsica\Stream;
use function Verraes\Parsica\isEqual;
use function Verraes\Parsica\notPred;
use Parsica\Parsica\Parser;
use Parsica\Parsica\ParseResult;
use Parsica\Parsica\ParserHasFailed;
use Parsica\Parsica\Stream;
use function Parsica\Parsica\isEqual;
use function Parsica\Parsica\notPred;

/**
* The return value of a failed parser.
Expand Down
2 changes: 1 addition & 1 deletion src/Internal/Position.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Internal;
namespace Parsica\Parsica\Internal;

/**
* File, line, and column position of the parser.
Expand Down
10 changes: 5 additions & 5 deletions src/Internal/Succeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Internal;
namespace Parsica\Parsica\Internal;

use BadMethodCallException;
use Exception;
use Verraes\Parsica\Parser;
use Verraes\Parsica\ParseResult;
use Verraes\Parsica\ParserHasFailed;
use Verraes\Parsica\Stream;
use Parsica\Parsica\Parser;
use Parsica\Parsica\ParseResult;
use Parsica\Parsica\ParserHasFailed;
use Parsica\Parsica\Stream;

/**
* @internal
Expand Down
4 changes: 2 additions & 2 deletions src/Internal/TakeResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\Internal;
namespace Parsica\Parsica\Internal;

use Verraes\Parsica\Stream;
use Parsica\Parsica\Stream;

/**
* The result of Stream::take*() functions
Expand Down
6 changes: 3 additions & 3 deletions src/JSON/JSON.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\JSON;
namespace Parsica\Parsica\JSON;

use Verraes\Parsica\Parser;
use function Verraes\Parsica\{any,
use Parsica\Parsica\Parser;
use function Parsica\Parsica\{any,
anySingleBut,
between,
char,
Expand Down
6 changes: 3 additions & 3 deletions src/PHPUnit/ParserAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica\PHPUnit;
namespace Parsica\Parsica\PHPUnit;

use Exception;
use Verraes\Parsica\Parser;
use Verraes\Parsica\StringStream;
use Parsica\Parsica\Parser;
use Parsica\Parsica\StringStream;

/**
* Convenience assertion methods. When writing tests for your own parsers, extend from this instead of PHPUnit's TestCase.
Expand Down
4 changes: 2 additions & 2 deletions src/ParseResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica;
namespace Parsica\Parsica;

use BadMethodCallException;
use Verraes\Parsica\Internal\Position;
use Parsica\Parsica\Internal\Position;

/**
* @template T
Expand Down
4 changes: 2 additions & 2 deletions src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
* file that was distributed with this source code.
*/

namespace Verraes\Parsica;
namespace Parsica\Parsica;

use Exception;
use Verraes\Parsica\Internal\Fail;
use Parsica\Parsica\Internal\Fail;

/**
* A parser is any function that takes a string input and returns a {@see ParseResult}. The Parser class is a wrapper
Expand Down
Loading

0 comments on commit 4983664

Please sign in to comment.