Add Composer, highlight.php, bunch of restructuring of paste.php

This commit is contained in:
Floorb 2021-08-20 15:53:06 -04:00
parent 248cc0fb10
commit 6d518cc008
318 changed files with 36414 additions and 199 deletions

19
composer.json Normal file
View file

@ -0,0 +1,19 @@
{
"name": "aftercase/ponepaste",
"description": "PonePaste can store green",
"minimum-stability": "stable",
"license": "proprietary",
"authors": [
{
"name": "aftercase"
},
{
"name": "appledash"
}
],
"require": {
"scrivo/highlight.php": "v9.18.1.7",
"ext-pdo": "*",
"ext-openssl": "*"
}
}

95
composer.lock generated Normal file
View file

@ -0,0 +1,95 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "6150c75f4650b6bf4b3f2cb2cbce0bda",
"packages": [
{
"name": "scrivo/highlight.php",
"version": "v9.18.1.7",
"source": {
"type": "git",
"url": "https://github.com/scrivo/highlight.php.git",
"reference": "05996fcc61e97978d76ca7d1ac14b65e7cd26f91"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/scrivo/highlight.php/zipball/05996fcc61e97978d76ca7d1ac14b65e7cd26f91",
"reference": "05996fcc61e97978d76ca7d1ac14b65e7cd26f91",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-mbstring": "*",
"php": ">=5.4"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.7",
"sabberworm/php-css-parser": "^8.3",
"symfony/finder": "^2.8|^3.4",
"symfony/var-dumper": "^2.8|^3.4"
},
"type": "library",
"autoload": {
"psr-0": {
"Highlight\\": "",
"HighlightUtilities\\": ""
},
"files": [
"HighlightUtilities/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Geert Bergman",
"homepage": "http://www.scrivo.org/",
"role": "Project Author"
},
{
"name": "Vladimir Jimenez",
"homepage": "https://allejo.io",
"role": "Maintainer"
},
{
"name": "Martin Folkers",
"homepage": "https://twobrain.io",
"role": "Contributor"
}
],
"description": "Server side syntax highlighter that supports 185 languages. It's a PHP port of highlight.js",
"keywords": [
"code",
"highlight",
"highlight.js",
"highlight.php",
"syntax"
],
"support": {
"issues": "https://github.com/scrivo/highlight.php/issues",
"source": "https://github.com/scrivo/highlight.php"
},
"funding": [
{
"url": "https://github.com/allejo",
"type": "github"
}
],
"time": "2021-07-09T00:30:39+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.1.0"
}

10
config/green.lang.json Normal file
View file

@ -0,0 +1,10 @@
{
"aliases": ["greentext"],
"contains": [
{
"className": "comment",
"begin": ">",
"end": "$"
}
]
}

View file

@ -2,7 +2,7 @@
if (!defined('IN_PONEPASTE')) { if (!defined('IN_PONEPASTE')) {
die('This file may not be accessed directly.'); die('This file may not be accessed directly.');
} }
require_once(__DIR__ . '/../vendor/autoload.php');
require_once(__DIR__ . '/config.php'); require_once(__DIR__ . '/config.php');
require_once(__DIR__ . '/functions.php'); require_once(__DIR__ . '/functions.php');
require_once(__DIR__ . '/DatabaseHandle.class.php'); require_once(__DIR__ . '/DatabaseHandle.class.php');
@ -53,7 +53,7 @@ function getSiteTotal_unique_views(DatabaseHandle $conn) : int {
* @return string HTML-escaped string * @return string HTML-escaped string
*/ */
function pp_html_escape(string $unescaped) : string { function pp_html_escape(string $unescaped) : string {
return htmlentities($unescaped, ENT_QUOTES, 'UTF-8', false); return htmlspecialchars($unescaped, ENT_QUOTES, 'UTF-8', false);
} }
function updatePageViews(DatabaseHandle $conn) : void { function updatePageViews(DatabaseHandle $conn) : void {

142
paste.php
View file

@ -24,10 +24,13 @@ require_once('includes/functions.php');
require_once('includes/Tag.class.php'); require_once('includes/Tag.class.php');
require_once('includes/passwords.php'); require_once('includes/passwords.php');
require_once('includes/Parsedown/Parsedown.php'); require_once('includes/Parsedown/Parsedown.php');
require_once('includes/Parsedown/ParsedownExtra.php'); require_once('includes/Parsedown/ParsedownExtra.php');
require_once('includes/Parsedown/SecureParsedown.php'); require_once('includes/Parsedown/SecureParsedown.php');
use Highlight\Highlighter;
function rawView($content, $p_code) { function rawView($content, $p_code) {
if ($p_code) { if ($p_code) {
header('Content-Type: text/plain'); header('Content-Type: text/plain');
@ -41,10 +44,11 @@ $paste_id = intval(trim($_REQUEST['id']));
updatePageViews($conn); updatePageViews($conn);
// This is used in the theme files.
$totalpastes = getSiteTotalPastes($conn);
// Get paste favorite count // Get paste favorite count
$query = $conn->prepare('SELECT COUNT(*) FROM pins WHERE paste_id = ?'); $fav_count = $conn->querySelectOne('SELECT COUNT(*) FROM pins WHERE paste_id = ?', [$paste_id], PDO::FETCH_NUM)[0];
$query->execute([$paste_id]);
$fav_count = intval($query->fetch(PDO::FETCH_NUM)[0]);
// Get paste info // Get paste info
$row = $conn->querySelectOne( $row = $conn->querySelectOne(
@ -54,9 +58,6 @@ $row = $conn->querySelectOne(
WHERE pastes.id = ?', [$paste_id]); WHERE pastes.id = ?', [$paste_id]);
// This is used in the theme files.
$totalpastes = getSiteTotalPastes($conn);
$notfound = null; $notfound = null;
$is_private = false; $is_private = false;
@ -64,10 +65,12 @@ if ($row === null) {
header('HTTP/1.1 404 Not Found'); header('HTTP/1.1 404 Not Found');
$notfound = $lang['notfound']; // "Not found"; $notfound = $lang['notfound']; // "Not found";
goto Not_Valid_Paste; goto Not_Valid_Paste;
} else { }
$paste_owner_id = (int) $row['user_id']; $paste_owner_id = (int) $row['user_id'];
$paste_title = $row['title']; $paste_title = $row['title'];
$paste_code = $row['code']; $paste_code = $row['code'];
$using_highlighter = $paste_code !== 'pastedown';
$paste = [ $paste = [
'title' => $paste_title, 'title' => $paste_title,
@ -82,26 +85,46 @@ if ($row === null) {
$p_content = $row['content']; $p_content = $row['content'];
$p_visible = $row['visible']; $p_visible = $row['visible'];
$p_expiry = Trim($row['expiry']); $p_expiry = $row['expiry'];
$p_password = $row['password']; $p_password = $row['password'];
$p_encrypt = (bool) $row['encrypt']; $p_encrypt = (bool) $row['encrypt'];
$is_private = $row['visible'] === '2'; $is_private = $row['visible'] === '2';
$private_error = false;
if ($is_private && (!$current_user || $current_user->user_id !== $paste_owner_id)) { if ($is_private && (!$current_user || $current_user->user_id !== $paste_owner_id)) {
$notfound = $lang['privatepaste']; //" This is a private paste. If you created this paste, please login to view it."; $notfound = $lang['privatepaste']; //" This is a private paste. If you created this paste, please login to view it.";
$private_error = true;
goto Not_Valid_Paste; goto Not_Valid_Paste;
} }
/* Verify paste password */
$password_required = $p_password !== null && $p_password !== 'NONE';
$password_valid = true;
$password_candidate = '';
if ($password_required) {
if (!empty($_POST['mypass'])) {
$password_candidate = $_POST['mypass'];
} else if (!empty($_GET['password'])) {
$password_candidate = @base64_decode($_GET['password']);
}
if (empty($password_candidate)) {
$password_valid = false;
$error = $lang['pwdprotected']; // 'Password protected paste';
goto Not_Valid_Paste;
} elseif (!pp_password_verify($password_candidate, $p_password)) {
$password_valid = false;
$error = $lang['wrongpassword']; // 'Wrong password';
goto Not_Valid_Paste;
}
}
if (!empty($p_expiry) && $p_expiry !== 'SELF') { if (!empty($p_expiry) && $p_expiry !== 'SELF') {
$input_time = $p_expiry; $input_time = $p_expiry;
$current_time = mktime(date("H"), date("i"), date("s"), date("n"), date("j"), date("Y")); $current_time = mktime(date("H"), date("i"), date("s"), date("n"), date("j"), date("Y"));
if ($input_time < $current_time) { if ($input_time < $current_time) {
$notfound = $lang['expired']; $notfound = $lang['expired'];
$p_private_error = 1;
goto Not_Valid_Paste; goto Not_Valid_Paste;
} }
} }
@ -114,40 +137,14 @@ if ($row === null) {
// Download the paste // Download the paste
if (isset($_GET['download'])) { if (isset($_GET['download'])) {
if ($p_password == "NONE" || $p_password === null) {
doDownload($paste_id, $paste_title, $p_member, $op_content, $paste_code); doDownload($paste_id, $paste_title, $p_member, $op_content, $paste_code);
exit(); exit();
} else {
if (isset($_GET['password'])) {
if (pp_password_verify($_GET['password'], $p_password)) {
doDownload($paste_id, $paste_title, $p_member, $op_content, $paste_code);
exit();
} else {
$error = $lang['wrongpassword']; // 'Wrong password';
}
} else {
$error = $lang['pwdprotected']; // 'Password protected paste';
}
}
} }
// Raw view // Raw view
if (isset($_GET['raw'])) { if (isset($_GET['raw'])) {
if ($p_password == "NONE" || $p_password === null) {
rawView($op_content, $paste_code); rawView($op_content, $paste_code);
exit(); exit();
} else {
if (isset($_GET['password'])) {
if (pp_password_verify($_GET['password'], $p_password)) {
rawView($op_content, $paste_code);
exit();
} else {
$error = $lang['wrongpassword']; // 'Wrong password';
}
} else {
$error = $lang['pwdprotected']; // 'Password protected paste';
}
}
} }
// Preprocess // Preprocess
@ -168,10 +165,19 @@ if ($row === null) {
// Apply syntax highlight // Apply syntax highlight
$p_content = htmlspecialchars_decode($p_content); $p_content = htmlspecialchars_decode($p_content);
if ($paste_code === "pastedown") { if ($paste_code === "pastedown") {
$Parsedown = new Parsedown(); $parsedown = new Parsedown();
$Parsedown->setSafeMode(true); $parsedown->setSafeMode(true);
$p_content = $Parsedown->text($p_content); $p_content = $parsedown->text($p_content);
} else { } else {
Highlighter::registerLanguage('green', 'config/green.lang.json');
$hl = new Highlighter();
$highlighted = $hl->highlight($paste_code == 'text' ? 'plaintext' : $paste_code, $p_content)->value;
$lines = HighlightUtilities\splitCodeIntoArray($highlighted);
//$highlight = new Highlighter();
//$p_content = $highlight->highlight($paste_code, $p_content)->value;
//$p_content = linkify($p_content);
$geshi = new GeSHi($p_content, $paste_code, 'includes/geshi/'); $geshi = new GeSHi($p_content, $paste_code, 'includes/geshi/');
$geshi->enable_classes(); $geshi->enable_classes();
@ -190,30 +196,19 @@ if ($row === null) {
$ges_style = '<style>' . $style . '</style>'; $ges_style = '<style>' . $style . '</style>';
} }
// Embed view after GeSHI is applied so that $p_code is syntax highlighted as it should be. // Embed view after highlighting is applied so that $p_code is syntax highlighted as it should be.
if (isset($_GET['embed'])) { if (isset($_GET['embed'])) {
if ($p_password == "NONE" || $p_password === null) {
embedView($paste_id, $paste_title, $p_content, $paste_code, $title, $baseurl, $ges_style, $lang); embedView($paste_id, $paste_title, $p_content, $paste_code, $title, $baseurl, $ges_style, $lang);
exit(); exit();
} else {
if (isset($_GET['password'])) {
if (pp_password_verify($_GET['password'], $p_password)) {
embedView($paste_id, $paste_title, $p_content, $paste_code, $title, $p_baseurl, $ges_style, $lang);
exit();
} else {
$error = $lang['wrongpassword']; // 'Wrong password';
}
} else {
$error = $lang['pwdprotected']; // 'Password protected paste';
}
}
}
} }
require_once('theme/' . $default_theme . '/header.php'); require_once('theme/' . $default_theme . '/header.php');
if ($p_password == "NONE" || $p_password === null) { if ($password_required && $password_valid) {
// No password & diplay the paste /* base64 here means that the password is exposed in the URL, technically - how to handle this better? */
$p_download = "paste.php?download&id=$paste_id&password=" . base64_encode($password_candidate);
$p_raw = "paste.php?raw&id=$paste_id&password=" . base64_encode($password_candidate);
$p_embed = "paste.php?embed&id=$paste_id&password=" . base64_encode($password_candidate);
} else {
// Set download URL // Set download URL
if (PP_MOD_REWRITE) { if (PP_MOD_REWRITE) {
$p_download = "download/$paste_id"; $p_download = "download/$paste_id";
@ -224,7 +219,7 @@ if ($p_password == "NONE" || $p_password === null) {
$p_raw = "paste.php?raw&id=$paste_id"; $p_raw = "paste.php?raw&id=$paste_id";
$p_embed = "paste.php?embed&id=$paste_id"; $p_embed = "paste.php?embed&id=$paste_id";
} }
}
// View counter // View counter
if (@$_SESSION['not_unique'] !== $paste_id) { if (@$_SESSION['not_unique'] !== $paste_id) {
@ -232,36 +227,11 @@ if ($p_password == "NONE" || $p_password === null) {
$conn->query("UPDATE pastes SET views = (views + 1) where id = ?", [$paste_id]); $conn->query("UPDATE pastes SET views = (views + 1) where id = ?", [$paste_id]);
} }
// Theme
require_once('theme/' . $default_theme . '/view.php'); require_once('theme/' . $default_theme . '/view.php');
if ($p_expiry == "SELF") {
$conn->query('DELETE FROM pastes WHERE id = ?', [$paste_id]);
}
} else {
$p_download = "paste.php?download&id=$paste_id&password=" . pp_password_hash(isset($_POST['mypass']));
$p_raw = "paste.php?raw&id=$paste_id&password=" . pp_password_hash(isset($_POST['mypass']));
// Check password
if (isset($_POST['mypass'])) {
if (pp_password_verify($_POST['mypass'], $p_password)) {
// Theme
require_once('theme/' . $default_theme . '/view.php');
if ($p_expiry == "SELF") {
$conn->prepare('DELETE FROM pastes WHERE id = ?')
->execute([$paste_id]);
}
} else {
$error = $lang['wrongpwd']; //"Password is wrong";
require_once('theme/' . $default_theme . '/errors.php');
}
} else {
// Display errors
require_once('theme/' . $default_theme . '/errors.php');
}
}
Not_Valid_Paste: Not_Valid_Paste:
// Private paste not valid
if ($is_private || $notfound) { if ($is_private || $notfound || !$password_valid) {
// Display errors // Display errors
require_once('theme/' . $default_theme . '/header.php'); require_once('theme/' . $default_theme . '/header.php');
require_once('theme/' . $default_theme . '/errors.php'); require_once('theme/' . $default_theme . '/errors.php');

View file

@ -74,6 +74,9 @@ function setupTagsInput() {
})(jQuery); })(jQuery);
}); });
</script> </script>
<?php if ($using_highlighter): ?>
<link rel="stylesheet" href="/vendor/scrivo/highlight.php/styles/default.css" />
<?php endif; ?>
<?php <?php
/* /*
* Paste <https://github.com/jordansamuel/PASTE> - Bulma theme * Paste <https://github.com/jordansamuel/PASTE> - Bulma theme
@ -98,8 +101,6 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
?> ?>
<style> <style>
.preloader { .preloader {
position: absolute; position: absolute;
top: 0; top: 0;
@ -208,7 +209,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
echo checkFavorite($conn, $paste_id, $current_user->user_id); echo checkFavorite($conn, $paste_id, $current_user->user_id);
} }
?> ?>
<a class="icon tool-icon" class="flip" onclick="openreport()"><i <a class="icon tool-icon flip" onclick="openreport()"><i
class="far fa-flag fa-lg has-text-grey" title="Report Paste"></i></a> class="far fa-flag fa-lg has-text-grey" title="Report Paste"></i></a>
<?php if ($paste['code'] != "pastedown") { ?> <?php if ($paste['code'] != "pastedown") { ?>
<a class="icon tool-icon" href="javascript:togglev();"><i <a class="icon tool-icon" href="javascript:togglev();"><i
@ -236,7 +237,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
} else { } else {
echo 'paste.php?embed&id='; echo 'paste.php?embed&id=';
} }
echo $paste_id . '"></script>'; ?>' readonly> echo $paste_id . '"></script>'; ?>' readonly />
</div> </div>
</div> </div>
</div> </div>
@ -258,17 +259,28 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
?> ?>
</div> </div>
<br> <br>
<?php if (isset($error)) { <?php if (isset($error)): ?>
echo '<div class="notification is-danger"><i class="fa fa-exclamation-circle" aria-hidden=" true"></i><p>' . $error . '</p></div>'; <div class="notification is-danger">
} else { <i class="fa fa-exclamation-circle" aria-hidden="true"></i>
if ($paste['code'] != "pastedown") { <p><?= pp_html_escape($error) ?></p>
echo ' </div>
<div id="paste" style="line-height:1!important;">' . linkify($p_content) . '</div>'; <?php elseif ($using_highlighter): ?>
} else { <div id="paste" style="line-height:1!important;">
echo ' <div class="<?= pp_html_escape($paste['code']) ?>">
<div id="paste" style="line-height:1!important;">' . $p_content . '</div>'; <ol>
} <?php foreach ($lines as $num => $line): ?>
} ?> <li class="<?= $num == 0 ? 'li1 ln-xtra' : 'li1' ?>" id="<?= $num + 1 ?>">
<div class="de1"><?= $line === '' ? '&nbsp;' : $line ?></div>
</li>
<?php endforeach; ?>
</ol>
</div>
</div>
<div id="paste" style="line-height:1!important;"><?= $p_content ?></div>
<?php else: ?>
<div id="paste" style="line-height:1!important;"><?= $p_content ?></div>
<?php endif; ?>
</div> </div>
<!-- Guests --> <!-- Guests -->
<?php if ($current_user === null || $current_user->user_id !== $paste['user_id']) { ?> <?php if ($current_user === null || $current_user->user_id !== $paste['user_id']) { ?>

7
vendor/autoload.php vendored Normal file
View file

@ -0,0 +1,7 @@
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit5bf95489f4eff2c10ec062bf7ba377da::getLoader();

481
vendor/composer/ClassLoader.php vendored Normal file
View file

@ -0,0 +1,481 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
private $vendorDir;
// PSR-4
private $prefixLengthsPsr4 = array();
private $prefixDirsPsr4 = array();
private $fallbackDirsPsr4 = array();
// PSR-0
private $prefixesPsr0 = array();
private $fallbackDirsPsr0 = array();
private $useIncludePath = false;
private $classMap = array();
private $classMapAuthoritative = false;
private $missingClasses = array();
private $apcuPrefix;
private static $registeredLoaders = array();
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
}
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}
return array();
}
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array $classMap Class to filename map
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*/
public function add($prefix, $paths, $prepend = false)
{
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
(array) $paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
(array) $paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
(array) $paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
(array) $paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
(array) $paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
(array) $paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 base directories
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
if (null === $this->vendorDir) {
return;
}
if ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
self::$registeredLoaders[$this->vendorDir] = $this;
}
}
/**
* Unregisters this instance as an autoloader.
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
return true;
}
return null;
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
/**
* Returns the currently registered loaders indexed by their corresponding vendor directories.
*
* @return self[]
*/
public static function getRegisteredLoaders()
{
return self::$registeredLoaders;
}
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*/
function includeFile($file)
{
include $file;
}

337
vendor/composer/InstalledVersions.php vendored Normal file
View file

@ -0,0 +1,337 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer;
use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;
/**
* This class is copied in every Composer installed project and available to all
*
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require it's presence, you can require `composer-runtime-api ^2.0`
*/
class InstalledVersions
{
private static $installed;
private static $canGetVendors;
private static $installedByVendor = array();
/**
* Returns a list of all package names which are present, either by being installed, replaced or provided
*
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackages()
{
$packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}
if (1 === \count($packages)) {
return $packages[0];
}
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}
/**
* Returns a list of all package names with a specific type e.g. 'library'
*
* @param string $type
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackagesByType($type)
{
$packagesByType = array();
foreach (self::getInstalled() as $installed) {
foreach ($installed['versions'] as $name => $package) {
if (isset($package['type']) && $package['type'] === $type) {
$packagesByType[] = $name;
}
}
}
return $packagesByType;
}
/**
* Checks whether the given package is installed
*
* This also returns true if the package name is provided or replaced by another package
*
* @param string $packageName
* @param bool $includeDevRequirements
* @return bool
*/
public static function isInstalled($packageName, $includeDevRequirements = true)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
}
}
return false;
}
/**
* Checks whether the given package satisfies a version constraint
*
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
*
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
*
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
* @param string $packageName
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
* @return bool
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints($constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
/**
* Returns a version constraint representing all the range(s) which are installed for a given package
*
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
* whether a given version of a package is installed, and not just whether it exists
*
* @param string $packageName
* @return string Version constraint usable with composer/semver
*/
public static function getVersionRanges($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
$ranges = array();
if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['version'])) {
return null;
}
return $installed['versions'][$packageName]['version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getPrettyVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return $installed['versions'][$packageName]['pretty_version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
*/
public static function getReference($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['reference'])) {
return null;
}
return $installed['versions'][$packageName]['reference'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
*/
public static function getInstallPath($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @return array
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
*/
public static function getRootPackage()
{
$installed = self::getInstalled();
return $installed[0]['root'];
}
/**
* Returns the raw installed.php data for custom implementations
*
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[]
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
*/
public static function getRawData()
{
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = include __DIR__ . '/installed.php';
} else {
self::$installed = array();
}
}
return self::$installed;
}
/**
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
*/
public static function getAllRawData()
{
return self::getInstalled();
}
/**
* Lets you reload the static array from another file
*
* This is only useful for complex integrations in which a project needs to use
* this class but then also needs to execute another project's autoloader in process,
* and wants to ensure both projects have access to their version of installed.php.
*
* A typical case would be PHPUnit, where it would need to make sure it reads all
* the data it needs from this class, then call reload() with
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
* the project in which it runs can then also use this class safely, without
* interference between PHPUnit's dependencies and the project's dependencies.
*
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
*/
public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();
}
/**
* @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
*/
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
if (self::$canGetVendors) {
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
}
}
}
}
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = require __DIR__ . '/installed.php';
} else {
self::$installed = array();
}
}
$installed[] = self::$installed;
return $installed;
}
}

21
vendor/composer/LICENSE vendored Normal file
View file

@ -0,0 +1,21 @@
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

10
vendor/composer/autoload_classmap.php vendored Normal file
View file

@ -0,0 +1,10 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
);

10
vendor/composer/autoload_files.php vendored Normal file
View file

@ -0,0 +1,10 @@
<?php
// autoload_files.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'b6ec61354e97f32c0ae683041c78392a' => $vendorDir . '/scrivo/highlight.php/HighlightUtilities/functions.php',
);

11
vendor/composer/autoload_namespaces.php vendored Normal file
View file

@ -0,0 +1,11 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Highlight\\' => array($vendorDir . '/scrivo/highlight.php'),
'HighlightUtilities\\' => array($vendorDir . '/scrivo/highlight.php'),
);

9
vendor/composer/autoload_psr4.php vendored Normal file
View file

@ -0,0 +1,9 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

75
vendor/composer/autoload_real.php vendored Normal file
View file

@ -0,0 +1,75 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit5bf95489f4eff2c10ec062bf7ba377da
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit5bf95489f4eff2c10ec062bf7ba377da', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit5bf95489f4eff2c10ec062bf7ba377da', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit5bf95489f4eff2c10ec062bf7ba377da::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit5bf95489f4eff2c10ec062bf7ba377da::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire5bf95489f4eff2c10ec062bf7ba377da($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire5bf95489f4eff2c10ec062bf7ba377da($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
}
}

39
vendor/composer/autoload_static.php vendored Normal file
View file

@ -0,0 +1,39 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit5bf95489f4eff2c10ec062bf7ba377da
{
public static $files = array (
'b6ec61354e97f32c0ae683041c78392a' => __DIR__ . '/..' . '/scrivo/highlight.php/HighlightUtilities/functions.php',
);
public static $prefixesPsr0 = array (
'H' =>
array (
'Highlight\\' =>
array (
0 => __DIR__ . '/..' . '/scrivo/highlight.php',
),
'HighlightUtilities\\' =>
array (
0 => __DIR__ . '/..' . '/scrivo/highlight.php',
),
),
);
public static $classMap = array (
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixesPsr0 = ComposerStaticInit5bf95489f4eff2c10ec062bf7ba377da::$prefixesPsr0;
$loader->classMap = ComposerStaticInit5bf95489f4eff2c10ec062bf7ba377da::$classMap;
}, null, ClassLoader::class);
}
}

85
vendor/composer/installed.json vendored Normal file
View file

@ -0,0 +1,85 @@
{
"packages": [
{
"name": "scrivo/highlight.php",
"version": "v9.18.1.7",
"version_normalized": "9.18.1.7",
"source": {
"type": "git",
"url": "https://github.com/scrivo/highlight.php.git",
"reference": "05996fcc61e97978d76ca7d1ac14b65e7cd26f91"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/scrivo/highlight.php/zipball/05996fcc61e97978d76ca7d1ac14b65e7cd26f91",
"reference": "05996fcc61e97978d76ca7d1ac14b65e7cd26f91",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-mbstring": "*",
"php": ">=5.4"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.7",
"sabberworm/php-css-parser": "^8.3",
"symfony/finder": "^2.8|^3.4",
"symfony/var-dumper": "^2.8|^3.4"
},
"time": "2021-07-09T00:30:39+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"Highlight\\": "",
"HighlightUtilities\\": ""
},
"files": [
"HighlightUtilities/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Geert Bergman",
"homepage": "http://www.scrivo.org/",
"role": "Project Author"
},
{
"name": "Vladimir Jimenez",
"homepage": "https://allejo.io",
"role": "Maintainer"
},
{
"name": "Martin Folkers",
"homepage": "https://twobrain.io",
"role": "Contributor"
}
],
"description": "Server side syntax highlighter that supports 185 languages. It's a PHP port of highlight.js",
"keywords": [
"code",
"highlight",
"highlight.js",
"highlight.php",
"syntax"
],
"support": {
"issues": "https://github.com/scrivo/highlight.php/issues",
"source": "https://github.com/scrivo/highlight.php"
},
"funding": [
{
"url": "https://github.com/allejo",
"type": "github"
}
],
"install-path": "../scrivo/highlight.php"
}
],
"dev": true,
"dev-package-names": []
}

32
vendor/composer/installed.php vendored Normal file
View file

@ -0,0 +1,32 @@
<?php return array(
'root' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '09e804a3b96f0f28a23da3d250e161f7c9dfb5a3',
'name' => 'aftercase/ponepaste',
'dev' => true,
),
'versions' => array(
'aftercase/ponepaste' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '09e804a3b96f0f28a23da3d250e161f7c9dfb5a3',
'dev_requirement' => false,
),
'scrivo/highlight.php' => array(
'pretty_version' => 'v9.18.1.7',
'version' => '9.18.1.7',
'type' => 'library',
'install_path' => __DIR__ . '/../scrivo/highlight.php',
'aliases' => array(),
'reference' => '05996fcc61e97978d76ca7d1ac14b65e7cd26f91',
'dev_requirement' => false,
),
),
);

26
vendor/composer/platform_check.php vendored Normal file
View file

@ -0,0 +1,26 @@
<?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 50400)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 5.4.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}

View file

@ -0,0 +1,40 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in('demo')
->in('Highlight')
->in('HighlightUtilities')
->in('test')
->in('tools')
->exclude('lib_dojo')
->exclude('lib_highlight')
;
$config = new PhpCsFixer\Config();
return $config
->setRules([
'@PSR1' => true,
'@PSR2' => true,
'@Symfony' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'long'],
'concat_space' => ['spacing' => 'one'],
'echo_tag_syntax' => ['format' => 'short'],
'no_alias_language_construct_call' => false,
'no_alternative_syntax' => false,
'no_useless_else' => true,
'no_useless_return' => true,
'phpdoc_align' => true,
'phpdoc_order' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'single_quote' => false,
'ternary_to_null_coalescing' => false,
'trailing_comma_in_multiline' => true,
'visibility_required' => false,
'yoda_style' => [
'equal' => false,
'identical' => false,
],
])
->setFinder($finder)
;

306
vendor/scrivo/highlight.php/AUTHORS.txt vendored Normal file
View file

@ -0,0 +1,306 @@
Syntax highlighting with language autodetection in PHP.
-------------------------------------------------------------------------------
Current maintainer(s):
Vladimir Jimenez <me@allejo.io>
Former maintainers:
Geert Bergman (original author) <geert@scrivo.nl>
Contributor(s):
Carsten Brandt <mail@cebe.cc>
Daniel Lynge
Daniel Gómez Pan <pana_1990@hotmail.com>
Martin Folkers <hello@twobrain.io>
-------------------------------------------------------------------------------
highlight.js (the reference project)
Current core developers (alphabetical):
Gidi Meir Morris <gidi@gidi.io>
Jan T. Sott <git@idleberg.com>
Josh Goebel <hello@joshgoebel.com>
Li Xuanji <xuanji@gmail.com>
Marcos Cáceres <marcos@marcosc.com>
Sang Dang <sang.dang@polku.io>
Former maintainers:
Ivan Sagalaev (original author) <maniac@softwaremaniacs.org>
Jeremy Hull <sourdrums@gmail.com>
Oleg Efimov <efimovov@gmail.com>
-------------------------------------------------------------------------------
Language and style definitions (copied from the highlight.js project)
Aahan Krish <geekpanth3r@gmail.com>
Adam Joseph Cook <adam.joseph.cook@gmail.com>
Ahmad Awais <me@AhmadAwais.com>
Alberto Gimeno <gimenete@gmail.com>
Alejandro Isaza <al@isaza.ca>
Aleksandar Ruzicic <aleksandar@ruzicic.info>
Alex Arslan <ararslan@comcast.net>
Alex McKibben <alex@nullscope.net>
Alexander Lichter <manniL@gmx.net>
Alexander Makarov <sam@rmcreative.ru>
Alexander Marenin <great_muchacho@mail.ru>
Alexander Myadzel <myadzel@gmail.com>
Alexis Hénaut <alexis@henaut.net>
Andres Täht <andres.taht@gmail.com>
Andrew Farmer <ahfarmer@gmail.com>
Andrew Fedorov <dmmdrs@mail.ru>
Andrey Vlasovskikh <andrey.vlasovskikh@gmail.com>
Angel G. Olloqui <angelgarcia.mail@gmail.com>
Anthony Dugois <dev.anthonydugois@gmail.com>
Anthony Scemama <scemama@irsamc.ups-tlse.fr>
Antoine Boisier-Michaud <aboisiermichaud@gmail.com>
Anton Kochkov <anton.kochkov@gmail.com>
Anton Kovalyov <anton@kovalyov.net>
Antono Vasiljev <self@antono.info>
Arctic Ice Studio <development@arcticicestudio.com>
Arthur Bikmullin <devolonter@gmail.com>
Benjamin Auder <benjamin.auder@gmail.com>
Benjamin Pannell <contact@sierrasoftworks.com>
Billy Quith <chinbillybilbo@gmail.com>
Boone Severson <boone.severson@gmail.com>
Boris Cherny <boris@performancejs.com>
Bram de Haan <info@atelierbramdehaan.nl>
Brendan Rocks <rocks.brendan@gmail.com>
Brent Bradbury <brent@brentium.com>
Brian Beck <exogen@gmail.com>
Brian Quistorff <bquistorff@gmail.com>
Bruno Dias <bruno.r.dias@gmail.com>
Bryant Williams <b.n.williams@gmail.com>
Builder's Brewery <buildersbrewery@gmail.com>
Camil Staps <info@camilstaps.nl>
Carl Baxter <carl@cbax.tech>
Carlo Kok <ck@remobjects.com>
Casey Duncan <casey.duncan@gmail.com>
Cedric Sohrauer <sohrauer@googlemail.com>
Chris Eidhof <chris@eidhof.nl>
Chris Kiehl <audionautic@gmail.com>
Christophe de Dinechin <christophe@taodyne.com>
Christopher Kaster <ikasoki@gmail.com>
Cédric Néhémie <cedric.nehemie@gmail.com>
Damian Mee <mee.damian@gmail.com>
Damien White <damien.white@visoftinc.com>
Dan Allen <dan.j.allen@gmail.com>
Dan Panzarella <alsoelp@gmail.com>
Dan Tao <daniel.tao@gmail.com>
Daniel Gamage <hellodanielgamage@gmail.com>
Daniel Kvasnicka <dkvasnicka@vendavo.com>
Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
David Anson <david@dlaa.me>
David Mohundro <david@mohundro.com>
Denis Bardadym <bardadymchik@gmail.com>
Denis Ciccale <dciccale@gmail.com>
Dennis Titze <dennis.titze@gmail.com>
Dirk Kirsten <dk@basex.org>
Dmitri Roudakov <dmitri@roudakov.ru>
Dmitriy Tarasov <dimatar@gmail.com>
Dmitry Kovega <arhibot@gmail.com>
Dmitry Medvinsky <me@dmedvinsky.name>
Dmytrii Nagirniak <dnagir@gmail.com>
Domen Kožar <domen@dev.si>
Dotan Dimet <dotan@corky.net>
Dr. Drang <drdrang@gmail.com>
Duncan Paterson <duncan@exist-db.org>
Edwin Dalorzo <edwin@dalorzo.org>
Egor Rogov <e.rogov@postgrespro.ru>
Eric Bailey <eric.w.bailey@gmail.com>
Eric Knibbe <eric@lassosoft.com>
Erik Osheim <d_m@plastic-idolatry.com>
Erik Paluka <erik.paluka@gmail.com>
Eugene Nizhibitsky <nizhibitsky@gmail.com>
Evgeny Stepanischev <imbolk@gmail.com>
Flaviu Tamas <tamas.flaviu@gmail.com>
G8t Guy <g8tguy@g8tguy.com>
Gavin Siu <gavsiu@gmail.com>
Google Inc. (David Benjamin) <davidben@google.com>
Greg Cline <gregrcline@gmail.com>
Gu Yiling <justice360@gmail.com>
Guannan Wei <guannanwei@outlook.com>
Guillaume Gomez <guillaume1.gomez@gmail.com>
Guillaume Laforge <glaforge@gmail.com>
Gustavo Costa <gusbemacbe@gmail.com>
Hakan Özler <ozler.hakan@gmail.com>
Hale Chan <halechan@qq.com>
Harmon <Harmon.Public@gmail.com>
Heiko August <post@auge8472.de>
Henrik Feldt <henrik@haf.se>
Herbert Shin <initbar@protonmail.ch>
Igor Kalnitsky <igor@kalnitsky.org>
Ike Ku <dempfi@yahoo.com>
Ilya Baryshev <baryshev@gmail.com>
Ilya Vassilevsky <vassilevsky@gmail.com>
innocenat <innocenat@gmail.com>
Ivan Dementev <ivan_div@mail.ru>
Jacob Childress <jacobc@gmail.com>
Jan Berkel <jan.berkel@gmail.com>
Jan Kühle <jkuehle90@gmail.com>
Janis Voigtländer <janis.voigtlaender@gmail.com>
Jason Diamond <jason@diamond.name>
Jason Jacobson <jason.a.jacobson@gmail.com>
Jason Tate <adminz@web-cms-designs.com>
Jay Strybis <jay.strybis@gmail.com>
Jeff Escalante <hello@jenius.me>
Jeffrey Arnold <jeffrey.arnold@gmail.com>
Jen Evers-Corvina <jen@sevvie.net>
Joe Cheng <joe@rstudio.org>
Joe Eli McIlvain <joe.eli.mac@gmail.org>
John Crepezzi <john.crepezzi@gmail.com>
John Foster <jfoster@esri.com>
Jon Evans <jon@craftyjon.com>
Jonas Follesø <jonas@follesoe.no>
Jonathan Suever <suever@gmail.com>
Jordi Petit <jordi.petit@gmail.com>
Jose Molina Colmenero <gaudy41@gmail.com>
Josh Adams <josh@isotope11.com>
Joël Porquet <joel@porquet.org>
JP Verkamp <me@jverkamp.com>
Jun Yang <yangjvn@126.com>
Kasper Andersen <kma_untrusted@protonmail.com>
Kassio Borges <kassioborgesm@gmail.com>
Kelley van Evert <kelleyvanevert@gmail.com>
Kenneth Fuglsang <kfuglsang@gmail.com>
Kenta Sato <bicycle1885@gmail.com>
Kenton Hamaluik <kentonh@gmail.com>
Kirk Kimmel <kimmel.k.programmer@gmail.com>
Konstantin Evdokimenko <qewerty@gmail.com>
Kristoffer Gronlund <kgronlund@suse.com>
Kurt Emch <kurt@kurtemch.com>
Ladislav Prskavec <ladislav@prskavec.net>
Lars Schulna <kartoffelbrei.mit.muskatnuss@gmail.org>
Laurent Voullemier <laurent.voullemier@gmail.com>
Loren Segal <lsegal@soen.ca>
Louis Barranqueiro <louis.barranqueiro@gmail.com>
Lucas Mazza <lucastmazza@gmail.com>
Lucas Werkmeister <mail@lucaswerkmeister.de>
Luigi Maselli <grigio.org@gmail.com>
Luke Holder <lukemh@gmail.com>
Magnus Madsen <mmadsen@uwaterloo.ca>
MajestiC <majestic2k@gmail.com>
Manh Tuan <junookyo@gmail.com>
Marc Fornos <marc.fornos@gmail.com>
Martin Braun <martin.braun@ettus.com>
Martin Clausen <martin.clausene@gmail.com>
Martin Dilling-Hansen <martindlling@gmail.com>
Marvin Saignat <contact@zgmrvn.com>
Matt Diephouse <matt@diephouse.com>
Matt Evans <matt@aptech.com>
Matthew Daly <matthewbdaly@gmail.com>
Max Mikhailov <seven.phases.max@gmail.com>
Maxim Dikun <dikmax@gmail.com>
Mehdi Dogguy <mehdi@dogguy.org>
Melissa Geels <melissa@nimble.tools>
Meseta <meseta@gmail.com>
Michael Allen <Michael.Allen@benefitfocus.com>
Michael Johnston <lastobelus@gmail.com>
Michael Rodler <contact@f0rki.at>
Michal Gabrukiewicz <mgabru@gmail.com>
Mick MacCallum <micksmaccallum@gmail.com>
Mickaël Delahaye <mickael.delahaye@gmail.com>
Mikko Kouhia <mikko.kouhia@iki.fi>
Morten Piibeleht <morten.piibeleht@gmail.com>
mucaho <mkucko@gmail.com>
MY Sun <simonmysun@gmail.com>
Nate Cook <natecook@gmail.com>
Nathan Grigg <nathan@nathanamy.org>
Nebuleon Fumika <nebuleon.fumika@gmail.com>
Nic West <nic@letolab.com>
Nicholas Blumhardt <nblumhardt@nblumhardt.com>
Nicolas Braud-Santoni <nicolas.braud-santoni@ens-cachan.fr>
Nicolas Le Gall <contact@nlegall.fr>
Nicolas LLOBERA <nllobera@gmail.com>
Nikita Ledyaev <lenikita@yandex.ru>
Nikita Savchenko <zitros.lab@gmail.com>
Nikolay Lisienko <info@neor.ru>
Nikolay Zakharov <nikolay.desh@gmail.com>
noformnocontent <i@noformnocontent.com>
Oleg Volchkov <oleg@volchkov.net>
Panu Horsmalahti <panu.horsmalahti@iki.fi>
Pascal Hurni <phi@ruby-reactive.org>
Pedro Oliveira <kanytu@gmail.com>
Peter Leonov <gojpeg@gmail.com>
Peter Piwowarski <oldlaptop654@aol.com>
Philipp A. <flying-sheep@web.de>
Philipp Wolfer <ph.wolfer@gmail.com>
Philippe Charrière <ph.charriere@gmail.com>
Poren Chiang <ren.chiang@gmail.com>
prince <MC.prince.0203@gmail.com>
pumbur <pumbur@pumbur.net>
Qeole <qeole@outlook.com>
Radek Liska <radekliska@gmail.com>
Raivo Laanemets <raivo@infdot.com>
Ralf Bitter <rabit@revigniter.com>
Raphaël Assénat <raph@raphnet.net>
Raphaël Parrëe <rparree@edc4it.com>
Rene Saarsoo <nene@triin.net>
Robert Dodier <robert.dodier@gmail.com>
Robin Ward <robin.ward@gmail.com>
Roman Shmatov <romanshmatov@gmail.com>
Ruslan Keba <rukeba@gmail.com>
Sam Wu <samsam2310@gmail.com>
Samia Ali <samiaab1990@gmail.com>
Samuel Reed <sam@bitmex.com>
Sean T. Allen <sean@monkeysnatchbanana.com>
Sejin Jeon <jinaidy93@gmail.com>
Seongwon Lee <dlimpid@gmail.com>
Sergey Baranov <segyrn@yandex.ru>
Sergey Bronnikov <sergeyb@bronevichok.ru>
Sergey Ignatov <sergey@ignatov.spb.su>
Sergey Mashkov <cy6erGn0m@gmail.com>
Sergey Sobko <s.sobko@profitware.ru>
Sergey Tikhomirov <sergey@tikhomirov.io>
Sergey Vidyuk <svidyuk@gmail.com>
Shuen-Huei Guan <drake.guan@gmail.com>
Simon Madine <simon@angryrobotzombie.com>
Stanislav Belov <stbelov@gmail.com>
Stefan Bechert <stefan.bechert@gmx.net>
Stefan Wienert <stwienert@gmail.com>
Stefania Mellai <s.mellai@arduino.cc>
Stephan Boyer <stephan@stephanboyer.com>
Stephan Kountso <steplg@gmail.com>
Sylvestre Ledru <sylvestre.ledru@scilab-enterprises.com>
Søren Enevoldsen <senevoldsen90@gmail.com>
Taif Alimov <inzeppelin@gmail.com>
Taisuke Fujimoto <temp-impl@users.noreply.github.com>
Taneli Vatanen <taneli.vatanen@gmail.com>
Taras <oxdef@oxdef.info>
Taufik Nurrohman <latitudu.latitudu@gmail.com>
Thomas Applencourt <thomas.applencourt@irsamc.ups-tlse.fr>
Thomas Reichel <tom.p.reichel@gmail.com>
Tim Schumacher <tim@datenknoten.me>
Travis Odom <travis.a.odom@gmail.com>
Trey Shugart <treshugart@gmail.com>
Tristano Ajmone <tajmone@gmail.com>
Tristian Kelly <tristian.kelly560@gmail.com>
Troy Kershaw <hello@troykershaw.com>
Tsuyusato Kitsune <make.just.on@gmail.com>
Vadimtro <vadimtro@yahoo.com>
Vah <vahtenberg@gmail.com>
Valerii Hiora <valerii.hiora@gmail.com>
Vasily Mikhailitchenko <vaskas@programica.ru>
Vasily Polovnyov <vast@whiteants.net>
Victor Karamzin <Victor.Karamzin@enterra-inc.com>
Victor Zhou <OiCMudkips@users.noreply.github.com>
Vincent Zurczak <vzurczak@linagora.com>
Vladimir Epifanov <voldmar@voldmar.ru>
Vladimir Ermakov <vooon341@mail.ru>
Vladimir Gubarkov <xonixx@gmail.com>
Vladimir Moskva <vladmos@gmail.com>
Vsevolod Solovyov <vsevolod.solovyov@gmail.com>
Yoshihide Jimbo <yjimbo@gmail.com>
Yuri Ivanov <ivanov@supersoft.ru>
Yuri Mazursky <mail@colomolome.com>
Yury Selivanov <yselivanov@gmail.com>
Zaripov Yura <yur4ik7@ukr.net>
Zaven Muradyan <megalivoithos@gmail.com>
Zena Treep <zena.treep@gmail.com>

View file

@ -0,0 +1,112 @@
# Contributing
Welcome to your server-side syntax highlighting solution! If you're interested in contributing to the project, here are a few things to keep in mind!
## Language Definitions + Styles
We do not accept PRs with new or updated language definitions or stylesheets. These should be contributed to the `highlight.js` project instead. The process of maintaining styles and transforming language definitions is completely automated and left up to project maintainers to run whenever a new version of `highlight.js` is released.
## Updates from `highlight.js`
If you'd like to make a PR containing behavior changes made in the `highlight.js` project, please make sure you link to the appropriate `highlight.js` commits and change logs. Because this project is a direct port, we need do our best to keep the behavior as identical as possible.
PRs reflecting changes made in `highlight.js` should **only** be made after `highlight.js` has had a release tagged with those changes. This project will always push out updates _after_ `highlight.js` releases.
We make no guarantees that the latest master `highlight.php` will be compatible with the latest master version of `highlight.js`.
## Project structure
The project contains the following folders:
1. [Highlight](#highlight)
2. [styles](#styles)
3. [demo](#demo)
4. [test](#test)
5. [tools](#tools)
## Highlight
This folder contains the main source and the following files (classes):
### Highlight.php (Highlight)
This is the one that does the highlighting for you and the one you'll probably look for.
### Language.php (Language)
Auxiliary class used in the Highlight class. Instances of these classes represent the rather complex structures of regular expressions needed to scan through programming code in order to highlight them.
You don't need this class.
### JsonRef.php (JsonRef)
Auxiliary class to decode JSON files containing path-based references. The language definition data from [highlight.js](http://www.highlightjs.org) is too complex to be described in ordinary JSON files. Therefore it was chosen to use [dojox.json.ref](https://dojotoolkit.org/reference-guide/1.9/dojox/json/ref.html) to export them. This class is able (to a very limited extend) to decode JSON data that was created with this [dojo](https://dojotoolkit.org) toolkit.
This class has a very distinct purpose and might be useful in other projects as well (and might be a good starting point for a new project ;) ).
### Autoloader.php (Autoloader)
A simple autoloader class that you possible might want or more likely not want to use. It is used for the tools and tests.
### the languages folder
This folder contains all language definitions: one JSON file for each language. These files are not hand coded but extracted from the original [highlight.js](http://www.highlightjs.org) project.
## Styles
These are the the CSS files needed to actually color the code. Not much to say about: these are just copied from the [highlight.js](https://github.com/isagalaev/highlight.js/tree/master/src/styles) project.
## Demo
This folder contains two demo pages that can be accessed through your browser.
### demo.php
A test page showing all supported languages and styles.
### compare.php
Much like [demo.php](#demo-php) but this page focuses on the comparison between _highlight.php_ and _highlight.js_. Both should yield the same results.
## Test
This folder contains the unit test for _highlight.php_. To run them, run _phpunit_ from this directory:
```bash
phpnunit .
```
Note that the following tests for _highlight.js_ were not rewritten for _highlight.php_:
### special explicitLanguage
Controlling language selection by setting an attribute to the containing `<div>` is irrelevant for _highlight.php_
### special customMarkup
In _highlight.js_, code may contain additional HTML markup like in the following PHP fragment: `$sum = <b>$a</b> + $b;`. Currently this is not supported by _highlight.php_ which can only highlight (unescaped) code. Also highlighting `<br>` (HTML break element) is not supported. _highlight.php_ does however support tab replacement (which defaults to 4 spaces).
### special noHighlight
There is no need to turn off highlighting through a class name on the code container.
### special buildClassName
_highlight.php_ does not modify class names of code containers.
## Tools
A collection of scripts that are used to extract data from the original [highlight.js](http://www.highlightjs.org) project.
The process of bringing in languages from highlight.js has been put into a single script. This script requires that you have cURL, PHP, and node.js installed on your machine. This is only necessary if you'd like to update languages or bring in new languages, it's **not** required for using this library in your application.
```bash
cd tools
bash process.sh
```
## Why don't we generally use `mb_*` functions?
PHP offers `mb_` prefixed string functions to support multi-byte strings, this means supporting unicode characters. However, the PREG functions in PHP calculate [string lengths and positions in _bytes_, and not character lengths](https://www.php.net/manual/en/function.preg-match.php#refsect1-function.preg-match-parameters). For that reason, we will generally **not** use the multi-byte variants of string functions; there are exceptions to this policy.
An exception to this policy is the use of functions that aren't used for calculating string lengths or positions; e.g. `mb_strtolower`.

View file

@ -0,0 +1,73 @@
<?php
/* Copyright (c) 2013-2019 Geert Bergman (geert@scrivo.nl), highlight.php
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of "highlight.js", "highlight.php", nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace Highlight;
/**
* The autoloader class for Highlight classes for projects without Composer or autoloaders.
*
* ```php
* <?php
*
* require_once("Highlight/Autoloader.php");
* spl_autoload_register("\\Highlight\\Autoloader::load");
*
* // Now use Highlight classes:
* $hl = new \Highlight\Highlighter(...);
* ```
*
* @TODO In v10.x, mark this class final for real
*
* @api
* @final
*
* @since 7.5.0.0
*/
class Autoloader
{
/**
* The method to include the source file for a given class to use in
* the PHP spl_autoload_register function.
*
* @param string $class a name of a Scrivo class
*
* @return bool true if the source file was successfully included
*/
public static function load($class)
{
if (substr($class, 0, 10) !== "Highlight\\") {
return false;
}
$c = str_replace("\\", "/", substr($class, 10)) . ".php";
$res = include __DIR__ . "/$c";
return $res == 1 ? true : false;
}
}

View file

@ -0,0 +1,60 @@
<?php
/* Copyright (c) 2019 Geert Bergman (geert@scrivo.nl), highlight.php
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of "highlight.js", "highlight.php", nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace Highlight;
/**
* @api
*
* @since 9.17.1.0
*/
abstract class HighlightResult
{
/** @var int the relevance score */
public $relevance;
/** @var string the highlighted HTML code */
public $value;
/** @var string the language name */
public $language;
/** @var bool indicates whether any illegal matches were found */
public $illegal;
/** @var Mode|null top of the current mode stack */
public $top;
/** @var \Exception|null */
public $errorRaised;
// @TODO In v10.x, remove \stdClass from this type
/** @var \stdClass|HighlightResult|null */
public $secondBest;
}

View file

@ -0,0 +1,978 @@
<?php
/* Copyright (c)
* - 2006-2013, Ivan Sagalaev (maniac@softwaremaniacs.org), highlight.js
* (original author)
* - 2013-2019, Geert Bergman (geert@scrivo.nl), highlight.php
* - 2014 Daniel Lynge, highlight.php (contributor)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of "highlight.js", "highlight.php", nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace Highlight;
/**
* @api
*
* @since 7.5.0.0
*/
class Highlighter
{
/**
* @since 9.12.0.4
*/
const SPAN_END_TAG = "</span>";
/** @var bool */
private $safeMode = true;
// @TODO In v10.x, this value should be static to match highlight.js behavior
/** @var array<string, mixed> */
private $options;
/** @var string */
private $modeBuffer = "";
/** @var string */
private $result = "";
/** @var Mode|null */
private $top = null;
/** @var Language|null */
private $language = null;
/** @var int */
private $relevance = 0;
/** @var bool */
private $ignoreIllegals = false;
/** @var array<string, Mode> */
private $continuations = array();
/** @var RegExMatch */
private $lastMatch;
/** @var string The current code we are highlighting */
private $codeToHighlight;
/** @var string[] A list of all the bundled languages */
private static $bundledLanguages = array();
/** @var array<string, Language> A mapping of a language ID to a Language definition */
private static $classMap = array();
/** @var string[] A list of registered language IDs */
private static $languages = array();
/** @var array<string, string> A mapping from alias (key) to main language ID (value) */
private static $aliases = array();
/**
* @param bool $loadAllLanguages If true, will automatically register all languages distributed with this library.
* If false, user must explicitly register languages by calling `registerLanguage()`.
*
* @since 9.18.1.4 added `$loadAllLanguages` parameter
* @see Highlighter::registerLanguage()
*/
public function __construct($loadAllLanguages = true)
{
$this->lastMatch = new RegExMatch(array());
$this->lastMatch->type = "";
$this->lastMatch->rule = null;
// @TODO In v10.x, remove the default value for the `languages` value to follow highlight.js behavior
$this->options = array(
'classPrefix' => 'hljs-',
'tabReplace' => null,
'useBR' => false,
'languages' => array(
"xml", "json", "javascript", "css", "php", "http",
),
);
if ($loadAllLanguages) {
self::registerAllLanguages();
}
}
/**
* Return a list of all available languages bundled with this library.
*
* @since 9.18.1.4
*
* @return string[] An array of language names
*/
public static function listBundledLanguages()
{
if (!empty(self::$bundledLanguages)) {
return self::$bundledLanguages;
}
// Languages that take precedence in the classMap array. (I don't know why...)
$bundledLanguages = array(
"xml" => true,
"django" => true,
"javascript" => true,
"matlab" => true,
"cpp" => true,
);
$languagePath = __DIR__ . '/languages/';
$d = @dir($languagePath);
if (!$d) {
throw new \RuntimeException('Could not read bundled language definition directory.');
}
// @TODO In 10.x, rewrite this as a generator yielding results
while (($entry = $d->read()) !== false) {
if (substr($entry, -5) === ".json") {
$languageId = substr($entry, 0, -5);
$filePath = $languagePath . $entry;
if (is_readable($filePath)) {
$bundledLanguages[$languageId] = true;
}
}
}
$d->close();
return self::$bundledLanguages = array_keys($bundledLanguages);
}
/**
* Return a list of all the registered languages. Using this list in
* setAutodetectLanguages will turn on auto-detection for all supported
* languages.
*
* @since 9.18.1.4
*
* @param bool $includeAliases Specify whether language aliases should be
* included as well
*
* @return string[] An array of language names
*/
public static function listRegisteredLanguages($includeAliases = false)
{
if ($includeAliases === true) {
return array_merge(self::$languages, array_keys(self::$aliases));
}
return self::$languages;
}
/**
* Register all 185+ languages that are bundled in this library.
*
* To register languages individually, use `registerLanguage`.
*
* @since 9.18.1.4 Method is now public
* @since 8.3.0.0
* @see Highlighter::registerLanguage
*
* @return void
*/
public static function registerAllLanguages()
{
// Languages that take precedence in the classMap array.
$languagePath = __DIR__ . DIRECTORY_SEPARATOR . "languages" . DIRECTORY_SEPARATOR;
foreach (array("xml", "django", "javascript", "matlab", "cpp") as $languageId) {
$filePath = $languagePath . $languageId . ".json";
if (is_readable($filePath)) {
self::registerLanguage($languageId, $filePath);
}
}
// @TODO In 10.x, call `listBundledLanguages()` instead when it's a generator
$d = @dir($languagePath);
if ($d) {
while (($entry = $d->read()) !== false) {
if (substr($entry, -5) === ".json") {
$languageId = substr($entry, 0, -5);
$filePath = $languagePath . $entry;
if (is_readable($filePath)) {
self::registerLanguage($languageId, $filePath);
}
}
}
$d->close();
}
}
/**
* Register a language definition with the Highlighter's internal language
* storage. Languages are stored in a static variable, so they'll be available
* across all instances. You only need to register a language once.
*
* @param string $languageId The unique name of a language
* @param string $filePath The file path to the language definition
* @param bool $overwrite Overwrite language if it already exists
*
* @return Language The object containing the definition for a language's markup
*/
public static function registerLanguage($languageId, $filePath, $overwrite = false)
{
if (!isset(self::$classMap[$languageId]) || $overwrite) {
$lang = new Language($languageId, $filePath);
self::$classMap[$languageId] = $lang;
self::$languages[] = $languageId;
self::$languages = array_unique(self::$languages);
if ($lang->aliases) {
foreach ($lang->aliases as $alias) {
self::$aliases[$alias] = $languageId;
}
}
}
return self::$classMap[$languageId];
}
/**
* Clear all registered languages.
*
* @since 9.18.1.4
*
* @return void
*/
public static function clearAllLanguages()
{
self::$classMap = array();
self::$languages = array();
self::$aliases = array();
}
/**
* @param RegEx|null $re
* @param string $lexeme
*
* @return bool
*/
private function testRe($re, $lexeme)
{
if (!$re) {
return false;
}
$lastIndex = $re->lastIndex;
$result = $re->exec($lexeme);
$re->lastIndex = $lastIndex;
return $result && $result->index === 0;
}
/**
* @param string $value
*
* @return RegEx
*/
private function escapeRe($value)
{
return new RegEx(sprintf('/%s/um', preg_quote($value)));
}
/**
* @param Mode $mode
* @param string $lexeme
*
* @return Mode|null
*/
private function endOfMode($mode, $lexeme)
{
if ($this->testRe($mode->endRe, $lexeme)) {
while ($mode->endsParent && $mode->parent) {
$mode = $mode->parent;
}
return $mode;
}
if ($mode->endsWithParent) {
return $this->endOfMode($mode->parent, $lexeme);
}
return null;
}
/**
* @param Mode $mode
* @param RegExMatch $match
*
* @return mixed|null
*/
private function keywordMatch($mode, $match)
{
$kwd = $this->language->case_insensitive ? mb_strtolower($match[0]) : $match[0];
return isset($mode->keywords[$kwd]) ? $mode->keywords[$kwd] : null;
}
/**
* @param string $className
* @param string $insideSpan
* @param bool $leaveOpen
* @param bool $noPrefix
*
* @return string
*/
private function buildSpan($className, $insideSpan, $leaveOpen = false, $noPrefix = false)
{
if (!$leaveOpen && $insideSpan === '') {
return '';
}
if (!$className) {
return $insideSpan;
}
$classPrefix = $noPrefix ? "" : $this->options['classPrefix'];
$openSpan = "<span class=\"" . $classPrefix;
$closeSpan = $leaveOpen ? "" : self::SPAN_END_TAG;
$openSpan .= $className . "\">";
return $openSpan . $insideSpan . $closeSpan;
}
/**
* @param string $value
*
* @return string
*/
private function escape($value)
{
return htmlspecialchars($value, ENT_NOQUOTES);
}
/**
* @return string
*/
private function processKeywords()
{
if (!$this->top->keywords) {
return $this->escape($this->modeBuffer);
}
$result = "";
$lastIndex = 0;
$this->top->lexemesRe->lastIndex = 0;
$match = $this->top->lexemesRe->exec($this->modeBuffer);
while ($match) {
$result .= $this->escape(substr($this->modeBuffer, $lastIndex, $match->index - $lastIndex));
$keyword_match = $this->keywordMatch($this->top, $match);
if ($keyword_match) {
$this->relevance += $keyword_match[1];
$result .= $this->buildSpan($keyword_match[0], $this->escape($match[0]));
} else {
$result .= $this->escape($match[0]);
}
$lastIndex = $this->top->lexemesRe->lastIndex;
$match = $this->top->lexemesRe->exec($this->modeBuffer);
}
return $result . $this->escape(substr($this->modeBuffer, $lastIndex));
}
/**
* @return string
*/
private function processSubLanguage()
{
try {
$hl = new Highlighter();
// @TODO in v10.x, this should no longer be necessary once `$options` is made static
$hl->setAutodetectLanguages($this->options['languages']);
$hl->setClassPrefix($this->options['classPrefix']);
$hl->setTabReplace($this->options['tabReplace']);
if (!$this->safeMode) {
$hl->disableSafeMode();
}
$explicit = is_string($this->top->subLanguage);
if ($explicit && !in_array($this->top->subLanguage, self::$languages)) {
return $this->escape($this->modeBuffer);
}
if ($explicit) {
$res = $hl->highlight(
$this->top->subLanguage,
$this->modeBuffer,
true,
isset($this->continuations[$this->top->subLanguage]) ? $this->continuations[$this->top->subLanguage] : null
);
} else {
$res = $hl->highlightAuto(
$this->modeBuffer,
count($this->top->subLanguage) ? $this->top->subLanguage : null
);
}
// Counting embedded language score towards the host language may be disabled
// with zeroing the containing mode relevance. Use case in point is Markdown that
// allows XML everywhere and makes every XML snippet to have a much larger Markdown
// score.
if ($this->top->relevance > 0) {
$this->relevance += $res->relevance;
}
if ($explicit) {
$this->continuations[$this->top->subLanguage] = $res->top;
}
return $this->buildSpan($res->language, $res->value, false, true);
} catch (\Exception $e) {
return $this->escape($this->modeBuffer);
}
}
/**
* @return void
*/
private function processBuffer()
{
if (is_object($this->top) && $this->top->subLanguage) {
$this->result .= $this->processSubLanguage();
} else {
$this->result .= $this->processKeywords();
}
$this->modeBuffer = '';
}
/**
* @param Mode $mode
*
* @return void
*/
private function startNewMode($mode)
{
$this->result .= $mode->className ? $this->buildSpan($mode->className, "", true) : "";
$t = clone $mode;
$t->parent = $this->top;
$this->top = $t;
}
/**
* @param RegExMatch $match
*
* @return int
*/
private function doBeginMatch($match)
{
$lexeme = $match[0];
$newMode = $match->rule;
if ($newMode && $newMode->endSameAsBegin) {
$newMode->endRe = $this->escapeRe($lexeme);
}
if ($newMode->skip) {
$this->modeBuffer .= $lexeme;
} else {
if ($newMode->excludeBegin) {
$this->modeBuffer .= $lexeme;
}
$this->processBuffer();
if (!$newMode->returnBegin && !$newMode->excludeBegin) {
$this->modeBuffer = $lexeme;
}
}
$this->startNewMode($newMode);
return $newMode->returnBegin ? 0 : strlen($lexeme);
}
/**
* @param RegExMatch $match
*
* @return int|null
*/
private function doEndMatch($match)
{
$lexeme = $match[0];
$matchPlusRemainder = substr($this->codeToHighlight, $match->index);
$endMode = $this->endOfMode($this->top, $matchPlusRemainder);
if (!$endMode) {
return null;
}
$origin = $this->top;
if ($origin->skip) {
$this->modeBuffer .= $lexeme;
} else {
if (!($origin->returnEnd || $origin->excludeEnd)) {
$this->modeBuffer .= $lexeme;
}
$this->processBuffer();
if ($origin->excludeEnd) {
$this->modeBuffer = $lexeme;
}
}
do {
if ($this->top->className) {
$this->result .= self::SPAN_END_TAG;
}
if (!$this->top->skip && !$this->top->subLanguage) {
$this->relevance += $this->top->relevance;
}
$this->top = $this->top->parent;
} while ($this->top !== $endMode->parent);
if ($endMode->starts) {
if ($endMode->endSameAsBegin) {
$endMode->starts->endRe = $endMode->endRe;
}
$this->startNewMode($endMode->starts);
}
return $origin->returnEnd ? 0 : strlen($lexeme);
}
/**
* @param string $textBeforeMatch
* @param RegExMatch|null $match
*
* @return int
*/
private function processLexeme($textBeforeMatch, $match = null)
{
$lexeme = $match ? $match[0] : null;
// add non-matched text to the current mode buffer
$this->modeBuffer .= $textBeforeMatch;
if ($lexeme === null) {
$this->processBuffer();
return 0;
}
// we've found a 0 width match and we're stuck, so we need to advance
// this happens when we have badly behaved rules that have optional matchers to the degree that
// sometimes they can end up matching nothing at all
// Ref: https://github.com/highlightjs/highlight.js/issues/2140
if ($this->lastMatch->type === "begin" && $match->type === "end" && $this->lastMatch->index === $match->index && $lexeme === "") {
// spit the "skipped" character that our regex choked on back into the output sequence
$this->modeBuffer .= substr($this->codeToHighlight, $match->index, 1);
return 1;
}
$this->lastMatch = $match;
if ($match->type === "begin") {
return $this->doBeginMatch($match);
} elseif ($match->type === "illegal" && !$this->ignoreIllegals) {
// illegal match, we do not continue processing
$_modeRaw = isset($this->top->className) ? $this->top->className : "<unnamed>";
throw new \UnexpectedValueException("Illegal lexeme \"$lexeme\" for mode \"$_modeRaw\"");
} elseif ($match->type === "end") {
$processed = $this->doEndMatch($match);
if ($processed !== null) {
return $processed;
}
}
// Why might be find ourselves here? Only one occasion now. An end match that was
// triggered but could not be completed. When might this happen? When an `endSameasBegin`
// rule sets the end rule to a specific match. Since the overall mode termination rule that's
// being used to scan the text isn't recompiled that means that any match that LOOKS like
// the end (but is not, because it is not an exact match to the beginning) will
// end up here. A definite end match, but when `doEndMatch` tries to "reapply"
// the end rule and fails to match, we wind up here, and just silently ignore the end.
//
// This causes no real harm other than stopping a few times too many.
$this->modeBuffer .= $lexeme;
return strlen($lexeme);
}
/**
* Replace tabs for something more usable.
*
* @param string $code
*
* @return string
*/
private function replaceTabs($code)
{
if ($this->options['tabReplace'] !== null) {
return str_replace("\t", $this->options['tabReplace'], $code);
}
return $code;
}
/**
* Set the languages that will used for auto-detection. When using auto-
* detection the code to highlight will be probed for every language in this
* set. Limiting this set to only the languages you want to use will greatly
* improve highlighting speed.
*
* @param string[] $set An array of language games to use for autodetection.
* This defaults to a typical set Web development
* languages.
*
* @return void
*/
public function setAutodetectLanguages(array $set)
{
$this->options['languages'] = array_unique($set);
}
/**
* Get the tab replacement string.
*
* @return string The tab replacement string
*/
public function getTabReplace()
{
return $this->options['tabReplace'];
}
/**
* Set the tab replacement string. This defaults to NULL: no tabs
* will be replaced.
*
* @param string $tabReplace The tab replacement string
*
* @return void
*/
public function setTabReplace($tabReplace)
{
$this->options['tabReplace'] = $tabReplace;
}
/**
* Get the class prefix string.
*
* @return string The class prefix string
*/
public function getClassPrefix()
{
return $this->options['classPrefix'];
}
/**
* Set the class prefix string.
*
* @param string $classPrefix The class prefix string
*
* @return void
*/
public function setClassPrefix($classPrefix)
{
$this->options['classPrefix'] = $classPrefix;
}
/**
* @since 9.17.1.0
*
* @return void
*/
public function enableSafeMode()
{
$this->safeMode = true;
}
/**
* @since 9.17.1.0
*
* @return void
*/
public function disableSafeMode()
{
$this->safeMode = false;
}
/**
* @param string $name
*
* @return Language|null
*/
private function getLanguage($name)
{
if (isset(self::$classMap[$name])) {
return self::$classMap[$name];
} elseif (isset(self::$aliases[$name]) && isset(self::$classMap[self::$aliases[$name]])) {
return self::$classMap[self::$aliases[$name]];
}
return null;
}
/**
* Determine whether or not a language definition supports auto detection.
*
* @param string $name Language name
*
* @return bool
*/
private function autoDetection($name)
{
$lang = $this->getLanguage($name);
return $lang && !$lang->disableAutodetect;
}
/**
* Core highlighting function. Accepts a language name, or an alias, and a
* string with the code to highlight. Returns an object with the following
* properties:
* - relevance (int)
* - value (an HTML string with highlighting markup).
*
* @todo In v10.x, change the return type from \stdClass to HighlightResult
*
* @param string $languageName
* @param string $code
* @param bool $ignoreIllegals
* @param Mode|null $continuation
*
* @throws \DomainException if the requested language was not in this
* Highlighter's language set
* @throws \Exception if an invalid regex was given in a language file
*
* @return HighlightResult|\stdClass
*/
public function highlight($languageName, $code, $ignoreIllegals = true, $continuation = null)
{
$this->codeToHighlight = $code;
$this->language = $this->getLanguage($languageName);
if ($this->language === null) {
throw new \DomainException("Unknown language: \"$languageName\"");
}
$this->language->compile($this->safeMode);
$this->top = $continuation ? $continuation : $this->language;
$this->continuations = array();
$this->result = "";
for ($current = $this->top; $current !== $this->language; $current = $current->parent) {
if ($current->className) {
$this->result = $this->buildSpan($current->className, '', true) . $this->result;
}
}
$this->modeBuffer = "";
$this->relevance = 0;
$this->ignoreIllegals = $ignoreIllegals;
/** @var HighlightResult $res */
$res = new \stdClass();
$res->relevance = 0;
$res->value = "";
$res->language = "";
$res->top = null;
$res->errorRaised = null;
try {
$match = null;
$count = 0;
$index = 0;
while ($this->top) {
$this->top->terminators->lastIndex = $index;
$match = $this->top->terminators->exec($this->codeToHighlight);
if (!$match) {
break;
}
$count = $this->processLexeme(substr($this->codeToHighlight, $index, $match->index - $index), $match);
$index = $match->index + $count;
}
$this->processLexeme(substr($this->codeToHighlight, $index));
for ($current = $this->top; isset($current->parent); $current = $current->parent) {
if ($current->className) {
$this->result .= self::SPAN_END_TAG;
}
}
$res->relevance = $this->relevance;
$res->value = $this->replaceTabs($this->result);
$res->illegal = false;
$res->language = $this->language->name;
$res->top = $this->top;
return $res;
} catch (\Exception $e) {
if (strpos($e->getMessage(), "Illegal") !== false) {
$res->illegal = true;
$res->relevance = 0;
$res->value = $this->escape($this->codeToHighlight);
return $res;
} elseif ($this->safeMode) {
$res->relevance = 0;
$res->value = $this->escape($this->codeToHighlight);
$res->language = $languageName;
$res->top = $this->top;
$res->errorRaised = $e;
return $res;
}
throw $e;
}
}
/**
* Highlight the given code by highlighting the given code with each
* registered language and then finding the match with highest accuracy.
*
* @param string $code
* @param string[]|null $languageSubset When set to null, this method will attempt to highlight $text with each
* language. Set this to an array of languages of your choice to limit the
* amount of languages to try.
*
* @throws \Exception if an invalid regex was given in a language file
* @throws \DomainException if the attempted language to check does not exist
*
* @return HighlightResult|\stdClass
*/
public function highlightAuto($code, $languageSubset = null)
{
/** @var HighlightResult $result */
$result = new \stdClass();
$result->relevance = 0;
$result->value = $this->escape($code);
$result->language = "";
$secondBest = clone $result;
if ($languageSubset === null) {
$optionsLanguages = $this->options['languages'];
if (is_array($optionsLanguages) && count($optionsLanguages) > 0) {
$languageSubset = $optionsLanguages;
} else {
$languageSubset = self::$languages;
}
}
foreach ($languageSubset as $name) {
if ($this->getLanguage($name) === null || !$this->autoDetection($name)) {
continue;
}
$current = $this->highlight($name, $code, false);
if ($current->relevance > $secondBest->relevance) {
$secondBest = $current;
}
if ($current->relevance > $result->relevance) {
$secondBest = $result;
$result = $current;
}
}
if ($secondBest->language) {
$result->secondBest = $secondBest;
}
return $result;
}
/**
* Return a list of all supported languages. Using this list in
* setAutodetectLanguages will turn on autodetection for all supported
* languages.
*
* @deprecated use `Highlighter::listRegisteredLanguages()` or `Highlighter::listBundledLanguages()` instead
*
* @param bool $include_aliases specify whether language aliases
* should be included as well
*
* @since 9.18.1.4 Deprecated in favor of `Highlighter::listRegisteredLanguages()`
* and `Highlighter::listBundledLanguages()`.
* @since 9.12.0.3 The `$include_aliases` parameter was added
* @since 8.3.0.0
*
* @return string[] An array of language names
*/
public function listLanguages($include_aliases = false)
{
@trigger_error('This method is deprecated in favor `Highlighter::listRegisteredLanguages()` or `Highlighter::listBundledLanguages()`. This function will be removed in highlight.php 10.', E_USER_DEPRECATED);
if (empty(self::$languages)) {
trigger_error('No languages are registered, returning all bundled languages instead. You probably did not want this.', E_USER_WARNING);
return self::listBundledLanguages();
}
if ($include_aliases === true) {
return array_merge(self::$languages, array_keys(self::$aliases));
}
return self::$languages;
}
/**
* Returns list of all available aliases for given language name.
*
* @param string $name name or alias of language to look-up
*
* @throws \DomainException if the requested language was not in this
* Highlighter's language set
*
* @since 9.12.0.3
*
* @return string[] An array of all aliases associated with the requested
* language name language. Passed-in name is included as
* well.
*/
public function getAliasesForLanguage($name)
{
$language = self::getLanguage($name);
if ($language === null) {
throw new \DomainException("Unknown language: $language");
}
if ($language->aliases === null) {
return array($language->name);
}
return array_merge(array($language->name), $language->aliases);
}
}

View file

@ -0,0 +1,177 @@
<?php
/* Copyright (c) 2014-2019 Geert Bergman (geert@scrivo.nl), highlight.php
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of "highlight.js", "highlight.php", nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* Implementation of the \Highlight\JsonRef class.
*/
namespace Highlight;
/**
* Class to decode JSON data that contains path-based references.
*
* The language data file for highlight.js are written as JavaScript classes
* and therefore may contain variables. This allows for inner references in
* the language data. This kind of data can be converterd to JSON using the
* path based references. This class can be used to decode such JSON
* structures. It follows the conventions for path based referencing as
* used in dojox.json.ref form the Dojo toolkit (Javascript). A typical
* example of such a structure is as follows:
*
* ```json
* {
* "name":"Kris Zyp",
* "children":[{"name":"Jennika Zyp"},{"name":"Korban Zyp"}],
* "spouse":{
* "name":"Nicole Zyp",
* "spouse":{"$ref":"#"},
* "children":{"$ref":"#children"}
* },
* "oldestChild":{"$ref":"#children.0"}
* }
* ```
*
* Usage example:
*
* ```php
* $jr = new JsonRef();
* $data = $jr->decode(file_get_contents("data.json"));
* echo $data->spouse->spouse->name; // echos 'Kris Zyp'
* echo $data->oldestChild->name; // echos 'Jennika Zyp'
* ```
*
* @todo In Highlight.php 10.x, mark this class final with a keyword.
*
* @since 9.16.0.0 Class has been marked as final
*
* @final
*
* @internal
*/
class JsonRef
{
/**
* Array to hold all data paths in the given JSON data.
*
* @var array<string, mixed>
*/
private $paths = null;
/**
* Recurse through the data tree and fill an array of paths that reference
* the nodes in the decoded JSON data structure.
*
* @param mixed $s Decoded JSON data (decoded with json_decode)
* @param string $r The current path key (for example: '#children.0').
*
* @return void
*/
private function getPaths(&$s, $r = "#")
{
$this->paths[$r] = &$s;
if (is_array($s) || is_object($s)) {
foreach ($s as $k => &$v) {
if ($k !== "\$ref") {
$this->getPaths($v, $r == "#" ? "#{$k}" : "{$r}.{$k}");
}
}
}
}
/**
* Recurse through the data tree and resolve all path references.
*
* @param mixed $s Decoded JSON data (decoded with json_decode)
* @param int $limit
* @param int $depth
*
* @return void
*/
private function resolvePathReferences(&$s, $limit = 20, $depth = 1)
{
if ($depth >= $limit) {
return;
}
++$depth;
if (is_array($s) || is_object($s)) {
foreach ($s as $k => &$v) {
if ($k === "\$ref") {
$s = $this->paths[$v];
} else {
$this->resolvePathReferences($v, $limit, $depth);
}
}
}
}
/**
* Decode JSON data that may contain path based references.
*
* @deprecated 9.16.0.0 This method will be removed in Highlight.php. Make use of `decodeRef` instead.
*
* @param string|object $json JSON data string or JSON data object
*
* @return mixed The decoded JSON data
*/
public function decode($json)
{
// Clear the path array.
$this->paths = array();
// Decode the given JSON data if necessary.
$x = is_string($json) ? json_decode($json) : $json;
// Get all data paths.
$this->getPaths($x);
// Resolve all path references.
$this->resolvePathReferences($x);
// Return the data.
return $x;
}
/**
* Decode JSON data that may contain path based references.
*
* @param object $json JSON data string or JSON data object
*
* @return void
*/
public function decodeRef(&$json)
{
// Clear the path array.
$this->paths = array();
// Get all data paths.
$this->getPaths($json);
// Resolve all path references.
$this->resolvePathReferences($json);
}
}

View file

@ -0,0 +1,413 @@
<?php
/* Copyright (c)
* - 2006-2013, Ivan Sagalaev (maniacsoftwaremaniacs.org), highlight.js
* (original author)
* - 2013-2019, Geert Bergman (geertscrivo.nl), highlight.php
* - 2014 Daniel Lynge, highlight.php (contributor)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of "highlight.js", "highlight.php", nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace Highlight;
/**
* @todo In highlight.php 10.x, replace the @final attribute with the `final` keyword.
*
* @final
*
* @internal
*
* // Backward compatibility properties
*
* @property Mode $mode (DEPRECATED) All properties traditionally inside of $mode are now available directly from this class.
* @property bool $caseInsensitive (DEPRECATED) Due to compatibility requirements with highlight.js, use `case_insensitive` instead.
*/
class Language extends Mode
{
/** @var string[] */
private static $COMMON_KEYWORDS = array('of', 'and', 'for', 'in', 'not', 'or', 'if', 'then');
/** @var string */
public $name;
/** @var Mode|null */
private $mode = null;
/**
* @param string $lang
* @param string $filePath
*
* @throws \InvalidArgumentException when the given $filePath is inaccessible
*/
public function __construct($lang, $filePath)
{
$this->name = $lang;
// We're loading the JSON definition file as an \stdClass object instead of an associative array. This is being
// done to take advantage of objects being pass by reference automatically in PHP whereas arrays are pass by
// value.
$json = file_get_contents($filePath);
if ($json === false) {
throw new \InvalidArgumentException("Language file inaccessible: $filePath");
}
$this->mode = json_decode($json);
}
/**
* @param string $name
*
* @return bool|Mode|null
*/
public function __get($name)
{
if ($name === 'mode') {
@trigger_error('The "mode" property will be removed in highlight.php 10.x', E_USER_DEPRECATED);
return $this->mode;
}
if ($name === 'caseInsensitive') {
@trigger_error('Due to compatibility requirements with highlight.js, use "case_insensitive" instead.', E_USER_DEPRECATED);
if (isset($this->mode->case_insensitive)) {
return $this->mode->case_insensitive;
}
return false;
}
if (isset($this->mode->{$name})) {
return $this->mode->{$name};
}
return null;
}
/**
* @param string $value
* @param bool $global
*
* @return RegEx
*/
private function langRe($value, $global = false)
{
return RegExUtils::langRe($value, $global, $this->case_insensitive);
}
/**
* Performs a shallow merge of multiple objects into one.
*
* @param Mode $params the objects to merge
* @param array<string, mixed> ...$_
*
* @return Mode
*/
private function inherit($params, $_ = array())
{
/** @var Mode $result */
$result = new \stdClass();
$objects = func_get_args();
$parent = array_shift($objects);
foreach ($parent as $key => $value) {
$result->{$key} = $value;
}
foreach ($objects as $object) {
foreach ($object as $key => $value) {
$result->{$key} = $value;
}
}
return $result;
}
/**
* @param Mode|null $mode
*
* @return bool
*/
private function dependencyOnParent($mode)
{
if (!$mode) {
return false;
}
if (isset($mode->endsWithParent) && $mode->endsWithParent) {
return $mode->endsWithParent;
}
return $this->dependencyOnParent(isset($mode->starts) ? $mode->starts : null);
}
/**
* @param Mode $mode
*
* @return array<int, \stdClass|Mode>
*/
private function expandOrCloneMode($mode)
{
if ($mode->variants && !$mode->cachedVariants) {
$mode->cachedVariants = array();
foreach ($mode->variants as $variant) {
$mode->cachedVariants[] = $this->inherit($mode, array('variants' => null), $variant);
}
}
// EXPAND
// if we have variants then essentially "replace" the mode with the variants
// this happens in compileMode, where this function is called from
if ($mode->cachedVariants) {
return $mode->cachedVariants;
}
// CLONE
// if we have dependencies on parents then we need a unique
// instance of ourselves, so we can be reused with many
// different parents without issue
if ($this->dependencyOnParent($mode)) {
return array($this->inherit($mode, array(
'starts' => $mode->starts ? $this->inherit($mode->starts) : null,
)));
}
// highlight.php does not have a concept freezing our Modes
// no special dependency issues, just return ourselves
return array($mode);
}
/**
* @param Mode $mode
* @param Mode|null $parent
*
* @return void
*/
private function compileMode($mode, $parent = null)
{
Mode::_normalize($mode);
if ($mode->compiled) {
return;
}
$mode->compiled = true;
$mode->keywords = $mode->keywords ? $mode->keywords : $mode->beginKeywords;
if ($mode->keywords) {
$mode->keywords = $this->compileKeywords($mode->keywords, (bool) $this->case_insensitive);
}
$mode->lexemesRe = $this->langRe($mode->lexemes ? $mode->lexemes : "\w+", true);
if ($parent) {
if ($mode->beginKeywords) {
$mode->begin = "\\b(" . implode("|", explode(" ", $mode->beginKeywords)) . ")\\b";
}
if (!$mode->begin) {
$mode->begin = "\B|\b";
}
$mode->beginRe = $this->langRe($mode->begin);
if ($mode->endSameAsBegin) {
$mode->end = $mode->begin;
}
if (!$mode->end && !$mode->endsWithParent) {
$mode->end = "\B|\b";
}
if ($mode->end) {
$mode->endRe = $this->langRe($mode->end);
}
$mode->terminator_end = $mode->end;
if ($mode->endsWithParent && $parent->terminator_end) {
$mode->terminator_end .= ($mode->end ? "|" : "") . $parent->terminator_end;
}
}
if ($mode->illegal) {
$mode->illegalRe = $this->langRe($mode->illegal);
}
if ($mode->relevance === null) {
$mode->relevance = 1;
}
if (!$mode->contains) {
$mode->contains = array();
}
/** @var Mode[] $expandedContains */
$expandedContains = array();
foreach ($mode->contains as &$c) {
if ($c instanceof \stdClass) {
Mode::_normalize($c);
}
$expandedContains = array_merge($expandedContains, $this->expandOrCloneMode(
$c === 'self' ? $mode : $c
));
}
$mode->contains = $expandedContains;
/** @var Mode $contain */
foreach ($mode->contains as $contain) {
$this->compileMode($contain, $mode);
}
if ($mode->starts) {
$this->compileMode($mode->starts, $parent);
}
$terminators = new Terminators($this->case_insensitive);
$mode->terminators = $terminators->_buildModeRegex($mode);
Mode::_handleDeprecations($mode);
}
/**
* @param array<string, string>|string $rawKeywords
* @param bool $caseSensitive
*
* @return array<string, array<int, string|int>>
*/
private function compileKeywords($rawKeywords, $caseSensitive)
{
/** @var array<string, array<int, string|int>> $compiledKeywords */
$compiledKeywords = array();
if (is_string($rawKeywords)) {
$this->splitAndCompile("keyword", $rawKeywords, $compiledKeywords, $caseSensitive);
} else {
foreach ($rawKeywords as $className => $rawKeyword) {
$this->splitAndCompile($className, $rawKeyword, $compiledKeywords, $caseSensitive);
}
}
return $compiledKeywords;
}
/**
* @param string $className
* @param string $str
* @param array<string, array<int, string|int>> $compiledKeywords
* @param bool $caseSensitive
*
* @return void
*/
private function splitAndCompile($className, $str, array &$compiledKeywords, $caseSensitive)
{
if ($caseSensitive) {
$str = strtolower($str);
}
$keywords = explode(' ', $str);
foreach ($keywords as $keyword) {
$pair = explode('|', $keyword);
$providedScore = isset($pair[1]) ? $pair[1] : null;
$compiledKeywords[$pair[0]] = array($className, $this->scoreForKeyword($pair[0], $providedScore));
}
}
/**
* @param string $keyword
* @param string $providedScore
*
* @return int
*/
private function scoreForKeyword($keyword, $providedScore)
{
if ($providedScore) {
return (int) $providedScore;
}
return $this->commonKeyword($keyword) ? 0 : 1;
}
/**
* @param string $word
*
* @return bool
*/
private function commonKeyword($word)
{
return in_array(strtolower($word), self::$COMMON_KEYWORDS);
}
/**
* Compile the Language definition.
*
* @param bool $safeMode
*
* @since 9.17.1.0 The 'safeMode' parameter was added.
*
* @return void
*/
public function compile($safeMode)
{
if ($this->compiled) {
return;
}
$jr = new JsonRef();
$jr->decodeRef($this->mode);
// self is not valid at the top-level
if (isset($this->mode->contains) && !in_array("self", $this->mode->contains)) {
if (!$safeMode) {
throw new \LogicException("`self` is not supported at the top-level of a language.");
}
$this->mode->contains = array_filter($this->mode->contains, function ($mode) {
return $mode !== "self";
});
}
$this->compileMode($this->mode);
}
/**
* @todo Remove in highlight.php 10.x
*
* @deprecated 9.16.0 This method should never have been exposed publicly as part of the API.
*
* @param \stdClass|null $e
*
* @return void
*/
public function complete(&$e)
{
Mode::_normalize($e);
}
}

View file

@ -0,0 +1,195 @@
<?php
/* Copyright (c) 2019 Geert Bergman (geert@scrivo.nl), highlight.php
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of "highlight.js", "highlight.php", nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace Highlight;
/**
* A PHP representation of a Mode in the JS library.
*
* @internal
*
* @since 9.16.0.0
* @mixin ModeDeprecations
*
* Language definition set via language definition JSON files
*
* @property bool $case_insensitive = false
* @property string[] $aliases = array()
* @property string|null $className = null
* @property string|null $begin = null
* @property RegEx|null $beginRe = null
* @property string|null $end = null
* @property RegEx|null $endRe = null
* @property string|null $beginKeywords = null
* @property bool $endsWithParent = false
* @property bool $endsParent = false
* @property bool $endSameAsBegin = false
* @property string|null $lexemes = null
* @property RegEx|null $lexemesRe = null
* @property array<string, array<int, string|int>> $keywords = array()
* @property string|null $illegal = null
* @property RegEx|null $illegalRe = null
* @property bool $excludeBegin = false
* @property bool $excludeEnd = false
* @property bool $returnBegin = false
* @property bool $returnEnd = false
* @property Mode[] $contains = array()
* @property Mode|null $starts = null
* @property Mode[] $variants = array()
* @property int|null $relevance = null
* @property string|string[]|null $subLanguage = null
* @property bool $skip = false
* @property bool $disableAutodetect = false
*
* Properties set at runtime by the language compilation process
* @property array<int, Mode> $cachedVariants = array()
* @property Terminators|null $terminators = null
* @property string $terminator_end = ""
* @property bool $compiled = false
* @property Mode|null $parent = null
* @property string $type = ''
*
* @see https://highlightjs.readthedocs.io/en/latest/reference.html
*/
abstract class Mode extends \stdClass
{
/**
* Fill in the missing properties that this Mode does not have.
*
* @internal
*
* @param \stdClass|null $obj
*
* @since 9.16.0.0
*
* @return void
*/
public static function _normalize(&$obj)
{
// Don't overload our Modes if we've already normalized it
if (isset($obj->__IS_COMPLETE)) {
return;
}
if ($obj === null) {
$obj = new \stdClass();
}
$patch = array(
"begin" => true,
"end" => true,
"lexemes" => true,
"illegal" => true,
);
// These values come in from JSON definition files
$defaultValues = array(
"case_insensitive" => false,
"aliases" => array(),
"className" => null,
"begin" => null,
"beginRe" => null,
"end" => null,
"endRe" => null,
"beginKeywords" => null,
"endsWithParent" => false,
"endsParent" => false,
"endSameAsBegin" => false,
"lexemes" => null,
"lexemesRe" => null,
"keywords" => array(),
"illegal" => null,
"illegalRe" => null,
"excludeBegin" => false,
"excludeEnd" => false,
"returnBegin" => false,
"returnEnd" => false,
"contains" => array(),
"starts" => null,
"variants" => array(),
"relevance" => null,
"subLanguage" => null,
"skip" => false,
"disableAutodetect" => false,
);
// These values are set at runtime
$runTimeValues = array(
"cachedVariants" => array(),
"terminators" => null,
"terminator_end" => "",
"compiled" => false,
"parent" => null,
// This value is unique to highlight.php Modes
"__IS_COMPLETE" => true,
);
foreach ($patch as $k => $v) {
if (isset($obj->{$k})) {
$obj->{$k} = str_replace("\\/", "/", $obj->{$k});
$obj->{$k} = str_replace("/", "\\/", $obj->{$k});
}
}
foreach ($defaultValues as $k => $v) {
if (!isset($obj->{$k}) && is_object($obj)) {
$obj->{$k} = $v;
}
}
foreach ($runTimeValues as $k => $v) {
if (is_object($obj)) {
$obj->{$k} = $v;
}
}
}
/**
* Set any deprecated properties values to their replacement values.
*
* @internal
*
* @param \stdClass $obj
*
* @return void
*/
public static function _handleDeprecations(&$obj)
{
$deprecations = array(
// @TODO Deprecated since 9.16.0.0; remove at 10.x
'caseInsensitive' => 'case_insensitive',
'terminatorEnd' => 'terminator_end',
);
foreach ($deprecations as $deprecated => $new) {
$obj->{$deprecated} = &$obj->{$new};
}
}
}

View file

@ -0,0 +1,50 @@
<?php
/* Copyright (c) 2019 Geert Bergman (geert@scrivo.nl), highlight.php
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of "highlight.js", "highlight.php", nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace Highlight;
/**
* @internal
*/
trait ModeDeprecations
{
/**
* @deprecated 9.16.0.0 Use `case_insensitive` instead
*
* @var bool DEPRECATED
*/
public $caseInsensitive;
/**
* @deprecated 9.16.0.0 Use `terminator_end` instead
*
* @var string
*/
public $terminatorEnd;
}

View file

@ -0,0 +1,108 @@
<?php
/* Copyright (c) 2019 Geert Bergman (geert@scrivo.nl), highlight.php
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of "highlight.js", "highlight.php", nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace Highlight;
/**
* A PHP implementation to match JavaScript's RegExp class as closely as possible.
*
* A lot of behavior in this class is reversed engineered, so improvements are welcome!
*
* @internal
*
* @since 9.16.0
*/
final class RegEx
{
/**
* @var string
*/
public $source;
/**
* @var int
*/
public $lastIndex = 0;
/**
* @param RegEx|string $regex
*/
public function __construct($regex)
{
$this->source = (string) $regex;
}
public function __toString()
{
return (string) $this->source;
}
/**
* Run the regular expression against the given string.
*
* @since 9.16.0.0
*
* @param string $str the string to run this regular expression against
*
* @return RegExMatch|null
*/
public function exec($str)
{
$index = null;
$results = array();
preg_match($this->source, $str, $results, PREG_OFFSET_CAPTURE, $this->lastIndex);
if ($results === null || count($results) === 0) {
return null;
}
foreach ($results as &$result) {
if ($result[1] !== -1) {
// Only save the index if it hasn't been set yet
if ($index === null) {
$index = $result[1];
}
$result = $result[0];
} else {
$result = null;
}
}
unset($result);
$this->lastIndex += strlen($results[0]) + ($index - $this->lastIndex);
$matches = new RegExMatch($results);
$matches->index = isset($index) ? $index : 0;
$matches->input = $str;
return $matches;
}
}

View file

@ -0,0 +1,108 @@
<?php
/* Copyright (c) 2019 Geert Bergman (geert@scrivo.nl), highlight.php
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of "highlight.js", "highlight.php", nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace Highlight;
/**
* @internal
*
* @implements \ArrayAccess<int, string|null>
* @implements \IteratorAggregate<int, string|null>
*
* @since 9.16.0.0
*/
class RegExMatch implements \ArrayAccess, \Countable, \IteratorAggregate
{
/** @var array<int, string|null> */
private $data;
/** @var int */
public $index;
/** @var string */
public $input;
/**
* @param array<int, string|null> $results
*/
public function __construct(array $results)
{
$this->data = $results;
}
/**
* {@inheritdoc}
*/
public function getIterator()
{
return new \ArrayIterator($this->data);
}
/**
* {@inheritdoc}
*/
public function offsetExists($offset)
{
return isset($this->data[$offset]);
}
/**
* {@inheritdoc}
*/
public function offsetGet($offset)
{
return $this->data[$offset];
}
/**
* {@inheritdoc}
*/
public function offsetSet($offset, $value)
{
throw new \LogicException(__CLASS__ . ' instances are read-only.');
}
/**
* {@inheritdoc}
*/
public function offsetUnset($offset)
{
throw new \LogicException(__CLASS__ . ' instances are read-only.');
}
/**
* {@inheritdoc}
*
* @return int
*/
public function count()
{
return count($this->data);
}
}

View file

@ -0,0 +1,61 @@
<?php
/* Copyright (c) 2019 Geert Bergman (geert@scrivo.nl), highlight.php
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of "highlight.js", "highlight.php", nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace Highlight;
/**
* @internal
*
* @since 9.16.0.0
*/
abstract class RegExUtils
{
/**
* @param string $value
* @param bool $global
* @param bool $case_insensitive
*
* @return RegEx
*/
public static function langRe($value, $global, $case_insensitive)
{
// PCRE allows us to change the definition of "new line." The
// `(*ANYCRLF)` matches `\r`, `\n`, and `\r\n` for `$`
//
// https://www.pcre.org/original/doc/html/pcrepattern.html
// PCRE requires us to tell it the string can be UTF-8, so the 'u' modifier
// is required. The `u` flag for PCRE is different from JS' unicode flag.
$escaped = preg_replace('#(?<!\\\)/#um', '\\/', $value);
$regex = "/(*ANYCRLF){$escaped}/um" . ($case_insensitive ? "i" : "");
return new RegEx($regex);
}
}

View file

@ -0,0 +1,245 @@
<?php
namespace Highlight;
/**
* @internal
*
* @since 9.16.0.0
*/
final class Terminators
{
/** @var bool */
private $caseInsensitive;
/** @var array<int, Mode|string> */
private $matchIndexes = array();
/** @var RegEx|null */
private $matcherRe = null;
/** @var array<int, array<int, Mode|string>> */
private $regexes = array();
/** @var int */
private $matchAt = 1;
/** @var Mode */
private $mode;
/** @var int */
public $lastIndex = 0;
/**
* @param bool $caseInsensitive
*/
public function __construct($caseInsensitive)
{
$this->caseInsensitive = $caseInsensitive;
}
/**
* @internal
*
* @param Mode $mode
*
* @return self
*/
public function _buildModeRegex($mode)
{
$this->mode = $mode;
$term = null;
for ($i = 0; $i < count($mode->contains); ++$i) {
$re = null;
$term = $mode->contains[$i];
if ($term->beginKeywords) {
$re = "\.?(?:" . $term->begin . ")\.?";
} else {
$re = $term->begin;
}
$this->addRule($term, $re);
}
if ($mode->terminator_end) {
$this->addRule('end', $mode->terminator_end);
}
if ($mode->illegal) {
$this->addRule('illegal', $mode->illegal);
}
/** @var array<int, string> $terminators */
$terminators = array();
foreach ($this->regexes as $regex) {
$terminators[] = $regex[1];
}
$this->matcherRe = $this->langRe($this->joinRe($terminators, '|'), true);
$this->lastIndex = 0;
return $this;
}
/**
* @param string $s
*
* @return RegExMatch|null
*/
public function exec($s)
{
if (count($this->regexes) === 0) {
return null;
}
$this->matcherRe->lastIndex = $this->lastIndex;
$match = $this->matcherRe->exec($s);
if (!$match) {
return null;
}
/** @var Mode|string $rule */
$rule = null;
for ($i = 0; $i < count($match); ++$i) {
if ($match[$i] !== null && isset($this->matchIndexes[$i])) {
$rule = $this->matchIndexes[$i];
break;
}
}
if (is_string($rule)) {
$match->type = $rule;
$match->extra = array($this->mode->illegal, $this->mode->terminator_end);
} else {
$match->type = "begin";
$match->rule = $rule;
}
return $match;
}
/**
* @param string $value
* @param bool $global
*
* @return RegEx
*/
private function langRe($value, $global = false)
{
return RegExUtils::langRe($value, $global, $this->caseInsensitive);
}
/**
* @param Mode|string $rule
* @param string $regex
*
* @return void
*/
private function addRule($rule, $regex)
{
$this->matchIndexes[$this->matchAt] = $rule;
$this->regexes[] = array($rule, $regex);
$this->matchAt += $this->reCountMatchGroups($regex) + 1;
}
/**
* joinRe logically computes regexps.join(separator), but fixes the
* backreferences so they continue to match.
*
* it also places each individual regular expression into it's own
* match group, keeping track of the sequencing of those match groups
* is currently an exercise for the caller. :-)
*
* @param array<int, string> $regexps
* @param string $separator
*
* @return string
*/
private function joinRe($regexps, $separator)
{
// backreferenceRe matches an open parenthesis or backreference. To avoid
// an incorrect parse, it additionally matches the following:
// - [...] elements, where the meaning of parentheses and escapes change
// - other escape sequences, so we do not misparse escape sequences as
// interesting elements
// - non-matching or lookahead parentheses, which do not capture. These
// follow the '(' with a '?'.
$backreferenceRe = '#\[(?:[^\\\\\]]|\\\.)*\]|\(\??|\\\([1-9][0-9]*)|\\\.#';
$numCaptures = 0;
$ret = '';
$strLen = count($regexps);
for ($i = 0; $i < $strLen; ++$i) {
++$numCaptures;
$offset = $numCaptures;
$re = $this->reStr($regexps[$i]);
if ($i > 0) {
$ret .= $separator;
}
$ret .= "(";
while (strlen($re) > 0) {
$matches = array();
$matchFound = preg_match($backreferenceRe, $re, $matches, PREG_OFFSET_CAPTURE);
if ($matchFound === 0) {
$ret .= $re;
break;
}
// PHP aliases to match the JS naming conventions
$match = $matches[0];
$index = $match[1];
$ret .= substr($re, 0, $index);
$re = substr($re, $index + strlen($match[0]));
if (substr($match[0], 0, 1) === '\\' && isset($matches[1])) {
// Adjust the backreference.
$ret .= "\\" . strval(intval($matches[1][0]) + $offset);
} else {
$ret .= $match[0];
if ($match[0] == "(") {
++$numCaptures;
}
}
}
$ret .= ")";
}
return $ret;
}
/**
* @param RegEx|string $re
*
* @return mixed
*/
private function reStr($re)
{
if ($re && isset($re->source)) {
return $re->source;
}
return $re;
}
/**
* @param RegEx|string $re
*
* @return int
*/
private function reCountMatchGroups($re)
{
$results = array();
$escaped = preg_replace('#(?<!\\\)/#um', '\\/', (string) $re);
preg_match_all("/{$escaped}|/u", '', $results);
return count($results) - 1;
}
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,58 @@
{
"illegal": "[!@#$^&',?+~`|:]",
"keywords": "ALPHA BIT CHAR CR CRLF CTL DIGIT DQUOTE HEXDIG HTAB LF LWSP OCTET SP VCHAR WSP",
"contains": [
{
"className": "attribute",
"begin": "^[a-zA-Z][a-zA-Z0-9\\-]*(?=\\s*=)"
},
{
"className": "comment",
"begin": ";",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "symbol",
"begin": "%b[0-1]+(-[0-1]+|(\\.[0-1]+)+){0,1}"
},
{
"className": "symbol",
"begin": "%d[0-9]+(-[0-9]+|(\\.[0-9]+)+){0,1}"
},
{
"className": "symbol",
"begin": "%x[0-9A-F]+(-[0-9A-F]+|(\\.[0-9A-F]+)+){0,1}"
},
{
"className": "symbol",
"begin": "%[si]"
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "number",
"begin": "\\b\\d+(\\.\\d+)?",
"relevance": 0
}
]
}

View file

@ -0,0 +1,55 @@
{
"contains": [
{
"className": "number",
"begin": "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b",
"relevance": 5
},
{
"className": "number",
"begin": "\\b\\d+\\b",
"relevance": 0
},
{
"className": "string",
"begin": "\"(GET|POST|HEAD|PUT|DELETE|CONNECT|OPTIONS|PATCH|TRACE)",
"end": "\"",
"keywords": "GET POST HEAD PUT DELETE CONNECT OPTIONS PATCH TRACE",
"illegal": "\\n",
"relevance": 5,
"contains": [
{
"begin": "HTTP\/[12]\\.\\d",
"relevance": 5
}
]
},
{
"className": "string",
"begin": "\\[\\d[^\\]\\n]{8,}\\]",
"illegal": "\\n",
"relevance": 1
},
{
"className": "string",
"begin": "\\[",
"end": "\\]",
"illegal": "\\n",
"relevance": 0
},
{
"className": "string",
"begin": "\"Mozilla\/\\d\\.\\d \\(",
"end": "\"",
"illegal": "\\n",
"relevance": 3
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"relevance": 0
}
]
}

View file

@ -0,0 +1,148 @@
{
"aliases": [
"as"
],
"keywords": {
"keyword": "as break case catch class const continue default delete do dynamic each else extends final finally for function get if implements import in include instanceof interface internal is namespace native new override package private protected public return set static super switch this throw try typeof use var void while with",
"literal": "true false null undefined"
},
"contains": [
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.0.contains.0"
}
]
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.2.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0
},
{
"className": "class",
"beginKeywords": "package",
"end": "{",
"contains": [
{
"className": "title",
"begin": "[a-zA-Z]\\w*",
"relevance": 0
}
]
},
{
"className": "class",
"beginKeywords": "class interface",
"end": "{",
"excludeEnd": true,
"contains": [
{
"beginKeywords": "extends implements"
},
{
"$ref": "#contains.5.contains.0"
}
]
},
{
"className": "meta",
"beginKeywords": "import include",
"end": ";",
"keywords": {
"meta-keyword": "import include"
}
},
{
"className": "function",
"beginKeywords": "function",
"end": "[{;]",
"excludeEnd": true,
"illegal": "\\S",
"contains": [
{
"$ref": "#contains.5.contains.0"
},
{
"className": "params",
"begin": "\\(",
"end": "\\)",
"contains": [
{
"$ref": "#contains.0"
},
{
"$ref": "#contains.1"
},
{
"$ref": "#contains.2"
},
{
"$ref": "#contains.3"
},
{
"className": "rest_arg",
"begin": "[.]{3}",
"end": "[a-zA-Z_$][a-zA-Z0-9_$]*",
"relevance": 10
}
]
},
{
"begin": ":\\s*([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)"
}
]
},
{
"begin": "\\.\\s*[a-zA-Z_]\\w*",
"relevance": 0
}
],
"illegal": "#"
}

View file

@ -0,0 +1,118 @@
{
"case_insensitive": true,
"keywords": {
"keyword": "abort else new return abs elsif not reverse abstract end accept entry select access exception of separate aliased exit or some all others subtype and for out synchronized array function overriding at tagged generic package task begin goto pragma terminate body private then if procedure type case in protected constant interface is raise use declare range delay limited record when delta loop rem while digits renames with do mod requeue xor",
"literal": "True False"
},
"contains": [
{
"className": "comment",
"begin": "--",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"contains": [
{
"begin": "\"\"",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "'.'"
},
{
"className": "number",
"begin": "\\b(\\d(_|\\d)*#\\w+(\\.\\w+)?#([eE][-+]?\\d(_|\\d)*)?|\\d(_|\\d)*(\\.\\d(_|\\d)*)?([eE][-+]?\\d(_|\\d)*)?)",
"relevance": 0
},
{
"className": "symbol",
"begin": "'[A-Za-z](_?[A-Za-z0-9.])*"
},
{
"className": "title",
"begin": "(\\bwith\\s+)?(\\bprivate\\s+)?\\bpackage\\s+(\\bbody\\s+)?",
"end": "(is|$)",
"keywords": "package body",
"excludeBegin": true,
"excludeEnd": true,
"illegal": "\\Q[]{}%#'\"\\E"
},
{
"begin": "(\\b(with|overriding)\\s+)?\\b(function|procedure)\\s+",
"end": "(\\bis|\\bwith|\\brenames|\\)\\s*;)",
"keywords": "overriding function procedure with is renames return",
"returnBegin": true,
"contains": [
{
"$ref": "#contains.0"
},
{
"className": "title",
"begin": "(\\bwith\\s+)?\\b(function|procedure)\\s+",
"end": "(\\(|\\s+|$)",
"excludeBegin": true,
"excludeEnd": true,
"illegal": "\\Q[]{}%#'\"\\E"
},
{
"begin": "\\s+:\\s+",
"end": "\\s*(:=|;|\\)|=>|$)",
"illegal": "\\Q[]{}%#'\"\\E",
"contains": [
{
"beginKeywords": "loop for declare others",
"endsParent": true
},
{
"className": "keyword",
"beginKeywords": "not null constant access function procedure in out aliased exception"
},
{
"className": "type",
"begin": "[A-Za-z](_?[A-Za-z0-9.])*",
"endsParent": true,
"relevance": 0
}
]
},
{
"className": "type",
"begin": "\\breturn\\s+",
"end": "(\\s+|;|$)",
"keywords": "return",
"excludeBegin": true,
"excludeEnd": true,
"endsParent": true,
"illegal": "\\Q[]{}%#'\"\\E"
}
]
},
{
"className": "type",
"begin": "\\b(sub)?type\\s+",
"end": "\\s+",
"keywords": "type",
"excludeBegin": true,
"illegal": "\\Q[]{}%#'\"\\E"
},
{
"$ref": "#contains.6.contains.2"
}
]
}

View file

@ -0,0 +1,138 @@
{
"aliases": [
"asc"
],
"keywords": "for in|0 break continue while do|0 return if else case switch namespace is cast or and xor not get|0 in inout|10 out override set|0 private public const default|0 final shared external mixin|10 enum typedef funcdef this super import from interface abstract|0 try catch protected explicit property",
"illegal": "(^using\\s+[A-Za-z0-9_\\.]+;$|\\bfunctions*[^\\(])",
"contains": [
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.0.contains.0"
}
],
"relevance": 0
},
{
"className": "string",
"begin": "\"\"\"",
"end": "\"\"\""
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.3.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"beginKeywords": "interface namespace",
"end": "{",
"illegal": "[;.\\-]",
"contains": [
{
"className": "symbol",
"begin": "[a-zA-Z0-9_]+"
}
]
},
{
"beginKeywords": "class",
"end": "{",
"illegal": "[;.\\-]",
"contains": [
{
"className": "symbol",
"begin": "[a-zA-Z0-9_]+",
"contains": [
{
"begin": "[:,]\\s*",
"contains": [
{
"className": "symbol",
"begin": "[a-zA-Z0-9_]+"
}
]
}
]
}
]
},
{
"className": "built_in",
"begin": "\\b(void|bool|int|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|string|ref|array|double|float|auto|dictionary)",
"contains": [
{
"className": "keyword",
"begin": "<",
"end": ">",
"contains": [
{
"$ref": "#contains.7"
},
{
"className": "symbol",
"begin": "[a-zA-Z0-9_]+@",
"contains": [
{
"$ref": "#contains.7.contains.0"
}
]
}
]
}
]
},
{
"$ref": "#contains.7.contains.0.contains.1"
},
{
"className": "literal",
"begin": "\\b(null|true|false)"
},
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?f?|\\.\\d+f?)([eE][-+]?\\d+f?)?)"
}
]
}

View file

@ -0,0 +1,78 @@
{
"aliases": [
"apacheconf"
],
"case_insensitive": true,
"contains": [
{
"className": "comment",
"begin": "#",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "section",
"begin": "<\/?",
"end": ">"
},
{
"className": "attribute",
"begin": "\\w+",
"relevance": 0,
"keywords": {
"nomarkup": "order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"
},
"starts": {
"end": "$",
"relevance": 0,
"keywords": {
"literal": "on off all"
},
"contains": [
{
"className": "meta",
"begin": "\\s\\[",
"end": "\\]$"
},
{
"className": "variable",
"begin": "[\\$%]\\{",
"end": "\\}",
"contains": [
"self",
{
"className": "number",
"begin": "[\\$%]\\d+"
}
]
},
{
"$ref": "#contains.2.starts.contains.1.contains.1"
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
}
]
}
}
],
"illegal": "\\S"
}

View file

@ -0,0 +1,116 @@
{
"aliases": [
"osascript"
],
"keywords": {
"keyword": "about above after against and around as at back before beginning behind below beneath beside between but by considering contain contains continue copy div does eighth else end equal equals error every exit fifth first for fourth from front get given global if ignoring in into is it its last local me middle mod my ninth not of on onto or over prop property put ref reference repeat returning script second set seventh since sixth some tell tenth that the|0 then third through thru timeout times to transaction try until where while whose with without",
"literal": "AppleScript false linefeed return pi quote result space tab true",
"built_in": "alias application boolean class constant date file integer list number real record string text activate beep count delay launch log offset read round run say summarize write character characters contents day frontmost id item length month name paragraph paragraphs rest reverse running time version weekday word words year"
},
"contains": [
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0
},
{
"className": "built_in",
"begin": "\\b(clipboard info|the clipboard|info for|list (disks|folder)|mount volume|path to|(close|open for) access|(get|set) eof|current date|do shell script|get volume settings|random number|set volume|system attribute|system info|time to GMT|(load|run|store) script|scripting components|ASCII (character|number)|localized string|choose (application|color|file|file name|folder|from list|remote application|URL)|display (alert|dialog))\\b|^\\s*return\\b"
},
{
"className": "literal",
"begin": "\\b(text item delimiters|current application|missing value)\\b"
},
{
"className": "keyword",
"begin": "\\b(apart from|aside from|instead of|out of|greater than|isn't|(doesn't|does not) (equal|come before|come after|contain)|(greater|less) than( or equal)?|(starts?|ends|begins?) with|contained by|comes (before|after)|a (ref|reference)|POSIX file|POSIX path|(date|time) string|quoted form)\\b"
},
{
"beginKeywords": "on",
"illegal": "[${=;\\n]",
"contains": [
{
"className": "title",
"begin": "[a-zA-Z_]\\w*",
"relevance": 0
},
{
"className": "params",
"begin": "\\(",
"end": "\\)",
"contains": [
"self",
{
"$ref": "#contains.1"
},
{
"$ref": "#contains.0"
}
]
}
]
},
{
"className": "comment",
"begin": "--",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\\(\\*",
"end": "\\*\\)",
"contains": [
"self",
{
"$ref": "#contains.6"
},
{
"$ref": "#contains.6.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "#",
"end": "$",
"contains": [
{
"$ref": "#contains.6.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
}
],
"illegal": "\/\/|->|=>|\\[\\["
}

View file

@ -0,0 +1,250 @@
{
"aliases": [
"arcade"
],
"keywords": {
"keyword": "if for while var new function do return void else break",
"literal": "BackSlash DoubleQuote false ForwardSlash Infinity NaN NewLine null PI SingleQuote Tab TextFormatting true undefined",
"built_in": "Abs Acos Angle Attachments Area AreaGeodetic Asin Atan Atan2 Average Bearing Boolean Buffer BufferGeodetic Ceil Centroid Clip Console Constrain Contains Cos Count Crosses Cut Date DateAdd DateDiff Day Decode DefaultValue Dictionary Difference Disjoint Distance DistanceGeodetic Distinct DomainCode DomainName Equals Exp Extent Feature FeatureSet FeatureSetByAssociation FeatureSetById FeatureSetByPortalItem FeatureSetByRelationshipName FeatureSetByTitle FeatureSetByUrl Filter First Floor Geometry GroupBy Guid HasKey Hour IIf IndexOf Intersection Intersects IsEmpty IsNan IsSelfIntersecting Length LengthGeodetic Log Max Mean Millisecond Min Minute Month MultiPartToSinglePart Multipoint NextSequenceValue Now Number OrderBy Overlaps Point Polygon Polyline Portal Pow Random Relate Reverse RingIsClockWise Round Second SetGeometry Sin Sort Sqrt Stdev Sum SymmetricDifference Tan Text Timestamp Today ToLocal Top Touches ToUTC TrackCurrentTime TrackGeometryWindow TrackIndex TrackStartTime TrackWindow TypeOf Union UrlEncode Variance Weekday When Within Year "
},
"contains": [
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.0.contains.0"
}
]
},
{
"className": "string",
"begin": "`",
"end": "`",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"className": "subst",
"begin": "\\$\\{",
"end": "\\}",
"keywords": {
"$ref": "#keywords"
},
"contains": [
{
"$ref": "#contains.0"
},
{
"$ref": "#contains.1"
},
{
"$ref": "#contains.2"
},
{
"className": "number",
"variants": [
{
"begin": "\\b(0[bB][01]+)"
},
{
"begin": "\\b(0[oO][0-7]+)"
},
{
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)"
}
],
"relevance": 0
},
{
"className": "regexp",
"begin": "\\\/",
"end": "\\\/[gimuy]*",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"begin": "\\[",
"end": "\\]",
"relevance": 0,
"contains": [
{
"$ref": "#contains.0.contains.0"
}
]
}
]
}
]
}
]
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.3.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "symbol",
"begin": "\\$[datastore|feature|layer|map|measure|sourcefeature|sourcelayer|targetfeature|targetlayer|value|view]+"
},
{
"$ref": "#contains.2.contains.1.contains.3"
},
{
"begin": "[{,]\\s*",
"relevance": 0,
"contains": [
{
"begin": "[A-Za-z_][0-9A-Za-z_]*\\s*:",
"returnBegin": true,
"relevance": 0,
"contains": [
{
"className": "attr",
"begin": "[A-Za-z_][0-9A-Za-z_]*",
"relevance": 0
}
]
}
]
},
{
"begin": "(!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|\/=|\/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~|\\b(return)\\b)\\s*",
"keywords": "return",
"contains": [
{
"$ref": "#contains.3"
},
{
"$ref": "#contains.4"
},
{
"$ref": "#contains.2.contains.1.contains.4"
},
{
"className": "function",
"begin": "(\\(.*?\\)|[A-Za-z_][0-9A-Za-z_]*)\\s*=>",
"returnBegin": true,
"end": "\\s*=>",
"contains": [
{
"className": "params",
"variants": [
{
"begin": "[A-Za-z_][0-9A-Za-z_]*"
},
{
"begin": "\\(\\s*\\)"
},
{
"begin": "\\(",
"end": "\\)",
"excludeBegin": true,
"excludeEnd": true,
"keywords": {
"$ref": "#keywords"
},
"contains": [
{
"$ref": "#contains.0"
},
{
"$ref": "#contains.1"
},
{
"$ref": "#contains.2"
},
{
"$ref": "#contains.2.contains.1.contains.3"
},
{
"$ref": "#contains.2.contains.1.contains.4"
},
{
"$ref": "#contains.4"
},
{
"$ref": "#contains.3"
}
]
}
]
}
]
}
],
"relevance": 0
},
{
"className": "function",
"beginKeywords": "function",
"end": "\\{",
"excludeEnd": true,
"contains": [
{
"className": "title",
"begin": "[A-Za-z_][0-9A-Za-z_]*",
"relevance": 0
},
{
"className": "params",
"begin": "\\(",
"end": "\\)",
"excludeBegin": true,
"excludeEnd": true,
"contains": {
"$ref": "#contains.8.contains.3.contains.0.variants.2.contains"
}
}
],
"illegal": "\\[|%"
},
{
"begin": "\\$[(.]"
}
],
"illegal": "#(?!!)"
}

View file

@ -0,0 +1,334 @@
{
"aliases": [
"c",
"cc",
"h",
"c++",
"h++",
"hpp",
"hh",
"hxx",
"cxx"
],
"keywords": {
"keyword": "int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_tshort reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq boolean byte word String",
"built_in": "std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr _Bool complex _Complex imaginary _Imaginary setup loopKeyboardController MouseController SoftwareSerial EthernetServer EthernetClient LiquidCrystal RobotControl GSMVoiceCall EthernetUDP EsploraTFT HttpClient RobotMotor WiFiClient GSMScanner FileSystem Scheduler GSMServer YunClient YunServer IPAddress GSMClient GSMModem Keyboard Ethernet Console GSMBand Esplora Stepper Process WiFiUDP GSM_SMS Mailbox USBHost Firmata PImage Client Server GSMPIN FileIO Bridge Serial EEPROM Stream Mouse Audio Servo File Task GPRS WiFi Wire TFT GSM SPI SD runShellCommandAsynchronously analogWriteResolution retrieveCallingNumber printFirmwareVersion analogReadResolution sendDigitalPortPair noListenOnLocalhost readJoystickButton setFirmwareVersion readJoystickSwitch scrollDisplayRight getVoiceCallStatus scrollDisplayLeft writeMicroseconds delayMicroseconds beginTransmission getSignalStrength runAsynchronously getAsynchronously listenOnLocalhost getCurrentCarrier readAccelerometer messageAvailable sendDigitalPorts lineFollowConfig countryNameWrite runShellCommand readStringUntil rewindDirectory readTemperature setClockDivider readLightSensor endTransmission analogReference detachInterrupt countryNameRead attachInterrupt encryptionType readBytesUntil robotNameWrite readMicrophone robotNameRead cityNameWrite userNameWrite readJoystickY readJoystickX mouseReleased openNextFile scanNetworks noInterrupts digitalWrite beginSpeaker mousePressed isActionDone mouseDragged displayLogos noAutoscroll addParameter remoteNumber getModifiers keyboardRead userNameRead waitContinue processInput parseCommand printVersion readNetworks writeMessage blinkVersion cityNameRead readMessage setDataMode parsePacket isListening setBitOrder beginPacket isDirectory motorsWrite drawCompass digitalRead clearScreen serialEvent rightToLeft setTextSize leftToRight requestFrom keyReleased compassRead analogWrite interrupts WiFiServer disconnect playMelody parseFloat autoscroll getPINUsed setPINUsed setTimeout sendAnalog readSlider analogRead beginWrite createChar motorsStop keyPressed tempoWrite readButton subnetMask debugPrint macAddress writeGreen randomSeed attachGPRS readString sendString remotePort releaseAll mouseMoved background getXChange getYChange answerCall getResult voiceCall endPacket constrain getSocket writeJSON getButton available connected findUntil readBytes exitValue readGreen writeBlue startLoop IPAddress isPressed sendSysex pauseMode gatewayIP setCursor getOemKey tuneWrite noDisplay loadImage switchPIN onRequest onReceive changePIN playFile noBuffer parseInt overflow checkPIN knobRead beginTFT bitClear updateIR bitWrite position writeRGB highByte writeRed setSpeed readBlue noStroke remoteIP transfer shutdown hangCall beginSMS endWrite attached maintain noCursor checkReg checkPUK shiftOut isValid shiftIn pulseIn connect println localIP pinMode getIMEI display noBlink process getBand running beginSD drawBMP lowByte setBand release bitRead prepare pointTo readRed setMode noFill remove listen stroke detach attach noTone exists buffer height bitSet circle config cursor random IRread setDNS endSMS getKey micros millis begin print write ready flush width isPIN blink clear press mkdir rmdir close point yield image BSSID click delay read text move peek beep rect line open seek fill size turn stop home find step tone sqrt RSSI SSID end bit tan cos sin pow map abs max min get run put",
"literal": "true false nullptr NULL DIGITAL_MESSAGE FIRMATA_STRING ANALOG_MESSAGE REPORT_DIGITAL REPORT_ANALOG INPUT_PULLUP SET_PIN_MODE INTERNAL2V56 SYSTEM_RESET LED_BUILTIN INTERNAL1V1 SYSEX_START INTERNAL EXTERNAL DEFAULT OUTPUT INPUT HIGH LOW"
},
"illegal": "<\/",
"contains": [
{
"variants": [
{
"begin": "=",
"end": ";"
},
{
"begin": "\\(",
"end": "\\)"
},
{
"beginKeywords": "new throw return else",
"end": ";"
}
],
"keywords": {
"$ref": "#keywords"
},
"contains": [
{
"className": "keyword",
"begin": "\\b[a-z\\d_]*_t\\b"
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.0.contains.1.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "number",
"variants": [
{
"begin": "\\b(0b[01']+)"
},
{
"begin": "(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"
},
{
"begin": "(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"
}
],
"relevance": 0
},
{
"className": "string",
"variants": [
{
"begin": "(u8?|U|L)?\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"begin": "(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",
"end": "'",
"illegal": "."
},
{
"begin": "(?:u8?|U|L)?R\"([^()\\\\ ]{0,16})\\((?:.|\\n)*?\\)\\1\""
}
]
},
{
"begin": "\\(",
"end": "\\)",
"keywords": {
"$ref": "#keywords"
},
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"$ref": "#contains.0.contains.1"
},
{
"$ref": "#contains.0.contains.2"
},
{
"$ref": "#contains.0.contains.3"
},
{
"$ref": "#contains.0.contains.4"
},
"self"
],
"relevance": 0
}
],
"relevance": 0
},
{
"className": "function",
"begin": "((decltype\\(auto\\)|(?:[a-zA-Z_]\\w*::)?[a-zA-Z_]\\w*(?:<.*?>)?)[\\*&\\s]+)+(?:[a-zA-Z_]\\w*::)?[a-zA-Z]\\w*\\s*\\(",
"returnBegin": true,
"end": "[{;=]",
"excludeEnd": true,
"keywords": {
"$ref": "#keywords"
},
"illegal": "[^\\w\\s\\*&:<>]",
"contains": [
{
"begin": "decltype\\(auto\\)",
"keywords": {
"$ref": "#keywords"
},
"relevance": 0
},
{
"begin": "(?:[a-zA-Z_]\\w*::)?[a-zA-Z]\\w*\\s*\\(",
"returnBegin": true,
"contains": [
{
"className": "title",
"begin": "(?:[a-zA-Z_]\\w*::)?[a-zA-Z]\\w*",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "params",
"begin": "\\(",
"end": "\\)",
"keywords": {
"$ref": "#keywords"
},
"relevance": 0,
"contains": [
{
"$ref": "#contains.0.contains.1"
},
{
"$ref": "#contains.0.contains.2"
},
{
"$ref": "#contains.0.contains.4"
},
{
"$ref": "#contains.0.contains.3"
},
{
"$ref": "#contains.0.contains.0"
},
{
"begin": "\\(",
"end": "\\)",
"keywords": {
"$ref": "#keywords"
},
"relevance": 0,
"contains": [
"self",
{
"$ref": "#contains.0.contains.1"
},
{
"$ref": "#contains.0.contains.2"
},
{
"$ref": "#contains.0.contains.4"
},
{
"$ref": "#contains.0.contains.3"
},
{
"$ref": "#contains.0.contains.0"
}
]
}
]
},
{
"$ref": "#contains.0.contains.0"
},
{
"$ref": "#contains.0.contains.1"
},
{
"$ref": "#contains.0.contains.2"
},
{
"className": "meta",
"begin": "#\\s*[a-z]+\\b",
"end": "$",
"keywords": {
"meta-keyword": "if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"
},
"contains": [
{
"begin": "\\\\\\n",
"relevance": 0
},
{
"className": "meta-string",
"variants": {
"$ref": "#contains.0.contains.4.variants"
}
},
{
"className": "meta-string",
"begin": "<.*?>",
"end": "$",
"illegal": "\\n"
},
{
"$ref": "#contains.0.contains.1"
},
{
"$ref": "#contains.0.contains.2"
}
]
}
]
},
{
"$ref": "#contains.0.contains.0"
},
{
"$ref": "#contains.0.contains.1"
},
{
"$ref": "#contains.0.contains.2"
},
{
"$ref": "#contains.0.contains.3"
},
{
"$ref": "#contains.0.contains.4"
},
{
"$ref": "#contains.1.contains.6"
},
{
"begin": "\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",
"end": ">",
"keywords": {
"$ref": "#keywords"
},
"contains": [
"self",
{
"$ref": "#contains.0.contains.0"
}
]
},
{
"begin": "[a-zA-Z]\\w*::",
"keywords": {
"$ref": "#keywords"
}
},
{
"className": "class",
"beginKeywords": "class struct",
"end": "[{;:]",
"contains": [
{
"begin": "<",
"end": ">",
"contains": [
"self"
]
},
{
"className": "title",
"begin": "[a-zA-Z]\\w*",
"relevance": 0
}
]
}
],
"exports": {
"preprocessor": {
"$ref": "#contains.1.contains.6"
},
"strings": {
"$ref": "#contains.0.contains.4"
},
"keywords": {
"$ref": "#keywords"
}
}
}

View file

@ -0,0 +1,107 @@
{
"case_insensitive": true,
"aliases": [
"arm"
],
"lexemes": "\\.?[a-zA-Z]\\w*",
"keywords": {
"meta": ".2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .arm .thumb .code16 .code32 .force_thumb .thumb_func .ltorg ALIAS ALIGN ARM AREA ASSERT ATTR CN CODE CODE16 CODE32 COMMON CP DATA DCB DCD DCDU DCDO DCFD DCFDU DCI DCQ DCQU DCW DCWU DN ELIF ELSE END ENDFUNC ENDIF ENDP ENTRY EQU EXPORT EXPORTAS EXTERN FIELD FILL FUNCTION GBLA GBLL GBLS GET GLOBAL IF IMPORT INCBIN INCLUDE INFO KEEP LCLA LCLL LCLS LTORG MACRO MAP MEND MEXIT NOFP OPT PRESERVE8 PROC QN READONLY RELOC REQUIRE REQUIRE8 RLIST FN ROUT SETA SETL SETS SN SPACE SUBT THUMB THUMBX TTL WHILE WEND ",
"built_in": "r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 pc lr sp ip sl sb fp a1 a2 a3 a4 v1 v2 v3 v4 v5 v6 v7 v8 f0 f1 f2 f3 f4 f5 f6 f7 p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 q0 q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12 q13 q14 q15 cpsr_c cpsr_x cpsr_s cpsr_f cpsr_cx cpsr_cxs cpsr_xs cpsr_xsf cpsr_sf cpsr_cxsf spsr_c spsr_x spsr_s spsr_f spsr_cx spsr_cxs spsr_xs spsr_xsf spsr_sf spsr_cxsf s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 s16 s17 s18 s19 s20 s21 s22 s23 s24 s25 s26 s27 s28 s29 s30 s31 d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 d21 d22 d23 d24 d25 d26 d27 d28 d29 d30 d31 {PC} {VAR} {TRUE} {FALSE} {OPT} {CONFIG} {ENDIAN} {CODESIZE} {CPU} {FPU} {ARCHITECTURE} {PCSTOREOFFSET} {ARMASM_VERSION} {INTER} {ROPI} {RWPI} {SWST} {NOSWST} . @"
},
"contains": [
{
"className": "keyword",
"begin": "\\b(adc|(qd?|sh?|u[qh]?)?add(8|16)?|usada?8|(q|sh?|u[qh]?)?(as|sa)x|and|adrl?|sbc|rs[bc]|asr|b[lx]?|blx|bxj|cbn?z|tb[bh]|bic|bfc|bfi|[su]bfx|bkpt|cdp2?|clz|clrex|cmp|cmn|cpsi[ed]|cps|setend|dbg|dmb|dsb|eor|isb|it[te]{0,3}|lsl|lsr|ror|rrx|ldm(([id][ab])|f[ds])?|ldr((s|ex)?[bhd])?|movt?|mvn|mra|mar|mul|[us]mull|smul[bwt][bt]|smu[as]d|smmul|smmla|mla|umlaal|smlal?([wbt][bt]|d)|mls|smlsl?[ds]|smc|svc|sev|mia([bt]{2}|ph)?|mrr?c2?|mcrr2?|mrs|msr|orr|orn|pkh(tb|bt)|rbit|rev(16|sh)?|sel|[su]sat(16)?|nop|pop|push|rfe([id][ab])?|stm([id][ab])?|str(ex)?[bhd]?|(qd?)?sub|(sh?|q|u[qh]?)?sub(8|16)|[su]xt(a?h|a?b(16)?)|srs([id][ab])?|swpb?|swi|smi|tst|teq|wfe|wfi|yield)(eq|ne|cs|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|hs|lo)?[sptrx]?",
"end": "\\s"
},
{
"className": "comment",
"begin": "[;@]",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.1.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "'",
"end": "[^\\\\]'",
"relevance": 0
},
{
"className": "title",
"begin": "\\|",
"end": "\\|",
"illegal": "\\n",
"relevance": 0
},
{
"className": "number",
"variants": [
{
"begin": "[#$=]?0x[0-9a-f]+"
},
{
"begin": "[#$=]?0b[01]+"
},
{
"begin": "[#$=]\\d+"
},
{
"begin": "\\b\\d+"
}
],
"relevance": 0
},
{
"className": "symbol",
"variants": [
{
"begin": "^[a-z_\\.\\$][a-z0-9_\\.\\$]+"
},
{
"begin": "^\\s*[a-z_\\.\\$][a-z0-9_\\.\\$]+:"
},
{
"begin": "[=#]\\w+"
}
],
"relevance": 0
}
]
}

View file

@ -0,0 +1,186 @@
{
"aliases": [
"adoc"
],
"contains": [
{
"className": "comment",
"begin": "^\/{4,}\\n",
"end": "\\n\/{4,}$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 10
},
{
"className": "comment",
"begin": "^\/\/",
"end": "$",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "title",
"begin": "^\\.\\w.*$"
},
{
"begin": "^[=\\*]{4,}\\n",
"end": "\\n^[=\\*]{4,}$",
"relevance": 10
},
{
"className": "section",
"relevance": 10,
"variants": [
{
"begin": "^(={1,5}) .+?( \\1)?$"
},
{
"begin": "^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$"
}
]
},
{
"className": "meta",
"begin": "^:.+?:",
"end": "\\s",
"excludeEnd": true,
"relevance": 10
},
{
"className": "meta",
"begin": "^\\[.+?\\]$",
"relevance": 0
},
{
"className": "quote",
"begin": "^_{4,}\\n",
"end": "\\n_{4,}$",
"relevance": 10
},
{
"className": "code",
"begin": "^[\\-\\.]{4,}\\n",
"end": "\\n[\\-\\.]{4,}$",
"relevance": 10
},
{
"begin": "^\\+{4,}\\n",
"end": "\\n\\+{4,}$",
"contains": [
{
"begin": "<",
"end": ">",
"subLanguage": "xml",
"relevance": 0
}
],
"relevance": 10
},
{
"className": "bullet",
"begin": "^(\\*+|\\-+|\\.+|[^\\n]+?::)\\s+"
},
{
"className": "symbol",
"begin": "^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+",
"relevance": 10
},
{
"className": "strong",
"begin": "\\B\\*(?![\\*\\s])",
"end": "(\\n{2}|\\*)",
"contains": [
{
"begin": "\\\\*\\w",
"relevance": 0
}
]
},
{
"className": "emphasis",
"begin": "\\B'(?!['\\s])",
"end": "(\\n{2}|')",
"contains": [
{
"begin": "\\\\'\\w",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "emphasis",
"begin": "_(?![_\\s])",
"end": "(\\n{2}|_)",
"relevance": 0
},
{
"className": "string",
"variants": [
{
"begin": "``.+?''"
},
{
"begin": "`.+?'"
}
]
},
{
"className": "code",
"begin": "(`.+?`|\\+.+?\\+)",
"relevance": 0
},
{
"className": "code",
"begin": "^[ \\t]",
"end": "$",
"relevance": 0
},
{
"begin": "^'{3,}[ \\t]*$",
"relevance": 10
},
{
"begin": "(link:)?(http|https|ftp|file|irc|image:?):\\S+\\[.*?\\]",
"returnBegin": true,
"contains": [
{
"begin": "(link|image:?):",
"relevance": 0
},
{
"className": "link",
"begin": "\\w",
"end": "[^\\[]+",
"relevance": 0
},
{
"className": "string",
"begin": "\\[",
"end": "\\]",
"excludeBegin": true,
"excludeEnd": true,
"relevance": 0
}
],
"relevance": 10
}
]
}

View file

@ -0,0 +1,219 @@
{
"keywords": "false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else extends implements break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws privileged aspectOf adviceexecution proceed cflowbelow cflow initialization preinitialization staticinitialization withincode target within execution getWithinTypeName handler thisJoinPoint thisJoinPointStaticPart thisEnclosingJoinPointStaticPart declare parents warning error soft precedence thisAspectInstance",
"illegal": "<\\\/|#",
"contains": [
{
"className": "comment",
"begin": "\/\\*\\*",
"end": "\\*\/",
"contains": [
{
"begin": "\\w+@",
"relevance": 0
},
{
"className": "doctag",
"begin": "@[A-Za-z]+"
},
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"$ref": "#contains.0.contains.2"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.0.contains.2"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.3.contains.0"
}
]
},
{
"className": "class",
"beginKeywords": "aspect",
"end": "[{;=]",
"excludeEnd": true,
"illegal": "[:;\"\\[\\]]",
"contains": [
{
"beginKeywords": "extends implements pertypewithin perthis pertarget percflowbelow percflow issingleton"
},
{
"className": "title",
"begin": "[a-zA-Z_]\\w*",
"relevance": 0
},
{
"begin": "\\([^\\)]*",
"end": "[)]+",
"keywords": "false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else extends implements break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws privileged aspectOf adviceexecution proceed cflowbelow cflow initialization preinitialization staticinitialization withincode target within execution getWithinTypeName handler thisJoinPoint thisJoinPointStaticPart thisEnclosingJoinPointStaticPart declare parents warning error soft precedence thisAspectInstance get set args call",
"excludeEnd": false
}
]
},
{
"className": "class",
"beginKeywords": "class interface",
"end": "[{;=]",
"excludeEnd": true,
"relevance": 0,
"keywords": "class interface",
"illegal": "[:\"\\[\\]]",
"contains": [
{
"beginKeywords": "extends implements"
},
{
"$ref": "#contains.5.contains.1"
}
]
},
{
"beginKeywords": "pointcut after before around throwing returning",
"end": "[)]",
"excludeEnd": false,
"illegal": "[\"\\[\\]]",
"contains": [
{
"begin": "[a-zA-Z_]\\w*\\s*\\(",
"returnBegin": true,
"contains": [
{
"$ref": "#contains.5.contains.1"
}
]
}
]
},
{
"begin": "[:]",
"returnBegin": true,
"end": "[{;]",
"relevance": 0,
"excludeEnd": false,
"keywords": "false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else extends implements break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws privileged aspectOf adviceexecution proceed cflowbelow cflow initialization preinitialization staticinitialization withincode target within execution getWithinTypeName handler thisJoinPoint thisJoinPointStaticPart thisEnclosingJoinPointStaticPart declare parents warning error soft precedence thisAspectInstance",
"illegal": "[\"\\[\\]]",
"contains": [
{
"begin": "[a-zA-Z_]\\w*\\s*\\(",
"keywords": "false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else extends implements break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws privileged aspectOf adviceexecution proceed cflowbelow cflow initialization preinitialization staticinitialization withincode target within execution getWithinTypeName handler thisJoinPoint thisJoinPointStaticPart thisEnclosingJoinPointStaticPart declare parents warning error soft precedence thisAspectInstance get set args call",
"relevance": 0
},
{
"$ref": "#contains.4"
}
]
},
{
"beginKeywords": "new throw",
"relevance": 0
},
{
"className": "function",
"begin": "\\w+ +\\w+(\\.)?\\w+\\s*\\([^\\)]*\\)\\s*((throws)[\\w\\s,]+)?[\\{;]",
"returnBegin": true,
"end": "[{;=]",
"keywords": "false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else extends implements break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws privileged aspectOf adviceexecution proceed cflowbelow cflow initialization preinitialization staticinitialization withincode target within execution getWithinTypeName handler thisJoinPoint thisJoinPointStaticPart thisEnclosingJoinPointStaticPart declare parents warning error soft precedence thisAspectInstance",
"excludeEnd": true,
"contains": [
{
"begin": "[a-zA-Z_]\\w*\\s*\\(",
"returnBegin": true,
"relevance": 0,
"contains": [
{
"$ref": "#contains.5.contains.1"
}
]
},
{
"className": "params",
"begin": "\\(",
"end": "\\)",
"relevance": 0,
"keywords": "false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else extends implements break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws privileged aspectOf adviceexecution proceed cflowbelow cflow initialization preinitialization staticinitialization withincode target within execution getWithinTypeName handler thisJoinPoint thisJoinPointStaticPart thisEnclosingJoinPointStaticPart declare parents warning error soft precedence thisAspectInstance",
"contains": [
{
"$ref": "#contains.3"
},
{
"$ref": "#contains.4"
},
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0
},
{
"$ref": "#contains.2"
}
]
},
{
"$ref": "#contains.1"
},
{
"$ref": "#contains.2"
}
]
},
{
"$ref": "#contains.10.contains.1.contains.2"
},
{
"className": "meta",
"begin": "@[A-Za-z]+"
}
]
}

View file

@ -0,0 +1,96 @@
{
"case_insensitive": true,
"aliases": [
"ahk"
],
"keywords": {
"keyword": "Break Continue Critical Exit ExitApp Gosub Goto New OnExit Pause return SetBatchLines SetTimer Suspend Thread Throw Until ahk_id ahk_class ahk_pid ahk_exe ahk_group",
"literal": "true false NOT AND OR",
"built_in": "ComSpec Clipboard ClipboardAll ErrorLevel"
},
"contains": [
{
"begin": "`[\\s\\S]"
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.0"
}
]
},
{
"className": "comment",
"begin": ";",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.2.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "number",
"begin": "\\b\\d+(\\.\\d+)?",
"relevance": 0
},
{
"className": "variable",
"begin": "%[a-zA-Z0-9#_$@]+%"
},
{
"className": "built_in",
"begin": "^\\s*\\w+\\s*(,|%)"
},
{
"className": "title",
"variants": [
{
"begin": "^[^\\n\";]+::(?!=)"
},
{
"begin": "^[^\\n\";]+:(?!=)",
"relevance": 0
}
]
},
{
"className": "meta",
"begin": "^\\s*#\\w+",
"end": "$",
"relevance": 0
},
{
"className": "built_in",
"begin": "A_[a-zA-Z0-9]+"
},
{
"begin": ",\\s*,"
}
]
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,87 @@
{
"case_insensitive": true,
"lexemes": "\\.?[a-zA-Z]\\w*",
"keywords": {
"keyword": "adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub subi swap tst wdr",
"built_in": "r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf",
"meta": ".byte .cseg .db .def .device .dseg .dw .endmacro .equ .eseg .exit .include .list .listmac .macro .nolist .org .set"
},
"contains": [
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": ";",
"end": "$",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0
},
{
"className": "number",
"begin": "\\b(0b[01]+)",
"relevance": 0
},
{
"className": "number",
"begin": "\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)"
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "'",
"end": "[^\\\\]'",
"illegal": "[^\\\\][^']"
},
{
"className": "symbol",
"begin": "^[A-Za-z0-9_.$]+:"
},
{
"className": "meta",
"begin": "#",
"end": "$"
},
{
"className": "subst",
"begin": "@[0-9]+"
}
]
}

View file

@ -0,0 +1,120 @@
{
"keywords": {
"keyword": "BEGIN END if else while do for in break continue delete next nextfile function func exit|10"
},
"contains": [
{
"className": "variable",
"variants": [
{
"begin": "\\$[\\w\\d#@][\\w\\d_]*"
},
{
"begin": "\\$\\{(.*?)}"
}
]
},
{
"className": "string",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
],
"variants": [
{
"begin": "(u|b)?r?'''",
"end": "'''",
"relevance": 10
},
{
"begin": "(u|b)?r?\"\"\"",
"end": "\"\"\"",
"relevance": 10
},
{
"begin": "(u|r|ur)'",
"end": "'",
"relevance": 10
},
{
"begin": "(u|r|ur)\"",
"end": "\"",
"relevance": 10
},
{
"begin": "(b|br)'",
"end": "'"
},
{
"begin": "(b|br)\"",
"end": "\""
},
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.1.contains.0"
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.1.contains.0"
}
]
}
]
},
{
"className": "regexp",
"begin": "\\\/",
"end": "\\\/[gimuy]*",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.1.contains.0"
},
{
"begin": "\\[",
"end": "\\]",
"relevance": 0,
"contains": [
{
"$ref": "#contains.1.contains.0"
}
]
}
]
},
{
"className": "comment",
"begin": "#",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "number",
"begin": "\\b\\d+(\\.\\d+)?",
"relevance": 0
}
]
}

View file

@ -0,0 +1,85 @@
{
"keywords": "false int abstract private char boolean static null if for true while long throw finally protected final return void enum else break new catch byte super case short default double public try this switch continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count order group by asc desc index hint like dispaly edit client server ttsbegin ttscommit str real date container anytype common div mod",
"contains": [
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.2.contains.0"
}
]
},
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0
},
{
"className": "meta",
"begin": "#",
"end": "$"
},
{
"className": "class",
"beginKeywords": "class interface",
"end": "{",
"excludeEnd": true,
"illegal": ":",
"contains": [
{
"beginKeywords": "extends implements"
},
{
"className": "title",
"begin": "[a-zA-Z_]\\w*",
"relevance": 0
}
]
}
]
}

View file

@ -0,0 +1,92 @@
{
"aliases": [
"sh",
"zsh"
],
"lexemes": "\\b-?[a-z\\._]+\\b",
"keywords": {
"keyword": "if then else elif fi for while in do done case esac function",
"literal": "true false",
"built_in": "break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",
"_": "-ne -eq -lt -gt -f -d -e -s -l -a"
},
"contains": [
{
"className": "meta",
"begin": "^#![^\\n]+sh\\s*$",
"relevance": 10
},
{
"className": "function",
"begin": "\\w[\\w\\d_]*\\s*\\(\\s*\\)\\s*\\{",
"returnBegin": true,
"contains": [
{
"className": "title",
"begin": "\\w[\\w\\d_]*",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "comment",
"begin": "#",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
},
{
"className": "variable",
"variants": [
{
"begin": "\\$[\\w\\d#@][\\w\\d_]*"
},
{
"begin": "\\$\\{(.*?)}"
}
]
},
{
"className": "variable",
"begin": "\\$\\(",
"end": "\\)",
"contains": [
{
"$ref": "#contains.3.contains.0"
}
]
}
]
},
{
"className": "",
"begin": "\\\\\""
},
{
"className": "string",
"begin": "'",
"end": "'"
},
{
"$ref": "#contains.3.contains.1"
}
]
}

View file

@ -0,0 +1,72 @@
{
"case_insensitive": true,
"illegal": "^.",
"lexemes": "[a-zA-Z][a-zA-Z0-9_$%!#]*",
"keywords": {
"keyword": "ABS ASC AND ATN AUTO|0 BEEP BLOAD|10 BSAVE|10 CALL CALLS CDBL CHAIN CHDIR CHR$|10 CINT CIRCLE CLEAR CLOSE CLS COLOR COM COMMON CONT COS CSNG CSRLIN CVD CVI CVS DATA DATE$ DEFDBL DEFINT DEFSNG DEFSTR DEF|0 SEG USR DELETE DIM DRAW EDIT END ENVIRON ENVIRON$ EOF EQV ERASE ERDEV ERDEV$ ERL ERR ERROR EXP FIELD FILES FIX FOR|0 FRE GET GOSUB|10 GOTO HEX$ IF THEN ELSE|0 INKEY$ INP INPUT INPUT# INPUT$ INSTR IMP INT IOCTL IOCTL$ KEY ON OFF LIST KILL LEFT$ LEN LET LINE LLIST LOAD LOC LOCATE LOF LOG LPRINT USING LSET MERGE MID$ MKDIR MKD$ MKI$ MKS$ MOD NAME NEW NEXT NOISE NOT OCT$ ON OR PEN PLAY STRIG OPEN OPTION BASE OUT PAINT PALETTE PCOPY PEEK PMAP POINT POKE POS PRINT PRINT] PSET PRESET PUT RANDOMIZE READ REM RENUM RESET|0 RESTORE RESUME RETURN|0 RIGHT$ RMDIR RND RSET RUN SAVE SCREEN SGN SHELL SIN SOUND SPACE$ SPC SQR STEP STICK STOP STR$ STRING$ SWAP SYSTEM TAB TAN TIME$ TIMER TROFF TRON TO USR VAL VARPTR VARPTR$ VIEW WAIT WHILE WEND WIDTH WINDOW WRITE XOR"
},
"contains": [
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "REM",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 10
},
{
"className": "comment",
"begin": "'",
"end": "$",
"contains": [
{
"$ref": "#contains.1.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "symbol",
"begin": "^[0-9]+ ",
"relevance": 10
},
{
"className": "number",
"begin": "\\b([0-9]+[0-9edED.]*[#!]?)",
"relevance": 0
},
{
"className": "number",
"begin": "(&[hH][0-9a-fA-F]{1,4})"
},
{
"className": "number",
"begin": "(&[oO][0-7]{1,6})"
}
]
}

View file

@ -0,0 +1,74 @@
{
"contains": [
{
"className": "attribute",
"begin": "<",
"end": ">"
},
{
"begin": "::=",
"starts": {
"end": "$",
"contains": [
{
"begin": "<",
"end": ">"
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.1.starts.contains.1.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.1.starts.contains.3.contains.0"
}
]
}
]
}
}
]
}

View file

@ -0,0 +1,47 @@
{
"aliases": [
"bf"
],
"contains": [
{
"className": "comment",
"begin": "[^\\[\\]\\.,\\+\\-<> \r\n]",
"end": "[\\[\\]\\.,\\+\\-<> \r\n]",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"returnEnd": true,
"relevance": 0
},
{
"className": "title",
"begin": "[\\[\\]]",
"relevance": 0
},
{
"className": "string",
"begin": "[\\.,]",
"relevance": 0
},
{
"begin": "(?:\\+\\+|\\-\\-)",
"contains": [
{
"className": "literal",
"begin": "[\\+\\-]",
"relevance": 0
}
]
},
{
"$ref": "#contains.3.contains.0"
}
]
}

View file

@ -0,0 +1,126 @@
{
"case_insensitive": true,
"keywords": {
"keyword": "div mod in and or not xor asserterror begin case do downto else end exit for if of repeat then to until while with var",
"literal": "false true"
},
"illegal": "\\\/\\*",
"contains": [
{
"className": "string",
"begin": "'",
"end": "'",
"contains": [
{
"begin": "''"
}
]
},
{
"className": "string",
"begin": "(#\\d+)+"
},
{
"className": "number",
"begin": "\\b\\d+(\\.\\d+)?(DT|D|T)",
"relevance": 0
},
{
"className": "string",
"begin": "\"",
"end": "\""
},
{
"className": "number",
"begin": "\\b\\d+(\\.\\d+)?",
"relevance": 0
},
{
"className": "class",
"begin": "OBJECT (Table|Form|Report|Dataport|Codeunit|XMLport|MenuSuite|Page|Query) (\\d+) ([^\\r\\n]+)",
"returnBegin": true,
"contains": [
{
"className": "title",
"begin": "[a-zA-Z]\\w*",
"relevance": 0
},
{
"className": "function",
"beginKeywords": "procedure",
"end": "[:;]",
"keywords": "procedure|10",
"contains": [
{
"$ref": "#contains.5.contains.0"
},
{
"className": "params",
"begin": "\\(",
"end": "\\)",
"keywords": "div mod in and or not xor asserterror begin case do downto else end exit for if of repeat then to until while with var",
"contains": [
{
"$ref": "#contains.0"
},
{
"$ref": "#contains.1"
}
]
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\\{",
"end": "\\}",
"contains": [
{
"$ref": "#contains.5.contains.1.contains.2.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "comment",
"begin": "\\(\\*",
"end": "\\*\\)",
"contains": [
{
"$ref": "#contains.5.contains.1.contains.2.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 10
}
]
}
]
},
{
"$ref": "#contains.5.contains.1"
}
]
}

View file

@ -0,0 +1,87 @@
{
"aliases": [
"capnp"
],
"keywords": {
"keyword": "struct enum interface union group import using const annotation extends in of on as with from fixed",
"built_in": "Void Bool Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Float32 Float64 Text Data AnyPointer AnyStruct Capability List",
"literal": "true false"
},
"contains": [
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "number",
"begin": "\\b\\d+(\\.\\d+)?",
"relevance": 0
},
{
"className": "comment",
"begin": "#",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "meta",
"begin": "@0x[\\w\\d]{16};",
"illegal": "\\n"
},
{
"className": "symbol",
"begin": "@\\d+\\b"
},
{
"className": "class",
"beginKeywords": "struct enum",
"end": "\\{",
"illegal": "\\n",
"contains": [
{
"className": "title",
"begin": "[a-zA-Z]\\w*",
"relevance": 0,
"starts": {
"endsWithParent": true,
"excludeEnd": true
}
}
]
},
{
"className": "class",
"beginKeywords": "interface",
"end": "\\{",
"illegal": "\\n",
"contains": [
{
"className": "title",
"begin": "[a-zA-Z]\\w*",
"relevance": 0,
"starts": {
"endsWithParent": true,
"excludeEnd": true
}
}
]
}
]
}

View file

@ -0,0 +1,90 @@
{
"keywords": {
"keyword": "assembly module package import alias class interface object given value assign void function new of extends satisfies abstracts in out return break continue throw assert dynamic if else switch case for while try catch finally then let this outer super is exists nonempty shared abstract formal default actual variable late native deprecatedfinal sealed annotation suppressWarnings small",
"meta": "doc by license see throws tagged"
},
"illegal": "\\$[^01]|#[^0-9a-fA-F]",
"contains": [
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
"self",
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "meta",
"begin": "@[a-z]\\w*(?:\\:\"[^\"]*\")?"
},
{
"className": "string",
"begin": "\"\"\"",
"end": "\"\"\"",
"relevance": 10
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"contains": [
{
"className": "subst",
"excludeBegin": true,
"excludeEnd": true,
"begin": "``",
"end": "``",
"keywords": "assembly module package import alias class interface object given value assign void function new of extends satisfies abstracts in out return break continue throw assert dynamic if else switch case for while try catch finally then let this outer super is exists nonempty",
"relevance": 10,
"contains": [
{
"$ref": "#contains.3"
},
{
"$ref": "#contains.4"
},
{
"className": "string",
"begin": "'",
"end": "'"
},
{
"className": "number",
"begin": "#[0-9a-fA-F_]+|\\$[01_]+|[0-9_]+(?:\\.[0-9_](?:[eE][+-]?\\d+)?)?[kMGTPmunpf]?",
"relevance": 0
}
]
}
]
},
{
"$ref": "#contains.4.contains.0.contains.2"
},
{
"$ref": "#contains.4.contains.0.contains.3"
}
]
}

View file

@ -0,0 +1,75 @@
{
"aliases": [
"clean",
"icl",
"dcl"
],
"keywords": {
"keyword": "if let in with where case of class instance otherwise implementation definition system module from import qualified as special code inline foreign export ccall stdcall generic derive infix infixl infixr",
"built_in": "Int Real Char Bool",
"literal": "True False"
},
"contains": [
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.2.contains.0"
}
]
},
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0
},
{
"begin": "->|<-[|:]?|#!?|>>=|\\{\\||\\|\\}|:==|=:|<>"
}
]
}

View file

@ -0,0 +1,12 @@
{
"contains": [
{
"className": "meta",
"begin": "^([\\w.-]+|\\s*#_)?=>",
"starts": {
"end": "$",
"subLanguage": "clojure"
}
}
]
}

View file

@ -0,0 +1,139 @@
{
"aliases": [
"clj"
],
"illegal": "\\S",
"contains": [
{
"begin": "\\(",
"end": "\\)",
"contains": [
{
"className": "comment",
"begin": "comment",
"end": "",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"keywords": {
"builtin-name": "def defonce cond apply if-not if-let if not not= = < > <= >= == + \/ * - rem quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last drop-while while intern condp case reduced cycle split-at split-with repeat replicate iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter monitor-exit defmacro defn defn- macroexpand macroexpand-1 for dosync and or when when-not when-let comp juxt partial sequence memoize constantly complement identity assert peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize"
},
"lexemes": "[a-zA-Z_\\-!.?+*=<>&#'][a-zA-Z_\\-!.?+*=<>&#'0-9\/;:]*",
"className": "name",
"begin": "[a-zA-Z_\\-!.?+*=<>&#'][a-zA-Z_\\-!.?+*=<>&#'0-9\/;:]*",
"starts": {
"endsWithParent": true,
"relevance": 0,
"contains": [
{
"$ref": "#contains.0"
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": null,
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\\^[a-zA-Z_\\-!.?+*=<>&#'][a-zA-Z_\\-!.?+*=<>&#'0-9\/;:]*"
},
{
"className": "comment",
"begin": "\\^\\{",
"end": "\\}",
"contains": [
{
"begin": "[\\[\\{]",
"end": "[\\]\\}]",
"contains": {
"$ref": "#contains.0.contains.1.starts.contains"
}
}
]
},
{
"className": "comment",
"begin": ";",
"end": "$",
"contains": [
{
"$ref": "#contains.0.contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "symbol",
"begin": "[:]{1,2}[a-zA-Z_\\-!.?+*=<>&#'][a-zA-Z_\\-!.?+*=<>&#'0-9\/;:]*"
},
{
"$ref": "#contains.0.contains.1.starts.contains.3.contains.0"
},
{
"className": "number",
"begin": "[-+]?\\d+(\\.\\d+)?",
"relevance": 0
},
{
"className": "literal",
"begin": "\\b(true|false|nil)\\b"
},
{
"begin": "[a-zA-Z_\\-!.?+*=<>&#'][a-zA-Z_\\-!.?+*=<>&#'0-9\/;:]*",
"relevance": 0
}
]
}
},
{
"$ref": "#contains.0.contains.1.starts"
}
]
},
{
"$ref": "#contains.0.contains.1.starts.contains.1"
},
{
"$ref": "#contains.0.contains.1.starts.contains.2"
},
{
"$ref": "#contains.0.contains.1.starts.contains.3"
},
{
"$ref": "#contains.0.contains.1.starts.contains.4"
},
{
"$ref": "#contains.0.contains.1.starts.contains.5"
},
{
"$ref": "#contains.0.contains.1.starts.contains.3.contains.0"
},
{
"$ref": "#contains.0.contains.1.starts.contains.7"
},
{
"$ref": "#contains.0.contains.1.starts.contains.8"
}
]
}

View file

@ -0,0 +1,48 @@
{
"aliases": [
"cmake.in"
],
"case_insensitive": true,
"keywords": {
"keyword": "break cmake_host_system_information cmake_minimum_required cmake_parse_arguments cmake_policy configure_file continue elseif else endforeach endfunction endif endmacro endwhile execute_process file find_file find_library find_package find_path find_program foreach function get_cmake_property get_directory_property get_filename_component get_property if include include_guard list macro mark_as_advanced math message option return separate_arguments set_directory_properties set_property set site_name string unset variable_watch while add_compile_definitions add_compile_options add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_link_options add_subdirectory add_test aux_source_directory build_command create_test_sourcelist define_property enable_language enable_testing export fltk_wrap_ui get_source_file_property get_target_property get_test_property include_directories include_external_msproject include_regular_expression install link_directories link_libraries load_cache project qt_wrap_cpp qt_wrap_ui remove_definitions set_source_files_properties set_target_properties set_tests_properties source_group target_compile_definitions target_compile_features target_compile_options target_include_directories target_link_directories target_link_libraries target_link_options target_sources try_compile try_run ctest_build ctest_configure ctest_coverage ctest_empty_binary_directory ctest_memcheck ctest_read_custom_files ctest_run_script ctest_sleep ctest_start ctest_submit ctest_test ctest_update ctest_upload build_name exec_program export_library_dependencies install_files install_programs install_targets load_command make_directory output_required_files remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or not command policy target test exists is_newer_than is_directory is_symlink is_absolute matches less greater equal less_equal greater_equal strless strgreater strequal strless_equal strgreater_equal version_less version_greater version_equal version_less_equal version_greater_equal in_list defined"
},
"contains": [
{
"className": "variable",
"begin": "\\${",
"end": "}"
},
{
"className": "comment",
"begin": "#",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "number",
"begin": "\\b\\d+(\\.\\d+)?",
"relevance": 0
}
]
}

View file

@ -0,0 +1,267 @@
{
"aliases": [
"coffee",
"cson",
"iced"
],
"keywords": {
"keyword": "in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super yield import export from as default await then unless until loop of by when and or is isnt not",
"literal": "true false null undefined yes no on off",
"built_in": "npm require console print module global window document"
},
"illegal": "\\\/\\*",
"contains": [
{
"className": "number",
"begin": "\\b(0b[01]+)",
"relevance": 0
},
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0,
"starts": {
"end": "(\\s*\/)?",
"relevance": 0
}
},
{
"className": "string",
"variants": [
{
"begin": "'''",
"end": "'''",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"begin": "'",
"end": "'",
"contains": [
{
"$ref": "#contains.2.variants.0.contains.0"
}
]
},
{
"begin": "\"\"\"",
"end": "\"\"\"",
"contains": [
{
"$ref": "#contains.2.variants.0.contains.0"
},
{
"className": "subst",
"begin": "#\\{",
"end": "}",
"keywords": {
"$ref": "#keywords"
},
"contains": [
{
"$ref": "#contains.0"
},
{
"$ref": "#contains.1"
},
{
"$ref": "#contains.2"
},
{
"className": "regexp",
"variants": [
{
"begin": "\/\/\/",
"end": "\/\/\/",
"contains": [
{
"$ref": "#contains.2.variants.2.contains.1"
},
{
"className": "comment",
"begin": "#",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
}
]
},
{
"begin": "\/\/[gim]{0,3}(?=\\W)",
"relevance": 0
},
{
"begin": "\\\/(?![ *]).*?(?![\\\\]).\\\/[gim]{0,3}(?=\\W)"
}
]
},
{
"begin": "@[A-Za-z$_][0-9A-Za-z$_]*"
},
{
"subLanguage": "javascript",
"excludeBegin": true,
"excludeEnd": true,
"variants": [
{
"begin": "```",
"end": "```"
},
{
"begin": "`",
"end": "`"
}
]
}
]
}
]
},
{
"begin": "\"",
"end": "\"",
"contains": [
{
"$ref": "#contains.2.variants.0.contains.0"
},
{
"$ref": "#contains.2.variants.2.contains.1"
}
]
}
]
},
{
"$ref": "#contains.2.variants.2.contains.1.contains.3"
},
{
"$ref": "#contains.2.variants.2.contains.1.contains.4"
},
{
"$ref": "#contains.2.variants.2.contains.1.contains.5"
},
{
"className": "comment",
"begin": "###",
"end": "###",
"contains": [
{
"$ref": "#contains.2.variants.2.contains.1.contains.3.variants.0.contains.1.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"$ref": "#contains.2.variants.2.contains.1.contains.3.variants.0.contains.1"
},
{
"className": "function",
"begin": "^\\s*[A-Za-z$_][0-9A-Za-z$_]*\\s*=\\s*(\\(.*\\))?\\s*\\B[-=]>",
"end": "[-=]>",
"returnBegin": true,
"contains": [
{
"className": "title",
"begin": "[A-Za-z$_][0-9A-Za-z$_]*",
"relevance": 0
},
{
"className": "params",
"begin": "\\([^\\(]",
"returnBegin": true,
"contains": [
{
"begin": "\\(",
"end": "\\)",
"keywords": {
"$ref": "#keywords"
},
"contains": [
"self",
{
"$ref": "#contains.0"
},
{
"$ref": "#contains.1"
},
{
"$ref": "#contains.2"
},
{
"$ref": "#contains.2.variants.2.contains.1.contains.3"
},
{
"$ref": "#contains.2.variants.2.contains.1.contains.4"
},
{
"$ref": "#contains.2.variants.2.contains.1.contains.5"
}
]
}
]
}
]
},
{
"begin": "[:\\(,=]\\s*",
"relevance": 0,
"contains": [
{
"className": "function",
"begin": "(\\(.*\\))?\\s*\\B[-=]>",
"end": "[-=]>",
"returnBegin": true,
"contains": [
{
"$ref": "#contains.8.contains.1"
}
]
}
]
},
{
"className": "class",
"beginKeywords": "class",
"end": "$",
"illegal": "[:=\"\\[\\]]",
"contains": [
{
"beginKeywords": "extends",
"endsWithParent": true,
"illegal": "[:=\"\\[\\]]",
"contains": [
{
"$ref": "#contains.8.contains.0"
}
]
},
{
"$ref": "#contains.8.contains.0"
}
]
},
{
"begin": "[A-Za-z$_][0-9A-Za-z$_]*:",
"end": ":",
"returnBegin": true,
"returnEnd": true,
"relevance": 0
}
]
}

View file

@ -0,0 +1,49 @@
{
"keywords": {
"keyword": "_|0 as at cofix else end exists exists2 fix for forall fun if IF in let match mod Prop return Set then Type using where with Abort About Add Admit Admitted All Arguments Assumptions Axiom Back BackTo Backtrack Bind Blacklist Canonical Cd Check Class Classes Close Coercion Coercions CoFixpoint CoInductive Collection Combined Compute Conjecture Conjectures Constant constr Constraint Constructors Context Corollary CreateHintDb Cut Declare Defined Definition Delimit Dependencies DependentDerive Drop eauto End Equality Eval Example Existential Existentials Existing Export exporting Extern Extract Extraction Fact Field Fields File Fixpoint Focus for From Function Functional Generalizable Global Goal Grab Grammar Graph Guarded Heap Hint HintDb Hints Hypotheses Hypothesis ident Identity If Immediate Implicit Import Include Inductive Infix Info Initial Inline Inspect Instance Instances Intro Intros Inversion Inversion_clear Language Left Lemma Let Libraries Library Load LoadPath Local Locate Ltac ML Mode Module Modules Monomorphic Morphism Next NoInline Notation Obligation Obligations Opaque Open Optimize Options Parameter Parameters Parametric Path Paths pattern Polymorphic Preterm Print Printing Program Projections Proof Proposition Pwd Qed Quit Rec Record Recursive Redirect Relation Remark Remove Require Reserved Reset Resolve Restart Rewrite Right Ring Rings Save Scheme Scope Scopes Script Search SearchAbout SearchHead SearchPattern SearchRewrite Section Separate Set Setoid Show Solve Sorted Step Strategies Strategy Structure SubClass Table Tables Tactic Term Test Theorem Time Timeout Transparent Type Typeclasses Types Undelimit Undo Unfocus Unfocused Unfold Universe Universes Unset Unshelve using Variable Variables Variant Verbose Visibility where with",
"built_in": "abstract absurd admit after apply as assert assumption at auto autorewrite autounfold before bottom btauto by case case_eq cbn cbv change classical_left classical_right clear clearbody cofix compare compute congruence constr_eq constructor contradict contradiction cut cutrewrite cycle decide decompose dependent destruct destruction dintuition discriminate discrR do double dtauto eapply eassumption eauto ecase econstructor edestruct ediscriminate eelim eexact eexists einduction einjection eleft elim elimtype enough equality erewrite eright esimplify_eq esplit evar exact exactly_once exfalso exists f_equal fail field field_simplify field_simplify_eq first firstorder fix fold fourier functional generalize generalizing gfail give_up has_evar hnf idtac in induction injection instantiate intro intro_pattern intros intuition inversion inversion_clear is_evar is_var lapply lazy left lia lra move native_compute nia nsatz omega once pattern pose progress proof psatz quote record red refine reflexivity remember rename repeat replace revert revgoals rewrite rewrite_strat right ring ring_simplify rtauto set setoid_reflexivity setoid_replace setoid_rewrite setoid_symmetry setoid_transitivity shelve shelve_unifiable simpl simple simplify_eq solve specialize split split_Rabs split_Rmult stepl stepr subst sum swap symmetry tactic tauto time timeout top transitivity trivial try tryif unfold unify until using vm_compute with"
},
"contains": [
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\\(\\*",
"end": "\\*\\)",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0
},
{
"className": "type",
"excludeBegin": true,
"begin": "\\|\\s*",
"end": "\\w+"
},
{
"begin": "[-=]>"
}
]
}

View file

@ -0,0 +1,105 @@
{
"case_insensitive": true,
"aliases": [
"cos",
"cls"
],
"keywords": "property parameter class classmethod clientmethod extends as break catch close continue do d|0 else elseif for goto halt hang h|0 if job j|0 kill k|0 lock l|0 merge new open quit q|0 read r|0 return set s|0 tcommit throw trollback try tstart use view while write w|0 xecute x|0 zkill znspace zn ztrap zwrite zw zzdump zzwrite print zbreak zinsert zload zprint zremove zsave zzprint mv mvcall mvcrt mvdim mvprint zquit zsync ascii",
"contains": [
{
"className": "number",
"begin": "\\b(\\d+(\\.\\d*)?|\\.\\d+)",
"relevance": 0
},
{
"className": "string",
"variants": [
{
"begin": "\"",
"end": "\"",
"contains": [
{
"begin": "\"\"",
"relevance": 0
}
]
}
]
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.2.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": ";",
"end": "$",
"relevance": 0
},
{
"className": "built_in",
"begin": "(?:\\$\\$?|\\.\\.)\\^?[a-zA-Z]+"
},
{
"className": "built_in",
"begin": "\\$\\$\\$[a-zA-Z]+"
},
{
"className": "built_in",
"begin": "%[a-z]+(?:\\.[a-z]+)*"
},
{
"className": "symbol",
"begin": "\\^%?[a-zA-Z][\\w]*"
},
{
"className": "keyword",
"begin": "##class|##super|#define|#dim"
},
{
"begin": "&sql\\(",
"end": "\\)",
"excludeBegin": true,
"excludeEnd": true,
"subLanguage": "sql"
},
{
"begin": "&(js|jscript|javascript)<",
"end": ">",
"excludeBegin": true,
"excludeEnd": true,
"subLanguage": "javascript"
},
{
"begin": "&html<\\s*<",
"end": ">\\s*>",
"subLanguage": "xml"
}
]
}

View file

@ -0,0 +1,334 @@
{
"aliases": [
"c",
"cc",
"h",
"c++",
"h++",
"hpp",
"hh",
"hxx",
"cxx"
],
"keywords": {
"keyword": "int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_tshort reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",
"built_in": "std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr _Bool complex _Complex imaginary _Imaginary",
"literal": "true false nullptr NULL"
},
"illegal": "<\/",
"contains": [
{
"variants": [
{
"begin": "=",
"end": ";"
},
{
"begin": "\\(",
"end": "\\)"
},
{
"beginKeywords": "new throw return else",
"end": ";"
}
],
"keywords": {
"$ref": "#keywords"
},
"contains": [
{
"className": "keyword",
"begin": "\\b[a-z\\d_]*_t\\b"
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.0.contains.1.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "number",
"variants": [
{
"begin": "\\b(0b[01']+)"
},
{
"begin": "(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"
},
{
"begin": "(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"
}
],
"relevance": 0
},
{
"className": "string",
"variants": [
{
"begin": "(u8?|U|L)?\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"begin": "(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",
"end": "'",
"illegal": "."
},
{
"begin": "(?:u8?|U|L)?R\"([^()\\\\ ]{0,16})\\((?:.|\\n)*?\\)\\1\""
}
]
},
{
"begin": "\\(",
"end": "\\)",
"keywords": {
"$ref": "#keywords"
},
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"$ref": "#contains.0.contains.1"
},
{
"$ref": "#contains.0.contains.2"
},
{
"$ref": "#contains.0.contains.3"
},
{
"$ref": "#contains.0.contains.4"
},
"self"
],
"relevance": 0
}
],
"relevance": 0
},
{
"className": "function",
"begin": "((decltype\\(auto\\)|(?:[a-zA-Z_]\\w*::)?[a-zA-Z_]\\w*(?:<.*?>)?)[\\*&\\s]+)+(?:[a-zA-Z_]\\w*::)?[a-zA-Z]\\w*\\s*\\(",
"returnBegin": true,
"end": "[{;=]",
"excludeEnd": true,
"keywords": {
"$ref": "#keywords"
},
"illegal": "[^\\w\\s\\*&:<>]",
"contains": [
{
"begin": "decltype\\(auto\\)",
"keywords": {
"$ref": "#keywords"
},
"relevance": 0
},
{
"begin": "(?:[a-zA-Z_]\\w*::)?[a-zA-Z]\\w*\\s*\\(",
"returnBegin": true,
"contains": [
{
"className": "title",
"begin": "(?:[a-zA-Z_]\\w*::)?[a-zA-Z]\\w*",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "params",
"begin": "\\(",
"end": "\\)",
"keywords": {
"$ref": "#keywords"
},
"relevance": 0,
"contains": [
{
"$ref": "#contains.0.contains.1"
},
{
"$ref": "#contains.0.contains.2"
},
{
"$ref": "#contains.0.contains.4"
},
{
"$ref": "#contains.0.contains.3"
},
{
"$ref": "#contains.0.contains.0"
},
{
"begin": "\\(",
"end": "\\)",
"keywords": {
"$ref": "#keywords"
},
"relevance": 0,
"contains": [
"self",
{
"$ref": "#contains.0.contains.1"
},
{
"$ref": "#contains.0.contains.2"
},
{
"$ref": "#contains.0.contains.4"
},
{
"$ref": "#contains.0.contains.3"
},
{
"$ref": "#contains.0.contains.0"
}
]
}
]
},
{
"$ref": "#contains.0.contains.0"
},
{
"$ref": "#contains.0.contains.1"
},
{
"$ref": "#contains.0.contains.2"
},
{
"className": "meta",
"begin": "#\\s*[a-z]+\\b",
"end": "$",
"keywords": {
"meta-keyword": "if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"
},
"contains": [
{
"begin": "\\\\\\n",
"relevance": 0
},
{
"className": "meta-string",
"variants": {
"$ref": "#contains.0.contains.4.variants"
}
},
{
"className": "meta-string",
"begin": "<.*?>",
"end": "$",
"illegal": "\\n"
},
{
"$ref": "#contains.0.contains.1"
},
{
"$ref": "#contains.0.contains.2"
}
]
}
]
},
{
"$ref": "#contains.0.contains.0"
},
{
"$ref": "#contains.0.contains.1"
},
{
"$ref": "#contains.0.contains.2"
},
{
"$ref": "#contains.0.contains.3"
},
{
"$ref": "#contains.0.contains.4"
},
{
"$ref": "#contains.1.contains.6"
},
{
"begin": "\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",
"end": ">",
"keywords": {
"$ref": "#keywords"
},
"contains": [
"self",
{
"$ref": "#contains.0.contains.0"
}
]
},
{
"begin": "[a-zA-Z]\\w*::",
"keywords": {
"$ref": "#keywords"
}
},
{
"className": "class",
"beginKeywords": "class struct",
"end": "[{;:]",
"contains": [
{
"begin": "<",
"end": ">",
"contains": [
"self"
]
},
{
"className": "title",
"begin": "[a-zA-Z]\\w*",
"relevance": 0
}
]
}
],
"exports": {
"preprocessor": {
"$ref": "#contains.1.contains.6"
},
"strings": {
"$ref": "#contains.0.contains.4"
},
"keywords": {
"$ref": "#keywords"
}
}
}

View file

@ -0,0 +1,101 @@
{
"aliases": [
"crm",
"pcmk"
],
"case_insensitive": true,
"keywords": {
"keyword": "params meta operations op rule attributes utilization read write deny defined not_defined in_range date spec in ref reference attribute type xpath version and or lt gt tag lte gte eq ne \\ number string",
"literal": "Master Started Slave Stopped start promote demote stop monitor true false"
},
"contains": [
{
"className": "comment",
"begin": "#",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"beginKeywords": "node",
"starts": {
"end": "\\s*([\\w_\\-]+:)?",
"starts": {
"className": "title",
"end": "\\s*[\\$\\w_][\\w_\\-]*"
}
}
},
{
"beginKeywords": "primitive rsc_template",
"starts": {
"className": "title",
"end": "\\s*[\\$\\w_][\\w_\\-]*",
"starts": {
"end": "\\s*@?[\\w_][\\w_\\.:-]*"
}
}
},
{
"begin": "\\b(group|clone|ms|master|location|colocation|order|fencing_topology|rsc_ticket|acl_target|acl_group|user|role|tag|xml)\\s+",
"keywords": "group clone ms master location colocation order fencing_topology rsc_ticket acl_target acl_group user role tag xml",
"starts": {
"className": "title",
"end": "[\\$\\w_][\\w_\\-]*"
}
},
{
"beginKeywords": "property rsc_defaults op_defaults",
"starts": {
"className": "title",
"end": "\\s*([\\w_\\-]+:)?"
}
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "meta",
"begin": "(ocf|systemd|service|lsb):[\\w_:-]+",
"relevance": 0
},
{
"className": "number",
"begin": "\\b\\d+(\\.\\d+)?(ms|s|h|m)?",
"relevance": 0
},
{
"className": "literal",
"begin": "[-]?(infinity|inf)",
"relevance": 0
},
{
"className": "attr",
"begin": "([A-Za-z\\$_\\#][\\w_\\-]+)=",
"relevance": 0
},
{
"className": "tag",
"begin": "<\/?",
"end": "\/?>",
"relevance": 0
}
]
}

View file

@ -0,0 +1,482 @@
{
"aliases": [
"cr"
],
"lexemes": "[a-zA-Z_]\\w*[!?=]?",
"keywords": {
"keyword": "abstract alias annotation as as? asm begin break case class def do else elsif end ensure enum extend for fun if include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? return require select self sizeof struct super then type typeof union uninitialized unless until verbatim when while with yield __DIR__ __END_LINE__ __FILE__ __LINE__",
"literal": "false nil true"
},
"contains": [
{
"className": "template-variable",
"variants": [
{
"begin": "\\{\\{",
"end": "\\}\\}"
},
{
"begin": "\\{%",
"end": "%\\}"
}
],
"keywords": {
"$ref": "#keywords"
},
"contains": [
{
"className": "string",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
},
{
"className": "subst",
"begin": "#{",
"end": "}",
"keywords": {
"$ref": "#keywords"
},
"contains": {
"$ref": "#contains"
}
}
],
"variants": [
{
"begin": "'",
"end": "'"
},
{
"begin": "\"",
"end": "\""
},
{
"begin": "`",
"end": "`"
},
{
"begin": "%[Qwi]?\\(",
"end": "\\)",
"contains": [
{
"begin": "\\(",
"end": "\\)",
"contains": {
"$ref": "#contains.0.contains.0.variants.3.contains"
}
}
]
},
{
"begin": "%[Qwi]?\\[",
"end": "\\]",
"contains": [
{
"begin": "\\[",
"end": "\\]",
"contains": {
"$ref": "#contains.0.contains.0.variants.4.contains"
}
}
]
},
{
"begin": "%[Qwi]?{",
"end": "}",
"contains": [
{
"begin": "{",
"end": "}",
"contains": {
"$ref": "#contains.0.contains.0.variants.5.contains"
}
}
]
},
{
"begin": "%[Qwi]?<",
"end": ">",
"contains": [
{
"begin": "<",
"end": ">",
"contains": {
"$ref": "#contains.0.contains.0.variants.6.contains"
}
}
]
},
{
"begin": "%[Qwi]?\\|",
"end": "\\|"
},
{
"begin": "<<-\\w+$",
"end": "^\\s*\\w+$"
}
],
"relevance": 0
},
{
"className": "string",
"variants": [
{
"begin": "%q\\(",
"end": "\\)",
"contains": [
{
"begin": "\\(",
"end": "\\)",
"contains": {
"$ref": "#contains.0.contains.1.variants.0.contains"
}
}
]
},
{
"begin": "%q\\[",
"end": "\\]",
"contains": [
{
"begin": "\\[",
"end": "\\]",
"contains": {
"$ref": "#contains.0.contains.1.variants.1.contains"
}
}
]
},
{
"begin": "%q{",
"end": "}",
"contains": [
{
"begin": "{",
"end": "}",
"contains": {
"$ref": "#contains.0.contains.1.variants.2.contains"
}
}
]
},
{
"begin": "%q<",
"end": ">",
"contains": [
{
"begin": "<",
"end": ">",
"contains": {
"$ref": "#contains.0.contains.1.variants.3.contains"
}
}
]
},
{
"begin": "%q\\|",
"end": "\\|"
},
{
"begin": "<<-'\\w+'$",
"end": "^\\s*\\w+$"
}
],
"relevance": 0
},
{
"className": "regexp",
"contains": [
{
"$ref": "#contains.0.contains.0.contains.0"
},
{
"$ref": "#contains.0.contains.0.contains.1"
}
],
"variants": [
{
"begin": "%r\\(",
"end": "\\)",
"contains": [
{
"begin": "\\(",
"end": "\\)",
"contains": {
"$ref": "#contains.0.contains.2.variants.0.contains"
}
}
]
},
{
"begin": "%r\\[",
"end": "\\]",
"contains": [
{
"begin": "\\[",
"end": "\\]",
"contains": {
"$ref": "#contains.0.contains.2.variants.1.contains"
}
}
]
},
{
"begin": "%r{",
"end": "}",
"contains": [
{
"begin": "{",
"end": "}",
"contains": {
"$ref": "#contains.0.contains.2.variants.2.contains"
}
}
]
},
{
"begin": "%r<",
"end": ">",
"contains": [
{
"begin": "<",
"end": ">",
"contains": {
"$ref": "#contains.0.contains.2.variants.3.contains"
}
}
]
},
{
"begin": "%r\\|",
"end": "\\|"
}
],
"relevance": 0
},
{
"begin": "(?!%})(!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|\/=|\/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~|\\n|\\b(case|if|select|unless|until|when|while)\\b)\\s*",
"keywords": "case if select unless until when while",
"contains": [
{
"className": "regexp",
"contains": [
{
"$ref": "#contains.0.contains.0.contains.0"
},
{
"$ref": "#contains.0.contains.0.contains.1"
}
],
"variants": [
{
"begin": "\/\/[a-z]*",
"relevance": 0
},
{
"begin": "\/(?!\\\/)",
"end": "\/[a-z]*"
}
]
}
],
"relevance": 0
},
{
"className": "meta",
"begin": "@\\[",
"end": "\\]",
"contains": [
{
"className": "meta-string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.0.contains.0.contains.0"
}
]
}
]
},
{
"className": "comment",
"begin": "#",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "class",
"beginKeywords": "class module struct",
"end": "$|;",
"illegal": "=",
"contains": [
{
"$ref": "#contains.0.contains.5"
},
{
"className": "title",
"begin": "[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",
"relevance": 0
},
{
"begin": "<"
}
]
},
{
"className": "class",
"beginKeywords": "lib enum union",
"end": "$|;",
"illegal": "=",
"contains": [
{
"$ref": "#contains.0.contains.5"
},
{
"className": "title",
"begin": "[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",
"relevance": 0
}
],
"relevance": 10
},
{
"beginKeywords": "annotation",
"end": "$|;",
"illegal": "=",
"contains": [
{
"$ref": "#contains.0.contains.5"
},
{
"className": "title",
"begin": "[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",
"relevance": 0
}
],
"relevance": 10
},
{
"className": "function",
"beginKeywords": "def",
"end": "\\B\\b",
"contains": [
{
"className": "title",
"begin": "[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|[=!]~|===?|<=>|[<>]=?|\\*\\*|[-\/+%^&*~|]|\/\/|\/\/=|&[-+*]=?|&\\*\\*|\\[\\][=?]?",
"relevance": 0,
"endsParent": true
}
]
},
{
"className": "function",
"beginKeywords": "fun macro",
"end": "\\B\\b",
"contains": [
{
"className": "title",
"begin": "[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|[=!]~|===?|<=>|[<>]=?|\\*\\*|[-\/+%^&*~|]|\/\/|\/\/=|&[-+*]=?|&\\*\\*|\\[\\][=?]?",
"relevance": 0,
"endsParent": true
}
],
"relevance": 5
},
{
"className": "symbol",
"begin": "[a-zA-Z_]\\w*(\\!|\\?)?:",
"relevance": 0
},
{
"className": "symbol",
"begin": ":",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"begin": "[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|[=!]~|===?|<=>|[<>]=?|\\*\\*|[-\/+%^&*~|]|\/\/|\/\/=|&[-+*]=?|&\\*\\*|\\[\\][=?]?"
}
],
"relevance": 0
},
{
"className": "number",
"variants": [
{
"begin": "\\b0b([01_]+)(_*[ui](8|16|32|64|128))?"
},
{
"begin": "\\b0o([0-7_]+)(_*[ui](8|16|32|64|128))?"
},
{
"begin": "\\b0x([A-Fa-f0-9_]+)(_*[ui](8|16|32|64|128))?"
},
{
"begin": "\\b([1-9][0-9_]*[0-9]|[0-9])(\\.[0-9][0-9_]*)?([eE]_*[-+]?[0-9_]*)?(_*f(32|64))?(?!_)"
},
{
"begin": "\\b([1-9][0-9_]*|0)(_*[ui](8|16|32|64|128))?"
}
],
"relevance": 0
}
]
},
{
"$ref": "#contains.0.contains.0"
},
{
"$ref": "#contains.0.contains.1"
},
{
"$ref": "#contains.0.contains.2"
},
{
"$ref": "#contains.0.contains.3"
},
{
"$ref": "#contains.0.contains.4"
},
{
"$ref": "#contains.0.contains.5"
},
{
"$ref": "#contains.0.contains.6"
},
{
"$ref": "#contains.0.contains.7"
},
{
"$ref": "#contains.0.contains.8"
},
{
"$ref": "#contains.0.contains.9"
},
{
"$ref": "#contains.0.contains.10"
},
{
"$ref": "#contains.0.contains.11"
},
{
"$ref": "#contains.0.contains.12"
},
{
"$ref": "#contains.0.contains.13"
}
]
}

View file

@ -0,0 +1,364 @@
{
"aliases": [
"csharp",
"c#"
],
"keywords": {
"keyword": "abstract as base bool break byte case catch char checked const continue decimal default delegate do double enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while add alias ascending async await by descending dynamic equals from get global group into join let nameof on orderby partial remove select set value var when where yield",
"literal": "null false true"
},
"illegal": "::",
"contains": [
{
"className": "comment",
"begin": "\/\/\/",
"end": "$",
"contains": [
{
"className": "doctag",
"variants": [
{
"begin": "\/\/\/",
"relevance": 0
},
{
"begin": "<!--|-->"
},
{
"begin": "<\/?",
"end": ">"
}
]
},
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"returnBegin": true
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"$ref": "#contains.0.contains.1"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.0.contains.1"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "meta",
"begin": "#",
"end": "$",
"keywords": {
"meta-keyword": "if else elif endif define undef warning error line region endregion pragma checksum"
}
},
{
"variants": [
{
"className": "string",
"begin": "\\$@\"",
"end": "\"",
"contains": [
{
"begin": "{{"
},
{
"begin": "}}"
},
{
"begin": "\"\""
},
{
"className": "subst",
"begin": "{",
"end": "}",
"keywords": {
"$ref": "#keywords"
},
"contains": [
{
"$ref": "#contains.4.variants.0"
},
{
"className": "string",
"begin": "\\$\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "{{"
},
{
"begin": "}}"
},
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
},
{
"className": "subst",
"begin": "{",
"end": "}",
"keywords": {
"$ref": "#keywords"
},
"illegal": "\\n",
"contains": [
{
"className": "string",
"begin": "\\$@\"",
"end": "\"",
"contains": [
{
"begin": "{{"
},
{
"begin": "}}"
},
{
"begin": "\"\""
},
{
"$ref": "#contains.4.variants.0.contains.3.contains.1.contains.3"
}
],
"illegal": "\\n"
},
{
"$ref": "#contains.4.variants.0.contains.3.contains.1"
},
{
"className": "string",
"begin": "@\"",
"end": "\"",
"contains": [
{
"begin": "\"\""
}
],
"illegal": "\\n"
},
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.4.variants.0.contains.3.contains.1.contains.2"
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.4.variants.0.contains.3.contains.1.contains.2"
}
]
},
{
"className": "number",
"variants": [
{
"begin": "\\b(0b[01']+)"
},
{
"begin": "(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"
},
{
"begin": "(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"
}
],
"relevance": 0
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": {
"$ref": "#contains.2.contains"
},
"illegal": "\\n"
}
]
}
]
},
{
"className": "string",
"begin": "@\"",
"end": "\"",
"contains": {
"$ref": "#contains.4.variants.0.contains.3.contains.1.contains.3.contains.2.contains"
}
},
{
"$ref": "#contains.4.variants.0.contains.3.contains.1.contains.3.contains.3"
},
{
"$ref": "#contains.4.variants.0.contains.3.contains.1.contains.3.contains.4"
},
{
"$ref": "#contains.4.variants.0.contains.3.contains.1.contains.3.contains.5"
},
{
"$ref": "#contains.2"
}
]
}
]
},
{
"$ref": "#contains.4.variants.0.contains.3.contains.1"
},
{
"$ref": "#contains.4.variants.0.contains.3.contains.2"
},
{
"$ref": "#contains.4.variants.0.contains.3.contains.1.contains.3.contains.3"
},
{
"$ref": "#contains.4.variants.0.contains.3.contains.1.contains.3.contains.4"
}
]
},
{
"$ref": "#contains.4.variants.0.contains.3.contains.1.contains.3.contains.5"
},
{
"beginKeywords": "class interface",
"end": "[{;=]",
"illegal": "[^\\s:,]",
"contains": [
{
"className": "title",
"begin": "[a-zA-Z]\\w*",
"relevance": 0
},
{
"$ref": "#contains.1"
},
{
"$ref": "#contains.2"
}
]
},
{
"beginKeywords": "namespace",
"end": "[{;=]",
"illegal": "[^\\s:]",
"contains": [
{
"className": "title",
"begin": "[a-zA-Z](\\.?\\w)*",
"relevance": 0
},
{
"$ref": "#contains.1"
},
{
"$ref": "#contains.2"
}
]
},
{
"className": "meta",
"begin": "^\\s*\\[",
"excludeBegin": true,
"end": "\\]",
"excludeEnd": true,
"contains": [
{
"className": "meta-string",
"begin": "\"",
"end": "\""
}
]
},
{
"beginKeywords": "new return throw await else",
"relevance": 0
},
{
"className": "function",
"begin": "([a-zA-Z]\\w*(<[a-zA-Z]\\w*(\\s*,\\s*[a-zA-Z]\\w*)*>)?(\\[\\])?\\s+)+[a-zA-Z]\\w*\\s*\\(",
"returnBegin": true,
"end": "\\s*[{;=]",
"excludeEnd": true,
"keywords": {
"$ref": "#keywords"
},
"contains": [
{
"begin": "[a-zA-Z]\\w*\\s*\\(",
"returnBegin": true,
"contains": [
{
"$ref": "#contains.6.contains.0"
}
],
"relevance": 0
},
{
"className": "params",
"begin": "\\(",
"end": "\\)",
"excludeBegin": true,
"excludeEnd": true,
"keywords": {
"$ref": "#keywords"
},
"relevance": 0,
"contains": [
{
"$ref": "#contains.4"
},
{
"$ref": "#contains.4.variants.0.contains.3.contains.1.contains.3.contains.5"
},
{
"$ref": "#contains.2"
}
]
},
{
"$ref": "#contains.1"
},
{
"$ref": "#contains.2"
}
]
}
]
}

View file

@ -0,0 +1,20 @@
{
"case_insensitive": false,
"lexemes": "[a-zA-Z][a-zA-Z0-9_\\-]*",
"keywords": {
"keyword": "base-uri child-src connect-src default-src font-src form-action frame-ancestors frame-src img-src media-src object-src plugin-types report-uri sandbox script-src style-src"
},
"contains": [
{
"className": "string",
"begin": "'",
"end": "'"
},
{
"className": "attribute",
"begin": "^Content",
"end": ":",
"excludeEnd": true
}
]
}

View file

@ -0,0 +1,185 @@
{
"case_insensitive": true,
"illegal": "[=\\\/|'\\$]",
"contains": [
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "selector-id",
"begin": "#[A-Za-z0-9_\\-]+"
},
{
"className": "selector-class",
"begin": "\\.[A-Za-z0-9_\\-]+"
},
{
"className": "selector-attr",
"begin": "\\[",
"end": "\\]",
"illegal": "$",
"contains": [
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.3.contains.0.contains.0"
}
]
}
]
},
{
"className": "selector-pseudo",
"begin": ":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\"'.]+"
},
{
"begin": "@(page|font-face)",
"lexemes": "@[a-z\\-]+",
"keywords": "@page @font-face"
},
{
"begin": "@",
"end": "[{;]",
"illegal": ":",
"returnBegin": true,
"contains": [
{
"className": "keyword",
"begin": "@\\-?\\w[\\w]*(\\-\\w+)*"
},
{
"begin": "\\s",
"endsWithParent": true,
"excludeEnd": true,
"relevance": 0,
"keywords": "and or not only",
"contains": [
{
"begin": "[a-z\\-]+:",
"className": "attribute"
},
{
"$ref": "#contains.3.contains.0"
},
{
"$ref": "#contains.3.contains.1"
},
{
"className": "number",
"begin": "\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",
"relevance": 0
}
]
}
]
},
{
"className": "selector-tag",
"begin": "[a-zA-Z\\-][a-zA-Z0-9_\\-]*",
"relevance": 0
},
{
"begin": "{",
"end": "}",
"illegal": "\\S",
"contains": [
{
"$ref": "#contains.0"
},
{
"begin": "(?:[A-Z\\_\\.\\-]+|--[a-zA-Z0-9_\\-]+)\\s*:",
"returnBegin": true,
"end": ";",
"endsWithParent": true,
"contains": [
{
"className": "attribute",
"begin": "\\S",
"end": ":",
"excludeEnd": true,
"starts": {
"endsWithParent": true,
"excludeEnd": true,
"contains": [
{
"begin": "[\\w\\-]+\\(",
"returnBegin": true,
"contains": [
{
"className": "built_in",
"begin": "[\\w\\-]+"
},
{
"begin": "\\(",
"end": "\\)",
"contains": [
{
"$ref": "#contains.3.contains.0"
},
{
"$ref": "#contains.3.contains.1"
},
{
"$ref": "#contains.6.contains.1.contains.3"
}
]
}
]
},
{
"$ref": "#contains.6.contains.1.contains.3"
},
{
"$ref": "#contains.3.contains.1"
},
{
"$ref": "#contains.3.contains.0"
},
{
"$ref": "#contains.0"
},
{
"className": "number",
"begin": "#[0-9A-Fa-f]+"
},
{
"className": "meta",
"begin": "!important"
}
]
}
}
]
}
]
}
]
}

View file

@ -0,0 +1,121 @@
{
"lexemes": "[a-zA-Z_]\\w*",
"keywords": {
"keyword": "abstract alias align asm assert auto body break byte case cast catch class const continue debug default delete deprecated do else enum export extern final finally for foreach foreach_reverse|10 goto if immutable import in inout int interface invariant is lazy macro mixin module new nothrow out override package pragma private protected public pure ref return scope shared static struct super switch synchronized template this throw try typedef typeid typeof union unittest version void volatile while with __FILE__ __LINE__ __gshared|10 __thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__",
"built_in": "bool cdouble cent cfloat char creal dchar delegate double dstring float function idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar wstring",
"literal": "false null true"
},
"contains": [
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\\\/\\+",
"end": "\\+\\\/",
"contains": [
"self",
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 10
},
{
"className": "string",
"begin": "x\"[\\da-fA-F\\s\\n\\r]*\"[cwd]?",
"relevance": 10
},
{
"className": "string",
"begin": "\"",
"contains": [
{
"begin": "\\\\(['\"\\?\\\\abfnrtv]|u[\\dA-Fa-f]{4}|[0-7]{1,3}|x[\\dA-Fa-f]{2}|U[\\dA-Fa-f]{8})|&[a-zA-Z\\d]{2,};",
"relevance": 0
}
],
"end": "\"[cwd]?"
},
{
"className": "string",
"begin": "[rq]\"",
"end": "\"[cwd]?",
"relevance": 5
},
{
"className": "string",
"begin": "`",
"end": "`[cwd]?"
},
{
"className": "string",
"begin": "q\"\\{",
"end": "\\}\""
},
{
"className": "number",
"begin": "\\b(((0[xX](([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)\\.([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)|\\.?([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*))[pP][+-]?(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d))|((0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)(\\.\\d*|([eE][+-]?(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)))|\\d+\\.(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)|\\.(0|[1-9][\\d_]*)([eE][+-]?(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d))?))([fF]|L|i|[fF]i|Li)?|((0|[1-9][\\d_]*)|0[bB][01_]+|0[xX]([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*))(i|[fF]i|Li))",
"relevance": 0
},
{
"className": "number",
"begin": "\\b((0|[1-9][\\d_]*)|0[bB][01_]+|0[xX]([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*))(L|u|U|Lu|LU|uL|UL)?",
"relevance": 0
},
{
"className": "string",
"begin": "'(\\\\(['\"\\?\\\\abfnrtv]|u[\\dA-Fa-f]{4}|[0-7]{1,3}|x[\\dA-Fa-f]{2}|U[\\dA-Fa-f]{8})|&[a-zA-Z\\d]{2,};|.)",
"end": "'",
"illegal": "."
},
{
"className": "meta",
"begin": "^#!",
"end": "$",
"relevance": 5
},
{
"className": "meta",
"begin": "#(line)",
"end": "$",
"relevance": 5
},
{
"className": "keyword",
"begin": "@[a-zA-Z_][a-zA-Z_\\d]*"
}
]
}

View file

@ -0,0 +1,208 @@
{
"keywords": {
"keyword": "abstract as assert async await break case catch class const continue covariant default deferred do dynamic else enum export extends extension external factory false final finally for Function get hide if implements import in inferface is library mixin new null on operator part rethrow return set show static super switch sync this throw true try typedef var void while with yield",
"built_in": "Comparable DateTime Duration Function Iterable Iterator List Map Match Null Object Pattern RegExp Set Stopwatch String StringBuffer StringSink Symbol Type Uri bool double dynamic int num print Element ElementList document querySelector querySelectorAll window"
},
"contains": [
{
"className": "string",
"variants": [
{
"begin": "r'''",
"end": "'''"
},
{
"begin": "r\"\"\"",
"end": "\"\"\""
},
{
"begin": "r'",
"end": "'",
"illegal": "\\n"
},
{
"begin": "r\"",
"end": "\"",
"illegal": "\\n"
},
{
"begin": "'''",
"end": "'''",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
},
{
"className": "subst",
"variants": [
{
"begin": "\\$[A-Za-z0-9_]+"
}
]
},
{
"className": "subst",
"variants": [
{
"begin": "\\${",
"end": "}"
}
],
"keywords": "true false null this is new super",
"contains": [
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0
},
{
"$ref": "#contains.0"
}
]
}
]
},
{
"begin": "\"\"\"",
"end": "\"\"\"",
"contains": [
{
"$ref": "#contains.0.variants.4.contains.0"
},
{
"$ref": "#contains.0.variants.4.contains.1"
},
{
"$ref": "#contains.0.variants.4.contains.2"
}
]
},
{
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.0.variants.4.contains.0"
},
{
"$ref": "#contains.0.variants.4.contains.1"
},
{
"$ref": "#contains.0.variants.4.contains.2"
}
]
},
{
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.0.variants.4.contains.0"
},
{
"$ref": "#contains.0.variants.4.contains.1"
},
{
"$ref": "#contains.0.variants.4.contains.2"
}
]
}
]
},
{
"className": "comment",
"begin": "\/\\*\\*",
"end": "\\*\/",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"subLanguage": "markdown"
},
{
"className": "comment",
"begin": "\/\/\/+\\s*",
"end": "$",
"contains": [
{
"subLanguage": "markdown",
"begin": ".",
"end": "$"
},
{
"$ref": "#contains.1.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"$ref": "#contains.1.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.1.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "class",
"beginKeywords": "class interface",
"end": "{",
"excludeEnd": true,
"contains": [
{
"beginKeywords": "extends implements"
},
{
"className": "title",
"begin": "[a-zA-Z_]\\w*",
"relevance": 0
}
]
},
{
"$ref": "#contains.0.variants.4.contains.2.contains.0"
},
{
"className": "meta",
"begin": "@[A-Za-z]+"
},
{
"begin": "=>"
}
]
}

View file

@ -0,0 +1,156 @@
{
"aliases": [
"dpr",
"dfm",
"pas",
"pascal",
"freepascal",
"lazarus",
"lpr",
"lfm"
],
"case_insensitive": true,
"keywords": "exports register file shl array record property for mod while set ally label uses raise not stored class safecall var interface or private static exit index inherited to else stdcall override shr asm far resourcestring finalization packed virtual out and protected library do xorwrite goto near function end div overload object unit begin string on inline repeat until destructor write message program with read initialization except default nil if case cdecl in downto threadvar of try pascal const external constructor type public then implementation finally published procedure absolute reintroduce operator as is abstract alias assembler bitpacked break continue cppdecl cvar enumerator experimental platform deprecated unimplemented dynamic export far16 forward generic helper implements interrupt iochecks local name nodefault noreturn nostackframe oldfpccall otherwise saveregisters softfloat specialize strict unaligned varargs ",
"illegal": "\"|\\$[G-Zg-z]|\\\/\\*|<\\\/|\\|",
"contains": [
{
"className": "string",
"begin": "'",
"end": "'",
"contains": [
{
"begin": "''"
}
]
},
{
"className": "string",
"begin": "(#\\d+)+"
},
{
"className": "number",
"begin": "\\b\\d+(\\.\\d+)?",
"relevance": 0
},
{
"begin": "[a-zA-Z]\\w*\\s*=\\s*class\\s*\\(",
"returnBegin": true,
"contains": [
{
"className": "title",
"begin": "[a-zA-Z]\\w*",
"relevance": 0
}
]
},
{
"className": "function",
"beginKeywords": "function constructor destructor procedure",
"end": "[:;]",
"keywords": "function constructor|10 destructor|10 procedure|10",
"contains": [
{
"$ref": "#contains.3.contains.0"
},
{
"className": "params",
"begin": "\\(",
"end": "\\)",
"keywords": "exports register file shl array record property for mod while set ally label uses raise not stored class safecall var interface or private static exit index inherited to else stdcall override shr asm far resourcestring finalization packed virtual out and protected library do xorwrite goto near function end div overload object unit begin string on inline repeat until destructor write message program with read initialization except default nil if case cdecl in downto threadvar of try pascal const external constructor type public then implementation finally published procedure absolute reintroduce operator as is abstract alias assembler bitpacked break continue cppdecl cvar enumerator experimental platform deprecated unimplemented dynamic export far16 forward generic helper implements interrupt iochecks local name nodefault noreturn nostackframe oldfpccall otherwise saveregisters softfloat specialize strict unaligned varargs ",
"contains": [
{
"$ref": "#contains.0"
},
{
"$ref": "#contains.1"
},
{
"className": "meta",
"variants": [
{
"begin": "\\{\\$",
"end": "\\}"
},
{
"begin": "\\(\\*\\$",
"end": "\\*\\)"
}
]
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\\{",
"end": "\\}",
"contains": [
{
"$ref": "#contains.4.contains.1.contains.3.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "comment",
"begin": "\\(\\*",
"end": "\\*\\)",
"contains": [
{
"$ref": "#contains.4.contains.1.contains.3.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 10
}
]
},
{
"$ref": "#contains.4.contains.1.contains.2"
},
{
"$ref": "#contains.4.contains.1.contains.3"
},
{
"$ref": "#contains.4.contains.1.contains.4"
},
{
"$ref": "#contains.4.contains.1.contains.5"
}
]
},
{
"$ref": "#contains.4.contains.1.contains.2"
},
{
"$ref": "#contains.4.contains.1.contains.3"
},
{
"$ref": "#contains.4.contains.1.contains.4"
},
{
"$ref": "#contains.4.contains.1.contains.5"
}
]
}

View file

@ -0,0 +1,65 @@
{
"aliases": [
"patch"
],
"contains": [
{
"className": "meta",
"relevance": 10,
"variants": [
{
"begin": "^@@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +@@$"
},
{
"begin": "^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$"
},
{
"begin": "^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$"
}
]
},
{
"className": "comment",
"variants": [
{
"begin": "Index: ",
"end": "$"
},
{
"begin": "={3,}",
"end": "$"
},
{
"begin": "^\\-{3}",
"end": "$"
},
{
"begin": "^\\*{3} ",
"end": "$"
},
{
"begin": "^\\+{3}",
"end": "$"
},
{
"begin": "^\\*{15}$"
}
]
},
{
"className": "addition",
"begin": "^\\+",
"end": "$"
},
{
"className": "deletion",
"begin": "^\\-",
"end": "$"
},
{
"className": "addition",
"begin": "^\\!",
"end": "$"
}
]
}

View file

@ -0,0 +1,101 @@
{
"aliases": [
"jinja"
],
"case_insensitive": true,
"subLanguage": "xml",
"contains": [
{
"className": "comment",
"begin": "\\{%\\s*comment\\s*%}",
"end": "\\{%\\s*endcomment\\s*%}",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\\{#",
"end": "#}",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "template-tag",
"begin": "\\{%",
"end": "%}",
"contains": [
{
"className": "name",
"begin": "\\w+",
"keywords": {
"name": "comment endcomment load templatetag ifchanged endifchanged if endif firstof for endfor ifnotequal endifnotequal widthratio extends include spaceless endspaceless regroup ifequal endifequal ssi now with cycle url filter endfilter debug block endblock else autoescape endautoescape csrf_token empty elif endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix plural get_current_language language get_available_languages get_current_language_bidi get_language_info get_language_info_list localize endlocalize localtime endlocaltime timezone endtimezone get_current_timezone verbatim"
},
"starts": {
"endsWithParent": true,
"keywords": "in by as",
"contains": [
{
"begin": "\\|[A-Za-z]+:?",
"keywords": {
"name": "truncatewords removetags linebreaksbr yesno get_digit timesince random striptags filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort dictsortreversed default_if_none pluralize lower join center default truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize localtime utc timezone"
},
"contains": [
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.2.contains.0.starts.contains.0.contains.0.contains.0"
}
]
}
]
}
],
"relevance": 0
}
}
]
},
{
"className": "template-variable",
"begin": "\\{\\{",
"end": "}}",
"contains": [
{
"$ref": "#contains.2.contains.0.starts.contains.0"
}
]
}
]
}

View file

@ -0,0 +1,44 @@
{
"aliases": [
"bind",
"zone"
],
"keywords": {
"keyword": "IN A AAAA AFSDB APL CAA CDNSKEY CDS CERT CNAME DHCID DLV DNAME DNSKEY DS HIP IPSECKEY KEY KX LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM PTR RRSIG RP SIG SOA SRV SSHFP TA TKEY TLSA TSIG TXT"
},
"contains": [
{
"className": "comment",
"begin": ";",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "meta",
"begin": "^\\$(TTL|GENERATE|INCLUDE|ORIGIN)\\b"
},
{
"className": "number",
"begin": "((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))\\b"
},
{
"className": "number",
"begin": "((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\b"
},
{
"className": "number",
"begin": "\\b\\d+[dhwm]?",
"relevance": 0
}
]
}

View file

@ -0,0 +1,60 @@
{
"aliases": [
"docker"
],
"case_insensitive": true,
"keywords": "from maintainer expose env arg user onbuild stopsignal",
"contains": [
{
"className": "comment",
"begin": "#",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.1.contains.0"
}
]
},
{
"className": "number",
"begin": "\\b\\d+(\\.\\d+)?",
"relevance": 0
},
{
"beginKeywords": "run cmd entrypoint volume add copy workdir label healthcheck shell",
"starts": {
"end": "[^\\\\]$",
"subLanguage": "bash"
}
}
],
"illegal": "<\/"
}

View file

@ -0,0 +1,54 @@
{
"aliases": [
"bat",
"cmd"
],
"case_insensitive": true,
"illegal": "\\\/\\*",
"keywords": {
"keyword": "if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq",
"built_in": "prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux shift cd dir echo setlocal endlocal set pause copy append assoc at attrib break cacls cd chcp chdir chkdsk chkntfs cls cmd color comp compact convert date dir diskcomp diskcopy doskey erase fs find findstr format ftype graftabl help keyb label md mkdir mode more move path pause print popd pushd promt rd recover rem rename replace restore rmdir shiftsort start subst time title tree type ver verify vol ping net ipconfig taskkill xcopy ren del"
},
"contains": [
{
"className": "variable",
"begin": "%%[^ ]|%[^ ]+?%|![^ ]+?!"
},
{
"className": "function",
"begin": "^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)",
"end": "goto:eof",
"contains": [
{
"className": "title",
"begin": "([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*",
"relevance": 0
},
{
"className": "comment",
"begin": "^\\s*@?rem\\b",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 10
}
]
},
{
"className": "number",
"begin": "\\b\\d+",
"relevance": 0
},
{
"$ref": "#contains.1.contains.1"
}
]
}

View file

@ -0,0 +1,63 @@
{
"keywords": "dsconfig",
"contains": [
{
"className": "keyword",
"begin": "^dsconfig",
"end": "\\s",
"excludeEnd": true,
"relevance": 10
},
{
"className": "built_in",
"begin": "(list|create|get|set|delete)-(\\w+)",
"end": "\\s",
"excludeEnd": true,
"illegal": "!@#$%^&*()",
"relevance": 10
},
{
"className": "built_in",
"begin": "--(\\w+)",
"end": "\\s",
"excludeEnd": true
},
{
"className": "string",
"begin": "\"",
"end": "\""
},
{
"className": "string",
"begin": "'",
"end": "'"
},
{
"className": "string",
"begin": "[\\w\\-?]+:\\w+",
"end": "\\W",
"relevance": 0
},
{
"className": "string",
"begin": "\\w+-?\\w+",
"end": "\\W",
"relevance": 0
},
{
"className": "comment",
"begin": "#",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
}
]
}

View file

@ -0,0 +1,193 @@
{
"keywords": "",
"contains": [
{
"className": "class",
"begin": "\/\\s*{",
"end": "};",
"relevance": 10,
"contains": [
{
"className": "variable",
"begin": "\\&[a-z\\d_]*\\b"
},
{
"className": "meta-keyword",
"begin": "\/[a-z][a-z\\d\\-]*\/"
},
{
"className": "symbol",
"begin": "^\\s*[a-zA-Z_][a-zA-Z\\d_]*:"
},
{
"className": "class",
"begin": "[a-zA-Z_][a-zA-Z\\d_@]*\\s{",
"end": "[{;=]",
"returnBegin": true,
"excludeEnd": true
},
{
"className": "params",
"begin": "<",
"end": ">",
"contains": [
{
"className": "number",
"variants": [
{
"begin": "\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"
},
{
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)"
}
],
"relevance": 0
},
{
"$ref": "#contains.0.contains.0"
}
]
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.0.contains.5.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"$ref": "#contains.0.contains.4.contains.0"
},
{
"className": "string",
"variants": [
{
"className": "string",
"begin": "((u8?|U)|L)?\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"begin": "(u8?|U)?R\"",
"end": "\"",
"contains": [
{
"$ref": "#contains.0.contains.8.variants.0.contains.0"
}
]
},
{
"begin": "'\\\\?.",
"end": "'",
"illegal": "."
}
]
}
]
},
{
"$ref": "#contains.0.contains.0"
},
{
"$ref": "#contains.0.contains.1"
},
{
"$ref": "#contains.0.contains.2"
},
{
"$ref": "#contains.0.contains.3"
},
{
"$ref": "#contains.0.contains.4"
},
{
"$ref": "#contains.0.contains.5"
},
{
"$ref": "#contains.0.contains.6"
},
{
"$ref": "#contains.0.contains.4.contains.0"
},
{
"$ref": "#contains.0.contains.8"
},
{
"className": "meta",
"begin": "#",
"end": "$",
"keywords": {
"meta-keyword": "if else elif endif define undef ifdef ifndef"
},
"contains": [
{
"begin": "\\\\\\n",
"relevance": 0
},
{
"beginKeywords": "include",
"end": "$",
"keywords": {
"meta-keyword": "include"
},
"contains": [
{
"className": "meta-string",
"variants": {
"$ref": "#contains.0.contains.8.variants"
}
},
{
"className": "meta-string",
"begin": "<",
"end": ">",
"illegal": "\\n"
}
]
},
{
"$ref": "#contains.0.contains.8"
},
{
"$ref": "#contains.0.contains.5"
},
{
"$ref": "#contains.0.contains.6"
}
]
},
{
"begin": "[a-zA-Z]\\w*::",
"keywords": ""
}
]
}

View file

@ -0,0 +1,46 @@
{
"aliases": [
"dst"
],
"case_insensitive": true,
"subLanguage": "xml",
"contains": [
{
"className": "template-tag",
"begin": "\\{[#\\\/]",
"end": "\\}",
"illegal": ";",
"contains": [
{
"className": "name",
"begin": "[a-zA-Z\\.-]+",
"starts": {
"endsWithParent": true,
"relevance": 0,
"contains": [
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
}
]
}
}
]
},
{
"className": "template-variable",
"begin": "\\{",
"end": "\\}",
"illegal": ";",
"keywords": "if eq ne lt lte gt gte select default math sep"
}
]
}

View file

@ -0,0 +1,69 @@
{
"illegal": "\\S",
"contains": [
{
"className": "comment",
"begin": "\\(\\*",
"end": "\\*\\)",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "attribute",
"begin": "^[ ]*[a-zA-Z][a-zA-Z\\-_]*([\\s\\-_]+[a-zA-Z][a-zA-Z]*)*"
},
{
"begin": "=",
"end": "[.;]",
"contains": [
{
"$ref": "#contains.0"
},
{
"className": "meta",
"begin": "\\?.*\\?"
},
{
"className": "string",
"variants": [
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.2.contains.2.variants.0.contains.0"
}
]
},
{
"begin": "`",
"end": "`"
}
]
}
]
}
]
}

View file

@ -0,0 +1,256 @@
{
"lexemes": "[a-zA-Z_][a-zA-Z0-9_.]*(\\!|\\?)?",
"keywords": "and false then defined module in return redo retry end for true self when next until do begin unless nil break not case cond alias while ensure or include use alias fn quote require import with|0",
"contains": [
{
"className": "string",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
},
{
"className": "subst",
"begin": "#\\{",
"end": "}",
"lexemes": "[a-zA-Z_][a-zA-Z0-9_.]*(\\!|\\?)?",
"keywords": "and false then defined module in return redo retry end for true self when next until do begin unless nil break not case cond alias while ensure or include use alias fn quote require import with|0",
"contains": {
"$ref": "#contains"
}
}
],
"variants": [
{
"begin": "\"\"\"",
"end": "\"\"\""
},
{
"begin": "'''",
"end": "'''"
},
{
"begin": "~S\"\"\"",
"end": "\"\"\"",
"contains": []
},
{
"begin": "~S\"",
"end": "\"",
"contains": []
},
{
"begin": "~S'''",
"end": "'''",
"contains": []
},
{
"begin": "~S'",
"end": "'",
"contains": []
},
{
"begin": "'",
"end": "'"
},
{
"begin": "\"",
"end": "\""
}
]
},
{
"className": "string",
"begin": "~[A-Z](?=[\/|([{<\"'])",
"contains": [
{
"begin": "\"",
"end": "\""
},
{
"begin": "'",
"end": "'"
},
{
"begin": "\\\/",
"end": "\\\/"
},
{
"begin": "\\|",
"end": "\\|"
},
{
"begin": "\\(",
"end": "\\)"
},
{
"begin": "\\[",
"end": "\\]"
},
{
"begin": "\\{",
"end": "\\}"
},
{
"begin": "\\<",
"end": "\\>"
}
]
},
{
"className": "string",
"begin": "~[a-z](?=[\/|([{<\"'])",
"contains": [
{
"endsParent": true,
"contains": [
{
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"$ref": "#contains.0.contains.1"
}
],
"variants": [
{
"begin": "\"",
"end": "\""
},
{
"begin": "'",
"end": "'"
},
{
"begin": "\\\/",
"end": "\\\/"
},
{
"begin": "\\|",
"end": "\\|"
},
{
"begin": "\\(",
"end": "\\)"
},
{
"begin": "\\[",
"end": "\\]"
},
{
"begin": "\\{",
"end": "\\}"
},
{
"begin": "<",
"end": ">"
}
]
}
]
}
]
},
{
"className": "comment",
"begin": "#",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "class",
"beginKeywords": "defimpl defmodule defprotocol defrecord",
"end": "\\bdo\\b|$|;",
"contains": [
{
"className": "title",
"begin": "[a-zA-Z_][a-zA-Z0-9_.]*(\\!|\\?)?",
"relevance": 0,
"endsParent": true
}
]
},
{
"className": "function",
"beginKeywords": "def defp defmacro",
"end": "\\B\\b",
"contains": {
"$ref": "#contains.4.contains"
}
},
{
"begin": "::"
},
{
"className": "symbol",
"begin": ":(?![\\s:])",
"contains": [
{
"$ref": "#contains.0"
},
{
"begin": "[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-\/+%^&*~`|]|\\[\\]=?"
}
],
"relevance": 0
},
{
"className": "symbol",
"begin": "[a-zA-Z_][a-zA-Z0-9_.]*(\\!|\\?)?:(?!:)",
"relevance": 0
},
{
"className": "number",
"begin": "(\\b0o[0-7_]+)|(\\b0b[01_]+)|(\\b0x[0-9a-fA-F_]+)|(-?\\b[1-9][0-9_]*(.[0-9_]+([eE][-+]?[0-9]+)?)?)",
"relevance": 0
},
{
"className": "variable",
"begin": "(\\$\\W)|((\\$|\\@\\@?)(\\w+))"
},
{
"begin": "->"
},
{
"begin": "(!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|\/=|\/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~)\\s*",
"contains": [
{
"$ref": "#contains.3"
},
{
"className": "regexp",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"$ref": "#contains.0.contains.1"
}
],
"variants": [
{
"begin": "\/",
"end": "\/[a-z]*"
},
{
"begin": "%r\\[",
"end": "\\][a-z]*"
}
]
}
],
"relevance": 0
}
]
}

View file

@ -0,0 +1,161 @@
{
"keywords": "let in if then else case of where module import exposing type alias as infix infixl infixr port effect command subscription",
"contains": [
{
"beginKeywords": "port effect module",
"end": "exposing",
"keywords": "port effect module where command subscription exposing",
"contains": [
{
"begin": "\\(",
"end": "\\)",
"illegal": "\"",
"contains": [
{
"className": "type",
"begin": "\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"
},
{
"variants": [
{
"className": "comment",
"begin": "--",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "{-",
"end": "-}",
"contains": [
"self",
{
"$ref": "#contains.0.contains.0.contains.1.variants.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
}
]
}
]
},
{
"$ref": "#contains.0.contains.0.contains.1"
}
],
"illegal": "\\W\\.|;"
},
{
"begin": "import",
"end": "$",
"keywords": "import as exposing",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"$ref": "#contains.0.contains.0.contains.1"
}
],
"illegal": "\\W\\.|;"
},
{
"begin": "type",
"end": "$",
"keywords": "type alias",
"contains": [
{
"className": "type",
"begin": "\\b[A-Z][\\w']*",
"relevance": 0
},
{
"$ref": "#contains.0.contains.0"
},
{
"begin": "{",
"end": "}",
"contains": {
"$ref": "#contains.0.contains.0.contains"
}
},
{
"$ref": "#contains.0.contains.0.contains.1"
}
]
},
{
"beginKeywords": "infix infixl infixr",
"end": "$",
"contains": [
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0
},
{
"$ref": "#contains.0.contains.0.contains.1"
}
]
},
{
"begin": "port",
"end": "$",
"keywords": "port",
"contains": [
{
"$ref": "#contains.0.contains.0.contains.1"
}
]
},
{
"className": "string",
"begin": "'\\\\?.",
"end": "'",
"illegal": "."
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"$ref": "#contains.3.contains.0"
},
{
"$ref": "#contains.2.contains.0"
},
{
"className": "title",
"begin": "^[_a-z][\\w']*",
"relevance": 0
},
{
"$ref": "#contains.0.contains.0.contains.1"
},
{
"begin": "->|<-"
}
],
"illegal": ";"
}

View file

@ -0,0 +1,27 @@
{
"subLanguage": "xml",
"contains": [
{
"className": "comment",
"begin": "<%#",
"end": "%>",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"begin": "<%[%=-]?",
"end": "[%-]?%>",
"subLanguage": "ruby",
"excludeBegin": true,
"excludeEnd": true
}
]
}

View file

@ -0,0 +1,76 @@
{
"keywords": {
"built_in": "spawn spawn_link self",
"keyword": "after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if let not of or orelse|10 query receive rem try when xor"
},
"contains": [
{
"className": "meta",
"begin": "^[0-9]+> ",
"relevance": 10
},
{
"className": "comment",
"begin": "%",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "number",
"begin": "\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",
"relevance": 0
},
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.3.contains.0"
}
]
},
{
"begin": "\\?(::)?([A-Z]\\w*(::)?)+"
},
{
"begin": "->"
},
{
"begin": "ok"
},
{
"begin": "!"
},
{
"begin": "(\\b[a-z'][a-zA-Z0-9_']*:[a-z'][a-zA-Z0-9_']*)|(\\b[a-z'][a-zA-Z0-9_']*)",
"relevance": 0
},
{
"begin": "[A-Z][a-zA-Z0-9_']*",
"relevance": 0
}
]
}

View file

@ -0,0 +1,222 @@
{
"aliases": [
"erl"
],
"keywords": {
"keyword": "after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if let not of orelse|10 query receive rem try when xor",
"literal": "false true"
},
"illegal": "(<\/|\\*=|\\+=|-=|\/\\*|\\*\/|\\(\\*|\\*\\))",
"contains": [
{
"className": "function",
"begin": "^[a-z'][a-zA-Z0-9_']*\\s*\\(",
"end": "->",
"returnBegin": true,
"illegal": "\\(|#|\/\/|\/\\*|\\\\|:|;",
"contains": [
{
"className": "params",
"begin": "\\(",
"end": "\\)",
"contains": [
{
"className": "comment",
"begin": "%",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"begin": "fun\\s+[a-z'][a-zA-Z0-9_']*\/\\d+"
},
{
"beginKeywords": "fun receive if try case",
"end": "end",
"keywords": {
"$ref": "#keywords"
},
"contains": [
{
"$ref": "#contains.0.contains.0.contains.0"
},
{
"$ref": "#contains.0.contains.0.contains.1"
},
{
"className": "",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"$ref": "#contains.0.contains.0.contains.2"
},
{
"begin": "([a-z'][a-zA-Z0-9_']*:[a-z'][a-zA-Z0-9_']*|[a-z'][a-zA-Z0-9_']*)\\(",
"end": "\\)",
"returnBegin": true,
"relevance": 0,
"contains": [
{
"begin": "([a-z'][a-zA-Z0-9_']*:[a-z'][a-zA-Z0-9_']*|[a-z'][a-zA-Z0-9_']*)",
"relevance": 0
},
{
"begin": "\\(",
"end": "\\)",
"endsWithParent": true,
"returnEnd": true,
"relevance": 0,
"contains": {
"$ref": "#contains.0.contains.0.contains"
}
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.0.contains.0.contains.2.contains.2.contains.0"
}
]
},
{
"className": "number",
"begin": "\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",
"relevance": 0
},
{
"begin": "{",
"end": "}",
"relevance": 0,
"contains": {
"$ref": "#contains.0.contains.0.contains"
}
},
{
"begin": "\\b_([A-Z][A-Za-z0-9_]*)?",
"relevance": 0
},
{
"begin": "[A-Z][a-zA-Z0-9_]*",
"relevance": 0
},
{
"begin": "#[a-zA-Z_]\\w*",
"relevance": 0,
"returnBegin": true,
"contains": [
{
"begin": "#[a-zA-Z_]\\w*",
"relevance": 0
},
{
"begin": "{",
"end": "}",
"relevance": 0,
"contains": {
"$ref": "#contains.0.contains.0.contains"
}
}
]
}
]
},
{
"$ref": "#contains.0.contains.0.contains.2.contains.4"
},
{
"$ref": "#contains.0.contains.0.contains.2.contains.5"
},
{
"$ref": "#contains.0.contains.0.contains.2.contains.6"
},
{
"$ref": "#contains.0.contains.0.contains.2.contains.7"
},
{
"$ref": "#contains.0.contains.0.contains.2.contains.8"
},
{
"$ref": "#contains.0.contains.0.contains.2.contains.9"
},
{
"$ref": "#contains.0.contains.0.contains.2.contains.10"
}
]
},
{
"className": "title",
"begin": "[a-z'][a-zA-Z0-9_']*",
"relevance": 0
}
],
"starts": {
"end": ";|\\.",
"keywords": {
"$ref": "#keywords"
},
"contains": {
"$ref": "#contains.0.contains.0.contains"
}
}
},
{
"$ref": "#contains.0.contains.0.contains.0"
},
{
"begin": "^-",
"end": "\\.",
"relevance": 0,
"excludeEnd": true,
"returnBegin": true,
"lexemes": "-[a-zA-Z]\\w*",
"keywords": "-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn -import -include -include_lib -compile -define -else -endif -file -behaviour -behavior -spec",
"contains": [
{
"$ref": "#contains.0.contains.0"
}
]
},
{
"$ref": "#contains.0.contains.0.contains.2.contains.6"
},
{
"$ref": "#contains.0.contains.0.contains.2.contains.5"
},
{
"$ref": "#contains.0.contains.0.contains.2.contains.10"
},
{
"$ref": "#contains.0.contains.0.contains.2.contains.8"
},
{
"$ref": "#contains.0.contains.0.contains.2.contains.9"
},
{
"$ref": "#contains.0.contains.0.contains.2.contains.7"
},
{
"begin": "\\.$"
}
]
}

View file

@ -0,0 +1,70 @@
{
"aliases": [
"xlsx",
"xls"
],
"case_insensitive": true,
"lexemes": "[a-zA-Z][\\w\\.]*",
"keywords": {
"built_in": "ABS ACCRINT ACCRINTM ACOS ACOSH ACOT ACOTH AGGREGATE ADDRESS AMORDEGRC AMORLINC AND ARABIC AREAS ASC ASIN ASINH ATAN ATAN2 ATANH AVEDEV AVERAGE AVERAGEA AVERAGEIF AVERAGEIFS BAHTTEXT BASE BESSELI BESSELJ BESSELK BESSELY BETADIST BETA.DIST BETAINV BETA.INV BIN2DEC BIN2HEX BIN2OCT BINOMDIST BINOM.DIST BINOM.DIST.RANGE BINOM.INV BITAND BITLSHIFT BITOR BITRSHIFT BITXOR CALL CEILING CEILING.MATH CEILING.PRECISE CELL CHAR CHIDIST CHIINV CHITEST CHISQ.DIST CHISQ.DIST.RT CHISQ.INV CHISQ.INV.RT CHISQ.TEST CHOOSE CLEAN CODE COLUMN COLUMNS COMBIN COMBINA COMPLEX CONCAT CONCATENATE CONFIDENCE CONFIDENCE.NORM CONFIDENCE.T CONVERT CORREL COS COSH COT COTH COUNT COUNTA COUNTBLANK COUNTIF COUNTIFS COUPDAYBS COUPDAYS COUPDAYSNC COUPNCD COUPNUM COUPPCD COVAR COVARIANCE.P COVARIANCE.S CRITBINOM CSC CSCH CUBEKPIMEMBER CUBEMEMBER CUBEMEMBERPROPERTY CUBERANKEDMEMBER CUBESET CUBESETCOUNT CUBEVALUE CUMIPMT CUMPRINC DATE DATEDIF DATEVALUE DAVERAGE DAY DAYS DAYS360 DB DBCS DCOUNT DCOUNTA DDB DEC2BIN DEC2HEX DEC2OCT DECIMAL DEGREES DELTA DEVSQ DGET DISC DMAX DMIN DOLLAR DOLLARDE DOLLARFR DPRODUCT DSTDEV DSTDEVP DSUM DURATION DVAR DVARP EDATE EFFECT ENCODEURL EOMONTH ERF ERF.PRECISE ERFC ERFC.PRECISE ERROR.TYPE EUROCONVERT EVEN EXACT EXP EXPON.DIST EXPONDIST FACT FACTDOUBLE FALSE|0 F.DIST FDIST F.DIST.RT FILTERXML FIND FINDB F.INV F.INV.RT FINV FISHER FISHERINV FIXED FLOOR FLOOR.MATH FLOOR.PRECISE FORECAST FORECAST.ETS FORECAST.ETS.CONFINT FORECAST.ETS.SEASONALITY FORECAST.ETS.STAT FORECAST.LINEAR FORMULATEXT FREQUENCY F.TEST FTEST FV FVSCHEDULE GAMMA GAMMA.DIST GAMMADIST GAMMA.INV GAMMAINV GAMMALN GAMMALN.PRECISE GAUSS GCD GEOMEAN GESTEP GETPIVOTDATA GROWTH HARMEAN HEX2BIN HEX2DEC HEX2OCT HLOOKUP HOUR HYPERLINK HYPGEOM.DIST HYPGEOMDIST IF IFERROR IFNA IFS IMABS IMAGINARY IMARGUMENT IMCONJUGATE IMCOS IMCOSH IMCOT IMCSC IMCSCH IMDIV IMEXP IMLN IMLOG10 IMLOG2 IMPOWER IMPRODUCT IMREAL IMSEC IMSECH IMSIN IMSINH IMSQRT IMSUB IMSUM IMTAN INDEX INDIRECT INFO INT INTERCEPT INTRATE IPMT IRR ISBLANK ISERR ISERROR ISEVEN ISFORMULA ISLOGICAL ISNA ISNONTEXT ISNUMBER ISODD ISREF ISTEXT ISO.CEILING ISOWEEKNUM ISPMT JIS KURT LARGE LCM LEFT LEFTB LEN LENB LINEST LN LOG LOG10 LOGEST LOGINV LOGNORM.DIST LOGNORMDIST LOGNORM.INV LOOKUP LOWER MATCH MAX MAXA MAXIFS MDETERM MDURATION MEDIAN MID MIDBs MIN MINIFS MINA MINUTE MINVERSE MIRR MMULT MOD MODE MODE.MULT MODE.SNGL MONTH MROUND MULTINOMIAL MUNIT N NA NEGBINOM.DIST NEGBINOMDIST NETWORKDAYS NETWORKDAYS.INTL NOMINAL NORM.DIST NORMDIST NORMINV NORM.INV NORM.S.DIST NORMSDIST NORM.S.INV NORMSINV NOT NOW NPER NPV NUMBERVALUE OCT2BIN OCT2DEC OCT2HEX ODD ODDFPRICE ODDFYIELD ODDLPRICE ODDLYIELD OFFSET OR PDURATION PEARSON PERCENTILE.EXC PERCENTILE.INC PERCENTILE PERCENTRANK.EXC PERCENTRANK.INC PERCENTRANK PERMUT PERMUTATIONA PHI PHONETIC PI PMT POISSON.DIST POISSON POWER PPMT PRICE PRICEDISC PRICEMAT PROB PRODUCT PROPER PV QUARTILE QUARTILE.EXC QUARTILE.INC QUOTIENT RADIANS RAND RANDBETWEEN RANK.AVG RANK.EQ RANK RATE RECEIVED REGISTER.ID REPLACE REPLACEB REPT RIGHT RIGHTB ROMAN ROUND ROUNDDOWN ROUNDUP ROW ROWS RRI RSQ RTD SEARCH SEARCHB SEC SECH SECOND SERIESSUM SHEET SHEETS SIGN SIN SINH SKEW SKEW.P SLN SLOPE SMALL SQL.REQUEST SQRT SQRTPI STANDARDIZE STDEV STDEV.P STDEV.S STDEVA STDEVP STDEVPA STEYX SUBSTITUTE SUBTOTAL SUM SUMIF SUMIFS SUMPRODUCT SUMSQ SUMX2MY2 SUMX2PY2 SUMXMY2 SWITCH SYD T TAN TANH TBILLEQ TBILLPRICE TBILLYIELD T.DIST T.DIST.2T T.DIST.RT TDIST TEXT TEXTJOIN TIME TIMEVALUE T.INV T.INV.2T TINV TODAY TRANSPOSE TREND TRIM TRIMMEAN TRUE|0 TRUNC T.TEST TTEST TYPE UNICHAR UNICODE UPPER VALUE VAR VAR.P VAR.S VARA VARP VARPA VDB VLOOKUP WEBSERVICE WEEKDAY WEEKNUM WEIBULL WEIBULL.DIST WORKDAY WORKDAY.INTL XIRR XNPV XOR YEAR YEARFRAC YIELD YIELDDISC YIELDMAT Z.TEST ZTEST"
},
"contains": [
{
"begin": "^=",
"end": "[^=]",
"returnEnd": true,
"illegal": "=",
"relevance": 10
},
{
"className": "symbol",
"begin": "\\b[A-Z]{1,2}\\d+\\b",
"end": "[^\\d]",
"excludeEnd": true,
"relevance": 0
},
{
"className": "symbol",
"begin": "[A-Z]{0,2}\\d*:[A-Z]{0,2}\\d*",
"relevance": 0
},
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.3"
}
]
},
{
"className": "number",
"begin": "\\b\\d+(\\.\\d+)?(%)?",
"relevance": 0
},
{
"className": "comment",
"begin": "\\bN\\(",
"end": "\\)",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"excludeBegin": true,
"excludeEnd": true,
"illegal": "\\n"
}
]
}

View file

@ -0,0 +1,28 @@
{
"contains": [
{
"begin": "[^\\x{2401}\\x{0001}]+",
"end": "[\\x{2401}\\x{0001}]",
"excludeEnd": true,
"returnBegin": true,
"returnEnd": false,
"contains": [
{
"begin": "([^\\x{2401}\\x{0001}=]+)",
"end": "=([^\\x{2401}\\x{0001}=]+)",
"returnEnd": true,
"returnBegin": false,
"className": "attr"
},
{
"begin": "=",
"end": "([\\x{2401}\\x{0001}])",
"excludeEnd": true,
"excludeBegin": true,
"className": "string"
}
]
}
],
"case_insensitive": true
}

View file

@ -0,0 +1,68 @@
{
"keywords": {
"literal": "true false",
"keyword": "case class def else enum if impl import in lat rel index let match namespace switch type yield with"
},
"contains": [
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "'(.|\\\\[xXuU][a-zA-Z0-9]+)'"
},
{
"className": "string",
"variants": [
{
"begin": "\"",
"end": "\""
}
]
},
{
"className": "function",
"beginKeywords": "def",
"end": "[:={\\[(\\n;]",
"excludeEnd": true,
"contains": [
{
"className": "title",
"begin": "[^0-9\\n\\t \"'(),.`{}\\[\\]:;][^\\n\\t \"'(),.`{}\\[\\]:;]+|[^0-9\\n\\t \"'(),.`{}\\[\\]:;=]"
}
]
},
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0
}
]
}

View file

@ -0,0 +1,78 @@
{
"case_insensitive": true,
"aliases": [
"f90",
"f95"
],
"keywords": {
"literal": ".False. .True.",
"keyword": "kind do while private call intrinsic where elsewhere type endtype endmodule endselect endinterface end enddo endif if forall endforall only contains default return stop then block endblock public subroutine|10 function program .and. .or. .not. .le. .eq. .ge. .gt. .lt. goto save else use module select case access blank direct exist file fmt form formatted iostat name named nextrec number opened rec recl sequential status unformatted unit continue format pause cycle exit c_null_char c_alert c_backspace c_form_feed flush wait decimal round iomsg synchronous nopass non_overridable pass protected volatile abstract extends import non_intrinsic value deferred generic final enumerator class associate bind enum c_int c_short c_long c_long_long c_signed_char c_size_t c_int8_t c_int16_t c_int32_t c_int64_t c_int_least8_t c_int_least16_t c_int_least32_t c_int_least64_t c_int_fast8_t c_int_fast16_t c_int_fast32_t c_int_fast64_t c_intmax_t C_intptr_t c_float c_double c_long_double c_float_complex c_double_complex c_long_double_complex c_bool c_char c_null_ptr c_null_funptr c_new_line c_carriage_return c_horizontal_tab c_vertical_tab iso_c_binding c_loc c_funloc c_associated c_f_pointer c_ptr c_funptr iso_fortran_env character_storage_size error_unit file_storage_size input_unit iostat_end iostat_eor numeric_storage_size output_unit c_f_procpointer ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode newunit contiguous recursive pad position action delim readwrite eor advance nml interface procedure namelist include sequence elemental pure integer real character complex logical dimension allocatable|10 parameter external implicit|10 none double precision assign intent optional pointer target in out common equivalence data",
"built_in": "alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint dlog dlog10 dmax1 dmin1 dmod dnint dsign dsin dsinh dsqrt dtan dtanh float iabs idim idint idnint ifix isign max0 max1 min0 min1 sngl algama cdabs cdcos cdexp cdlog cdsin cdsqrt cqabs cqcos cqexp cqlog cqsin cqsqrt dcmplx dconjg derf derfc dfloat dgamma dimag dlgama iqint qabs qacos qasin qatan qatan2 qcmplx qconjg qcos qcosh qdim qerf qerfc qexp qgamma qimag qlgama qlog qlog10 qmax1 qmin1 qmod qnint qsign qsin qsinh qsqrt qtan qtanh abs acos aimag aint anint asin atan atan2 char cmplx conjg cos cosh exp ichar index int log log10 max min nint sign sin sinh sqrt tan tanh print write dim lge lgt lle llt mod nullify allocate deallocate adjustl adjustr all allocated any associated bit_size btest ceiling count cshift date_and_time digits dot_product eoshift epsilon exponent floor fraction huge iand ibclr ibits ibset ieor ior ishft ishftc lbound len_trim matmul maxexponent maxloc maxval merge minexponent minloc minval modulo mvbits nearest pack present product radix random_number random_seed range repeat reshape rrspacing scale scan selected_int_kind selected_real_kind set_exponent shape size spacing spread sum system_clock tiny transpose trim ubound unpack verify achar iachar transfer dble entry dprod cpu_time command_argument_count get_command get_command_argument get_environment_variable is_iostat_end ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_ofacosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2 atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr num_images parity popcnt poppar shifta shiftl shiftr this_image"
},
"illegal": "\\\/\\*",
"contains": [
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.0.contains.0"
}
],
"relevance": 0
},
{
"className": "function",
"beginKeywords": "subroutine function program",
"illegal": "[${=\\n]",
"contains": [
{
"className": "title",
"begin": "[a-zA-Z_]\\w*",
"relevance": 0
},
{
"className": "params",
"begin": "\\(",
"end": "\\)"
}
]
},
{
"className": "comment",
"begin": "!",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
],
"relevance": 0
},
{
"className": "number",
"begin": "(?=\\b|\\+|\\-|\\.)(?=\\.\\d|\\d)(?:\\d+)?(?:\\.?\\d*)(?:[de][+-]?\\d+)?\\b\\.?",
"relevance": 0
}
]
}

View file

@ -0,0 +1,114 @@
{
"aliases": [
"fs"
],
"keywords": "abstract and as assert base begin class default delegate do done downcast downto elif else end exception extern false finally for fun function global if in inherit inline interface internal lazy let match member module mutable namespace new null of open or override private public rec return sig static struct then to true try type upcast use val void when while with yield",
"illegal": "\\\/\\*",
"contains": [
{
"className": "keyword",
"begin": "\\b(yield|return|let|do)!"
},
{
"className": "string",
"begin": "@\"",
"end": "\"",
"contains": [
{
"begin": "\"\""
}
]
},
{
"className": "string",
"begin": "\"\"\"",
"end": "\"\"\""
},
{
"className": "comment",
"begin": "\\(\\*",
"end": "\\*\\)",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "class",
"beginKeywords": "type",
"end": "\\(|=|$",
"excludeEnd": true,
"contains": [
{
"className": "title",
"begin": "[a-zA-Z_]\\w*",
"relevance": 0
},
{
"begin": "<",
"end": ">",
"contains": [
{
"className": "title",
"begin": "'[a-zA-Z0-9_]+",
"relevance": 0
}
]
}
]
},
{
"className": "meta",
"begin": "\\[<",
"end": ">\\]",
"relevance": 10
},
{
"className": "symbol",
"begin": "\\B('[A-Za-z])\\b",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"$ref": "#contains.3.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": null,
"contains": [
{
"$ref": "#contains.6.contains.0"
}
]
},
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0
}
]
}

View file

@ -0,0 +1,286 @@
{
"aliases": [
"gms"
],
"case_insensitive": true,
"keywords": {
"keyword": "abort acronym acronyms alias all and assign binary card diag display else eq file files for free ge gt if integer le loop lt maximizing minimizing model models ne negative no not option options or ord positive prod put putpage puttl repeat sameas semicont semiint smax smin solve sos1 sos2 sum system table then until using while xor yes",
"literal": "eps inf na",
"built-in": "abs arccos arcsin arctan arctan2 Beta betaReg binomial ceil centropy cos cosh cvPower div div0 eDist entropy errorf execSeed exp fact floor frac gamma gammaReg log logBeta logGamma log10 log2 mapVal max min mod ncpCM ncpF ncpVUpow ncpVUsin normal pi poly power randBinomial randLinear randTriangle round rPower sigmoid sign signPower sin sinh slexp sllog10 slrec sqexp sqlog10 sqr sqrec sqrt tan tanh trunc uniform uniformInt vcPower bool_and bool_eqv bool_imp bool_not bool_or bool_xor ifThen rel_eq rel_ge rel_gt rel_le rel_lt rel_ne gday gdow ghour gleap gmillisec gminute gmonth gsecond gyear jdate jnow jstart jtime errorLevel execError gamsRelease gamsVersion handleCollect handleDelete handleStatus handleSubmit heapFree heapLimit heapSize jobHandle jobKill jobStatus jobTerminate licenseLevel licenseStatus maxExecError sleep timeClose timeComp timeElapsed timeExec timeStart"
},
"contains": [
{
"className": "comment",
"begin": "^\\$ontext",
"end": "^\\$offtext",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "meta",
"begin": "^\\$[a-z0-9]+",
"end": "$",
"returnBegin": true,
"contains": [
{
"className": "meta-keyword",
"begin": "^\\$[a-z0-9]+"
}
]
},
{
"className": "comment",
"begin": "^\\*",
"end": "$",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.5.contains.0"
}
]
},
{
"beginKeywords": "set sets parameter parameters variable variables scalar scalars equation equations",
"end": ";",
"contains": [
{
"className": "comment",
"begin": "^\\*",
"end": "$",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"$ref": "#contains.3"
},
{
"$ref": "#contains.4"
},
{
"$ref": "#contains.5"
},
{
"$ref": "#contains.6"
},
{
"begin": "\/",
"end": "\/",
"keywords": {
"$ref": "#keywords"
},
"contains": [
{
"className": "comment",
"variants": [
{
"begin": "'",
"end": "'"
},
{
"begin": "\"",
"end": "\""
}
],
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.5.contains.0"
}
]
},
{
"$ref": "#contains.3"
},
{
"$ref": "#contains.4"
},
{
"$ref": "#contains.5"
},
{
"$ref": "#contains.6"
},
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0
}
]
},
{
"begin": "[a-z][a-z0-9_]*(\\([a-z0-9_, ]*\\))?[ \\t]+",
"excludeBegin": true,
"end": "$",
"endsWithParent": true,
"contains": [
{
"$ref": "#contains.7.contains.5.contains.0"
},
{
"$ref": "#contains.7.contains.5"
},
{
"className": "comment",
"begin": "([ ]*[a-z0-9&#*=?@>\\\\<:\\-,()$\\[\\]_.{}!+%^]+)+",
"relevance": 0
}
]
}
]
},
{
"beginKeywords": "table",
"end": ";",
"returnBegin": true,
"contains": [
{
"beginKeywords": "table",
"end": "$",
"contains": [
{
"$ref": "#contains.7.contains.6"
}
]
},
{
"className": "comment",
"begin": "^\\*",
"end": "$",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"$ref": "#contains.3"
},
{
"$ref": "#contains.4"
},
{
"$ref": "#contains.5"
},
{
"$ref": "#contains.6"
},
{
"$ref": "#contains.7.contains.5.contains.5"
}
]
},
{
"className": "function",
"begin": "^[a-z][a-z0-9_,\\-+' ()$]+\\.{2}",
"returnBegin": true,
"contains": [
{
"className": "title",
"begin": "^[a-z0-9_]+"
},
{
"className": "params",
"begin": "\\(",
"end": "\\)",
"excludeBegin": true,
"excludeEnd": true
},
{
"className": "symbol",
"variants": [
{
"begin": "\\=[lgenxc]="
},
{
"begin": "\\$"
}
]
}
]
},
{
"$ref": "#contains.7.contains.5.contains.5"
},
{
"$ref": "#contains.9.contains.2"
}
]
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,123 @@
{
"aliases": [
"nc"
],
"case_insensitive": true,
"lexemes": "[A-Z_][A-Z0-9_.]*",
"keywords": "IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT EQ LT GT NE GE LE OR XOR",
"contains": [
{
"className": "meta",
"begin": "\\%"
},
{
"className": "meta",
"begin": "([O])([0-9]+)"
},
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.2.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\\(",
"end": "\\)",
"contains": [
{
"$ref": "#contains.2.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "number",
"begin": "([-+]?([0-9]*\\.?[0-9]+\\.?))|(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0
},
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": null,
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": null,
"contains": [
{
"$ref": "#contains.6.contains.0"
}
]
},
{
"className": "name",
"begin": "([G])([0-9]+\\.?[0-9]?)"
},
{
"className": "name",
"begin": "([M])([0-9]+\\.?[0-9]?)"
},
{
"className": "attr",
"begin": "(VC|VS|#)",
"end": "(\\d+)"
},
{
"className": "attr",
"begin": "(VZOFX|VZOFY|VZOFZ)"
},
{
"className": "built_in",
"begin": "(ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN)(\\[)",
"end": "([-+]?([0-9]*\\.?[0-9]+\\.?))(\\])"
},
{
"className": "symbol",
"variants": [
{
"begin": "N",
"end": "\\d+",
"illegal": "\\W"
}
]
}
]
}

View file

@ -0,0 +1,64 @@
{
"aliases": [
"feature"
],
"keywords": "Feature Background Ability Business Need Scenario Scenarios Scenario Outline Scenario Template Examples Given And Then But When",
"contains": [
{
"className": "symbol",
"begin": "\\*",
"relevance": 0
},
{
"className": "meta",
"begin": "@[^@\\s]+"
},
{
"begin": "\\|",
"end": "\\|\\w*$",
"contains": [
{
"className": "string",
"begin": "[^|]+"
}
]
},
{
"className": "variable",
"begin": "<",
"end": ">"
},
{
"className": "comment",
"begin": "#",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "\"\"\"",
"end": "\"\"\""
},
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
}
]
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,114 @@
{
"aliases": [
"golang"
],
"keywords": {
"keyword": "break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",
"literal": "true false iota nil",
"built_in": "append cap close complex copy imag len make new panic print println real recover delete"
},
"illegal": "<\/",
"contains": [
{
"className": "comment",
"begin": "\/\/",
"end": "$",
"contains": [
{
"begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "comment",
"begin": "\/\\*",
"end": "\\*\/",
"contains": [
{
"$ref": "#contains.0.contains.0"
},
{
"className": "doctag",
"begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
"relevance": 0
}
]
},
{
"className": "string",
"variants": [
{
"className": "string",
"begin": "\"",
"end": "\"",
"illegal": "\\n",
"contains": [
{
"begin": "\\\\[\\s\\S]",
"relevance": 0
}
]
},
{
"className": "string",
"begin": "'",
"end": "'",
"illegal": "\\n",
"contains": [
{
"$ref": "#contains.2.variants.0.contains.0"
}
]
},
{
"begin": "`",
"end": "`"
}
]
},
{
"className": "number",
"variants": [
{
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)[i]",
"relevance": 1
},
{
"className": "number",
"begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
"relevance": 0
}
]
},
{
"begin": ":="
},
{
"className": "function",
"beginKeywords": "func",
"end": "\\s*(\\{|$)",
"excludeEnd": true,
"contains": [
{
"className": "title",
"begin": "[a-zA-Z]\\w*",
"relevance": 0
},
{
"className": "params",
"begin": "\\(",
"end": "\\)",
"keywords": {
"$ref": "#keywords"
},
"illegal": "[\"']"
}
]
}
]
}

Some files were not shown because too many files have changed in this diff Show more