mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 21:53:35 +00:00
004ccfdb5c
This implements T230982#5475400, and it should speed up the CachingParser by roughly 40%. Bug: T230982 Change-Id: I803cc58637d50eb90e57decf243f5ca78075d63d
28 lines
564 B
PHP
28 lines
564 B
PHP
<?php
|
|
|
|
/**
|
|
* A class representing a whole AST generated by AFPTreeParser, holding AFPTreeNode's. This wrapper
|
|
* could be expanded in the future. For now, it's mostly useful for typehints, and to have an
|
|
* evalTree function in the CachingParser.
|
|
*/
|
|
class AFPSyntaxTree {
|
|
/**
|
|
* @var AFPTreeNode|null
|
|
*/
|
|
private $rootNode;
|
|
|
|
/**
|
|
* @param AFPTreeNode|null $root
|
|
*/
|
|
public function __construct( AFPTreeNode $root = null ) {
|
|
$this->rootNode = $root;
|
|
}
|
|
|
|
/**
|
|
* @return AFPTreeNode|null
|
|
*/
|
|
public function getRoot() {
|
|
return $this->rootNode;
|
|
}
|
|
}
|