initial commit
This commit is contained in:
commit
5210d78d7d
969 changed files with 223828 additions and 0 deletions
30
kirby/src/Query/Parser/Token.php
Normal file
30
kirby/src/Query/Parser/Token.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Kirby\Query\Parser;
|
||||
|
||||
/**
|
||||
* Represents a single token of a particular type
|
||||
* within a query
|
||||
*
|
||||
* @package Kirby Query
|
||||
* @author Roman Steiner <roman@toastlab.ch>,
|
||||
* Nico Hoffmann <nico@getkirby.com>
|
||||
* @link https://getkirby.com
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
* @since 5.1.0
|
||||
* @unstable
|
||||
*/
|
||||
class Token
|
||||
{
|
||||
public function __construct(
|
||||
public TokenType $type,
|
||||
public string $lexeme,
|
||||
public mixed $literal = null,
|
||||
) {
|
||||
}
|
||||
|
||||
public function is(TokenType $type): bool
|
||||
{
|
||||
return $this->type === $type;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue