44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace Aviat\Kilo;
|
|
|
|
class Syntax {
|
|
public const HIGHLIGHT_NUMBERS = (1 << 0);
|
|
public const HIGHLIGHT_STRINGS = (1 << 1);
|
|
|
|
// Tokens for PHP files
|
|
public array $tokens = [];
|
|
|
|
public static function new(
|
|
string $name,
|
|
array $extList = [],
|
|
array $keywords1 = [],
|
|
array $keywords2 = [],
|
|
string $slcs = '//',
|
|
string $mcs = '/*',
|
|
string $mce = '*/',
|
|
int $flags = 0,
|
|
): self
|
|
{
|
|
return new self($name, $extList, $keywords1, $keywords2, $slcs, $mcs, $mce, $flags);
|
|
}
|
|
|
|
private function __construct(
|
|
/** The name of the programming language */
|
|
public string $filetype,
|
|
/** Relevant file extensions for the specified language */
|
|
public array $filematch,
|
|
/** Primary set of language keywords */
|
|
public array $keywords1,
|
|
/** Secondary set of language keywords */
|
|
public array $keywords2,
|
|
/** Syntax to start a single line comment */
|
|
public string $singleLineCommentStart,
|
|
/** Syntax to start a multi-line comment */
|
|
public string $multiLineCommentStart,
|
|
/** Syntax to end a multi-line commment */
|
|
public string $multiLineCommentEnd,
|
|
/** Bitflags configuring the specified language syntax */
|
|
public int $flags,
|
|
) {}
|
|
} |