mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-23 15:16:56 +00:00
Rename TexVC in PHP to WikiTexVC
Change-Id: Idd98205ea291640b01946374f15c807da7fc26e5
This commit is contained in:
parent
9abb258422
commit
a82727f61f
|
@ -1,2 +1,2 @@
|
|||
/vendor/
|
||||
/tests/phpunit/unit/TexVC/
|
||||
/tests/phpunit/unit/WikiTexVC/
|
||||
|
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,5 +1,5 @@
|
|||
src/TexVC/test.4.1.1.php
|
||||
src/TexVC/test.4.1.2.php
|
||||
src/WikiTexVC/test.4.1.1.php
|
||||
src/WikiTexVC/test.4.1.2.php
|
||||
.DS_Store
|
||||
/nbproject/private/
|
||||
node_modules/
|
||||
|
|
|
@ -19,7 +19,7 @@ $cfg['exclude_analysis_directory_list'] = array_merge(
|
|||
'../../extensions/Wikibase/client',
|
||||
'../../extensions/Wikibase/repo',
|
||||
'../../extensions/Wikibase/lib',
|
||||
'./src/TexVC/Parser.php',
|
||||
'./src/WikiTexVC/Parser.php',
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
|
||||
</rule>
|
||||
<rule ref="Generic.Files.LineLength.TooLong">
|
||||
<exclude-pattern>/src/TexVC/Mhchem/MhchemPatterns.php</exclude-pattern>
|
||||
<exclude-pattern>/src/TexVC/Mhchem/MhchemStateMachines.php</exclude-pattern>
|
||||
<exclude-pattern>/src/WikiTexVC/Mhchem/MhchemPatterns.php</exclude-pattern>
|
||||
<exclude-pattern>/src/WikiTexVC/Mhchem/MhchemStateMachines.php</exclude-pattern>
|
||||
</rule>
|
||||
<exclude-pattern>/src/TexVC/Parser.php</exclude-pattern>
|
||||
<exclude-pattern>/src/WikiTexVC/Parser.php</exclude-pattern>
|
||||
<file>.</file>
|
||||
<arg name="extensions" value="php" />
|
||||
<arg name="encoding" value="UTF-8" />
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"test": [
|
||||
"parallel-lint . --exclude vendor --exclude node_modules --exclude src/TexVC/Parser.php",
|
||||
"parallel-lint . --exclude vendor --exclude node_modules --exclude src/WikiTexVC/Parser.php",
|
||||
"@phpcs",
|
||||
"minus-x check ."
|
||||
],
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
"DummyPropertyDataTypeLookup": "tests/phpunit/DummyPropertyDataTypeLookup.php",
|
||||
"MediaWiki\\Extension\\Math\\Tests\\MathWikibaseConnectorTestFactory": "tests/phpunit/unit/MathWikibaseConnectorTestFactory.php",
|
||||
"MediaWiki\\Extension\\Math\\Tests\\MathMockHttpTrait": "tests/phpunit/MathMockHttpTrait.php",
|
||||
"MediaWiki\\Extension\\Math\\TexVC\\MMLmappings\\Util\\MMLTestUtilHTML": "tests/phpunit/unit/TexVC/MMLTestUtilHTML.php",
|
||||
"MediaWiki\\Extension\\Math\\TexVC\\MMLmappings\\Util\\MMLTestUtil": "tests/phpunit/unit/TexVC/MMLTestUtil.php",
|
||||
"MediaWiki\\Extension\\Math\\TexVC\\MMLmappings\\Util\\MMLComparator": "tests/phpunit/unit/TexVC/MMLComparator.php"
|
||||
"MediaWiki\\Extension\\Math\\WikiTexVC\\MMLmappings\\Util\\MMLTestUtilHTML": "tests/phpunit/unit/WikiTexVC/MMLTestUtilHTML.php",
|
||||
"MediaWiki\\Extension\\Math\\WikiTexVC\\MMLmappings\\Util\\MMLTestUtil": "tests/phpunit/unit/WikiTexVC/MMLTestUtil.php",
|
||||
"MediaWiki\\Extension\\Math\\WikiTexVC\\MMLmappings\\Util\\MMLComparator": "tests/phpunit/unit/WikiTexVC/MMLComparator.php"
|
||||
},
|
||||
"DefaultUserOptions": {
|
||||
"math": "mathml"
|
||||
|
|
|
@ -26,7 +26,7 @@ require_once __DIR__ . '/../../../maintenance/Maintenance.php';
|
|||
/**
|
||||
* From a specified json file with (La)TeX formula as input,
|
||||
* create a json file with the Tex and corresponding MathML.
|
||||
* This is mostly used for generating Test-Content for the MathML features of TexVC(PHP).
|
||||
* This is mostly used for generating Test-Content for the MathML features of WikiTexVC.
|
||||
*
|
||||
* The script fetches:
|
||||
* - Mathoid MathML (mode: 'mathml')
|
||||
|
|
|
@ -19,8 +19,8 @@ const { program } = require( 'commander' );
|
|||
const peggy = require( 'peggy' );
|
||||
const phpeggy = require( 'phpeggy' );
|
||||
const fs = require( 'fs' );
|
||||
const DEFAULT_PATH_INPUT = './src/TexVC/parser.pegjs';
|
||||
const DEFAULT_PATH_OUTPUT = './src/TexVC/Parser.php';
|
||||
const DEFAULT_PATH_INPUT = './src/WikiTexVC/parser.pegjs';
|
||||
const DEFAULT_PATH_OUTPUT = './src/WikiTexVC/Parser.php';
|
||||
const PHP_INSERTION_LINE = 9; // indicates where the 'use_xyz' statements are inserted
|
||||
|
||||
program
|
||||
|
@ -32,8 +32,8 @@ program
|
|||
.option( '-d, --debug',
|
||||
'debug logging activated', false )
|
||||
.description( 'Generates Parser.php as output from parser.pegjs as input. ' +
|
||||
'This is used for for updating the parser expression grammar in TexVC ' +
|
||||
'which is located in src/TexVC' )
|
||||
'This is used for for updating the parser expression grammar in WikiTexVC ' +
|
||||
'which is located in src/WikiTexVC' )
|
||||
.version( '0.1.0' );
|
||||
|
||||
program.parse();
|
||||
|
@ -48,35 +48,35 @@ let parser = peggy.generate( parserPeg, {
|
|||
plugins: [ phpeggy ],
|
||||
cache: true,
|
||||
phpeggy: {
|
||||
parserNamespace: 'MediaWiki\\Extension\\Math\\TexVC'
|
||||
parserNamespace: 'MediaWiki\\Extension\\Math\\WikiTexVC'
|
||||
}
|
||||
} );
|
||||
|
||||
const useStatements =
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Box;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Big;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\ChemFun2u;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\ChemWord;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Curly;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Declh;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Dollar;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\DQ;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\FQ;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Fun1;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Fun1nb;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Fun2;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Fun2nb;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Fun2sq;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Fun4;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Infix;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Literal;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Lr;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Matrix;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\Mhchem;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\UQ;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\Nodes\\TexArray;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\TexUtil;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\TexVC\\ParserUtil;';
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Box;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Big;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\ChemFun2u;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\ChemWord;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Curly;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Declh;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Dollar;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\DQ;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\FQ;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Fun1;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Fun1nb;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Fun2;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Fun2nb;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Fun2sq;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Fun4;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Infix;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Literal;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Lr;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Matrix;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\Mhchem;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\UQ;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\Nodes\\TexArray;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\TexUtil;\n' +
|
||||
'use MediaWiki\\Extension\\Math\\WikiTexVC\\ParserUtil;';
|
||||
|
||||
function addUseStatements( p, lineStart = PHP_INSERTION_LINE ) {
|
||||
// Adding the specified use statements
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Downloads files which contain input and supposed output for some tests of TexVC within this extension.
|
||||
# Downloads files which contain input and supposed output for some tests of WikiTexVC within this extension.
|
||||
|
||||
# The tests are deactivated by default. They can be found and activated with a flag in:
|
||||
# - EnWikiFormulaeTest.php
|
||||
# - ChemRegressionTest.php
|
||||
|
||||
# Downloads the file containing all english wikipedia formula to the testfolder
|
||||
FILEPATH=../tests/phpunit/unit/TexVC/en-wiki-formulae-good.json
|
||||
FILEPATH=../tests/phpunit/unit/WikiTexVC/en-wiki-formulae-good.json
|
||||
URL=https://raw.githubusercontent.com/wikimedia/mediawiki-services-texvcjs/ca9b33d3b5081ae78829af4c65322becb4f4a216/test/en-wiki-formulae-good.json
|
||||
curl $URL -o $FILEPATH
|
||||
|
||||
# Downloads the file containing for chem-regression tests to the testfolder
|
||||
FILEPATH=../tests/phpunit/unit/TexVC/chem-regression.json
|
||||
FILEPATH=../tests/phpunit/unit/WikiTexVC/chem-regression.json
|
||||
URL=https://raw.githubusercontent.com/wikimedia/mediawiki-services-texvcjs/fb56991251b8889b554fc42ef9fe4825bc35d0ed/test/chem-regression.json
|
||||
curl $URL -o $FILEPATH
|
||||
|
||||
# Downloads the file containing reference renderings for all english wikipedia chem-regression tests to the testfolder
|
||||
FILEPATH=../tests/phpunit/unit/TexVC/en-wiki-formulae-good-reference.json
|
||||
FILEPATH=../tests/phpunit/unit/WikiTexVC/en-wiki-formulae-good-reference.json
|
||||
URL=https://zenodo.org/record/7494266/files/normalized.json?download=1
|
||||
curl $URL -o $FILEPATH
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
require_once __DIR__ . '/../../../maintenance/Maintenance.php';
|
||||
|
||||
// phpcs:disable MediaWiki.Files.ClassMatchesFilename.NotMatch
|
||||
class TexVcCli extends Maintenance {
|
||||
class WikiTexVcCli extends Maintenance {
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
@ -39,7 +39,7 @@ class TexVcCli extends Maintenance {
|
|||
*/
|
||||
public function execute() {
|
||||
$userInputTex = $this->getArg( 0 );
|
||||
$texvc = new MediaWiki\Extension\Math\TexVC\TexVC();
|
||||
$texvc = new MediaWiki\Extension\Math\WikiTexVC\TexVC();
|
||||
$options = [ 'usemhchem' => $this->getOption( 'chem' ) ];
|
||||
$result = $texvc->check( $userInputTex, $options );
|
||||
if ( $result['status'] !== '+' ) {
|
||||
|
@ -50,6 +50,6 @@ class TexVcCli extends Maintenance {
|
|||
}
|
||||
}
|
||||
|
||||
$maintClass = TexVcCli::class;
|
||||
$maintClass = WikiTexVcCli::class;
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
require_once RUN_MAINTENANCE_IF_MAIN;
|
||||
|
|
|
@ -84,7 +84,7 @@ class InputCheckFactory {
|
|||
/**
|
||||
* @param string $input input string to be checked
|
||||
* @param string $type type of input (only 'tex')
|
||||
* @return LocalChecker checker based on php implementation of TexVC within Math-extension
|
||||
* @return LocalChecker checker based on php implementation of WikiTexVC within Math-extension
|
||||
*/
|
||||
public function newLocalChecker( string $input, string $type ): LocalChecker {
|
||||
return new LocalChecker(
|
||||
|
@ -96,7 +96,7 @@ class InputCheckFactory {
|
|||
|
||||
/**
|
||||
* Creates an instance of BaseChecker based on the configuration parameter for the texVC Service.
|
||||
* By default, this sets the checker to the local PHP variant of TexVC.
|
||||
* By default, this sets the checker to the local PHP variant of WikiTexVC.
|
||||
*
|
||||
* @param string $input input string which is checked
|
||||
* @param string $type input type, for some configurations this has to be 'tex'
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace MediaWiki\Extension\Math\InputCheck;
|
|||
use Exception;
|
||||
use MediaWiki\Extension\Math\Hooks\HookRunner;
|
||||
use MediaWiki\Extension\Math\MathRenderer;
|
||||
use MediaWiki\Extension\Math\TexVC\TexVC;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\TexVC;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
use Message;
|
||||
use WANObjectCache;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
namespace MediaWiki\Extension\Math;
|
||||
|
||||
use MediaWiki\Extension\Math\InputCheck\LocalChecker;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmath;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmath;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\Title\Title;
|
||||
use SpecialPage;
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
<?php
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants;
|
||||
|
||||
class Misc {
|
||||
public const P_HEIGHT = 1.2 / 0.85;
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\Lengths\MathSpace;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\Align;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\TexClass;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\Variants;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\Util\MMLutil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Lengths\MathSpace;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\Align;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\TexClass;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\Variants;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Util\MMLutil;
|
||||
|
||||
/**
|
||||
* Based on AMSMappings.js in MML3
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\Lengths\MathSpace;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\Notation;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\Tag;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\TexClass;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\Variants;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\Util\MMLutil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Lengths\MathSpace;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\Notation;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\Tag;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\TexClass;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\Variants;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Util\MMLutil;
|
||||
|
||||
/**
|
||||
* Based on BaseMappings.js in MML3
|
|
@ -1,17 +1,17 @@
|
|||
<?php
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings;
|
||||
|
||||
use ArgumentCountError;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\Variants;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\Util\MMLutil;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmerror;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmi;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmo;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmspace;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmstyle;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmtext;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\TexNode;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\Variants;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Util\MMLutil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmerror;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmi;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmo;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmspace;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmstyle;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmtext;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\TexNode;
|
||||
|
||||
/**
|
||||
* This contains the basic parsing methods for tex elements, which get invoked
|
|
@ -1,48 +1,48 @@
|
|||
<?php
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings;
|
||||
|
||||
use IntlChar;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\Misc;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\Sizes;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\Tag;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\TexClass;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\Variants;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\Util\MMLParsingUtil;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\Util\MMLutil;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmenclose;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmerror;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmfrac;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmi;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmmultiscripts;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmo;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmover;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmpadded;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmphantom;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmroot;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmspace;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmsqrt;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmstyle;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmsub;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmsup;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmtable;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmtd;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmtext;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmtr;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmunder;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmunderover;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Curly;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\DQ;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\FQ;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Fun1;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Fun1nb;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Fun2;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Fun2sq;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Fun4;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Literal;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\TexArray;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\TexNode;
|
||||
use MediaWiki\Extension\Math\TexVC\TexVC;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\Misc;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\Sizes;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\Tag;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\TexClass;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\Variants;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Util\MMLParsingUtil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Util\MMLutil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmenclose;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmerror;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmfrac;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmi;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmmultiscripts;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmo;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmover;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmpadded;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmphantom;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmroot;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmspace;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmsqrt;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmstyle;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmsub;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmsup;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmtable;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmtd;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmtext;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmtr;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmunder;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmunderover;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Curly;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\DQ;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\FQ;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun1;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun1nb;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2sq;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun4;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Literal;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\TexArray;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\TexNode;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\TexVC;
|
||||
|
||||
/**
|
||||
* Parsing functions for specific recognized mappings.
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings\Lengths;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Lengths;
|
||||
|
||||
class MathSpace {
|
||||
public const VERYVERYTHINMATHSPACE = 1 / 18;
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings\Lengths;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Lengths;
|
||||
|
||||
class RelUnits {
|
||||
public const EM = 1;
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings\Lengths;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Lengths;
|
||||
|
||||
class Units {
|
||||
public const PX = 1;
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\Util\MMLutil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Util\MMLutil;
|
||||
|
||||
/**
|
||||
* Based on OperatorDictionary.js in MML3
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants;
|
||||
|
||||
class Align {
|
||||
public const TOP = 'top';
|
6
src/WikiTexVC/MMLmappings/TexConstants/Misc.php
Normal file
6
src/WikiTexVC/MMLmappings/TexConstants/Misc.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants;
|
||||
|
||||
class Misc {
|
||||
public const P_HEIGHT = 1.2 / 0.85;
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants;
|
||||
|
||||
class Notation {
|
||||
public const LONGDIV = 'longdiv';
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants;
|
||||
|
||||
class Sizes {
|
||||
public const VERYVERYTHINMATHSPACE = 1 / 18 . "em";
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants;
|
||||
|
||||
/**
|
||||
* This class contains the string how tags are written
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants;
|
||||
|
||||
class TexClass {
|
||||
public const ORD = "ORD";
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants;
|
||||
|
||||
class Variants {
|
||||
public const NORMAL = 'normal';
|
|
@ -1,14 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings\Util;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Util;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\Tag;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\TexClass;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\Variants;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmo;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmpadded;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmtext;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\Tag;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\TexClass;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\Variants;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmo;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmpadded;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmtext;
|
||||
|
||||
/**
|
||||
* This class contains functionalities for MML-node
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings\Util;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Util;
|
||||
|
||||
use IntlChar;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Curly;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Literal;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Curly;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Literal;
|
||||
|
||||
/**
|
||||
* Utility Methods for parsing Tex to MathML
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
use Html;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\Tag;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\Tag;
|
||||
|
||||
class MMLbase {
|
||||
private string $name;
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
class MMLmath extends MMLbase {
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\TexClass;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\TexClass;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\TexClass;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\TexClass;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLnodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes;
|
||||
|
||||
/**
|
||||
* Presentation MathML 3 Element
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Mhchem;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Mhchem;
|
||||
|
||||
use MediaWiki\Logger\LoggerFactory;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
@ -58,7 +58,7 @@ class MhchemParser {
|
|||
/**
|
||||
* @param string $input input formula in tex eventually containing chemical environments or physical units
|
||||
* @param string $type currently ce or pu (physical units)
|
||||
* @param bool $optimizeMhchemForTexVC optimize the output of mhchem for usage in TexVC, usually extra curlies
|
||||
* @param bool $optimizeMhchemForTexVC optimize the output of mhchem for usage in WikiTexVC, usually extra curlies
|
||||
* surrounding parameters which specify dimensions
|
||||
* @return string
|
||||
*/
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Mhchem;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Mhchem;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\Mhchem\MhchemRegExp as Reg;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Mhchem\MhchemRegExp as Reg;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
|
@ -6,7 +6,7 @@
|
|||
* The original license for this software can be found in the accompanying LICENSE.mhchemParser-ts.txt file.
|
||||
*/
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Mhchem;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Mhchem;
|
||||
|
||||
/**
|
||||
* Wrapper class to declare a hardcoded string to a regular expression.
|
|
@ -8,10 +8,10 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Mhchem;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Mhchem;
|
||||
|
||||
use Closure;
|
||||
use MediaWiki\Extension\Math\TexVC\MHChem\MhchemUtil as MU;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MHChem\MhchemUtil as MU;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
|
@ -6,9 +6,9 @@
|
|||
* The original license for this software can be found in the accompanying LICENSE.mhchemParser-ts.txt file.
|
||||
*/
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Mhchem;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Mhchem;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MHChem\MhchemUtil as MU;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MHChem\MhchemUtil as MU;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
|
@ -22,12 +22,12 @@ use RuntimeException;
|
|||
*/
|
||||
class MhchemTexify {
|
||||
|
||||
/** @var bool optimize the output TeX for TexVC */
|
||||
/** @var bool optimize the output TeX for WikiTexVC */
|
||||
private bool $optimizeForTexVC;
|
||||
|
||||
/**
|
||||
* Takes MhchemParser output and convert it to TeX
|
||||
* @param bool $optimizeForTexVC optimizes the output for TexVC grammar by
|
||||
* @param bool $optimizeForTexVC optimizes the output for WikiTexVC grammar by
|
||||
* wrapping dimensions for some TeX commands in curly brackets.
|
||||
*/
|
||||
public function __construct( bool $optimizeForTexVC = false ) {
|
|
@ -6,7 +6,7 @@
|
|||
* The original license for this software can be found in the accompanying LICENSE.mhchemParser-ts.txt file.
|
||||
*/
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Mhchem;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Mhchem;
|
||||
|
||||
/**
|
||||
* Some utility classes mostly for creating similar functionalities
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
class Big extends TexNode {
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmtext;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmtext;
|
||||
|
||||
class Box extends TexNode {
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
class ChemFun2u extends TexNode {
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmtext;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmtext;
|
||||
|
||||
class ChemWord extends TexNode {
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
class Curly extends TexNode {
|
||||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\BaseParsing;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmsub;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmunder;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\BaseParsing;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmsub;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmunder;
|
||||
|
||||
class DQ extends TexNode {
|
||||
/** @var TexNode */
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
class Declh extends TexNode {
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
class Dollar extends TexNode {
|
||||
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\BaseParsing;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmstyle;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmsubsup;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmunderover;
|
||||
use MediaWiki\Extension\Math\TexVC\TexUtil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\BaseParsing;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmstyle;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmsubsup;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmunderover;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\TexUtil;
|
||||
|
||||
class FQ extends TexNode {
|
||||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmo;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmover;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\TexVC\TexUtil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmo;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmover;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\TexUtil;
|
||||
|
||||
class Fun1 extends TexNode {
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
class Fun1nb extends Fun1 {
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
class Fun2 extends TexNode {
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
class Fun2nb extends Fun2 {
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
class Fun2sq extends Fun2 {
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
class Fun4 extends TexNode {
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
class Infix extends TexNode {
|
||||
|
|
@ -2,17 +2,17 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\BaseMethods;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\Util\MMLutil;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmi;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmn;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmo;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmpadded;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmstyle;
|
||||
use MediaWiki\Extension\Math\TexVC\TexUtil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\BaseMethods;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Util\MMLutil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmi;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmn;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmo;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmpadded;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmstyle;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\TexUtil;
|
||||
|
||||
class Literal extends TexNode {
|
||||
|
||||
|
@ -50,7 +50,7 @@ class Literal extends TexNode {
|
|||
}
|
||||
|
||||
// This is rather a workaround:
|
||||
// Sometimes literals from TexVC contain complete \\operatorname {asd} hinted as bug tex-2-mml.json
|
||||
// Sometimes literals from WikiTexVC contain complete \\operatorname {asd} hinted as bug tex-2-mml.json
|
||||
if ( str_contains( $input, "\\operatorname" ) ) {
|
||||
$mi = new MMLmi();
|
||||
return $mi->encapsulateRaw( $operatorContent["foundOC"] );
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\BaseMethods;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\TexConstants\TexClass;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmo;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\BaseMethods;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\TexConstants\TexClass;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmo;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmrow;
|
||||
|
||||
class Lr extends TexNode {
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
class Mhchem extends Fun1 {
|
||||
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\BaseMappings;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\Util\MMLParsingUtil;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\Util\MMLutil;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmo;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmstyle;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmsup;
|
||||
use MediaWiki\Extension\Math\TexVC\TexUtil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\BaseMappings;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Util\MMLParsingUtil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Util\MMLutil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmo;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmstyle;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmsup;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\TexUtil;
|
||||
|
||||
class TexArray extends TexNode {
|
||||
|
||||
|
@ -180,7 +180,7 @@ class TexArray extends TexNode {
|
|||
}
|
||||
|
||||
public function renderMML( $arguments = [], $state = [] ) {
|
||||
// Everything here is for parsing displaystyle, probably refactored to TexVC grammar later
|
||||
// Everything here is for parsing displaystyle, probably refactored to WikiTexVC grammar later
|
||||
$fullRenderedArray = "";
|
||||
$mmlStyles = [];
|
||||
$currentColor = null;
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLmappings\BaseMethods;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLmappings\BaseMethods;
|
||||
|
||||
class TexNode {
|
||||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\Nodes;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\Nodes;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmi;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmover;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\TexVC\MMLnodes\MMLmsup;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmi;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmover;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmrow;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmsup;
|
||||
|
||||
class UQ extends TexNode {
|
||||
|
|
@ -5,42 +5,42 @@
|
|||
* https://peggyjs.org/
|
||||
*/
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Box;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Big;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\ChemFun2u;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\ChemWord;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Curly;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Declh;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Dollar;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\DQ;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\FQ;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Fun1;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Fun1nb;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Fun2;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Fun2nb;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Fun2sq;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Fun4;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Infix;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Literal;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Lr;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Matrix;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\Mhchem;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\UQ;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\TexArray;
|
||||
use MediaWiki\Extension\Math\TexVC\TexUtil;
|
||||
use MediaWiki\Extension\Math\TexVC\ParserUtil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Box;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Big;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\ChemFun2u;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\ChemWord;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Curly;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Declh;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Dollar;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\DQ;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\FQ;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun1;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun1nb;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2nb;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2sq;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun4;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Infix;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Literal;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Lr;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Matrix;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\Mhchem;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\UQ;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\TexArray;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\TexUtil;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\ParserUtil;
|
||||
/* Useful functions: */
|
||||
|
||||
/* chr_unicode - get unicode character from its char code */
|
||||
if (!function_exists("MediaWiki\\Extension\\Math\\TexVC\\chr_unicode")) {
|
||||
if (!function_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\chr_unicode")) {
|
||||
function chr_unicode($code) {
|
||||
return html_entity_decode("&#$code;", ENT_QUOTES, "UTF-8");
|
||||
}
|
||||
}
|
||||
/* ord_unicode - get unicode char code from string */
|
||||
if (!function_exists("MediaWiki\\Extension\\Math\\TexVC\\ord_unicode")) {
|
||||
if (!function_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\ord_unicode")) {
|
||||
function ord_unicode($character) {
|
||||
if (strlen($character) === 1) {
|
||||
return ord($character);
|
||||
|
@ -56,7 +56,7 @@ if (!function_exists("MediaWiki\\Extension\\Math\\TexVC\\ord_unicode")) {
|
|||
}
|
||||
}
|
||||
/* peg_regex_test - multibyte regex test */
|
||||
if (!function_exists("MediaWiki\\Extension\\Math\\TexVC\\peg_regex_test")) {
|
||||
if (!function_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\peg_regex_test")) {
|
||||
function peg_regex_test($pattern, $string) {
|
||||
if (substr($pattern, -1) == "i") {
|
||||
return mb_eregi(substr($pattern, 1, -2), $string);
|
||||
|
@ -67,7 +67,7 @@ if (!function_exists("MediaWiki\\Extension\\Math\\TexVC\\peg_regex_test")) {
|
|||
}
|
||||
|
||||
/* Syntax error exception */
|
||||
if (!class_exists("MediaWiki\\Extension\\Math\\TexVC\\SyntaxError", false)) {
|
||||
if (!class_exists("MediaWiki\\Extension\\Math\\WikiTexVC\\SyntaxError", false)) {
|
||||
class SyntaxError extends \Exception {
|
||||
public $expected;
|
||||
public $found;
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\TexArray;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\TexArray;
|
||||
|
||||
class ParserUtil {
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
|
@ -2,17 +2,17 @@
|
|||
|
||||
declare( strict_types = 1 );
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC;
|
||||
|
||||
use Exception;
|
||||
use MediaWiki\Extension\Math\TexVC\Mhchem\MhchemParser;
|
||||
use MediaWiki\Extension\Math\TexVC\Nodes\TexArray;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Mhchem\MhchemParser;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\Nodes\TexArray;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* A TeX/LaTeX validator.
|
||||
* TexVC(PHP) takes user input and validates it while replacing
|
||||
* MediaWiki-specific functions. It is a PHP port of the JavaScript port of texvc,
|
||||
* A TeX/LaTeX validator and MathML converter.
|
||||
* WikiTexVC takes user input and validates it while replacing
|
||||
* MediaWiki-specific functions. The validator component is a PHP port of the JavaScript port of texvc,
|
||||
* which was originally written in Ocaml for the Math extension.
|
||||
*
|
||||
* @author Johannes Stegmüller
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\Tests\TexVC;
|
||||
namespace MediaWiki\Extension\Math\Tests\WikiTexVC;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\TexVC;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\TexVC;
|
||||
use MediaWikiUnitTestCase;
|
||||
|
||||
/**
|
||||
* @covers \MediaWiki\Extension\Math\TexVC\TexVC
|
||||
* @covers \MediaWiki\Extension\Math\TexVC\Parser
|
||||
* @covers \MediaWiki\Extension\Math\TexVC\TexUtil
|
||||
* @covers \MediaWiki\Extension\Math\TexVC\ParserUtil
|
||||
* @covers \MediaWiki\Extension\Math\WikiTexVC\TexVC
|
||||
* @covers \MediaWiki\Extension\Math\WikiTexVC\Parser
|
||||
* @covers \MediaWiki\Extension\Math\WikiTexVC\TexUtil
|
||||
* @covers \MediaWiki\Extension\Math\WikiTexVC\ParserUtil
|
||||
*/
|
||||
class AllTest extends MediaWikiUnitTestCase {
|
||||
private $testCases;
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\Tests\TexVC;
|
||||
namespace MediaWiki\Extension\Math\Tests\WikiTexVC;
|
||||
|
||||
use MediaWiki\Extension\Math\TexVC\SyntaxError;
|
||||
use MediaWiki\Extension\Math\TexVC\TexVC;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\SyntaxError;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\TexVC;
|
||||
use MediaWikiUnitTestCase;
|
||||
|
||||
/**
|
||||
* @covers \MediaWiki\Extension\Math\TexVC\TexVC
|
||||
* @covers \MediaWiki\Extension\Math\TexVC\Parser
|
||||
* @covers \MediaWiki\Extension\Math\TexVC\TexUtil
|
||||
* @covers \MediaWiki\Extension\Math\TexVC\ParserUtil
|
||||
* @covers \MediaWiki\Extension\Math\WikiTexVC\TexVC
|
||||
* @covers \MediaWiki\Extension\Math\WikiTexVC\Parser
|
||||
* @covers \MediaWiki\Extension\Math\WikiTexVC\TexUtil
|
||||
* @covers \MediaWiki\Extension\Math\WikiTexVC\ParserUtil
|
||||
*/
|
||||
class ApiTest extends MediaWikiUnitTestCase {
|
||||
private $testCases;
|
|
@ -1,14 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\Tests\TexVC;
|
||||
namespace MediaWiki\Extension\Math\Tests\WikiTexVC;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use MediaWiki\Extension\Math\TexVC\TexVC;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\TexVC;
|
||||
use MediaWikiUnitTestCase;
|
||||
|
||||
/**
|
||||
* @covers \MediaWiki\Extension\Math\TexVC\TexVC
|
||||
* @covers \MediaWiki\Extension\Math\TexVC\Parser
|
||||
* @covers \MediaWiki\Extension\Math\WikiTexVC\TexVC
|
||||
* @covers \MediaWiki\Extension\Math\WikiTexVC\Parser
|
||||
* @group Stub
|
||||
*/
|
||||
class ChemRegressionTest extends MediaWikiUnitTestCase {
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\Tests\TexVC;
|
||||
namespace MediaWiki\Extension\Math\Tests\WikiTexVC;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use MediaWiki\Extension\Math\TexVC\TexVC;
|
||||
use MediaWiki\Extension\Math\WikiTexVC\TexVC;
|
||||
use MediaWikiUnitTestCase;
|
||||
|
||||
/**
|
||||
|
@ -12,7 +12,7 @@ use MediaWikiUnitTestCase;
|
|||
* These tests can be run locally by enabling the ACTIVE flag.
|
||||
* File download of the json-input can be done by running:
|
||||
* $ cd maintenance && ./downloadMoreTexVCtests.sh
|
||||
* @covers \MediaWiki\Extension\Math\TexVC\Parser
|
||||
* @covers \MediaWiki\Extension\Math\WikiTexVC\Parser
|
||||
* @group Stub
|
||||
*/
|
||||
class EnWikiFormulaeTest extends MediaWikiUnitTestCase {
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\Math\TexVC\MMLmappings\Util;
|
||||
namespace MediaWiki\Extension\Math\WikiTexVC\MMLmappings\Util;
|
||||
|
||||
/**
|
||||
* Algorithm to make a simple, but customizable comparison of two MathML-Strings for automated testing.
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue