php-kilo/src/Syntax.php

41 lines
946 B
PHP
Raw Normal View History

2019-10-24 16:58:52 -04:00
<?php declare(strict_types=1);
namespace Kilo;
class Syntax {
public const HIGHLIGHT_NUMBERS = (1 << 0);
2019-10-25 11:49:04 -04:00
public const HIGHLIGHT_STRINGS = (1 << 1);
2019-10-24 16:58:52 -04:00
public string $filetype = '';
public array $filematch = [];
2019-10-25 16:36:03 -04:00
public string $singleLineCommentStart = '//';
2019-10-25 16:36:03 -04:00
public string $multiLineCommentStart = '/*';
public string $multiLineCommentEnd = '*/';
public array $keywords1 = [];
public array $keywords2 = [];
2019-10-24 16:58:52 -04:00
public int $flags = 0;
2019-10-25 16:36:03 -04:00
public static function new(string $name, array $extList, array $keywords1, array $keywords2, string $slcs, string $mcs, string $mce, int $flags): self
2019-10-24 16:58:52 -04:00
{
$self = new self();
$self->filetype = $name;
$self->filematch = $extList;
$self->keywords1 = $keywords1;
$self->keywords2 = $keywords2;
$self->singleLineCommentStart = $slcs;
2019-10-25 16:36:03 -04:00
$self->multiLineCommentStart = $mcs;
$self->multiLineCommentEnd = $mce;
2019-10-24 16:58:52 -04:00
$self->flags = $flags;
return $self;
}
private function __construct() {}
}