TextMate-style syntax highlighting in PHP
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

39 lines
1.4 KiB

<?php
/** @license MIT
* Copyright 2021 Dustin Wilson et al.
* See LICENSE file for details */
declare(strict_types=1);
namespace dW\Lit\Grammar;
use dW\Lit\FauxReadOnly;
use dW\Lit\Grammar;
/** Contains patterns responsible for matching a portion of the document */
class Rule {
use FauxReadOnly;
protected bool $_applyEndPatternLast = false;
protected ?string $_begin;
protected ?CaptureList $_beginCaptures;
protected ?CaptureList $_captures;
protected ?string $_contentName;
protected ?string $_end;
protected ?CaptureList $_endCaptures;
protected ?string $_match;
protected ?string $_name;
protected ?RuleList $_patterns;
public function __construct(?string $name = null, ?string $contentName = null, ?string $begin = null, ?string $end = null, ?string $match = null, ?RuleList $rules = null, ?CaptureList $captures = null, ?CaptureList $beginCaptures = null, ?CaptureList $endCaptures = null, bool $applyEndPatternLast = false) {
$this->_name = $name;
$this->_contentName = $contentName;
$this->_begin = $begin;
$this->_end = $end;
$this->_match = $match;
$this->_patterns = $rules;
$this->_captures = $captures;
$this->_beginCaptures = $beginCaptures;
$this->_endCaptures = $endCaptures;
$this->_applyEndPatternLast = $applyEndPatternLast;
}
}