From 90002c2a35053b5a8e96f05adf58e6a7b841605a Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Sat, 5 Oct 2024 00:07:25 +0100 Subject: [PATCH] init --- .editorconfig | 4 + .gitignore | 2 + README.md | 3 + composer.json | 53 + languages/blade.json | 3870 +++++++++++ languages/c.json | 3550 ++++++++++ languages/css.json | 1860 +++++ languages/go.json | 2894 ++++++++ languages/html.json | 2638 ++++++++ languages/javascript.json | 5987 +++++++++++++++++ languages/json.json | 208 + languages/jsx.json | 5987 +++++++++++++++++ languages/php.json | 4025 +++++++++++ languages/rust.json | 1184 ++++ languages/shellscript.json | 2348 +++++++ languages/toml.json | 431 ++ languages/txt.json | 5 + languages/yaml.json | 627 ++ meta/.gitignore | 2 + meta/input.txt | 1 + meta/package.json | 7 + meta/textmate.js | 66 + phpstan.neon | 5 + phpunit.xml | 18 + samples/blade.sample | 47 + samples/c.sample | 52 + samples/css.sample | 46 + samples/go.sample | 18 + samples/html.sample | 52 + samples/javascript.sample | 151 + samples/json.sample | 38 + samples/jsx.sample | 30 + samples/php.sample | 29 + samples/rust.sample | 39 + samples/sample.php | 66 + samples/shellscript.sample | 1 + samples/toml.sample | 26 + samples/yaml.sample | 50 + src/CommonMark/CodeBlockRenderer.php | 29 + src/CommonMark/PhikiExtension.php | 22 + src/Contracts/ContainsCapturesInterface.php | 18 + src/Contracts/GrammarRepositoryInterface.php | 43 + src/Contracts/InjectionMatcherInterface.php | 23 + .../InjectionSelectorParserInputInterface.php | 15 + src/Contracts/PatternCollectionInterface.php | 18 + src/Contracts/PatternInterface.php | 27 + src/Contracts/ThemeRepositoryInterface.php | 32 + .../IndeterminateStateException.php | 10 + .../MissingRequiredGrammarKeyException.php | 13 + src/Exceptions/UnreachableException.php | 10 + .../UnrecognisedGrammarException.php | 13 + .../UnrecognisedReferenceException.php | 13 + src/Exceptions/UnrecognisedThemeException.php | 13 + src/Grammar/BeginEndPattern.php | 75 + src/Grammar/Capture.php | 29 + src/Grammar/CollectionPattern.php | 67 + src/Grammar/EndPattern.php | 67 + src/Grammar/Grammar.php | 66 + src/Grammar/IncludePattern.php | 56 + src/Grammar/Injections/Composite.php | 50 + src/Grammar/Injections/Expression.php | 34 + src/Grammar/Injections/Filter.php | 27 + src/Grammar/Injections/Group.php | 26 + src/Grammar/Injections/Injection.php | 29 + src/Grammar/Injections/Operator.php | 11 + src/Grammar/Injections/Path.php | 37 + src/Grammar/Injections/Prefix.php | 9 + src/Grammar/Injections/Scope.php | 37 + src/Grammar/Injections/Selector.php | 37 + src/Grammar/MatchPattern.php | 49 + src/Grammar/Pattern.php | 23 + src/GrammarParser.php | 300 + src/GrammarRepository.php | 100 + src/HighlightedToken.php | 11 + src/Highlighter.php | 33 + src/HtmlGenerator.php | 34 + src/MatchedPattern.php | 39 + src/Phiki.php | 42 + src/Regex.php | 82 + src/ThemeRepository.php | 38 + src/ThemeStyles.php | 91 + src/Token.php | 13 + src/TokenSettings.php | 53 + src/Tokenizer.php | 661 ++ tests/Fixtures/example.json | 3 + tests/Fixtures/theme.json | 6 + tests/Languages/HtmlTest.php | 89 + tests/Languages/JavascriptTest.php | 23 + tests/Languages/PhpTest.php | 181 + tests/Languages/TomlTest.php | 39 + tests/Languages/YamlTest.php | 29 + tests/Pest.php | 13 + tests/TestCase.php | 10 + tests/Unit/CommonMark/PhikiExtensionTest.php | 28 + tests/Unit/GrammarParserTest.php | 35 + tests/Unit/GrammarRepositoryTest.php | 60 + tests/Unit/HighlighterTest.php | 17 + tests/Unit/InjectionMatchingTest.php | 67 + tests/Unit/InjectionParserTest.php | 178 + tests/Unit/PhikiTest.php | 17 + tests/Unit/ThemeRepositoryTest.php | 48 + tests/Unit/ThemeStylesTest.php | 59 + tests/Unit/TokenSettingsTest.php | 69 + tests/Unit/TokenizerTest.php | 615 ++ themes/github-dark.json | 544 ++ 105 files changed, 41075 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 README.md create mode 100644 composer.json create mode 100644 languages/blade.json create mode 100644 languages/c.json create mode 100644 languages/css.json create mode 100644 languages/go.json create mode 100644 languages/html.json create mode 100644 languages/javascript.json create mode 100644 languages/json.json create mode 100644 languages/jsx.json create mode 100644 languages/php.json create mode 100644 languages/rust.json create mode 100644 languages/shellscript.json create mode 100644 languages/toml.json create mode 100644 languages/txt.json create mode 100644 languages/yaml.json create mode 100644 meta/.gitignore create mode 100644 meta/input.txt create mode 100644 meta/package.json create mode 100644 meta/textmate.js create mode 100644 phpstan.neon create mode 100644 phpunit.xml create mode 100644 samples/blade.sample create mode 100644 samples/c.sample create mode 100644 samples/css.sample create mode 100644 samples/go.sample create mode 100644 samples/html.sample create mode 100644 samples/javascript.sample create mode 100644 samples/json.sample create mode 100644 samples/jsx.sample create mode 100644 samples/php.sample create mode 100644 samples/rust.sample create mode 100644 samples/sample.php create mode 100644 samples/shellscript.sample create mode 100644 samples/toml.sample create mode 100644 samples/yaml.sample create mode 100644 src/CommonMark/CodeBlockRenderer.php create mode 100644 src/CommonMark/PhikiExtension.php create mode 100644 src/Contracts/ContainsCapturesInterface.php create mode 100644 src/Contracts/GrammarRepositoryInterface.php create mode 100644 src/Contracts/InjectionMatcherInterface.php create mode 100644 src/Contracts/InjectionSelectorParserInputInterface.php create mode 100644 src/Contracts/PatternCollectionInterface.php create mode 100644 src/Contracts/PatternInterface.php create mode 100644 src/Contracts/ThemeRepositoryInterface.php create mode 100644 src/Exceptions/IndeterminateStateException.php create mode 100644 src/Exceptions/MissingRequiredGrammarKeyException.php create mode 100644 src/Exceptions/UnreachableException.php create mode 100644 src/Exceptions/UnrecognisedGrammarException.php create mode 100644 src/Exceptions/UnrecognisedReferenceException.php create mode 100644 src/Exceptions/UnrecognisedThemeException.php create mode 100644 src/Grammar/BeginEndPattern.php create mode 100644 src/Grammar/Capture.php create mode 100644 src/Grammar/CollectionPattern.php create mode 100644 src/Grammar/EndPattern.php create mode 100644 src/Grammar/Grammar.php create mode 100644 src/Grammar/IncludePattern.php create mode 100644 src/Grammar/Injections/Composite.php create mode 100644 src/Grammar/Injections/Expression.php create mode 100644 src/Grammar/Injections/Filter.php create mode 100644 src/Grammar/Injections/Group.php create mode 100644 src/Grammar/Injections/Injection.php create mode 100644 src/Grammar/Injections/Operator.php create mode 100644 src/Grammar/Injections/Path.php create mode 100644 src/Grammar/Injections/Prefix.php create mode 100644 src/Grammar/Injections/Scope.php create mode 100644 src/Grammar/Injections/Selector.php create mode 100644 src/Grammar/MatchPattern.php create mode 100644 src/Grammar/Pattern.php create mode 100644 src/GrammarParser.php create mode 100644 src/GrammarRepository.php create mode 100644 src/HighlightedToken.php create mode 100644 src/Highlighter.php create mode 100644 src/HtmlGenerator.php create mode 100644 src/MatchedPattern.php create mode 100644 src/Phiki.php create mode 100644 src/Regex.php create mode 100644 src/ThemeRepository.php create mode 100644 src/ThemeStyles.php create mode 100644 src/Token.php create mode 100644 src/TokenSettings.php create mode 100644 src/Tokenizer.php create mode 100644 tests/Fixtures/example.json create mode 100644 tests/Fixtures/theme.json create mode 100644 tests/Languages/HtmlTest.php create mode 100644 tests/Languages/JavascriptTest.php create mode 100644 tests/Languages/PhpTest.php create mode 100644 tests/Languages/TomlTest.php create mode 100644 tests/Languages/YamlTest.php create mode 100644 tests/Pest.php create mode 100644 tests/TestCase.php create mode 100644 tests/Unit/CommonMark/PhikiExtensionTest.php create mode 100644 tests/Unit/GrammarParserTest.php create mode 100644 tests/Unit/GrammarRepositoryTest.php create mode 100644 tests/Unit/HighlighterTest.php create mode 100644 tests/Unit/InjectionMatchingTest.php create mode 100644 tests/Unit/InjectionParserTest.php create mode 100644 tests/Unit/PhikiTest.php create mode 100644 tests/Unit/ThemeRepositoryTest.php create mode 100644 tests/Unit/ThemeStylesTest.php create mode 100644 tests/Unit/TokenSettingsTest.php create mode 100644 tests/Unit/TokenizerTest.php create mode 100644 themes/github-dark.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8f6419c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +[*] +indent_size = 4 +indent_style = space +tab_width = 4 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..19982ea --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +composer.lock +vendor \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..010e81e --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Phiki + +Phiki is a syntax highlighter written in PHP. It uses TextMate grammar files and Visual Studio Code themes to highlight code. \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..7aabc02 --- /dev/null +++ b/composer.json @@ -0,0 +1,53 @@ +{ + "name": "ryangjchandler/phiki", + "description": "Syntax highlighting using TextMate grammars in PHP.", + "license": "MIT", + "authors": [ + { + "name": "Ryan Chandler", + "email": "support@ryangjchandler.co.uk", + "role": "Developer", + "homepage": "https://ryangjchandler.co.uk" + } + ], + "require": { + "php": "^8.2", + "illuminate/support": "^11.23", + "league/commonmark": "^2.5" + }, + "autoload": { + "psr-4": { + "Phiki\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Phiki\\Tests\\": "tests/" + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "require-dev": { + "symfony/var-dumper": "^7.1", + "pestphp/pest": "^3.0", + "laravel/pint": "^1.17", + "phpstan/phpstan": "^1.12", + "phpstan/extension-installer": "^1.4" + }, + "config": { + "allow-plugins": { + "pestphp/pest-plugin": true, + "phpstan/extension-installer": true + } + }, + "scripts": { + "sample": [ + "Composer\\Config::disableProcessTimeout", + "php -S 127.0.0.1:8080 ./samples/sample.php" + ], + "serve": [ + "Composer\\Config::disableProcessTimeout", + "php -S 127.0.0.1:8080 ./test-server.php" + ] + } +} diff --git a/languages/blade.json b/languages/blade.json new file mode 100644 index 0000000..d4c6cd9 --- /dev/null +++ b/languages/blade.json @@ -0,0 +1,3870 @@ +{ + "displayName": "Blade", + "fileTypes": [ + "blade.php" + ], + "foldingStartMarker": "(/\\*|\\{\\s*$|<<))", + "beginCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.leading.php" + } + }, + "end": "(?!\\G)(\\s*$\\n)?", + "endCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.trailing.php" + } + }, + "patterns": [ + { + "begin": "<\\?(?i:php|=)?", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + } + }, + "contentName": "source.php", + "end": "(\\?)>", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "source.php" + } + }, + "name": "meta.embedded.block.php", + "patterns": [ + { + "include": "#language" + } + ] + } + ] + }, + { + "begin": "<\\?(?i:php|=)?(?![^?]*\\?>)", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + } + }, + "contentName": "source.php", + "end": "(\\?)>", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "source.php" + } + }, + "name": "meta.embedded.block.php", + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "begin": "<\\?(?i:php|=)?", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + } + }, + "name": "meta.embedded.line.php", + "patterns": [ + { + "captures": { + "1": { + "name": "source.php" + }, + "2": { + "name": "punctuation.section.embedded.end.php" + }, + "3": { + "name": "source.php" + } + }, + "match": "\\G(\\s*)((\\?))(?=>)", + "name": "meta.special.empty-tag.php" + }, + { + "begin": "\\G", + "contentName": "source.php", + "end": "(\\?)(?=>)", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "source.php" + } + }, + "patterns": [ + { + "include": "#language" + } + ] + } + ] + } + ] + } + }, + "name": "blade", + "patterns": [ + { + "include": "text.html.basic" + } + ], + "repository": { + "balance_brackets": { + "patterns": [ + { + "begin": "\\(", + "end": "\\)", + "patterns": [ + { + "include": "#balance_brackets" + } + ] + }, + { + "match": "[^()]+" + } + ] + }, + "blade": { + "patterns": [ + { + "begin": "{{--", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.blade" + } + }, + "end": "--}}", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.blade" + } + }, + "name": "comment.block.blade", + "patterns": [ + { + "begin": "(^\\s*)(?=<\\?(?![^?]*\\?>))", + "beginCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.leading.php" + } + }, + "end": "(?!\\G)(\\s*$\\n)?", + "endCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.trailing.php" + } + }, + "name": "invalid.illegal.php-code-in-comment.blade", + "patterns": [ + { + "begin": "<\\?(?i:php|=)?", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + } + }, + "contentName": "source.php", + "end": "(\\?)>", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "source.php" + } + }, + "name": "meta.embedded.block.php", + "patterns": [ + { + "include": "#language" + } + ] + } + ] + }, + { + "begin": "<\\?(?i:php|=)?(?![^?]*\\?>)", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + } + }, + "contentName": "source.php", + "end": "(\\?)>", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "source.php" + } + }, + "name": "invalid.illegal.php-code-in-comment.blade.meta.embedded.block.php", + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "begin": "<\\?(?i:php|=)?", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + } + }, + "name": "invalid.illegal.php-code-in-comment.blade.meta.embedded.line.php", + "patterns": [ + { + "captures": { + "1": { + "name": "source.php" + }, + "2": { + "name": "punctuation.section.embedded.end.php" + }, + "3": { + "name": "source.php" + } + }, + "match": "\\G(\\s*)((\\?))(?=>)", + "name": "meta.special.empty-tag.php" + }, + { + "begin": "\\G", + "contentName": "source.php", + "end": "(\\?)(?=>)", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "source.php" + } + }, + "patterns": [ + { + "include": "#language" + } + ] + } + ] + } + ] + }, + { + "begin": "(?)", + "name": "comment.line.double-slash.php" + } + ] + }, + { + "begin": "(^\\s+)?(?=#)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.php" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "#", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.php" + } + }, + "end": "\\n|(?=\\?>)", + "name": "comment.line.number-sign.php" + } + ] + } + ] + }, + "constants": { + "patterns": [ + { + "match": "(?i)\\b(TRUE|FALSE|NULL|__(FILE|DIR|FUNCTION|CLASS|METHOD|LINE|NAMESPACE)__|ON|OFF|YES|NO|NL|BR|TAB)\\b", + "name": "constant.language.php" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.inheritance.php" + } + }, + "match": "(\\\\)?\\b(DEFAULT_INCLUDE_PATH|EAR_(INSTALL|EXTENSION)_DIR|E_(ALL|COMPILE_(ERROR|WARNING)|CORE_(ERROR|WARNING)|DEPRECATED|ERROR|NOTICE|PARSE|RECOVERABLE_ERROR|STRICT|USER_(DEPRECATED|ERROR|NOTICE|WARNING)|WARNING)|PHP_(ROUND_HALF_(DOWN|EVEN|ODD|UP)|(MAJOR|MINOR|RELEASE)_VERSION|MAXPATHLEN|BINDIR|SHLIB_SUFFIX|SYSCONFDIR|SAPI|CONFIG_FILE_(PATH|SCAN_DIR)|INT_(MAX|SIZE)|ZTS|OS|OUTPUT_HANDLER_(START|CONT|END)|DEBUG|DATADIR|URL_(SCHEME|HOST|USER|PORT|PASS|PATH|QUERY|FRAGMENT)|PREFIX|EXTRA_VERSION|EXTENSION_DIR|EOL|VERSION(_ID)?|WINDOWS_(NT_(SERVER|DOMAIN_CONTROLLER|WORKSTATION)|VERSION_(MAJOR|MINOR)|BUILD|SUITEMASK|SP_(MAJOR|MINOR)|PRODUCTTYPE|PLATFORM)|LIBDIR|LOCALSTATEDIR)|STD(ERR|IN|OUT)|ZEND_(DEBUG_BUILD|THREAD_SAFE))\\b", + "name": "support.constant.core.php" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.inheritance.php" + } + }, + "match": "(\\\\)?\\b(__COMPILER_HALT_OFFSET__|AB(MON_(1|2|3|4|5|6|7|8|9|10|11|12)|DAY[1-7])|AM_STR|ASSERT_(ACTIVE|BAIL|CALLBACK_QUIET_EVAL|WARNING)|ALT_DIGITS|CASE_(UPPER|LOWER)|CHAR_MAX|CONNECTION_(ABORTED|NORMAL|TIMEOUT)|CODESET|COUNT_(NORMAL|RECURSIVE)|CREDITS_(ALL|DOCS|FULLPAGE|GENERAL|GROUP|MODULES|QA|SAPI)|CRYPT_(BLOWFISH|EXT_DES|MD5|SHA(256|512)|SALT_LENGTH|STD_DES)|CURRENCY_SYMBOL|D_(T_)?FMT|DATE_(ATOM|COOKIE|ISO8601|RFC(822|850|1036|1123|2822|3339)|RSS|W3C)|DAY_[1-7]|DECIMAL_POINT|DIRECTORY_SEPARATOR|ENT_(COMPAT|IGNORE|(NO)?QUOTES)|EXTR_(IF_EXISTS|OVERWRITE|PREFIX_(ALL|IF_EXISTS|INVALID|SAME)|REFS|SKIP)|ERA(_(D_(T_)?FMT)|T_FMT|YEAR)?|FRAC_DIGITS|GROUPING|HASH_HMAC|HTML_(ENTITIES|SPECIALCHARS)|INF|INFO_(ALL|CREDITS|CONFIGURATION|ENVIRONMENT|GENERAL|LICENSEMODULES|VARIABLES)|INI_(ALL|CANNER_(NORMAL|RAW)|PERDIR|SYSTEM|USER)|INT_(CURR_SYMBOL|FRAC_DIGITS)|LC_(ALL|COLLATE|CTYPE|MESSAGES|MONETARY|NUMERIC|TIME)|LOCK_(EX|NB|SH|UN)|LOG_(ALERT|AUTH(PRIV)?|CRIT|CRON|CONS|DAEMON|DEBUG|EMERG|ERR|INFO|LOCAL[1-7]|LPR|KERN|MAIL|NEWS|NODELAY|NOTICE|NOWAIT|ODELAY|PID|PERROR|WARNING|SYSLOG|UCP|USER)|M_(1_PI|SQRT(1_2|2|3|PI)|2_(SQRT)?PI|PI(_(2|4))?|E(ULER)?|LN(10|2|PI)|LOG(10|2)E)|MON_(1|2|3|4|5|6|7|8|9|10|11|12|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|N_(CS_PRECEDES|SEP_BY_SPACE|SIGN_POSN)|NAN|NEGATIVE_SIGN|NO(EXPR|STR)|P_(CS_PRECEDES|SEP_BY_SPACE|SIGN_POSN)|PM_STR|POSITIVE_SIGN|PATH(_SEPARATOR|INFO_(EXTENSION|(BASE|DIR|FILE)NAME))|RADIXCHAR|SEEK_(CUR|END|SET)|SORT_(ASC|DESC|LOCALE_STRING|REGULAR|STRING)|STR_PAD_(BOTH|LEFT|RIGHT)|T_FMT(_AMPM)?|THOUSEP|THOUSANDS_SEP|UPLOAD_ERR_(CANT_WRITE|EXTENSION|(FORM|INI)_SIZE|NO_(FILE|TMP_DIR)|OK|PARTIAL)|YES(EXPR|STR))\\b", + "name": "support.constant.std.php" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.inheritance.php" + } + }, + "match": "(\\\\)?\\b(GLOB_(MARK|BRACE|NO(SORT|CHECK|ESCAPE)|ONLYDIR|ERR|AVAILABLE_FLAGS)|XML_(SAX_IMPL|(DTD|DOCUMENT(_(FRAG|TYPE))?|HTML_DOCUMENT|NOTATION|NAMESPACE_DECL|PI|COMMENT|DATA_SECTION|TEXT)_NODE|OPTION_(SKIP_(TAGSTART|WHITE)|CASE_FOLDING|TARGET_ENCODING)|ERROR_((BAD_CHAR|(ATTRIBUTE_EXTERNAL|BINARY|PARAM|RECURSIVE)_ENTITY)_REF|MISPLACED_XML_PI|SYNTAX|NONE|NO_(MEMORY|ELEMENTS)|TAG_MISMATCH|INCORRECT_ENCODING|INVALID_TOKEN|DUPLICATE_ATTRIBUTE|UNCLOSED_(CDATA_SECTION|TOKEN)|UNDEFINED_ENTITY|UNKNOWN_ENCODING|JUNK_AFTER_DOC_ELEMENT|PARTIAL_CHAR|EXTERNAL_ENTITY_HANDLING|ASYNC_ENTITY)|ENTITY_(((REF|DECL)_)?NODE)|ELEMENT(_DECL)?_NODE|LOCAL_NAMESPACE|ATTRIBUTE_(NMTOKEN(S)?|NOTATION|NODE)|CDATA|ID(REF(S)?)?|DECL_NODE|ENTITY|ENUMERATION)|MHASH_(RIPEMD(128|160|256|320)|GOST|MD(2|4|5)|SHA(1|224|256|384|512)|SNEFRU256|HAVAL(128|160|192|224|256)|CRC23(B)?|TIGER(128|160)?|WHIRLPOOL|ADLER32)|MYSQL_(BOTH|NUM|CLIENT_(SSL|COMPRESS|IGNORE_SPACE|INTERACTIVE|ASSOC))|MYSQLI_(REPORT_(STRICT|INDEX|OFF|ERROR|ALL)|REFRESH_(GRANT|MASTER|BACKUP_LOG|STATUS|SLAVE|HOSTS|THREADS|TABLES|LOG)|READ_DEFAULT_(FILE|GROUP)|(GROUP|MULTIPLE_KEY|BINARY|BLOB)_FLAG|BOTH|STMT_ATTR_(CURSOR_TYPE|UPDATE_MAX_LENGTH|PREFETCH_ROWS)|STORE_RESULT|SERVER_QUERY_(NO_((GOOD_)?INDEX_USED)|WAS_SLOW)|SET_(CHARSET_NAME|FLAG)|NO_(DEFAULT_VALUE_FLAG|DATA)|NOT_NULL_FLAG|NUM(_FLAG)?|CURSOR_TYPE_(READ_ONLY|SCROLLABLE|NO_CURSOR|FOR_UPDATE)|CLIENT_(SSL|NO_SCHEMA|COMPRESS|IGNORE_SPACE|INTERACTIVE|FOUND_ROWS)|TYPE_(GEOMETRY|((MEDIUM|LONG|TINY)_)?BLOB|BIT|SHORT|STRING|SET|YEAR|NULL|NEWDECIMAL|NEWDATE|CHAR|TIME(STAMP)?|TINY|INT24|INTERVAL|DOUBLE|DECIMAL|DATE(TIME)?|ENUM|VAR_STRING|FLOAT|LONG(LONG)?)|TIME_STAMP_FLAG|INIT_COMMAND|ZEROFILL_FLAG|ON_UPDATE_NOW_FLAG|OPT_(NET_((CMD|READ)_BUFFER_SIZE)|CONNECT_TIMEOUT|INT_AND_FLOAT_NATIVE|LOCAL_INFILE)|DEBUG_TRACE_ENABLED|DATA_TRUNCATED|USE_RESULT|(ENUM|(PART|PRI|UNIQUE)_KEY|UNSIGNED)_FLAG|ASSOC|ASYNC|AUTO_INCREMENT_FLAG)|MCRYPT_(RC(2|6)|RIJNDAEL_(128|192|256)|RAND|GOST|XTEA|MODE_(STREAM|NOFB|CBC|CFB|OFB|ECB)|MARS|BLOWFISH(_COMPAT)?|SERPENT|SKIPJACK|SAFER(64|128|PLUS)|CRYPT|CAST_(128|256)|TRIPLEDES|THREEWAY|TWOFISH|IDEA|(3)?DES|DECRYPT|DEV_(U)?RANDOM|PANAMA|ENCRYPT|ENIGNA|WAKE|LOKI97|ARCFOUR(_IV)?)|STREAM_(REPORT_ERRORS|MUST_SEEK|MKDIR_RECURSIVE|BUFFER_(NONE|FULL|LINE)|SHUT_(RD)?WR|SOCK_(RDM|RAW|STREAM|SEQPACKET|DGRAM)|SERVER_(BIND|LISTEN)|NOTIFY_(REDIRECTED|RESOLVE|MIME_TYPE_IS|SEVERITY_(INFO|ERR|WARN)|COMPLETED|CONNECT|PROGRESS|FILE_SIZE_IS|FAILURE|AUTH_(REQUIRED|RESULT))|CRYPTO_METHOD_((SSLv2(3)?|SSLv3|TLS)_(CLIENT|SERVER))|CLIENT_((ASYNC_)?CONNECT|PERSISTENT)|CAST_(AS_STREAM|FOR_SELECT)|(IGNORE|IS)_URL|IPPROTO_(RAW|TCP|ICMP|IP|UDP)|OOB|OPTION_(READ_(BUFFER|TIMEOUT)|BLOCKING|WRITE_BUFFER)|URL_STAT_(LINK|QUIET)|USE_PATH|PEEK|PF_(INET(6)?|UNIX)|ENFORCE_SAFE_MODE|FILTER_(ALL|READ|WRITE))|SUNFUNCS_RET_(DOUBLE|STRING|TIMESTAMP)|SQLITE_(READONLY|ROW|MISMATCH|MISUSE|BOTH|BUSY|SCHEMA|NOMEM|NOTFOUND|NOTADB|NOLFS|NUM|CORRUPT|CONSTRAINT|CANTOPEN|TOOBIG|INTERRUPT|INTERNAL|IOERR|OK|DONE|PROTOCOL|PERM|ERROR|EMPTY|FORMAT|FULL|LOCKED|ABORT|ASSOC|AUTH)|SQLITE3_(BOTH|BLOB|NUM|NULL|TEXT|INTEGER|OPEN_(READ(ONLY|WRITE)|CREATE)|FLOAT_ASSOC)|CURL(M_(BAD_((EASY)?HANDLE)|CALL_MULTI_PERFORM|INTERNAL_ERROR|OUT_OF_MEMORY|OK)|MSG_DONE|SSH_AUTH_(HOST|NONE|DEFAULT|PUBLICKEY|PASSWORD|KEYBOARD)|CLOSEPOLICY_(SLOWEST|CALLBACK|OLDEST|LEAST_(RECENTLY_USED|TRAFFIC)|INFO_(REDIRECT_(COUNT|TIME)|REQUEST_SIZE|SSL_VERIFYRESULT|STARTTRANSFER_TIME|(SIZE|SPEED)_(DOWNLOAD|UPLOAD)|HTTP_CODE|HEADER_(OUT|SIZE)|NAMELOOKUP_TIME|CONNECT_TIME|CONTENT_(TYPE|LENGTH_(DOWNLOAD|UPLOAD))|CERTINFO|TOTAL_TIME|PRIVATE|PRETRANSFER_TIME|EFFECTIVE_URL|FILETIME)|OPT_(RESUME_FROM|RETURNTRANSFER|REDIR_PROTOCOLS|REFERER|READ(DATA|FUNCTION)|RANGE|RANDOM_FILE|MAX(CONNECTS|REDIRS)|BINARYTRANSFER|BUFFERSIZE|SSH_(HOST_PUBLIC_KEY_MD5|(PRIVATE|PUBLIC)_KEYFILE)|AUTH_TYPES)|SSL(CERT(TYPE|PASSWD)?|ENGINE(_DEFAULT)?|VERSION|KEY(TYPE|PASSWD)?)|SSL_(CIPHER_LIST|VERIFY(HOST|PEER))|STDERR|HTTP(GET|HEADER|200ALIASES|_VERSION|PROXYTUNNEL|AUTH)|HEADER(FUNCTION)?|NO(BODY|SIGNAL|PROGRESS)|NETRC|CRLF|CONNECTTIMEOUT(_MS)?|COOKIE(SESSION|JAR|FILE)?|CUSTOMREQUEST|CERTINFO|CLOSEPOLICY|CA(INFO|PATH)|TRANSFERTEXT|TCP_NODELAY|TIME(CONDITION|OUT(_MS)?|VALUE)|INTERFACE|INFILE(SIZE)?|IPRESOLVE|DNS_(CACHE_TIMEOUT|USE_GLOBAL_CACHE)|URL|USER(AGENT|PWD)|UNRESTRICTED_AUTH|UPLOAD|PRIVATE|PROGRESSFUNCTION|PROXY(TYPE|USERPWD|PORT|AUTH)?|PROTOCOLS|PORT|POST(REDIR|QUOTE|FIELDS)?|PUT|EGDSOCKET|ENCODING|VERBOSE|KRB4LEVEL|KEYPASSWD|QUOTE|FRESH_CONNECT|FTP(APPEND|LISTONLY|PORT|SSLAUTH)|FTP_(SSL|SKIP_PASV_IP|CREATE_MISSING_DIRS|USE_EP(RT|SV)|FILEMETHOD)|FILE(TIME)?|FORBID_REUSE|FOLLOWLOCATION|FAILONERROR|WRITE(FUNCTION|HEADER)|LOW_SPEED_(LIMIT|TIME)|AUTOREFERER)|PROXY_(HTTP|SOCKS(4|5))|PROTO_(SCP|SFTP|HTTP(S)?|TELNET|TFTP|DICT|FTP(S)?|FILE|LDAP(S)?|ALL)|E_((RECV|READ)_ERROR|GOT_NOTHING|MALFORMAT_USER|BAD_(CONTENT_ENCODING|CALLING_ORDER|PASSWORD_ENTERED|FUNCTION_ARGUMENT)|SSH|SSL_(CIPHER|CONNECT_ERROR|CERTPROBLEM|CACERT|PEER_CERTIFICATE|ENGINE_(NOTFOUND|SETFAILED))|SHARE_IN_USE|SEND_ERROR|HTTP_(RANGE_ERROR|NOT_FOUND|PORT_FAILED|POST_ERROR)|COULDNT_(RESOLVE_(HOST|PROXY)|CONNECT)|TOO_MANY_REDIRECTS|TELNET_OPTION_SYNTAX|OBSOLETE|OUT_OF_MEMORY|OPERATION|TIMEOUTED|OK|URL_MALFORMAT(_USER)?|UNSUPPORTED_PROTOCOL|UNKNOWN_TELNET_OPTION|PARTIAL_FILE|FTP_(BAD_DOWNLOAD_RESUME|SSL_FAILED|COULDNT_(RETR_FILE|GET_SIZE|STOR_FILE|SET_(BINARY|ASCII)|USE_REST)|CANT_(GET_HOST|RECONNECT)|USER_PASSWORD_INCORRECT|PORT_FAILED|QUOTE_ERROR|WRITE_ERROR|WEIRD_((PASS|PASV|SERVER|USER)_REPLY|227_FORMAT)|ACCESS_DENIED)|FILESIZE_EXCEEDED|FILE_COULDNT_READ_FILE|FUNCTION_NOT_FOUND|FAILED_INIT|WRITE_ERROR|LIBRARY_NOT_FOUND|LDAP_(SEARCH_FAILED|CANNOT_BIND|INVALID_URL)|ABORTED_BY_CALLBACK)|VERSION_NOW|FTP(METHOD_(MULTI|SINGLE|NO)CWD|SSL_(ALL|NONE|CONTROL|TRY)|AUTH_(DEFAULT|SSL|TLS))|AUTH_(ANY(SAFE)?|BASIC|DIGEST|GSSNEGOTIATE|NTLM))|CURL_(HTTP_VERSION_(1_(0|1)|NONE)|NETRC_(REQUIRED|IGNORED|OPTIONAL)|TIMECOND_(IF(UN)?MODSINCE|LASTMOD)|IPRESOLVE_(V(4|6)|WHATEVER)|VERSION_(SSL|IPV6|KERBEROS4|LIBZ))|IMAGETYPE_(GIF|XBM|BMP|SWF|COUNT|TIFF_(MM|II)|ICO|IFF|UNKNOWN|JB2|JPX|JP2|JPC|JPEG(2000)?|PSD|PNG|WBMP)|INPUT_(REQUEST|GET|SERVER|SESSION|COOKIE|POST|ENV)|ICONV_(MIME_DECODE_(STRICT|CONTINUE_ON_ERROR)|IMPL|VERSION)|DNS_(MX|SRV|SOA|HINFO|NS|NAPTR|CNAME|TXT|PTR|ANY|ALL|AAAA|A(6)?)|DOM(STRING_SIZE_ERR)|DOM_((SYNTAX|HIERARCHY_REQUEST|NO_(MODIFICATION_ALLOWED|DATA_ALLOWED)|NOT_(FOUND|SUPPORTED)|NAMESPACE|INDEX_SIZE|USE_ATTRIBUTE|VALID_(MODIFICATION|STATE|CHARACTER|ACCESS)|PHP|VALIDATION|WRONG_DOCUMENT)_ERR)|JSON_(HEX_(TAG|QUOT|AMP|APOS)|NUMERIC_CHECK|ERROR_(SYNTAX|STATE_MISMATCH|NONE|CTRL_CHAR|DEPTH|UTF8)|FORCE_OBJECT)|PREG_((D_UTF8(_OFFSET)?|NO|INTERNAL|(BACKTRACK|RECURSION)_LIMIT)_ERROR|GREP_INVERT|SPLIT_(NO_EMPTY|(DELIM|OFFSET)_CAPTURE)|SET_ORDER|OFFSET_CAPTURE|PATTERN_ORDER)|PSFS_(PASS_ON|ERR_FATAL|FEED_ME|FLAG_(NORMAL|FLUSH_(CLOSE|INC)))|PCRE_VERSION|POSIX_((F|R|W|X)_OK|S_IF(REG|BLK|SOCK|CHR|IFO))|FNM_(NOESCAPE|CASEFOLD|PERIOD|PATHNAME)|FILTER_(REQUIRE_(SCALAR|ARRAY)|NULL_ON_FAILURE|CALLBACK|DEFAULT|UNSAFE_RAW|SANITIZE_(MAGIC_QUOTES|STRING|STRIPPED|SPECIAL_CHARS|NUMBER_(INT|FLOAT)|URL|EMAIL|ENCODED|FULL_SPCIAL_CHARS)|VALIDATE_(REGEXP|BOOLEAN|INT|IP|URL|EMAIL|FLOAT)|FORCE_ARRAY|FLAG_(SCHEME_REQUIRED|STRIP_(BACKTICK|HIGH|LOW)|HOST_REQUIRED|NONE|NO_(RES|PRIV)_RANGE|ENCODE_QUOTES|IPV(4|6)|PATH_REQUIRED|EMPTY_STRING_NULL|ENCODE_(HIGH|LOW|AMP)|QUERY_REQUIRED|ALLOW_(SCIENTIFIC|HEX|THOUSAND|OCTAL|FRACTION)))|FILE_(BINARY|SKIP_EMPTY_LINES|NO_DEFAULT_CONTEXT|TEXT|IGNORE_NEW_LINES|USE_INCLUDE_PATH|APPEND)|FILEINFO_(RAW|MIME(_(ENCODING|TYPE))?|SYMLINK|NONE|CONTINUE|DEVICES|PRESERVE_ATIME)|FORCE_(DEFLATE|GZIP)|LIBXML_(XINCLUDE|NSCLEAN|NO(XMLDECL|BLANKS|NET|CDATA|ERROR|EMPTYTAG|ENT|WARNING)|COMPACT|DTD(VALID|LOAD|ATTR)|((DOTTED|LOADED)_)?VERSION|PARSEHUGE|ERR_(NONE|ERROR|FATAL|WARNING)))\\b", + "name": "support.constant.ext.php" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.inheritance.php" + } + }, + "match": "(\\\\)?\\b(T_(RETURN|REQUIRE(_ONCE)?|GOTO|GLOBAL|(MINUS|MOD|MUL|XOR)_EQUAL|METHOD_C|ML_COMMENT|BREAK|BOOL_CAST|BOOLEAN_(AND|OR)|BAD_CHARACTER|SR(_EQUAL)?|STRING(_CAST|VARNAME)?|START_HEREDOC|STATIC|SWITCH|SL(_EQUAL)?|HALT_COMPILER|NS_(C|SEPARATOR)|NUM_STRING|NEW|NAMESPACE|CHARACTER|COMMENT|CONSTANT(_ENCAPSED_STRING)?|CONCAT_EQUAL|CONTINUE|CURLY_OPEN|CLOSE_TAG|CLONE|CLASS(_C)?|CASE|CATCH|TRY|THROW|IMPLEMENTS|ISSET|IS_((GREATER|SMALLER)_OR_EQUAL|(NOT_)?(IDENTICAL|EQUAL))|INSTANCEOF|INCLUDE(_ONCE)?|INC|INT_CAST|INTERFACE|INLINE_HTML|IF|OR_EQUAL|OBJECT_(CAST|OPERATOR)|OPEN_TAG(_WITH_ECHO)?|OLD_FUNCTION|DNUMBER|DIR|DIV_EQUAL|DOC_COMMENT|DOUBLE_(ARROW|CAST|COLON)|DOLLAR_OPEN_CURLY_BRACES|DO|DEC|DECLARE|DEFAULT|USE|UNSET(_CAST)?|PRINT|PRIVATE|PROTECTED|PUBLIC|PLUS_EQUAL|PAAMAYIM_NEKUDOTAYIM|EXTENDS|EXIT|EMPTY|ENCAPSED_AND_WHITESPACE|END(SWITCH|IF|DECLARE|FOR(EACH)?|WHILE)|END_HEREDOC|ECHO|EVAL|ELSE(IF)?|VAR(IABLE)?|FINAL|FILE|FOR(EACH)?|FUNC_C|FUNCTION|WHITESPACE|WHILE|LNUMBER|LIST|LINE|LOGICAL_(AND|OR|XOR)|ARRAY_(CAST)?|ABSTRACT|AS|AND_EQUAL))\\b", + "name": "support.constant.parser-token.php" + }, + { + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "constant.other.php" + } + ] + }, + "function-call": { + "patterns": [ + { + "begin": "(?i)(\\\\?\\b[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*(?:\\\\[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)+)\\s*(\\()", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#namespace" + }, + { + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "entity.name.function.php" + } + ] + }, + "2": { + "name": "punctuation.definition.arguments.begin.bracket.round.php" + } + }, + "end": "\\)|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.php" + } + }, + "name": "meta.function-call.php", + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "begin": "(?i)(\\\\)?\\b([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(\\()", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#namespace" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#support" + }, + { + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "entity.name.function.php" + } + ] + }, + "3": { + "name": "punctuation.definition.arguments.begin.bracket.round.php" + } + }, + "end": "\\)|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.php" + } + }, + "name": "meta.function-call.php", + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "match": "(?i)\\b(print|echo)\\b", + "name": "support.function.construct.output.php" + } + ] + }, + "function-parameters": { + "patterns": [ + { + "include": "#comments" + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.php" + }, + { + "begin": "(?i)(array)\\s+((&)?\\s*(\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(=)\\s*(array)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "storage.type.php" + }, + "2": { + "name": "variable.other.php" + }, + "3": { + "name": "storage.modifier.reference.php" + }, + "4": { + "name": "punctuation.definition.variable.php" + }, + "5": { + "name": "keyword.operator.assignment.php" + }, + "6": { + "name": "support.function.construct.php" + }, + "7": { + "name": "punctuation.definition.array.begin.bracket.round.php" + } + }, + "contentName": "meta.array.php", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.array.end.bracket.round.php" + } + }, + "name": "meta.function.parameter.array.php", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#strings" + }, + { + "include": "#numbers" + } + ] + }, + { + "captures": { + "1": { + "name": "storage.type.php" + }, + "10": { + "name": "invalid.illegal.non-null-typehinted.php" + }, + "2": { + "name": "variable.other.php" + }, + "3": { + "name": "storage.modifier.reference.php" + }, + "4": { + "name": "punctuation.definition.variable.php" + }, + "5": { + "name": "keyword.operator.assignment.php" + }, + "6": { + "name": "constant.language.php" + }, + "7": { + "name": "punctuation.section.array.begin.php" + }, + "8": { + "patterns": [ + { + "include": "#parameter-default-types" + } + ] + }, + "9": { + "name": "punctuation.section.array.end.php" + } + }, + "match": "(?i)(array|callable)\\s+((&)?\\s*(\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)(?:\\s*(=)\\s*(?:(null)|(\\[)((?>[^\\[\\]]+|\\[\\g<8>\\])*)(\\])|((?:\\S*?\\(\\))|(?:\\S*?))))?\\s*(?=,|\\)|/[/*]|\\#|$)", + "name": "meta.function.parameter.array.php" + }, + { + "begin": "(?i)(\\\\?(?:[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*\\\\)*)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s+((&)?\\s*(\\.\\.\\.)?(\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)", + "beginCaptures": { + "1": { + "name": "support.other.namespace.php", + "patterns": [ + { + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "storage.type.php" + }, + { + "match": "\\\\", + "name": "punctuation.separator.inheritance.php" + } + ] + }, + "2": { + "name": "storage.type.php" + }, + "3": { + "name": "variable.other.php" + }, + "4": { + "name": "storage.modifier.reference.php" + }, + "5": { + "name": "keyword.operator.variadic.php" + }, + "6": { + "name": "punctuation.definition.variable.php" + } + }, + "end": "(?=,|\\)|/[/*]|\\#)", + "name": "meta.function.parameter.typehinted.php", + "patterns": [ + { + "begin": "=", + "beginCaptures": { + "0": { + "name": "keyword.operator.assignment.php" + } + }, + "end": "(?=,|\\)|/[/*]|\\#)", + "patterns": [ + { + "include": "#language" + } + ] + } + ] + }, + { + "captures": { + "1": { + "name": "variable.other.php" + }, + "2": { + "name": "storage.modifier.reference.php" + }, + "3": { + "name": "keyword.operator.variadic.php" + }, + "4": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(?i)((&)?\\s*(\\.\\.\\.)?(\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(?=,|\\)|/[/*]|\\#|$)", + "name": "meta.function.parameter.no-default.php" + }, + { + "begin": "(?i)((&)?\\s*(\\.\\.\\.)?(\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(=)\\s*(?:(\\[)((?>[^\\[\\]]+|\\[\\g<6>\\])*)(\\]))?", + "beginCaptures": { + "1": { + "name": "variable.other.php" + }, + "2": { + "name": "storage.modifier.reference.php" + }, + "3": { + "name": "keyword.operator.variadic.php" + }, + "4": { + "name": "punctuation.definition.variable.php" + }, + "5": { + "name": "keyword.operator.assignment.php" + }, + "6": { + "name": "punctuation.section.array.begin.php" + }, + "7": { + "patterns": [ + { + "include": "#parameter-default-types" + } + ] + }, + "8": { + "name": "punctuation.section.array.end.php" + } + }, + "end": "(?=,|\\)|/[/*]|\\#)", + "name": "meta.function.parameter.default.php", + "patterns": [ + { + "include": "#parameter-default-types" + } + ] + } + ] + }, + "heredoc": { + "patterns": [ + { + "begin": "(?i)(?=<<<\\s*(\"?)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)(\\1)\\s*$)", + "end": "(?!\\G)", + "name": "string.unquoted.heredoc.php", + "patterns": [ + { + "include": "#heredoc_interior" + } + ] + }, + { + "begin": "(?=<<<\\s*'([a-zA-Z_]+\\w*)'\\s*$)", + "end": "(?!\\G)", + "name": "string.unquoted.nowdoc.php", + "patterns": [ + { + "include": "#nowdoc_interior" + } + ] + } + ] + }, + "heredoc_interior": { + "patterns": [ + { + "begin": "(<<<)\\s*(\"?)(HTML)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "text.html", + "end": "^(\\3)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.html", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "text.html.basic" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(XML)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "text.xml", + "end": "^(\\3)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.xml", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "text.xml" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(SQL)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.sql", + "end": "^(\\3)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.sql", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "source.sql" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(JAVASCRIPT|JS)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.js", + "end": "^(\\3)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.js", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "source.js" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(JSON)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.json", + "end": "^(\\3)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.json", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "source.json" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(CSS)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.css", + "end": "^(\\3)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.css", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "source.css" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(REGEXP?)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "string.regexp.heredoc.php", + "end": "^(\\3)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "patterns": [ + { + "include": "#interpolation" + }, + { + "match": "(\\\\){1,2}[.$^\\[\\]{}]", + "name": "constant.character.escape.regex.php" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repitition.php" + }, + "3": { + "name": "punctuation.definition.arbitrary-repitition.php" + } + }, + "match": "({)\\d+(,\\d+)?(})", + "name": "string.regexp.arbitrary-repitition.php" + }, + { + "begin": "\\[(?:\\^?\\])?", + "captures": { + "0": { + "name": "punctuation.definition.character-class.php" + } + }, + "end": "\\]", + "name": "string.regexp.character-class.php", + "patterns": [ + { + "match": "\\\\[\\\\'\\[\\]]", + "name": "constant.character.escape.php" + } + ] + }, + { + "match": "[$^+*]", + "name": "keyword.operator.regexp.php" + }, + { + "begin": "(?i)(?<=^|\\s)(#)\\s(?=[[a-z0-9_\\x{7f}-\\x{ff},. \\t?!-][^\\x{00}-\\x{7f}]]*$)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.php" + } + }, + "end": "$", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.php" + } + }, + "name": "comment.line.number-sign.php" + } + ] + }, + { + "begin": "(?i)(<<<)\\s*(\"?)([a-z_\\x{7f}-\\x{ff}]+[a-z0-9_\\x{7f}-\\x{ff}]*)(\\2)(\\s*)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "end": "^(\\3)\\b", + "endCaptures": { + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "patterns": [ + { + "include": "#interpolation" + } + ] + } + ] + }, + "instantiation": { + "begin": "(?i)(new)\\s+", + "beginCaptures": { + "1": { + "name": "keyword.other.new.php" + } + }, + "end": "(?i)(?=[^a-z0-9_\\x{7f}-\\x{ff}\\\\])", + "patterns": [ + { + "match": "(?i)(parent|static|self)(?![a-z0-9_\\x{7f}-\\x{ff}])", + "name": "storage.type.php" + }, + { + "include": "#class-name" + }, + { + "include": "#variable-name" + } + ] + }, + "interpolation": { + "patterns": [ + { + "match": "\\\\[0-7]{1,3}", + "name": "constant.character.escape.octal.php" + }, + { + "match": "\\\\x[0-9A-Fa-f]{1,2}", + "name": "constant.character.escape.hex.php" + }, + { + "match": "\\\\u{[0-9A-Fa-f]+}", + "name": "constant.character.escape.unicode.php" + }, + { + "match": "\\\\[nrtvef$\"\\\\]", + "name": "constant.character.escape.php" + }, + { + "begin": "{(?=\\$.*?})", + "beginCaptures": { + "0": { + "name": "punctuation.definition.variable.php" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.variable.php" + } + }, + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "include": "#variable-name" + } + ] + }, + "invoke-call": { + "captures": { + "1": { + "name": "punctuation.definition.variable.php" + }, + "2": { + "name": "variable.other.php" + } + }, + "match": "(?i)(\\$+)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)(?=\\s*\\()", + "name": "meta.function-call.invoke.php" + }, + "language": { + "patterns": [ + { + "include": "#comments" + }, + { + "begin": "(?i)^\\s*(interface)\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(extends)?\\s*", + "beginCaptures": { + "1": { + "name": "storage.type.interface.php" + }, + "2": { + "name": "entity.name.type.interface.php" + }, + "3": { + "name": "storage.modifier.extends.php" + } + }, + "end": "(?i)((?:[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*\\s*,\\s*)*)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?\\s*(?:(?={)|$)", + "endCaptures": { + "1": { + "patterns": [ + { + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "entity.other.inherited-class.php" + }, + { + "match": ",", + "name": "punctuation.separator.classes.php" + } + ] + }, + "2": { + "name": "entity.other.inherited-class.php" + } + }, + "name": "meta.interface.php", + "patterns": [ + { + "include": "#namespace" + } + ] + }, + { + "begin": "(?i)^\\s*(trait)\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)", + "beginCaptures": { + "1": { + "name": "storage.type.trait.php" + }, + "2": { + "name": "entity.name.type.trait.php" + } + }, + "end": "(?={)", + "name": "meta.trait.php", + "patterns": [ + { + "include": "#comments" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.other.namespace.php" + }, + "2": { + "name": "entity.name.type.namespace.php", + "patterns": [ + { + "match": "\\\\", + "name": "punctuation.separator.inheritance.php" + } + ] + } + }, + "match": "(?i)(?:^|(?<=<\\?php))\\s*(namespace)\\s+([a-z0-9_\\x{7f}-\\x{ff}\\\\]+)(?=\\s*;)", + "name": "meta.namespace.php" + }, + { + "begin": "(?i)(?:^|(?<=<\\?php))\\s*(namespace)\\s+", + "beginCaptures": { + "1": { + "name": "keyword.other.namespace.php" + } + }, + "end": "(?<=})|(?=\\?>)", + "name": "meta.namespace.php", + "patterns": [ + { + "include": "#comments" + }, + { + "captures": { + "0": { + "patterns": [ + { + "match": "\\\\", + "name": "punctuation.separator.inheritance.php" + } + ] + } + }, + "match": "(?i)[a-z0-9_\\x{7f}-\\x{ff}\\\\]+", + "name": "entity.name.type.namespace.php" + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.namespace.begin.bracket.curly.php" + } + }, + "end": "}|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.namespace.end.bracket.curly.php" + } + }, + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "match": "[^\\s]+", + "name": "invalid.illegal.identifier.php" + } + ] + }, + { + "match": "\\s+(?=use\\b)" + }, + { + "begin": "(?i)\\buse\\b", + "beginCaptures": { + "0": { + "name": "keyword.other.use.php" + } + }, + "end": "(?<=})|(?=;)", + "name": "meta.use.php", + "patterns": [ + { + "match": "\\b(const|function)\\b", + "name": "storage.type.${1:/downcase}.php" + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.use.begin.bracket.curly.php" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.use.end.bracket.curly.php" + } + }, + "patterns": [ + { + "include": "#scope-resolution" + }, + { + "captures": { + "1": { + "name": "keyword.other.use-as.php" + }, + "2": { + "name": "storage.modifier.php" + }, + "3": { + "name": "entity.other.alias.php" + } + }, + "match": "(?i)\\b(as)\\s+(final|abstract|public|private|protected|static)\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\b" + }, + { + "captures": { + "1": { + "name": "keyword.other.use-as.php" + }, + "2": { + "patterns": [ + { + "match": "^(?:final|abstract|public|private|protected|static)$", + "name": "storage.modifier.php" + }, + { + "match": ".+", + "name": "entity.other.alias.php" + } + ] + } + }, + "match": "(?i)\\b(as)\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\b" + }, + { + "captures": { + "1": { + "name": "keyword.other.use-insteadof.php" + }, + "2": { + "name": "support.class.php" + } + }, + "match": "(?i)\\b(insteadof)\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)" + }, + { + "match": ";", + "name": "punctuation.terminator.expression.php" + }, + { + "include": "#use-inner" + } + ] + }, + { + "include": "#use-inner" + } + ] + }, + { + "begin": "(?i)^\\s*(?:(abstract|final)\\s+)?(class)\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)", + "beginCaptures": { + "1": { + "name": "storage.modifier.${1:/downcase}.php" + }, + "2": { + "name": "storage.type.class.php" + }, + "3": { + "name": "entity.name.type.class.php" + } + }, + "end": "}|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.class.end.bracket.curly.php" + } + }, + "name": "meta.class.php", + "patterns": [ + { + "include": "#comments" + }, + { + "begin": "(?i)(extends)\\s+", + "beginCaptures": { + "1": { + "name": "storage.modifier.extends.php" + } + }, + "contentName": "meta.other.inherited-class.php", + "end": "(?i)(?=[^a-z0-9_\\x{7f}-\\x{ff}\\\\])", + "patterns": [ + { + "begin": "(?i)(?=\\\\?[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*\\\\)", + "end": "(?i)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?(?=[^a-z0-9_\\x{7f}-\\x{ff}\\\\])", + "endCaptures": { + "1": { + "name": "entity.other.inherited-class.php" + } + }, + "patterns": [ + { + "include": "#namespace" + } + ] + }, + { + "include": "#class-builtin" + }, + { + "include": "#namespace" + }, + { + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "entity.other.inherited-class.php" + } + ] + }, + { + "begin": "(?i)(implements)\\s+", + "beginCaptures": { + "1": { + "name": "storage.modifier.implements.php" + } + }, + "end": "(?i)(?=[;{])", + "patterns": [ + { + "include": "#comments" + }, + { + "begin": "(?i)(?=[a-z0-9_\\x{7f}-\\x{ff}\\\\]+)", + "contentName": "meta.other.inherited-class.php", + "end": "(?i)(?:\\s*(?:,|(?=[^a-z0-9_\\x{7f}-\\x{ff}\\\\\\s]))\\s*)", + "patterns": [ + { + "begin": "(?i)(?=\\\\?[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*\\\\)", + "end": "(?i)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?(?=[^a-z0-9_\\x{7f}-\\x{ff}\\\\])", + "endCaptures": { + "1": { + "name": "entity.other.inherited-class.php" + } + }, + "patterns": [ + { + "include": "#namespace" + } + ] + }, + { + "include": "#class-builtin" + }, + { + "include": "#namespace" + }, + { + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "entity.other.inherited-class.php" + } + ] + } + ] + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.class.begin.bracket.curly.php" + } + }, + "contentName": "meta.class.body.php", + "end": "(?=}|\\?>)", + "patterns": [ + { + "include": "#language" + } + ] + } + ] + }, + { + "include": "#switch_statement" + }, + { + "captures": { + "1": { + "name": "keyword.control.${1:/downcase}.php" + } + }, + "match": "\\s*\\b(break|case|continue|declare|default|die|do|else(if)?|end(declare|for(each)?|if|switch|while)|exit|for(each)?|if|return|switch|use|while|yield)\\b" + }, + { + "begin": "(?i)\\b((?:require|include)(?:_once)?)\\s+", + "beginCaptures": { + "1": { + "name": "keyword.control.import.include.php" + } + }, + "end": "(?=\\s|;|$|\\?>)", + "name": "meta.include.php", + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "begin": "\\b(catch)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.control.exception.catch.php" + }, + "2": { + "name": "punctuation.definition.parameters.begin.bracket.round.php" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.php" + } + }, + "name": "meta.catch.php", + "patterns": [ + { + "include": "#namespace" + }, + { + "captures": { + "1": { + "name": "support.class.exception.php" + }, + "2": { + "patterns": [ + { + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "support.class.exception.php" + }, + { + "match": "\\|", + "name": "punctuation.separator.delimiter.php" + } + ] + }, + "3": { + "name": "variable.other.php" + }, + "4": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(?i)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)((?:\\s*\\|\\s*[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)*)\\s*((\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)" + } + ] + }, + { + "match": "\\b(catch|try|throw|exception|finally)\\b", + "name": "keyword.control.exception.php" + }, + { + "begin": "(?i)\\b(function)\\s*(?=\\()", + "beginCaptures": { + "1": { + "name": "storage.type.function.php" + } + }, + "end": "(?={)", + "name": "meta.function.closure.php", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.parameters.begin.bracket.round.php" + } + }, + "contentName": "meta.function.parameters.php", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.php" + } + }, + "patterns": [ + { + "include": "#function-parameters" + } + ] + }, + { + "begin": "(?i)(use)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.other.function.use.php" + }, + "2": { + "name": "punctuation.definition.parameters.begin.bracket.round.php" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.php" + } + }, + "patterns": [ + { + "captures": { + "1": { + "name": "variable.other.php" + }, + "2": { + "name": "storage.modifier.reference.php" + }, + "3": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(?i)((&)?\\s*(\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(?=,|\\))", + "name": "meta.function.closure.use.php" + } + ] + } + ] + }, + { + "begin": "((?:(?:final|abstract|public|private|protected|static)\\s+)*)(function)\\s+(?i:(__(?:call|construct|debugInfo|destruct|get|set|isset|unset|tostring|clone|set_state|sleep|wakeup|autoload|invoke|callStatic))|([a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*))\\s*(\\()", + "beginCaptures": { + "1": { + "patterns": [ + { + "match": "final|abstract|public|private|protected|static", + "name": "storage.modifier.php" + } + ] + }, + "2": { + "name": "storage.type.function.php" + }, + "3": { + "name": "support.function.magic.php" + }, + "4": { + "name": "entity.name.function.php" + }, + "5": { + "name": "punctuation.definition.parameters.begin.bracket.round.php" + } + }, + "contentName": "meta.function.parameters.php", + "end": "(\\))(?:\\s*(:)\\s*([a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*))?", + "endCaptures": { + "1": { + "name": "punctuation.definition.parameters.end.bracket.round.php" + }, + "2": { + "name": "keyword.operator.return-value.php" + }, + "3": { + "name": "storage.type.php" + } + }, + "name": "meta.function.php", + "patterns": [ + { + "include": "#function-parameters" + } + ] + }, + { + "include": "#invoke-call" + }, + { + "include": "#scope-resolution" + }, + { + "include": "#variables" + }, + { + "include": "#strings" + }, + { + "captures": { + "1": { + "name": "support.function.construct.php" + }, + "2": { + "name": "punctuation.definition.array.begin.bracket.round.php" + }, + "3": { + "name": "punctuation.definition.array.end.bracket.round.php" + } + }, + "match": "(array)(\\()(\\))", + "name": "meta.array.empty.php" + }, + { + "begin": "(array)(\\()", + "beginCaptures": { + "1": { + "name": "support.function.construct.php" + }, + "2": { + "name": "punctuation.definition.array.begin.bracket.round.php" + } + }, + "end": "\\)|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.array.end.bracket.round.php" + } + }, + "name": "meta.array.php", + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.storage-type.begin.bracket.round.php" + }, + "2": { + "name": "storage.type.php" + }, + "3": { + "name": "punctuation.definition.storage-type.end.bracket.round.php" + } + }, + "match": "(?i)(\\()\\s*(array|real|double|float|int(?:eger)?|bool(?:ean)?|string|object|binary|unset)\\s*(\\))" + }, + { + "match": "(?i)\\b(array|real|double|float|int(eger)?|bool(ean)?|string|class|var|function|interface|trait|parent|self|object)\\b", + "name": "storage.type.php" + }, + { + "match": "(?i)\\b(global|abstract|const|extends|implements|final|private|protected|public|static)\\b", + "name": "storage.modifier.php" + }, + { + "include": "#object" + }, + { + "match": ";", + "name": "punctuation.terminator.expression.php" + }, + { + "match": ":", + "name": "punctuation.terminator.statement.php" + }, + { + "include": "#heredoc" + }, + { + "include": "#numbers" + }, + { + "match": "(?i)\\bclone\\b", + "name": "keyword.other.clone.php" + }, + { + "match": "\\.=?", + "name": "keyword.operator.string.php" + }, + { + "match": "=>", + "name": "keyword.operator.key.php" + }, + { + "captures": { + "1": { + "name": "keyword.operator.assignment.php" + }, + "2": { + "name": "storage.modifier.reference.php" + }, + "3": { + "name": "storage.modifier.reference.php" + } + }, + "match": "(?i)(=)(&)|(&)(?=[$a-z_])" + }, + { + "match": "@", + "name": "keyword.operator.error-control.php" + }, + { + "match": "===|==|!==|!=|<>", + "name": "keyword.operator.comparison.php" + }, + { + "match": "=|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=", + "name": "keyword.operator.assignment.php" + }, + { + "match": "<=>|<=|>=|<|>", + "name": "keyword.operator.comparison.php" + }, + { + "match": "--|\\+\\+", + "name": "keyword.operator.increment-decrement.php" + }, + { + "match": "-|\\+|\\*|/|%", + "name": "keyword.operator.arithmetic.php" + }, + { + "match": "(?i)(!|&&|\\|\\|)|\\b(and|or|xor|as)\\b", + "name": "keyword.operator.logical.php" + }, + { + "include": "#function-call" + }, + { + "match": "<<|>>|~|\\^|&|\\|", + "name": "keyword.operator.bitwise.php" + }, + { + "begin": "(?i)\\b(instanceof)\\s+(?=[\\\\$a-z_])", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.php" + } + }, + "end": "(?=[^\\\\$a-z0-9_\\x{7f}-\\x{ff}])", + "patterns": [ + { + "include": "#class-name" + }, + { + "include": "#variable-name" + } + ] + }, + { + "include": "#instantiation" + }, + { + "captures": { + "1": { + "name": "keyword.control.goto.php" + }, + "2": { + "name": "support.other.php" + } + }, + "match": "(?i)(goto)\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)" + }, + { + "captures": { + "1": { + "name": "entity.name.goto-label.php" + } + }, + "match": "(?i)^\\s*([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*:(?!:)" + }, + { + "include": "#string-backtick" + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.begin.bracket.curly.php" + } + }, + "end": "}|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.curly.php" + } + }, + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.php" + } + }, + "end": "\\]|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.php" + } + }, + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.begin.bracket.round.php" + } + }, + "end": "\\)|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.php" + } + }, + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "include": "#constants" + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.php" + } + ] + }, + "namespace": { + "begin": "(?i)(?:(namespace)|[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?(\\\\)(?=.*?[^a-z0-9_\\x{7f}-\\x{ff}\\\\])", + "beginCaptures": { + "1": { + "name": "variable.language.namespace.php" + }, + "2": { + "name": "punctuation.separator.inheritance.php" + } + }, + "end": "(?i)(?=[a-z0-9_\\x{7f}-\\x{ff}]*[^a-z0-9_\\x{7f}-\\x{ff}\\\\])", + "name": "support.other.namespace.php", + "patterns": [ + { + "match": "\\\\", + "name": "punctuation.separator.inheritance.php" + } + ] + }, + "nowdoc_interior": { + "patterns": [ + { + "begin": "(<<<)\\s*'(HTML)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "text.html", + "end": "^(\\2)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.html", + "patterns": [ + { + "include": "text.html.basic" + } + ] + }, + { + "begin": "(<<<)\\s*'(XML)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "text.xml", + "end": "^(\\2)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.xml", + "patterns": [ + { + "include": "text.xml" + } + ] + }, + { + "begin": "(<<<)\\s*'(SQL)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.sql", + "end": "^(\\2)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.sql", + "patterns": [ + { + "include": "source.sql" + } + ] + }, + { + "begin": "(<<<)\\s*'(JAVASCRIPT|JS)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.js", + "end": "^(\\2)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.js", + "patterns": [ + { + "include": "source.js" + } + ] + }, + { + "begin": "(<<<)\\s*'(JSON)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.json", + "end": "^(\\2)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.json", + "patterns": [ + { + "include": "source.json" + } + ] + }, + { + "begin": "(<<<)\\s*'(CSS)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.css", + "end": "^(\\2)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.css", + "patterns": [ + { + "include": "source.css" + } + ] + }, + { + "begin": "(<<<)\\s*'(REGEXP?)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "string.regexp.nowdoc.php", + "end": "^(\\2)\\b", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "patterns": [ + { + "match": "(\\\\){1,2}[.$^\\[\\]{}]", + "name": "constant.character.escape.regex.php" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repitition.php" + }, + "3": { + "name": "punctuation.definition.arbitrary-repitition.php" + } + }, + "match": "({)\\d+(,\\d+)?(})", + "name": "string.regexp.arbitrary-repitition.php" + }, + { + "begin": "\\[(?:\\^?\\])?", + "captures": { + "0": { + "name": "punctuation.definition.character-class.php" + } + }, + "end": "\\]", + "name": "string.regexp.character-class.php", + "patterns": [ + { + "match": "\\\\[\\\\'\\[\\]]", + "name": "constant.character.escape.php" + } + ] + }, + { + "match": "[$^+*]", + "name": "keyword.operator.regexp.php" + }, + { + "begin": "(?i)(?<=^|\\s)(#)\\s(?=[[a-z0-9_\\x{7f}-\\x{ff},. \\t?!-][^\\x{00}-\\x{7f}]]*$)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.php" + } + }, + "end": "$", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.php" + } + }, + "name": "comment.line.number-sign.php" + } + ] + }, + { + "begin": "(?i)(<<<)\\s*'([a-z_\\x{7f}-\\x{ff}]+[a-z0-9_\\x{7f}-\\x{ff}]*)'(\\s*)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "end": "^(\\2)\\b", + "endCaptures": { + "1": { + "name": "keyword.operator.nowdoc.php" + } + } + } + ] + }, + "numbers": { + "patterns": [ + { + "match": "0[xX][0-9a-fA-F]+", + "name": "constant.numeric.hex.php" + }, + { + "match": "0[bB][01]+", + "name": "constant.numeric.binary.php" + }, + { + "match": "0[0-7]+", + "name": "constant.numeric.octal.php" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.decimal.period.php" + }, + "2": { + "name": "punctuation.separator.decimal.period.php" + } + }, + "match": "(?:\\d*(\\.)\\d+(?:[eE][+-]?\\d+)?|\\d+(\\.)\\d*(?:[eE][+-]?\\d+)?|\\d+[eE][+-]?\\d+)", + "name": "constant.numeric.decimal.php" + }, + { + "match": "0|[1-9]\\d*", + "name": "constant.numeric.decimal.php" + } + ] + }, + "object": { + "patterns": [ + { + "begin": "(->)(\\$?{)", + "beginCaptures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "punctuation.definition.variable.php" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.variable.php" + } + }, + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "begin": "(?i)(->)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "entity.name.function.php" + }, + "3": { + "name": "punctuation.definition.arguments.begin.bracket.round.php" + } + }, + "end": "\\)|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.php" + } + }, + "name": "meta.method-call.php", + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "variable.other.property.php" + }, + "3": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(?i)(->)((\\$+)?[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?" + } + ] + }, + "parameter-default-types": { + "patterns": [ + { + "include": "#strings" + }, + { + "include": "#numbers" + }, + { + "include": "#string-backtick" + }, + { + "include": "#variables" + }, + { + "match": "=>", + "name": "keyword.operator.key.php" + }, + { + "match": "=", + "name": "keyword.operator.assignment.php" + }, + { + "match": "&(?=\\s*\\$)", + "name": "storage.modifier.reference.php" + }, + { + "begin": "(array)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "support.function.construct.php" + }, + "2": { + "name": "punctuation.definition.array.begin.bracket.round.php" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.array.end.bracket.round.php" + } + }, + "name": "meta.array.php", + "patterns": [ + { + "include": "#parameter-default-types" + } + ] + }, + { + "include": "#instantiation" + }, + { + "begin": "(?i)(?=[a-z0-9_\\x{7f}-\\x{ff}\\\\]+(::)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?)", + "end": "(?i)(::)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?", + "endCaptures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "constant.other.class.php" + } + }, + "patterns": [ + { + "include": "#class-name" + } + ] + }, + { + "include": "#constants" + } + ] + }, + "php_doc": { + "patterns": [ + { + "match": "^(?!\\s*\\*).*?(?:(?=\\*\\/)|$\\n?)", + "name": "invalid.illegal.missing-asterisk.phpdoc.php" + }, + { + "captures": { + "1": { + "name": "keyword.other.phpdoc.php" + }, + "3": { + "name": "storage.modifier.php" + }, + "4": { + "name": "invalid.illegal.wrong-access-type.phpdoc.php" + } + }, + "match": "^\\s*\\*\\s*(@access)\\s+((public|private|protected)|(.+))\\s*$" + }, + { + "captures": { + "1": { + "name": "keyword.other.phpdoc.php" + }, + "2": { + "name": "markup.underline.link.php" + } + }, + "match": "(@xlink)\\s+(.+)\\s*$" + }, + { + "begin": "(@(?:global|param|property(-(read|write))?|return|throws|var))\\s+(?=[A-Za-z_\\x{7f}-\\x{ff}\\\\]|\\()", + "beginCaptures": { + "1": { + "name": "keyword.other.phpdoc.php" + } + }, + "contentName": "meta.other.type.phpdoc.php", + "end": "(?=\\s|\\*/)", + "patterns": [ + { + "include": "#php_doc_types_array_multiple" + }, + { + "include": "#php_doc_types_array_single" + }, + { + "include": "#php_doc_types" + } + ] + }, + { + "match": "@(api|abstract|author|category|copyright|example|global|inherit[Dd]oc|internal|license|link|method|property(-(read|write))?|package|param|return|see|since|source|static|subpackage|throws|todo|var|version|uses|deprecated|final|ignore)\\b", + "name": "keyword.other.phpdoc.php" + }, + { + "captures": { + "1": { + "name": "keyword.other.phpdoc.php" + } + }, + "match": "{(@(link|inherit[Dd]oc)).+?}", + "name": "meta.tag.inline.phpdoc.php" + } + ] + }, + "php_doc_types": { + "captures": { + "0": { + "patterns": [ + { + "match": "\\b(string|integer|int|boolean|bool|float|double|object|mixed|array|resource|void|null|callback|false|true|self)\\b", + "name": "keyword.other.type.php" + }, + { + "include": "#class-name" + }, + { + "match": "\\|", + "name": "punctuation.separator.delimiter.php" + } + ] + } + }, + "match": "(?i)[a-z_\\x{7f}-\\x{ff}\\\\][a-z0-9_\\x{7f}-\\x{ff}\\\\]*(\\|[a-z_\\x{7f}-\\x{ff}\\\\][a-z0-9_\\x{7f}-\\x{ff}\\\\]*)*" + }, + "php_doc_types_array_multiple": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.type.begin.bracket.round.phpdoc.php" + } + }, + "end": "(\\))(\\[\\])|(?=\\*/)", + "endCaptures": { + "1": { + "name": "punctuation.definition.type.end.bracket.round.phpdoc.php" + }, + "2": { + "name": "keyword.other.array.phpdoc.php" + } + }, + "patterns": [ + { + "include": "#php_doc_types_array_multiple" + }, + { + "include": "#php_doc_types_array_single" + }, + { + "include": "#php_doc_types" + }, + { + "match": "\\|", + "name": "punctuation.separator.delimiter.php" + } + ] + }, + "php_doc_types_array_single": { + "captures": { + "1": { + "patterns": [ + { + "include": "#php_doc_types" + } + ] + }, + "2": { + "name": "keyword.other.array.phpdoc.php" + } + }, + "match": "(?i)([a-z_\\x{7f}-\\x{ff}\\\\][a-z0-9_\\x{7f}-\\x{ff}\\\\]*)(\\[\\])" + }, + "regex-double-quoted": { + "begin": "\"/(?=(\\\\.|[^\"/])++/[imsxeADSUXu]*\")", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.php" + } + }, + "end": "(/)([imsxeADSUXu]*)(\")", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.php" + } + }, + "name": "string.regexp.double-quoted.php", + "patterns": [ + { + "match": "(\\\\){1,2}[.$^\\[\\]{}]", + "name": "constant.character.escape.regex.php" + }, + { + "include": "#interpolation" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repetition.php" + }, + "3": { + "name": "punctuation.definition.arbitrary-repetition.php" + } + }, + "match": "({)\\d+(,\\d+)?(})", + "name": "string.regexp.arbitrary-repetition.php" + }, + { + "begin": "\\[(?:\\^?\\])?", + "captures": { + "0": { + "name": "punctuation.definition.character-class.php" + } + }, + "end": "\\]", + "name": "string.regexp.character-class.php", + "patterns": [ + { + "include": "#interpolation" + } + ] + }, + { + "match": "[$^+*]", + "name": "keyword.operator.regexp.php" + } + ] + }, + "regex-single-quoted": { + "begin": "'/(?=(\\\\(?:\\\\(?:\\\\[\\\\']?|[^'])|.)|[^'/])++/[imsxeADSUXu]*')", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.php" + } + }, + "end": "(/)([imsxeADSUXu]*)(')", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.php" + } + }, + "name": "string.regexp.single-quoted.php", + "patterns": [ + { + "include": "#single_quote_regex_escape" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repetition.php" + }, + "3": { + "name": "punctuation.definition.arbitrary-repetition.php" + } + }, + "match": "({)\\d+(,\\d+)?(})", + "name": "string.regexp.arbitrary-repetition.php" + }, + { + "begin": "\\[(?:\\^?\\])?", + "captures": { + "0": { + "name": "punctuation.definition.character-class.php" + } + }, + "end": "\\]", + "name": "string.regexp.character-class.php" + }, + { + "match": "[$^+*]", + "name": "keyword.operator.regexp.php" + } + ] + }, + "scope-resolution": { + "patterns": [ + { + "captures": { + "1": { + "patterns": [ + { + "match": "\\b(self|static|parent)\\b", + "name": "storage.type.php" + }, + { + "match": "\\w+", + "name": "entity.name.class.php" + }, + { + "include": "#class-name" + }, + { + "include": "#variable-name" + } + ] + } + }, + "match": "(?i)\\b([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)(?=\\s*::)" + }, + { + "begin": "(?i)(::)\\s*([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "entity.name.function.php" + }, + "3": { + "name": "punctuation.definition.arguments.begin.bracket.round.php" + } + }, + "end": "\\)|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.php" + } + }, + "name": "meta.method-call.static.php", + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "keyword.other.class.php" + } + }, + "match": "(?i)(::)\\s*(class)\\b" + }, + { + "captures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "variable.other.class.php" + }, + "3": { + "name": "punctuation.definition.variable.php" + }, + "4": { + "name": "constant.other.class.php" + } + }, + "match": "(?i)(::)\\s*(?:((\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)|([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*))?" + } + ] + }, + "single_quote_regex_escape": { + "match": "\\\\(?:\\\\(?:\\\\[\\\\']?|[^'])|.)", + "name": "constant.character.escape.php" + }, + "sql-string-double-quoted": { + "begin": "\"\\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER|AND)\\b)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.php" + } + }, + "contentName": "source.sql.embedded.php", + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.php" + } + }, + "name": "string.quoted.double.sql.php", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.comment.sql" + } + }, + "match": "(#)(\\\\\"|[^\"])*(?=\"|$)", + "name": "comment.line.number-sign.sql" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.comment.sql" + } + }, + "match": "(--)(\\\\\"|[^\"])*(?=\"|$)", + "name": "comment.line.double-dash.sql" + }, + { + "match": "\\\\[\\\\\"`']", + "name": "constant.character.escape.php" + }, + { + "match": "'(?=((\\\\')|[^'\"])*(\"|$))", + "name": "string.quoted.single.unclosed.sql" + }, + { + "match": "`(?=((\\\\`)|[^`\"])*(\"|$))", + "name": "string.quoted.other.backtick.unclosed.sql" + }, + { + "begin": "'", + "end": "'", + "name": "string.quoted.single.sql", + "patterns": [ + { + "include": "#interpolation" + } + ] + }, + { + "begin": "`", + "end": "`", + "name": "string.quoted.other.backtick.sql", + "patterns": [ + { + "include": "#interpolation" + } + ] + }, + { + "include": "#interpolation" + }, + { + "include": "source.sql" + } + ] + }, + "sql-string-single-quoted": { + "begin": "'\\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER|AND)\\b)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.php" + } + }, + "contentName": "source.sql.embedded.php", + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.php" + } + }, + "name": "string.quoted.single.sql.php", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.comment.sql" + } + }, + "match": "(#)(\\\\'|[^'])*(?='|$)", + "name": "comment.line.number-sign.sql" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.comment.sql" + } + }, + "match": "(--)(\\\\'|[^'])*(?='|$)", + "name": "comment.line.double-dash.sql" + }, + { + "match": "\\\\[\\\\'`\"]", + "name": "constant.character.escape.php" + }, + { + "match": "`(?=((\\\\`)|[^`'])*('|$))", + "name": "string.quoted.other.backtick.unclosed.sql" + }, + { + "match": "\"(?=((\\\\\")|[^\"'])*('|$))", + "name": "string.quoted.double.unclosed.sql" + }, + { + "include": "source.sql" + } + ] + }, + "string-backtick": { + "begin": "`", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.php" + } + }, + "end": "`", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.php" + } + }, + "name": "string.interpolated.php", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.php" + }, + { + "include": "#interpolation" + } + ] + }, + "string-double-quoted": { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.php" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.php" + } + }, + "name": "string.quoted.double.php", + "patterns": [ + { + "include": "#interpolation" + } + ] + }, + "string-single-quoted": { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.php" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.php" + } + }, + "name": "string.quoted.single.php", + "patterns": [ + { + "match": "\\\\[\\\\']", + "name": "constant.character.escape.php" + } + ] + }, + "strings": { + "patterns": [ + { + "include": "#regex-double-quoted" + }, + { + "include": "#sql-string-double-quoted" + }, + { + "include": "#string-double-quoted" + }, + { + "include": "#regex-single-quoted" + }, + { + "include": "#sql-string-single-quoted" + }, + { + "include": "#string-single-quoted" + } + ] + }, + "support": { + "patterns": [ + { + "match": "(?i)\\bapc_(store|sma_info|compile_file|clear_cache|cas|cache_info|inc|dec|define_constants|delete(_file)?|exists|fetch|load_constants|add|bin_(dump|load)(file)?)\\b", + "name": "support.function.apc.php" + }, + { + "match": "(?i)\\b(shuffle|sizeof|sort|next|nat(case)?sort|count|compact|current|in_array|usort|uksort|uasort|pos|prev|end|each|extract|ksort|key(_exists)?|krsort|list|asort|arsort|rsort|reset|range|array(_(shift|sum|splice|search|slice|chunk|change_key_case|count_values|column|combine|(diff|intersect)(_(u)?(key|assoc))?|u(diff|intersect)(_(u)?assoc)?|unshift|unique|pop|push|pad|product|values|keys|key_exists|filter|fill(_keys)?|flip|walk(_recursive)?|reduce|replace(_recursive)?|reverse|rand|multisort|merge(_recursive)?|map)?))\\b", + "name": "support.function.array.php" + }, + { + "match": "(?i)\\b(show_source|sys_getloadavg|sleep|highlight_(file|string)|constant|connection_(aborted|status)|time_(nanosleep|sleep_until)|ignore_user_abort|die|define(d)?|usleep|uniqid|unpack|__halt_compiler|php_(check_syntax|strip_whitespace)|pack|eval|exit|get_browser)\\b", + "name": "support.function.basic_functions.php" + }, + { + "match": "(?i)\\bbc(scale|sub|sqrt|comp|div|pow(mod)?|add|mod|mul)\\b", + "name": "support.function.bcmath.php" + }, + { + "match": "(?i)\\bblenc_encrypt\\b", + "name": "support.function.blenc.php" + }, + { + "match": "(?i)\\bbz(compress|close|open|decompress|errstr|errno|error|flush|write|read)\\b", + "name": "support.function.bz2.php" + }, + { + "match": "(?i)\\b((French|Gregorian|Jewish|Julian)ToJD|cal_(to_jd|info|days_in_month|from_jd)|unixtojd|jdto(unix|jewish)|easter_(date|days)|JD(MonthName|To(Gregorian|Julian|French)|DayOfWeek))\\b", + "name": "support.function.calendar.php" + }, + { + "match": "(?i)\\b(class_alias|all_user_method(_array)?|is_(a|subclass_of)|__autoload|(class|interface|method|property|trait)_exists|get_(class(_(vars|methods))?|(called|parent)_class|object_vars|declared_(classes|interfaces|traits)))\\b", + "name": "support.function.classobj.php" + }, + { + "match": "(?i)\\b(com_(create_guid|print_typeinfo|event_sink|load_typelib|get_active_object|message_pump)|variant_(sub|set(_type)?|not|neg|cast|cat|cmp|int|idiv|imp|or|div|date_(from|to)_timestamp|pow|eqv|fix|and|add|abs|round|get_type|xor|mod|mul))\\b", + "name": "support.function.com.php" + }, + { + "match": "(?i)\\b(isset|unset|eval|empty|list)\\b", + "name": "support.function.construct.php" + }, + { + "match": "(?i)\\b(print|echo)\\b", + "name": "support.function.construct.output.php" + }, + { + "match": "(?i)\\bctype_(space|cntrl|digit|upper|punct|print|lower|alnum|alpha|graph|xdigit)\\b", + "name": "support.function.ctype.php" + }, + { + "match": "(?i)\\bcurl_(share_(close|init|setopt)|strerror|setopt(_array)?|copy_handle|close|init|unescape|pause|escape|errno|error|exec|version|file_create|reset|getinfo|multi_(strerror|setopt|select|close|init|info_read|(add|remove)_handle|getcontent|exec))\\b", + "name": "support.function.curl.php" + }, + { + "match": "(?i)\\b(strtotime|str[fp]time|checkdate|time|timezone_name_(from_abbr|get)|idate|timezone_((location|offset|transitions|version)_get|(abbreviations|identifiers)_list|open)|date(_(sun(rise|set)|sun_info|sub|create(_(immutable_)?from_format)?|timestamp_(get|set)|timezone_(get|set)|time_set|isodate_set|interval_(create_from_date_string|format)|offset_get|diff|default_timezone_(get|set)|date_set|parse(_from_format)?|format|add|get_last_errors|modify))?|localtime|get(date|timeofday)|gm(strftime|date|mktime)|microtime|mktime)\\b", + "name": "support.function.datetime.php" + }, + { + "match": "(?i)\\bdba_(sync|handlers|nextkey|close|insert|optimize|open|delete|popen|exists|key_split|firstkey|fetch|list|replace)\\b", + "name": "support.function.dba.php" + }, + { + "match": "(?i)\\bdbx_(sort|connect|compare|close|escape_string|error|query|fetch_row)\\b", + "name": "support.function.dbx.php" + }, + { + "match": "(?i)\\b(scandir|chdir|chroot|closedir|opendir|dir|rewinddir|readdir|getcwd)\\b", + "name": "support.function.dir.php" + }, + { + "match": "(?i)\\beio_(sync(fs)?|sync_file_range|symlink|stat(vfs)?|sendfile|set_min_parallel|set_max_(idle|poll_(reqs|time)|parallel)|seek|n(threads|op|pending|reqs|ready)|chown|chmod|custom|close|cancel|truncate|init|open|dup2|unlink|utime|poll|event_loop|f(sync|stat(vfs)?|chown|chmod|truncate|datasync|utime|allocate)|write|lstat|link|rename|realpath|read(ahead|dir|link)?|rmdir|get_(event_stream|last_error)|grp(_(add|cancel|limit))?|mknod|mkdir|busy)\\b", + "name": "support.function.eio.php" + }, + { + "match": "(?i)\\benchant_(dict_(store_replacement|suggest|check|is_in_session|describe|quick_check|add_to_(personal|session)|get_error)|broker_(set_ordering|init|dict_exists|describe|free(_dict)?|list_dicts|request_(pwl_)?dict|get_error))\\b", + "name": "support.function.enchant.php" + }, + { + "match": "(?i)\\bsplit(i)?|sql_regcase|ereg(i)?(_replace)?\\b", + "name": "support.function.ereg.php" + }, + { + "match": "(?i)\\b((restore|set)_(error_handler|exception_handler)|trigger_error|debug_(print_)?backtrace|user_error|error_(log|reporting|get_last))\\b", + "name": "support.function.errorfunc.php" + }, + { + "match": "(?i)\\bshell_exec|system|passthru|proc_(nice|close|terminate|open|get_status)|escapeshell(arg|cmd)|exec\\b", + "name": "support.function.exec.php" + }, + { + "match": "(?i)\\b(exif_(thumbnail|tagname|imagetype|read_data)|read_exif_data)\\b", + "name": "support.function.exif.php" + }, + { + "match": "(?i)\\bfann_((duplicate|length|merge|shuffle|subset)_train_data|scale_(train(_data)?|(input|output)(_train_data)?)|set_(scaling_params|sarprop_(step_error_(shift|threshold_factor)|temperature|weight_decay_shift)|cascade_(num_candidate_groups|candidate_(change_fraction|limit|stagnation_epochs)|output_(change_fraction|stagnation_epochs)|weight_multiplier|activation_(functions|steepnesses)|(max|min)_(cand|out)_epochs)|callback|training_algorithm|train_(error|stop)_function|(input|output)_scaling_params|error_log|quickprop_(decay|mu)|weight(_array)?|learning_(momentum|rate)|bit_fail_limit|activation_(function|steepness)(_(hidden|layer|output))?|rprop_((decrease|increase)_factor|delta_(max|min|zero)))|save(_train)?|num_(input|output)_train_data|copy|clear_scaling_params|cascadetrain_on_(file|data)|create_((sparse|shortcut|standard)(_array)?|train(_from_callback)?|from_file)|test(_data)?|train(_(on_(file|data)|epoch))?|init_weights|descale_(input|output|train)|destroy(_train)?|print_error|run|reset_(MSE|err(no|str))|read_train_from_file|randomize_weights|get_(sarprop_(step_error_(shift|threshold_factor)|temperature|weight_decay_shift)|num_(input|output|layers)|network_type|MSE|connection_(array|rate)|bias_array|bit_fail(_limit)?|cascade_(num_(candidates|candidate_groups)|(candidate|output)_(change_fraction|limit|stagnation_epochs)|weight_multiplier|activation_(functions|steepnesses)(_count)?|(max|min)_(cand|out)_epochs)|total_(connections|neurons)|training_algorithm|train_(error|stop)_function|err(no|str)|quickprop_(decay|mu)|learning_(momentum|rate)|layer_array|activation_(function|steepness)|rprop_((decrease|increase)_factor|delta_(max|min|zero))))\\b", + "name": "support.function.fann.php" + }, + { + "match": "(?i)\\b(symlink|stat|set_file_buffer|chown|chgrp|chmod|copy|clearstatcache|touch|tempnam|tmpfile|is_(dir|(uploaded_)?file|executable|link|readable|writ(e)?able)|disk_(free|total)_space|diskfreespace|dirname|delete|unlink|umask|pclose|popen|pathinfo|parse_ini_(file|string)|fscanf|fstat|fseek|fnmatch|fclose|ftell|ftruncate|file(size|[acm]time|type|inode|owner|perms|group)?|file_(exists|(get|put)_contents)|f(open|puts|putcsv|passthru|eof|flush|write|lock|read|gets(s)?|getc(sv)?)|lstat|lchown|lchgrp|link(info)?|rename|rewind|read(file|link)|realpath(_cache_(get|size))?|rmdir|glob|move_uploaded_file|mkdir|basename)\\b", + "name": "support.function.file.php" + }, + { + "match": "(?i)\\b(finfo_(set_flags|close|open|file|buffer)|mime_content_type)\\b", + "name": "support.function.fileinfo.php" + }, + { + "match": "(?i)\\bfilter_(has_var|input(_array)?|id|var(_array)?|list)\\b", + "name": "support.function.filter.php" + }, + { + "match": "(?i)\\bfastcgi_finish_request\\b", + "name": "support.function.fpm.php" + }, + { + "match": "(?i)\\b(call_user_(func|method)(_array)?|create_function|unregister_tick_function|forward_static_call(_array)?|function_exists|func_(num_args|get_arg(s)?)|register_(shutdown|tick)_function|get_defined_functions)\\b", + "name": "support.function.funchand.php" + }, + { + "match": "(?i)\\b((n)?gettext|textdomain|d((n)?gettext|c(n)?gettext)|bind(textdomain|_textdomain_codeset))\\b", + "name": "support.function.gettext.php" + }, + { + "match": "(?i)\\bgmp_(scan[01]|strval|sign|sub|setbit|sqrt(rem)?|hamdist|neg|nextprime|com|clrbit|cmp|testbit|intval|init|invert|import|or|div(exact)?|div_(q|qr|r)|jacobi|popcount|pow(m)?|perfect_square|prob_prime|export|fact|legendre|and|add|abs|root(rem)?|random(_(bits|range))?|gcd(ext)?|xor|mod|mul)\\b", + "name": "support.function.gmp.php" + }, + { + "match": "(?i)\\bhash(_(hmac(_file)?|copy|init|update(_(file|stream))?|pbkdf2|equals|file|final|algos))?\\b", + "name": "support.function.hash.php" + }, + { + "match": "(?i)\\b(http_(support|send_(status|stream|content_(disposition|type)|data|file|last_modified)|head|negotiate_(charset|content_type|language)|chunked_decode|cache_(etag|last_modified)|throttle|inflate|deflate|date|post_(data|fields)|put_(data|file|stream)|persistent_handles_(count|clean|ident)|parse_(cookie|headers|message|params)|redirect|request(_(method_(exists|name|(un)?register)|body_encode))?|get(_request_(headers|body(_stream)?))?|match_(etag|modified|request_header)|build_(cookie|str|url))|ob_(etag|deflate|inflate)handler)\\b", + "name": "support.function.http.php" + }, + { + "match": "(?i)\\b(iconv(_(str(pos|len|rpos)|substr|(get|set)_encoding|mime_(decode(_headers)?|encode)))?|ob_iconv_handler)\\b", + "name": "support.function.iconv.php" + }, + { + "match": "(?i)\\biis_((start|stop)_(service|server)|set_(script_map|server_rights|dir_security|app_settings)|(add|remove)_server|get_(script_map|service_state|server_(rights|by_(comment|path))|dir_security))\\b", + "name": "support.function.iisfunc.php" + }, + { + "match": "(?i)\\b(iptc(embed|parse)|(jpeg|png)2wbmp|gd_info|getimagesize(fromstring)?|image(s[xy]|scale|(char|string)(up)?|set(style|thickness|tile|interpolation|pixel|brush)|savealpha|convolution|copy(resampled|resized|merge(gray)?)?|colors(forindex|total)|color(set|closest(alpha|hwb)?|transparent|deallocate|(allocate|exact|resolve)(alpha)?|at|match)|crop(auto)?|create(truecolor|from(string|jpeg|png|wbmp|webp|gif|gd(2(part)?)?|xpm|xbm))?|types|ttf(bbox|text)|truecolortopalette|istruecolor|interlace|2wbmp|destroy|dashedline|jpeg|_type_to_(extension|mime_type)|ps(slantfont|text|(encode|extend|free|load)font|bbox)|png|polygon|palette(copy|totruecolor)|ellipse|ft(text|bbox)|filter|fill|filltoborder|filled(arc|ellipse|polygon|rectangle)|font(height|width)|flip|webp|wbmp|line|loadfont|layereffect|antialias|affine(matrix(concat|get))?|alphablending|arc|rotate|rectangle|gif|gd(2)?|gammacorrect|grab(screen|window)|xbm))\\b", + "name": "support.function.image.php" + }, + { + "match": "(?i)\\b(sys_get_temp_dir|set_(time_limit|include_path|magic_quotes_runtime)|cli_(get|set)_process_title|ini_(alter|get(_all)?|restore|set)|zend_(thread_id|version|logo_guid)|dl|php(credits|info|version)|php_(sapi_name|ini_(scanned_files|loaded_file)|uname|logo_guid)|putenv|extension_loaded|version_compare|assert(_options)?|restore_include_path|gc_(collect_cycles|disable|enable(d)?)|getopt|get_(cfg_var|current_user|defined_constants|extension_funcs|include_path|included_files|loaded_extensions|magic_quotes_(gpc|runtime)|required_files|resources)|get(env|lastmod|rusage|my(inode|[gup]id))|memory_get_(peak_)?usage|main|magic_quotes_runtime)\\b", + "name": "support.function.info.php" + }, + { + "match": "(?i)\\bibase_(set_event_handler|service_(attach|detach)|server_info|num_(fields|params)|name_result|connect|commit(_ret)?|close|trans|delete_user|drop_db|db_info|pconnect|param_info|prepare|err(code|msg)|execute|query|field_info|fetch_(assoc|object|row)|free_(event_handler|query|result)|wait_event|add_user|affected_rows|rollback(_ret)?|restore|gen_id|modify_user|maintain_db|backup|blob_(cancel|close|create|import|info|open|echo|add|get))\\b", + "name": "support.function.interbase.php" + }, + { + "match": "(?i)\\b(normalizer_(normalize|is_normalized)|idn_to_(unicode|utf8|ascii)|numfmt_(set_(symbol|(text_)?attribute|pattern)|create|(parse|format)(_currency)?|get_(symbol|(text_)?attribute|pattern|error_(code|message)|locale))|collator_(sort(_with_sort_keys)?|set_(attribute|strength)|compare|create|asort|get_(strength|sort_key|error_(code|message)|locale|attribute))|transliterator_(create(_(inverse|from_rules))?|transliterate|list_ids|get_error_(code|message))|intl(cal|tz)_get_error_(code|message)|intl_(is_failure|error_name|get_error_(code|message))|datefmt_(set_(calendar|lenient|pattern|timezone(_id)?)|create|is_lenient|parse|format(_object)?|localtime|get_(calendar(_object)?|time(type|zone(_id)?)|datetype|pattern|error_(code|message)|locale))|locale_(set_default|compose|canonicalize|parse|filter_matches|lookup|accept_from_http|get_(script|display_(script|name|variant|language|region)|default|primary_language|keywords|all_variants|region))|resourcebundle_(create|count|locales|get(_(error_(code|message)))?)|grapheme_(str(i?str|r?i?pos|len)|substr|extract)|msgfmt_(set_pattern|create|(format|parse)(_message)?|get_(pattern|error_(code|message)|locale)))\\b", + "name": "support.function.intl.php" + }, + { + "match": "(?i)\\bjson_(decode|encode|last_error(_msg)?)\\b", + "name": "support.function.json.php" + }, + { + "match": "(?i)\\bldap_(start|tls|sort|search|sasl_bind|set_(option|rebind_proc)|(first|next)_(attribute|entry|reference)|connect|control_paged_result(_response)?|count_entries|compare|close|t61_to_8859|8859_to_t61|dn2ufn|delete|unbind|parse_(reference|result)|escape|errno|err2str|error|explode_dn|bind|free_result|list|add|rename|read|get_(option|dn|entries|values(_len)?|attributes)|modify(_batch)?|mod_(add|del|replace))\\b", + "name": "support.function.ldap.php" + }, + { + "match": "(?i)\\blibxml_(set_(streams_context|external_entity_loader)|clear_errors|disable_entity_loader|use_internal_errors|get_(errors|last_error))\\b", + "name": "support.function.libxml.php" + }, + { + "match": "(?i)\\b(ezmlm_hash|mail)\\b", + "name": "support.function.mail.php" + }, + { + "match": "(?i)\\b((a)?(cos|sin|tan)(h)?|sqrt|srand|hypot|hexdec|ceil|is_(nan|(in)?finite)|octdec|dec(hex|oct|bin)|deg2rad|pi|pow|exp(m1)?|floor|fmod|lcg_value|log(1(p|0))?|atan2|abs|round|rand|rad2deg|getrandmax|mt_(srand|rand|getrandmax)|max|min|bindec|base_convert)\\b", + "name": "support.function.math.php" + }, + { + "match": "(?i)\\bmb_(str(cut|str|to(lower|upper)|istr|ipos|imwidth|pos|width|len|rchr|richr|ripos|rpos)|substitute_character|substr(_count)?|split|send_mail|http_(input|output)|check_encoding|convert_(case|encoding|kana|variables)|internal_encoding|output_handler|decode_(numericentity|mimeheader)|detect_(encoding|order)|parse_str|preferred_mime_name|encoding_aliases|encode_(numericentity|mimeheader)|ereg(i(_replace)?)?|ereg_(search(_(get(pos|regs)|init|regs|(set)?pos))?|replace(_callback)?|match)|list_encodings|language|regex_(set_options|encoding)|get_info)\\b", + "name": "support.function.mbstring.php" + }, + { + "match": "(?i)\\b(mcrypt_(cfb|create_iv|cbc|ofb|decrypt|encrypt|ecb|list_(algorithms|modes)|generic(_((de)?init|end))?|enc_(self_test|is_block_(algorithm|algorithm_mode|mode)|get_(supported_key_sizes|(block|iv|key)_size|(algorithms|modes)_name))|get_(cipher_name|(block|iv|key)_size)|module_(close|self_test|is_block_(algorithm|algorithm_mode|mode)|open|get_(supported_key_sizes|algo_(block|key)_size)))|mdecrypt_generic)\\b", + "name": "support.function.mcrypt.php" + }, + { + "match": "(?i)\\bmemcache_debug\\b", + "name": "support.function.memcache.php" + }, + { + "match": "(?i)\\bmhash(_(count|keygen_s2k|get_(hash_name|block_size)))?\\b", + "name": "support.function.mhash.php" + }, + { + "match": "(?i)\\b(log_(cmd_(insert|delete|update)|killcursor|write_batch|reply|getmore)|bson_(decode|encode))\\b", + "name": "support.function.mongo.php" + }, + { + "match": "(?i)\\bmysql_(stat|set_charset|select_db|num_(fields|rows)|connect|client_encoding|close|create_db|escape_string|thread_id|tablename|insert_id|info|data_seek|drop_db|db_(name|query)|unbuffered_query|pconnect|ping|errno|error|query|field_(seek|name|type|table|flags|len)|fetch_(object|field|lengths|assoc|array|row)|free_result|list_(tables|dbs|processes|fields)|affected_rows|result|real_escape_string|get_(client|host|proto|server)_info)\\b", + "name": "support.function.mysql.php" + }, + { + "match": "(?i)\\bmysqli_(ssl_set|store_result|stat|send_(query|long_data)|set_(charset|opt|local_infile_(default|handler))|stmt_(store_result|send_long_data|next_result|close|init|data_seek|prepare|execute|fetch|free_result|attr_(get|set)|result_metadata|reset|get_(result|warnings)|more_results|bind_(param|result))|select_db|slave_query|savepoint|next_result|change_user|character_set_name|connect|commit|client_encoding|close|thread_safe|init|options|(enable|disable)_(reads_from_master|rpl_parse)|dump_debug_info|debug|data_seek|use_result|ping|poll|param_count|prepare|escape_string|execute|embedded_server_(start|end)|kill|query|field_seek|free_result|autocommit|rollback|report|refresh|fetch(_(object|fields|field(_direct)?|assoc|all|array|row))?|rpl_(parse_enabled|probe|query_type)|release_savepoint|reap_async_query|real_(connect|escape_string|query)|more_results|multi_query|get_(charset|connection_stats|client_(stats|info|version)|cache_stats|warnings|links_stats|metadata)|master_query|bind_(param|result)|begin_transaction)\\b", + "name": "support.function.mysqli.php" + }, + { + "match": "(?i)\\bmysqlnd_memcache_(set|get_config)\\b", + "name": "support.function.mysqlnd-memcache.php" + }, + { + "match": "(?i)\\bmysqlnd_ms_(set_(user_pick_server|qos)|dump_servers|query_is_select|fabric_select_(shard|global)|get_(stats|last_(used_connection|gtid))|xa_(commit|rollback|gc|begin)|match_wild)\\b", + "name": "support.function.mysqlnd-ms.php" + }, + { + "match": "(?i)\\bmysqlnd_qc_(set_(storage_handler|cache_condition|is_select|user_handlers)|clear_cache|get_(normalized_query_trace_log|core_stats|cache_info|query_trace_log|available_handlers))\\b", + "name": "support.function.mysqlnd-qc.php" + }, + { + "match": "(?i)\\bmysqlnd_uh_(set_(statement|connection)_proxy|convert_to_mysqlnd)\\b", + "name": "support.function.mysqlnd-uh.php" + }, + { + "match": "(?i)\\b(syslog|socket_(set_(blocking|timeout)|get_status)|set(raw)?cookie|http_response_code|openlog|headers_(list|sent)|header(_(register_callback|remove))?|checkdnsrr|closelog|inet_(ntop|pton)|ip2long|openlog|dns_(check_record|get_(record|mx))|define_syslog_variables|(p)?fsockopen|long2ip|get(servby(name|port)|host(name|by(name(l)?|addr))|protoby(name|number)|mxrr))\\b", + "name": "support.function.network.php" + }, + { + "match": "(?i)\\bnsapi_(virtual|response_headers|request_headers)\\b", + "name": "support.function.nsapi.php" + }, + { + "match": "(?i)\\b(oci(statementtype|setprefetch|serverversion|savelob(file)?|numcols|new(collection|cursor|descriptor)|nlogon|column(scale|size|name|type(raw)?|isnull|precision)|coll(size|trim|assign(elem)?|append|getelem|max)|commit|closelob|cancel|internaldebug|definebyname|plogon|parse|error|execute|fetch(statement|into)?|free(statement|collection|cursor|desc)|write(temporarylob|lobtofile)|loadlob|log(on|off)|rowcount|rollback|result|bindbyname)|oci_(statement_type|set_(client_(info|identifier)|prefetch|edition|action|module_name)|server_version|num_(fields|rows)|new_(connect|collection|cursor|descriptor)|connect|commit|client_version|close|cancel|internal_debug|define_by_name|pconnect|password_change|parse|error|execute|bind_(array_)?by_name|field_(scale|size|name|type(_raw)?|is_null|precision)|fetch(_(object|assoc|all|array|row))?|free_(statement|descriptor)|lob_(copy|is_equal)|rollback|result|get_implicit_resultset))\\b", + "name": "support.function.oci8.php" + }, + { + "match": "(?i)\\bopcache_(compile_file|invalidate|reset|get_(status|configuration))\\b", + "name": "support.function.opcache.php" + }, + { + "match": "(?i)\\bopenssl_(sign|spki_(new|export(_challenge)?|verify)|seal|csr_(sign|new|export(_to_file)?|get_(subject|public_key))|cipher_iv_length|open|dh_compute_key|digest|decrypt|public_(decrypt|encrypt)|encrypt|error_string|pkcs12_(export(_to_file)?|read)|pkcs7_(sign|decrypt|encrypt|verify)|verify|free_key|random_pseudo_bytes|pkey_(new|export(_to_file)?|free|get_(details|public|private))|private_(decrypt|encrypt)|pbkdf2|get_((cipher|md)_methods|cert_locations|(public|private)key)|x509_(check_private_key|checkpurpose|parse|export(_to_file)?|fingerprint|free|read))\\b", + "name": "support.function.openssl.php" + }, + { + "match": "(?i)\\b(output_(add_rewrite_var|reset_rewrite_vars)|flush|ob_(start|clean|implicit_flush|end_(clean|flush)|flush|list_handlers|gzhandler|get_(status|contents|clean|flush|length|level)))\\b", + "name": "support.function.output.php" + }, + { + "match": "(?i)\\bpassword_(hash|needs_rehash|verify|get_info)\\b", + "name": "support.function.password.php" + }, + { + "match": "(?i)\\bpcntl_(strerror|signal(_dispatch)?|sig(timedwait|procmask|waitinfo)|setpriority|errno|exec|fork|w(stopsig|termsig|if(stopped|signaled|exited))|wait(pid)?|alarm|getpriority|get_last_error)\\b", + "name": "support.function.pcntl.php" + }, + { + "match": "(?i)\\bpg_(socket|send_(prepare|execute|query(_params)?)|set_(client_encoding|error_verbosity)|select|host|num_(fields|rows)|consume_input|connection_(status|reset|busy)|connect(_poll)?|convert|copy_(from|to)|client_encoding|close|cancel_query|tty|transaction_status|trace|insert|options|delete|dbname|untrace|unescape_bytea|update|pconnect|ping|port|put_line|parameter_status|prepare|version|query(_params)?|escape_(string|identifier|literal|bytea)|end_copy|execute|flush|free_result|last_(notice|error|oid)|field_(size|num|name|type(_oid)?|table|is_null|prtlen)|affected_rows|result_(status|seek|error(_field)?)|fetch_(object|assoc|all(_columns)?|array|row|result)|get_(notify|pid|result)|meta_data|lo_(seek|close|create|tell|truncate|import|open|unlink|export|write|read(_all)?)|)\\b", + "name": "support.function.pgsql.php" + }, + { + "match": "(?i)\\b(virtual|getallheaders|apache_((get|set)env|note|child_terminate|lookup_uri|response_headers|reset_timeout|request_headers|get_(version|modules)))\\b", + "name": "support.function.php_apache.php" + }, + { + "match": "(?i)\\bdom_import_simplexml\\b", + "name": "support.function.php_dom.php" + }, + { + "match": "(?i)\\bftp_(ssl_connect|systype|site|size|set_option|nlist|nb_(continue|f?(put|get))|ch(dir|mod)|connect|cdup|close|delete|put|pwd|pasv|exec|quit|f(put|get)|login|alloc|rename|raw(list)?|rmdir|get(_option)?|mdtm|mkdir)\\b", + "name": "support.function.php_ftp.php" + }, + { + "match": "(?i)\\bimap_((create|delete|list|rename|scan)(mailbox)?|status|sort|subscribe|set_quota|set(flag_full|acl)|search|savebody|num_(recent|msg)|check|close|clearflag_full|thread|timeout|open|header(info)?|headers|append|alerts|reopen|8bit|unsubscribe|undelete|utf7_(decode|encode)|utf8|uid|ping|errors|expunge|qprint|gc|fetch(structure|header|text|mime|body)|fetch_overview|lsub|list(scan|subscribed)|last_error|rfc822_(parse_(headers|adrlist)|write_address)|get(subscribed|acl|mailboxes)|get_quota(root)?|msgno|mime_header_decode|mail_(copy|compose|move)|mail|mailboxmsginfo|binary|body(struct)?|base64)\\b", + "name": "support.function.php_imap.php" + }, + { + "match": "(?i)\\bmssql_(select_db|num_(fields|rows)|next_result|connect|close|init|data_seek|pconnect|execute|query|field_(seek|name|type|length)|fetch_(object|field|assoc|array|row|batch)|free_(statement|result)|rows_affected|result|guid_string|get_last_message|min_(error|message)_severity|bind)\\b", + "name": "support.function.php_mssql.php" + }, + { + "match": "(?i)\\bodbc_(statistics|specialcolumns|setoption|num_(fields|rows)|next_result|connect|columns|columnprivileges|commit|cursor|close(_all)?|tables|tableprivileges|do|data_source|pconnect|primarykeys|procedures|procedurecolumns|prepare|error(msg)?|exec(ute)?|field_(scale|num|name|type|precision|len)|foreignkeys|free_result|fetch_(into|object|array|row)|longreadlen|autocommit|rollback|result(_all)?|gettypeinfo|binmode)\\b", + "name": "support.function.php_odbc.php" + }, + { + "match": "(?i)\\bpreg_(split|quote|filter|last_error|replace(_callback)?|grep|match(_all)?)\\b", + "name": "support.function.php_pcre.php" + }, + { + "match": "(?i)\\b(spl_(classes|object_hash|autoload(_(call|unregister|extensions|functions|register))?)|class_(implements|uses|parents)|iterator_(count|to_array|apply))\\b", + "name": "support.function.php_spl.php" + }, + { + "match": "(?i)\\bzip_(close|open|entry_(name|compressionmethod|compressedsize|close|open|filesize|read)|read)\\b", + "name": "support.function.php_zip.php" + }, + { + "match": "(?i)\\bposix_(strerror|set(s|e?u|[ep]?g)id|ctermid|ttyname|times|isatty|initgroups|uname|errno|kill|access|get(sid|cwd|uid|pid|ppid|pwnam|pwuid|pgid|pgrp|euid|egid|login|rlimit|gid|grnam|groups|grgid)|get_last_error|mknod|mkfifo)\\b", + "name": "support.function.posix.php" + }, + { + "match": "(?i)\\bset(thread|proc)title\\b", + "name": "support.function.proctitle.php" + }, + { + "match": "(?i)\\bpspell_(store_replacement|suggest|save_wordlist|new(_(config|personal))?|check|clear_session|config_(save_repl|create|ignore|(data|dict)_dir|personal|runtogether|repl|mode)|add_to_(session|personal))\\b", + "name": "support.function.pspell.php" + }, + { + "match": "(?i)\\breadline(_(completion_function|clear_history|callback_(handler_(install|remove)|read_char)|info|on_new_line|write_history|list_history|add_history|redisplay|read_history))?\\b", + "name": "support.function.readline.php" + }, + { + "match": "(?i)\\brecode(_(string|file))?\\b", + "name": "support.function.recode.php" + }, + { + "match": "(?i)\\brrd(c_disconnect|_(create|tune|info|update|error|version|first|fetch|last(update)?|restore|graph|xport))\\b", + "name": "support.function.rrd.php" + }, + { + "match": "(?i)\\b(shm_((get|has|remove|put)_var|detach|attach|remove)|sem_(acquire|release|remove|get)|ftok|msg_((get|remove|set|stat)_queue|send|queue_exists|receive))\\b", + "name": "support.function.sem.php" + }, + { + "match": "(?i)\\bsession_(status|start|set_(save_handler|cookie_params)|save_path|name|commit|cache_(expire|limiter)|is_registered|id|destroy|decode|unset|unregister|encode|write_close|abort|reset|register(_shutdown)?|regenerate_id|get_cookie_params|module_name)\\b", + "name": "support.function.session.php" + }, + { + "match": "(?i)\\bshmop_(size|close|open|delete|write|read)\\b", + "name": "support.function.shmop.php" + }, + { + "match": "(?i)\\bsimplexml_(import_dom|load_(string|file))\\b", + "name": "support.function.simplexml.php" + }, + { + "match": "(?i)\\b(snmp(walk(oid)?|realwalk|get(next)?|set)|snmp_(set_(valueretrieval|quick_print|enum_print|oid_(numeric_print|output_format))|read_mib|get_(valueretrieval|quick_print))|snmp[23]_(set|walk|real_walk|get(next)?))\\b", + "name": "support.function.snmp.php" + }, + { + "match": "(?i)\\b(is_soap_fault|use_soap_error_handler)\\b", + "name": "support.function.soap.php" + }, + { + "match": "(?i)\\bsocket_(shutdown|strerror|send(to|msg)?|set_((non)?block|option)|select|connect|close|clear_error|bind|create(_(pair|listen))?|cmsg_space|import_stream|write|listen|last_error|accept|recv(from|msg)?|read|get(peer|sock)name|get_option)\\b", + "name": "support.function.sockets.php" + }, + { + "match": "(?i)\\bsqlite_(single_query|seek|has_(more|prev)|num_(fields|rows)|next|changes|column|current|close|create_(aggregate|function)|open|unbuffered_query|udf_(decode|encode)_binary|popen|prev|escape_string|error_string|exec|valid|key|query|field_name|factory|fetch_(string|single|column_types|object|all|array)|lib(encoding|version)|last_(insert_rowid|error)|array_query|rewind|busy_timeout)\\b", + "name": "support.function.sqlite.php" + }, + { + "match": "(?i)\\bsqlsrv_(send_stream_data|server_info|has_rows|num_(fields|rows)|next_result|connect|configure|commit|client_info|close|cancel|prepare|errors|execute|query|field_metadata|fetch(_(array|object))?|free_stmt|rows_affected|rollback|get_(config|field)|begin_transaction)\\b", + "name": "support.function.sqlsrv.php" + }, + { + "match": "(?i)\\bstats_(harmonic_mean|covariance|standard_deviation|skew|cdf_(noncentral_(chisquare|f)|negative_binomial|chisquare|cauchy|t|uniform|poisson|exponential|f|weibull|logistic|laplace|gamma|binomial|beta)|stat_(noncentral_t|correlation|innerproduct|independent_t|powersum|percentile|paired_t|gennch|binomial_coef)|dens_(normal|negative_binomial|chisquare|cauchy|t|pmf_(hypergeometric|poisson|binomial)|exponential|f|weibull|logistic|laplace|gamma|beta)|den_uniform|variance|kurtosis|absolute_deviation|rand_(setall|phrase_to_seeds|ranf|get_seeds|gen_(noncentral_[ft]|noncenral_chisquare|normal|chisquare|t|int|i(uniform|poisson|binomial(_negative)?)|exponential|f(uniform)?|gamma|beta)))\\b", + "name": "support.function.stats.php" + }, + { + "match": "(?i)\\b(set_socket_blocking|stream_(socket_(shutdown|sendto|server|client|pair|enable_crypto|accept|recvfrom|get_name)|set_(chunk_size|timeout|(read|write)_buffer|blocking)|select|notification_callback|supports_lock|context_(set_(option|default|params)|create|get_(options|default|params))|copy_to_stream|is_local|encoding|filter_(append|prepend|register|remove)|wrapper_((un)?register|restore)|resolve_include_path|register_wrapper|get_(contents|transports|filters|wrappers|line|meta_data)|bucket_(new|prepend|append|make_writeable)))\\b", + "name": "support.function.streamsfuncs.php" + }, + { + "match": "(?i)\\b(money_format|md5(_file)?|metaphone|bin2hex|sscanf|sha1(_file)?|str(str|c?spn|n(at)?(case)?cmp|chr|coll|(case)?cmp|to(upper|lower)|tok|tr|istr|pos|pbrk|len|rchr|ri?pos|rev)|str_(getcsv|ireplace|pad|repeat|replace|rot13|shuffle|split|word_count)|strip(c?slashes|os)|strip_tags|similar_text|soundex|substr(_(count|compare|replace))?|setlocale|html(specialchars(_decode)?|entities)|html_entity_decode|hex2bin|hebrev(c)?|number_format|nl2br|nl_langinfo|chop|chunk_split|chr|convert_(cyr_string|uu(decode|encode))|count_chars|crypt|crc32|trim|implode|ord|uc(first|words)|join|parse_str|print(f)?|echo|explode|v?[fs]?printf|quoted_printable_(decode|encode)|quotemeta|wordwrap|lcfirst|[lr]trim|localeconv|levenshtein|addc?slashes|get_html_translation_table)\\b", + "name": "support.function.string.php" + }, + { + "match": "(?i)\\bsybase_(set_message_handler|select_db|num_(fields|rows)|connect|close|deadlock_retry_count|data_seek|unbuffered_query|pconnect|query|field_seek|fetch_(object|field|assoc|array|row)|free_result|affected_rows|result|get_last_message|min_(client|error|message|server)_severity)\\b", + "name": "support.function.sybase.php" + }, + { + "match": "(?i)\\b(taint|is_tainted|untaint)\\b", + "name": "support.function.taint.php" + }, + { + "match": "(?i)\\b(tidy_((get|set)opt|set_encoding|save_config|config_count|clean_repair|is_(xhtml|xml)|diagnose|(access|error|warning)_count|load_config|reset_config|(parse|repair)_(string|file)|get_(status|html(_ver)?|head|config|output|opt_doc|root|release|body))|ob_tidyhandler)\\b", + "name": "support.function.tidy.php" + }, + { + "match": "(?i)\\btoken_(name|get_all)\\b", + "name": "support.function.tokenizer.php" + }, + { + "match": "(?i)\\btrader_(stoch(f|r|rsi)?|stddev|sin(h)?|sum|sub|set_(compat|unstable_period)|sqrt|sar(ext)?|sma|ht_(sine|trend(line|mode)|dc(period|phase)|phasor)|natr|cci|cos(h)?|correl|cdl(shootingstar|shortline|sticksandwich|stalledpattern|spinningtop|separatinglines|hikkake(mod)?|highwave|homingpigeon|hangingman|harami(cross)?|hammer|concealbabyswall|counterattack|closingmarubozu|thrusting|tasukigap|takuri|tristar|inneck|invertedhammer|identical3crows|2crows|onneck|doji(star)?|darkcloudcover|dragonflydoji|unique3river|upsidegap2crows|3(starsinsouth|inside|outside|whitesoldiers|linestrike|blackcrows)|piercing|engulfing|evening(doji)?star|kicking(bylength)?|longline|longleggeddoji|ladderbottom|advanceblock|abandonedbaby|risefall3methods|rickshawman|gapsidesidewhite|gravestonedoji|xsidegap3methods|morning(doji)?star|mathold|matchinglow|marubozu|belthold|breakaway)|ceil|cmo|tsf|typprice|t3|tema|tan(h)?|trix|trima|trange|obv|div|dema|dx|ultosc|ppo|plus_d[im]|errno|exp|ema|var|kama|floor|wclprice|willr|wma|ln|log10|bop|beta|bbands|linearreg(_(slope|intercept|angle))?|asin|acos|atan|atr|adosc|ad|add|adx(r)?|apo|avgprice|aroon(osc)?|rsi|roc|rocp|rocr(100)?|get_(compat|unstable_period)|min(index)?|minus_d[im]|minmax(index)?|mid(point|price)|mom|mult|medprice|mfi|macd(ext|fix)?|mavp|max(index)?|ma(ma)?)\\b", + "name": "support.function.trader.php" + }, + { + "match": "(?i)\\buopz_(copy|compose|implement|overload|delete|undefine|extend|function|flags|restore|rename|redefine|backup)\\b", + "name": "support.function.uopz.php" + }, + { + "match": "(?i)\\b(http_build_query|(raw)?url(decode|encode)|parse_url|get_(headers|meta_tags)|base64_(decode|encode))\\b", + "name": "support.function.url.php" + }, + { + "match": "(?i)\\b(strval|settype|serialize|(bool|double|float)val|debug_zval_dump|intval|import_request_variables|isset|is_(scalar|string|null|numeric|callable|int(eger)?|object|double|float|long|array|resource|real|bool)|unset|unserialize|print_r|empty|var_(dump|export)|gettype|get_(defined_vars|resource_type))\\b", + "name": "support.function.var.php" + }, + { + "match": "(?i)\\bwddx_(serialize_(value|vars)|deserialize|packet_(start|end)|add_vars)\\b", + "name": "support.function.wddx.php" + }, + { + "match": "(?i)\\bxhprof_(sample_)?(disable|enable)\\b", + "name": "support.function.xhprof.php" + }, + { + "match": "(?i)\\b(utf8_(decode|encode)|xml_(set_((notation|(end|start)_namespace|unparsed_entity)_decl_handler|(character_data|default|element|external_entity_ref|processing_instruction)_handler|object)|parse(_into_struct)?|parser_((get|set)_option|create(_ns)?|free)|error_string|get_(current_((column|line)_number|byte_index)|error_code)))\\b", + "name": "support.function.xml.php" + }, + { + "match": "(?i)\\bxmlrpc_(server_(call_method|create|destroy|add_introspection_data|register_(introspection_callback|method))|is_fault|decode(_request)?|parse_method_descriptions|encode(_request)?|(get|set)_type)\\b", + "name": "support.function.xmlrpc.php" + }, + { + "match": "(?i)\\bxmlwriter_((end|start|write)_(comment|cdata|dtd(_(attlist|entity|element))?|document|pi|attribute|element)|(start|write)_(attribute|element)_ns|write_raw|set_indent(_string)?|text|output_memory|open_(memory|uri)|full_end_element|flush|)\\b", + "name": "support.function.xmlwriter.php" + }, + { + "match": "(?i)\\b(zlib_(decode|encode|get_coding_type)|readgzfile|gz(seek|compress|close|tell|inflate|open|decode|deflate|uncompress|puts|passthru|encode|eof|file|write|rewind|read|getc|getss?))\\b", + "name": "support.function.zlib.php" + }, + { + "match": "(?i)\\bis_int(eger)?\\b", + "name": "support.function.alias.php" + } + ] + }, + "switch_statement": { + "patterns": [ + { + "match": "\\s+(?=switch\\b)" + }, + { + "begin": "\\bswitch\\b(?!\\s*\\(.*\\)\\s*:)", + "beginCaptures": { + "0": { + "name": "keyword.control.switch.php" + } + }, + "end": "}|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.section.switch-block.end.bracket.curly.php" + } + }, + "name": "meta.switch-statement.php", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.switch-expression.begin.bracket.round.php" + } + }, + "end": "\\)|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.switch-expression.end.bracket.round.php" + } + }, + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.section.switch-block.begin.bracket.curly.php" + } + }, + "end": "(?=}|\\?>)", + "patterns": [ + { + "include": "#language" + } + ] + } + ] + } + ] + }, + "use-inner": { + "patterns": [ + { + "include": "#comments" + }, + { + "begin": "(?i)\\b(as)\\s+", + "beginCaptures": { + "1": { + "name": "keyword.other.use-as.php" + } + }, + "end": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "endCaptures": { + "0": { + "name": "entity.other.alias.php" + } + } + }, + { + "include": "#class-name" + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.php" + } + ] + }, + "var_basic": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(?i)(\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*\\b", + "name": "variable.other.php" + } + ] + }, + "var_global": { + "captures": { + "1": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(\\$)((_(COOKIE|FILES|GET|POST|REQUEST))|arg(v|c))\\b", + "name": "variable.other.global.php" + }, + "var_global_safer": { + "captures": { + "1": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(\\$)((GLOBALS|_(ENV|SERVER|SESSION)))", + "name": "variable.other.global.safer.php" + }, + "var_language": { + "captures": { + "1": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(\\$)this\\b", + "name": "variable.language.this.php" + }, + "variable-name": { + "patterns": [ + { + "include": "#var_global" + }, + { + "include": "#var_global_safer" + }, + { + "captures": { + "1": { + "name": "variable.other.php" + }, + "10": { + "name": "string.unquoted.index.php" + }, + "11": { + "name": "punctuation.section.array.end.php" + }, + "2": { + "name": "punctuation.definition.variable.php" + }, + "4": { + "name": "keyword.operator.class.php" + }, + "5": { + "name": "variable.other.property.php" + }, + "6": { + "name": "punctuation.section.array.begin.php" + }, + "7": { + "name": "constant.numeric.index.php" + }, + "8": { + "name": "variable.other.index.php" + }, + "9": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(?i)((\\$)(?[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*))(?:(->)(\\g)|(\\[)(?:(\\d+)|((\\$)\\g)|([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*))(\\]))?" + }, + { + "captures": { + "1": { + "name": "variable.other.php" + }, + "2": { + "name": "punctuation.definition.variable.php" + }, + "4": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(?i)((\\${)(?[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)(}))" + } + ] + }, + "variables": { + "patterns": [ + { + "include": "#var_language" + }, + { + "include": "#var_global" + }, + { + "include": "#var_global_safer" + }, + { + "include": "#var_basic" + }, + { + "begin": "\\${(?=.*?})", + "beginCaptures": { + "0": { + "name": "punctuation.definition.variable.php" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.variable.php" + } + }, + "patterns": [ + { + "include": "#language" + } + ] + } + ] + } + }, + "scopeName": "text.html.php.blade" +} \ No newline at end of file diff --git a/languages/c.json b/languages/c.json new file mode 100644 index 0000000..c5ff5f0 --- /dev/null +++ b/languages/c.json @@ -0,0 +1,3550 @@ +{ + "displayName": "C", + "name": "c", + "patterns": [ + { + "include": "#preprocessor-rule-enabled" + }, + { + "include": "#preprocessor-rule-disabled" + }, + { + "include": "#preprocessor-rule-conditional" + }, + { + "include": "#predefined_macros" + }, + { + "include": "#comments" + }, + { + "include": "#switch_statement" + }, + { + "include": "#anon_pattern_1" + }, + { + "include": "#storage_types" + }, + { + "include": "#anon_pattern_2" + }, + { + "include": "#anon_pattern_3" + }, + { + "include": "#anon_pattern_4" + }, + { + "include": "#anon_pattern_5" + }, + { + "include": "#anon_pattern_6" + }, + { + "include": "#anon_pattern_7" + }, + { + "include": "#operators" + }, + { + "include": "#numbers" + }, + { + "include": "#strings" + }, + { + "include": "#anon_pattern_range_1" + }, + { + "include": "#anon_pattern_range_2" + }, + { + "include": "#anon_pattern_range_3" + }, + { + "include": "#pragma-mark" + }, + { + "include": "#anon_pattern_range_4" + }, + { + "include": "#anon_pattern_range_5" + }, + { + "include": "#anon_pattern_range_6" + }, + { + "include": "#anon_pattern_8" + }, + { + "include": "#anon_pattern_9" + }, + { + "include": "#anon_pattern_10" + }, + { + "include": "#anon_pattern_11" + }, + { + "include": "#anon_pattern_12" + }, + { + "include": "#anon_pattern_13" + }, + { + "include": "#block" + }, + { + "include": "#parens" + }, + { + "include": "#anon_pattern_range_7" + }, + { + "include": "#line_continuation_character" + }, + { + "include": "#anon_pattern_range_8" + }, + { + "include": "#anon_pattern_range_9" + }, + { + "include": "#anon_pattern_14" + }, + { + "include": "#anon_pattern_15" + } + ], + "repository": { + "access-method": { + "begin": "([a-zA-Z_][a-zA-Z_0-9]*|(?<=[\\])]))\\s*(?:(\\.)|(->))((?:(?:[a-zA-Z_][a-zA-Z_0-9]*)\\s*(?:(?:\\.)|(?:->)))*)\\s*([a-zA-Z_][a-zA-Z_0-9]*)(\\()", + "beginCaptures": { + "1": { + "name": "variable.object.c" + }, + "2": { + "name": "punctuation.separator.dot-access.c" + }, + "3": { + "name": "punctuation.separator.pointer-access.c" + }, + "4": { + "patterns": [ + { + "match": "\\.", + "name": "punctuation.separator.dot-access.c" + }, + { + "match": "->", + "name": "punctuation.separator.pointer-access.c" + }, + { + "match": "[a-zA-Z_][a-zA-Z_0-9]*", + "name": "variable.object.c" + }, + { + "match": ".+", + "name": "everything.else.c" + } + ] + }, + "5": { + "name": "entity.name.function.member.c" + }, + "6": { + "name": "punctuation.section.arguments.begin.bracket.round.function.member.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.function.member.c" + } + }, + "name": "meta.function-call.member.c", + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + "anon_pattern_1": { + "match": "\\b(break|continue|do|else|for|goto|if|_Pragma|return|while)\\b", + "name": "keyword.control.c" + }, + "anon_pattern_10": { + "match": "\\b(int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t)\\b", + "name": "support.type.stdint.c" + }, + "anon_pattern_11": { + "match": "\\b(noErr|kNilOptions|kInvalidID|kVariableLengthArray)\\b", + "name": "support.constant.mac-classic.c" + }, + "anon_pattern_12": { + "match": "\\b(AbsoluteTime|Boolean|Byte|ByteCount|ByteOffset|BytePtr|CompTimeValue|ConstLogicalAddress|ConstStrFileNameParam|ConstStringPtr|Duration|Fixed|FixedPtr|Float32|Float32Point|Float64|Float80|Float96|FourCharCode|Fract|FractPtr|Handle|ItemCount|LogicalAddress|OptionBits|OSErr|OSStatus|OSType|OSTypePtr|PhysicalAddress|ProcessSerialNumber|ProcessSerialNumberPtr|ProcHandle|Ptr|ResType|ResTypePtr|ShortFixed|ShortFixedPtr|SignedByte|SInt16|SInt32|SInt64|SInt8|Size|StrFileName|StringHandle|StringPtr|TimeBase|TimeRecord|TimeScale|TimeValue|TimeValue64|UInt16|UInt32|UInt64|UInt8|UniChar|UniCharCount|UniCharCountPtr|UniCharPtr|UnicodeScalarValue|UniversalProcHandle|UniversalProcPtr|UnsignedFixed|UnsignedFixedPtr|UnsignedWide|UTF16Char|UTF32Char|UTF8Char)\\b", + "name": "support.type.mac-classic.c" + }, + "anon_pattern_13": { + "match": "\\b([A-Za-z0-9_]+_t)\\b", + "name": "support.type.posix-reserved.c" + }, + "anon_pattern_14": { + "match": ";", + "name": "punctuation.terminator.statement.c" + }, + "anon_pattern_15": { + "match": ",", + "name": "punctuation.separator.delimiter.c" + }, + "anon_pattern_2": { + "match": "typedef", + "name": "keyword.other.typedef.c" + }, + "anon_pattern_3": { + "match": "\\b(const|extern|register|restrict|static|volatile|inline)\\b", + "name": "storage.modifier.c" + }, + "anon_pattern_4": { + "match": "\\bk[A-Z]\\w*\\b", + "name": "constant.other.variable.mac-classic.c" + }, + "anon_pattern_5": { + "match": "\\bg[A-Z]\\w*\\b", + "name": "variable.other.readwrite.global.mac-classic.c" + }, + "anon_pattern_6": { + "match": "\\bs[A-Z]\\w*\\b", + "name": "variable.other.readwrite.static.mac-classic.c" + }, + "anon_pattern_7": { + "match": "\\b(NULL|true|false|TRUE|FALSE)\\b", + "name": "constant.language.c" + }, + "anon_pattern_8": { + "match": "\\b(u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|div_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t)\\b", + "name": "support.type.sys-types.c" + }, + "anon_pattern_9": { + "match": "\\b(pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t)\\b", + "name": "support.type.pthread.c" + }, + "anon_pattern_range_1": { + "begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((#)\\s*define\\b)\\s+((?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.c" + } + }, + "name": "string.quoted.other.lt-gt.include.c" + } + ] + }, + "anon_pattern_range_4": { + "begin": "^\\s*((#)\\s*line)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.line.c" + }, + "2": { + "name": "punctuation.definition.directive.c" + } + }, + "end": "(?=(?://|/\\*))|(?=+!]+|\\(\\)|\\[\\])))\\s*(\\()", + "beginCaptures": { + "1": { + "name": "variable.other.c" + }, + "2": { + "name": "punctuation.section.parens.begin.bracket.round.initialization.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.initialization.c" + } + }, + "name": "meta.initialization.c", + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.c" + } + }, + "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.c" + } + }, + "patterns": [ + { + "include": "#block_innards" + } + ] + }, + { + "include": "#parens-block" + }, + { + "include": "$self" + } + ] + }, + "c_conditional_context": { + "patterns": [ + { + "include": "$self" + }, + { + "include": "#block_innards" + } + ] + }, + "c_function_call": { + "begin": "(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()(?=(?:[A-Za-z_][A-Za-z0-9_]*+|::)++\\s*\\(|(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\()", + "end": "(?<=\\))(?!\\w)", + "name": "meta.function-call.c", + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + "case_statement": { + "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\s*)(\\/\\/[!\\/]+)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.documentation.c" + } + }, + "end": "(?<=\\n)(?|%|\"|\\.|=|::|\\||--|---)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "captures": { + "1": { + "name": "storage.type.class.doxygen.c" + }, + "2": { + "name": "markup.italic.doxygen.c" + } + }, + "match": "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))\\s+(\\S+)" + }, + { + "captures": { + "1": { + "name": "storage.type.class.doxygen.c" + }, + "2": { + "name": "markup.bold.doxygen.c" + } + }, + "match": "((?<=[\\s*!\\/])[\\\\@]b)\\s+(\\S+)" + }, + { + "captures": { + "1": { + "name": "storage.type.class.doxygen.c" + }, + "2": { + "name": "markup.inline.raw.string.c" + } + }, + "match": "((?<=[\\s*!\\/])[\\\\@](?:c|p))\\s+(\\S+)" + }, + { + "match": "(?<=[\\s*!\\/])[\\\\@](?:a|anchor|b|c|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|e|em|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "match": "(?<=[\\s*!\\/])[\\\\@](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "captures": { + "1": { + "name": "storage.type.class.doxygen.c" + }, + "2": { + "patterns": [ + { + "match": "in|out", + "name": "keyword.other.parameter.direction.$0.c" + } + ] + }, + "3": { + "name": "variable.parameter.c" + } + }, + "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)" + }, + { + "match": "(?<=[\\s*!\\/])[\\\\@](?:arg|attention|author|authors|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remark|remarks|result|return|returns|retval|sa|see|short|since|test|throw|todo|tparam|version|warning|xrefitem)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "match": "(?<=[\\s*!\\/])[\\\\@](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|uml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "match": "(?:\\b[A-Z]+:|@[a-z_]+:)", + "name": "storage.type.class.gtkdoc" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.comment.begin.documentation.c" + }, + "2": { + "patterns": [ + { + "match": "(?<=[\\s*!\\/])[\\\\@](?:callergraph|callgraph|else|endif|f\\$|f\\[|f\\]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitializer|showrefby|showrefs|tableofcontents|\\$|\\#|<|>|%|\"|\\.|=|::|\\||--|---)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "captures": { + "1": { + "name": "storage.type.class.doxygen.c" + }, + "2": { + "name": "markup.italic.doxygen.c" + } + }, + "match": "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))\\s+(\\S+)" + }, + { + "captures": { + "1": { + "name": "storage.type.class.doxygen.c" + }, + "2": { + "name": "markup.bold.doxygen.c" + } + }, + "match": "((?<=[\\s*!\\/])[\\\\@]b)\\s+(\\S+)" + }, + { + "captures": { + "1": { + "name": "storage.type.class.doxygen.c" + }, + "2": { + "name": "markup.inline.raw.string.c" + } + }, + "match": "((?<=[\\s*!\\/])[\\\\@](?:c|p))\\s+(\\S+)" + }, + { + "match": "(?<=[\\s*!\\/])[\\\\@](?:a|anchor|b|c|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|e|em|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "match": "(?<=[\\s*!\\/])[\\\\@](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "captures": { + "1": { + "name": "storage.type.class.doxygen.c" + }, + "2": { + "patterns": [ + { + "match": "in|out", + "name": "keyword.other.parameter.direction.$0.c" + } + ] + }, + "3": { + "name": "variable.parameter.c" + } + }, + "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)" + }, + { + "match": "(?<=[\\s*!\\/])[\\\\@](?:arg|attention|author|authors|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remark|remarks|result|return|returns|retval|sa|see|short|since|test|throw|todo|tparam|version|warning|xrefitem)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "match": "(?<=[\\s*!\\/])[\\\\@](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|uml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "match": "(?:\\b[A-Z]+:|@[a-z_]+:)", + "name": "storage.type.class.gtkdoc" + } + ] + }, + "3": { + "name": "punctuation.definition.comment.end.documentation.c" + } + }, + "match": "(\\/\\*[!*]+(?=\\s))(.+)([!*]*\\*\\/)", + "name": "comment.block.documentation.c" + }, + { + "begin": "((?>\\s*)\\/\\*[!*]+(?:(?:\\n|$)|(?=\\s)))", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.begin.documentation.c" + } + }, + "end": "([!*]*\\*\\/)", + "endCaptures": { + "1": { + "name": "punctuation.definition.comment.end.documentation.c" + } + }, + "name": "comment.block.documentation.c", + "patterns": [ + { + "match": "(?<=[\\s*!\\/])[\\\\@](?:callergraph|callgraph|else|endif|f\\$|f\\[|f\\]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitializer|showrefby|showrefs|tableofcontents|\\$|\\#|<|>|%|\"|\\.|=|::|\\||--|---)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "captures": { + "1": { + "name": "storage.type.class.doxygen.c" + }, + "2": { + "name": "markup.italic.doxygen.c" + } + }, + "match": "((?<=[\\s*!\\/])[\\\\@](?:a|em|e))\\s+(\\S+)" + }, + { + "captures": { + "1": { + "name": "storage.type.class.doxygen.c" + }, + "2": { + "name": "markup.bold.doxygen.c" + } + }, + "match": "((?<=[\\s*!\\/])[\\\\@]b)\\s+(\\S+)" + }, + { + "captures": { + "1": { + "name": "storage.type.class.doxygen.c" + }, + "2": { + "name": "markup.inline.raw.string.c" + } + }, + "match": "((?<=[\\s*!\\/])[\\\\@](?:c|p))\\s+(\\S+)" + }, + { + "match": "(?<=[\\s*!\\/])[\\\\@](?:a|anchor|b|c|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|e|em|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "match": "(?<=[\\s*!\\/])[\\\\@](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "captures": { + "1": { + "name": "storage.type.class.doxygen.c" + }, + "2": { + "patterns": [ + { + "match": "in|out", + "name": "keyword.other.parameter.direction.$0.c" + } + ] + }, + "3": { + "name": "variable.parameter.c" + } + }, + "match": "((?<=[\\s*!\\/])[\\\\@]param)(?:\\s*\\[((?:,?\\s*(?:in|out)\\s*)+)\\])?\\s+(\\b\\w+\\b)" + }, + { + "match": "(?<=[\\s*!\\/])[\\\\@](?:arg|attention|author|authors|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remark|remarks|result|return|returns|retval|sa|see|short|since|test|throw|todo|tparam|version|warning|xrefitem)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "match": "(?<=[\\s*!\\/])[\\\\@](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|uml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\b(?:\\{[^}]*\\})?", + "name": "storage.type.class.doxygen.c" + }, + { + "match": "(?:\\b[A-Z]+:|@[a-z_]+:)", + "name": "storage.type.class.gtkdoc" + } + ] + }, + { + "captures": { + "1": { + "name": "meta.toc-list.banner.block.c" + } + }, + "match": "^\\/\\* =(\\s*.*?)\\s*= \\*\\/$\\n?", + "name": "comment.block.banner.c" + }, + { + "begin": "(\\/\\*)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.begin.c" + } + }, + "end": "(\\*\\/)", + "endCaptures": { + "1": { + "name": "punctuation.definition.comment.end.c" + } + }, + "name": "comment.block.c" + }, + { + "captures": { + "1": { + "name": "meta.toc-list.banner.line.c" + } + }, + "match": "^\\/\\/ =(\\s*.*?)\\s*=$\\n?", + "name": "comment.line.banner.c" + }, + { + "begin": "((?:^[ \\t]+)?)(?=\\/\\/)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.c" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "(\\/\\/)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.c" + } + }, + "end": "(?=\\n)", + "name": "comment.line.double-slash.c", + "patterns": [ + { + "include": "#line_continuation_character" + } + ] + } + ] + } + ] + }, + { + "include": "#block_comment" + }, + { + "include": "#line_comment" + } + ] + }, + { + "include": "#block_comment" + }, + { + "include": "#line_comment" + } + ] + }, + "default_statement": { + "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?=+!]+|\\(\\)|\\[\\])))\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.c" + }, + "2": { + "name": "punctuation.section.arguments.begin.bracket.round.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.c" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.c" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + { + "include": "#block_innards" + } + ] + }, + "function-innards": { + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#storage_types" + }, + { + "include": "#operators" + }, + { + "include": "#vararg_ellipses" + }, + { + "begin": "(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()((?:[A-Za-z_][A-Za-z0-9_]*+|::)++|(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\])))\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.c" + }, + "2": { + "name": "punctuation.section.parameters.begin.bracket.round.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parameters.end.bracket.round.c" + } + }, + "name": "meta.function.definition.parameters.c", + "patterns": [ + { + "include": "#probably_a_parameter" + }, + { + "include": "#function-innards" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.c" + } + }, + "patterns": [ + { + "include": "#function-innards" + } + ] + }, + { + "include": "$self" + } + ] + }, + "inline_comment": { + "patterns": [ + { + "patterns": [ + { + "captures": { + "1": { + "name": "comment.block.c punctuation.definition.comment.begin.c" + }, + "2": { + "name": "comment.block.c" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.c punctuation.definition.comment.end.c" + }, + { + "match": "\\*", + "name": "comment.block.c" + } + ] + } + }, + "match": "(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/))" + }, + { + "captures": { + "1": { + "name": "comment.block.c punctuation.definition.comment.begin.c" + }, + "2": { + "name": "comment.block.c" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.c punctuation.definition.comment.end.c" + }, + { + "match": "\\*", + "name": "comment.block.c" + } + ] + } + }, + "match": "(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/))" + } + ] + }, + { + "captures": { + "1": { + "name": "comment.block.c punctuation.definition.comment.begin.c" + }, + "2": { + "name": "comment.block.c" + }, + "3": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.c punctuation.definition.comment.end.c" + }, + { + "match": "\\*", + "name": "comment.block.c" + } + ] + } + }, + "match": "(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/))" + } + ] + }, + "line_comment": { + "patterns": [ + { + "begin": "\\s*+(\\/\\/)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.c" + } + }, + "end": "(?<=\\n)(?\\*|->)))" + } + ] + }, + "5": { + "name": "variable.other.member.c" + } + }, + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!(?:atomic_uint_least64_t|atomic_uint_least16_t|atomic_uint_least32_t|atomic_uint_least8_t|atomic_int_least16_t|atomic_uint_fast64_t|atomic_uint_fast32_t|atomic_int_least64_t|atomic_int_least32_t|pthread_rwlockattr_t|atomic_uint_fast16_t|pthread_mutexattr_t|atomic_int_fast16_t|atomic_uint_fast8_t|atomic_int_fast64_t|atomic_int_least8_t|atomic_int_fast32_t|atomic_int_fast8_t|pthread_condattr_t|atomic_uintptr_t|atomic_ptrdiff_t|pthread_rwlock_t|atomic_uintmax_t|pthread_mutex_t|atomic_intmax_t|atomic_intptr_t|atomic_char32_t|atomic_char16_t|pthread_attr_t|atomic_wchar_t|uint_least64_t|uint_least32_t|uint_least16_t|pthread_cond_t|pthread_once_t|uint_fast64_t|uint_fast16_t|atomic_size_t|uint_least8_t|int_least64_t|int_least32_t|int_least16_t|pthread_key_t|atomic_ullong|atomic_ushort|uint_fast32_t|atomic_schar|atomic_short|uint_fast8_t|int_fast64_t|int_fast32_t|int_fast16_t|atomic_ulong|atomic_llong|int_least8_t|atomic_uchar|memory_order|suseconds_t|int_fast8_t|atomic_bool|atomic_char|atomic_uint|atomic_long|atomic_int|useconds_t|_Imaginary|blksize_t|pthread_t|in_addr_t|uintptr_t|in_port_t|uintmax_t|uintmax_t|blkcnt_t|uint16_t|unsigned|_Complex|uint32_t|intptr_t|intmax_t|intmax_t|uint64_t|u_quad_t|int64_t|int32_t|ssize_t|caddr_t|clock_t|uint8_t|u_short|swblk_t|segsz_t|int16_t|fixpt_t|daddr_t|nlink_t|qaddr_t|size_t|time_t|mode_t|signed|quad_t|ushort|u_long|u_char|double|int8_t|ino_t|uid_t|pid_t|_Bool|float|dev_t|div_t|short|gid_t|off_t|u_int|key_t|id_t|uint|long|void|char|bool|id_t|int)\\b)[a-zA-Z_]\\w*\\b(?!\\())" + }, + "method_access": { + "begin": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*([a-zA-Z_]\\w*)(\\()", + "beginCaptures": { + "1": { + "name": "variable.other.object.access.c" + }, + "2": { + "name": "punctuation.separator.dot-access.c" + }, + "3": { + "name": "punctuation.separator.pointer-access.c" + }, + "4": { + "patterns": [ + { + "include": "#member_access" + }, + { + "include": "#method_access" + }, + { + "captures": { + "1": { + "name": "variable.other.object.access.c" + }, + "2": { + "name": "punctuation.separator.dot-access.c" + }, + "3": { + "name": "punctuation.separator.pointer-access.c" + } + }, + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))" + } + ] + }, + "5": { + "name": "entity.name.function.member.c" + }, + "6": { + "name": "punctuation.section.arguments.begin.bracket.round.function.member.c" + } + }, + "contentName": "meta.function-call.member.c", + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.arguments.end.bracket.round.function.member.c" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + "numbers": { + "captures": { + "0": { + "patterns": [ + { + "begin": "(?=.)", + "end": "$", + "patterns": [ + { + "captures": { + "1": { + "name": "keyword.other.unit.hexadecimal.c" + }, + "10": { + "name": "keyword.operator.minus.exponent.hexadecimal.c" + }, + "11": { + "name": "constant.numeric.exponent.hexadecimal.c", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric" + } + ] + }, + "12": { + "name": "keyword.other.unit.suffix.floating-point.c" + }, + "2": { + "name": "constant.numeric.hexadecimal.c", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric" + } + ] + }, + "3": { + "name": "punctuation.separator.constant.numeric" + }, + "4": { + "name": "constant.numeric.hexadecimal.c" + }, + "5": { + "name": "constant.numeric.hexadecimal.c", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric" + } + ] + }, + "6": { + "name": "punctuation.separator.constant.numeric" + }, + "8": { + "name": "keyword.other.unit.exponent.hexadecimal.c" + }, + "9": { + "name": "keyword.operator.plus.exponent.hexadecimal.c" + } + }, + "match": "(\\G0[xX])([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F])))*)?((?>=|\\|=", + "name": "keyword.operator.assignment.compound.bitwise.c" + }, + { + "match": "<<|>>", + "name": "keyword.operator.bitwise.shift.c" + }, + { + "match": "!=|<=|>=|==|<|>", + "name": "keyword.operator.comparison.c" + }, + { + "match": "&&|!|\\|\\|", + "name": "keyword.operator.logical.c" + }, + { + "match": "&|\\||\\^|~", + "name": "keyword.operator.c" + }, + { + "match": "=", + "name": "keyword.operator.assignment.c" + }, + { + "match": "%|\\*|/|-|\\+", + "name": "keyword.operator.c" + }, + { + "begin": "(\\?)", + "beginCaptures": { + "1": { + "name": "keyword.operator.ternary.c" + } + }, + "end": "(:)", + "endCaptures": { + "1": { + "name": "keyword.operator.ternary.c" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + }, + { + "include": "$self" + } + ] + } + ] + }, + "parens": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.c" + } + }, + "name": "meta.parens.c", + "patterns": [ + { + "include": "$self" + } + ] + }, + "parens-block": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.c" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.c" + } + }, + "name": "meta.parens.block.c", + "patterns": [ + { + "include": "#block_innards" + }, + { + "match": "(?-mix:(?=+!]+|\\(\\)|\\[\\]))\\s*\\()", + "end": "(?<=\\))(?!\\w)|(?=+!]+|\\(\\)|\\[\\])))\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.c" + }, + "2": { + "name": "punctuation.section.arguments.begin.bracket.round.c" + } + }, + "end": "(\\))|(?\\])]))\\s*([a-zA-Z_]\\w*)\\s*(?=(?:\\[\\]\\s*)?(?:,|\\)))" + }, + "static_assert": { + "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "10": { + "name": "punctuation.section.arguments.begin.bracket.round.static_assert.c" + }, + "2": { + "name": "comment.block.c punctuation.definition.comment.begin.c" + }, + "3": { + "name": "comment.block.c" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.c punctuation.definition.comment.end.c" + }, + { + "match": "\\*", + "name": "comment.block.c" + } + ] + }, + "5": { + "name": "keyword.other.static_assert.c" + }, + "6": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "7": { + "name": "comment.block.c punctuation.definition.comment.begin.c" + }, + "8": { + "name": "comment.block.c" + }, + "9": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.c punctuation.definition.comment.end.c" + }, + { + "match": "\\*", + "name": "comment.block.c" + } + ] + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.arguments.end.bracket.round.static_assert.c" + } + }, + "patterns": [ + { + "begin": "(,)\\s*(?=(?:L|u8|u|U\\s*\\\")?)", + "beginCaptures": { + "1": { + "name": "punctuation.separator.delimiter.comma.c" + } + }, + "end": "(?=\\))", + "name": "meta.static_assert.message.c", + "patterns": [ + { + "include": "#string_context" + } + ] + }, + { + "include": "#evaluation_context" + } + ] + }, + "storage_types": { + "patterns": [ + { + "match": "(?-mix:(?\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(?:\\n|$)" + }, + { + "include": "#comments" + }, + { + "begin": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\()", + "beginCaptures": { + "1": { + "name": "punctuation.section.parens.begin.bracket.round.assembly.c" + }, + "2": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "3": { + "name": "comment.block.c punctuation.definition.comment.begin.c" + }, + "4": { + "name": "comment.block.c" + }, + "5": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.c punctuation.definition.comment.end.c" + }, + { + "match": "\\*", + "name": "comment.block.c" + } + ] + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.parens.end.bracket.round.assembly.c" + } + }, + "patterns": [ + { + "begin": "(R?)(\")", + "beginCaptures": { + "1": { + "name": "meta.encoding.c" + }, + "2": { + "name": "punctuation.definition.string.begin.assembly.c" + } + }, + "contentName": "meta.embedded.assembly.c", + "end": "(\")", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.assembly.c" + } + }, + "name": "string.quoted.double.c", + "patterns": [ + { + "include": "source.asm" + }, + { + "include": "source.x86" + }, + { + "include": "source.x86_64" + }, + { + "include": "source.arm" + }, + { + "include": "#backslash_escapes" + }, + { + "include": "#string_escaped_char" + } + ] + }, + { + "begin": "(\\()", + "beginCaptures": { + "1": { + "name": "punctuation.section.parens.begin.bracket.round.assembly.inner.c" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.parens.end.bracket.round.assembly.inner.c" + } + }, + "patterns": [ + { + "include": "#evaluation_context" + } + ] + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.c punctuation.definition.comment.begin.c" + }, + "3": { + "name": "comment.block.c" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.c punctuation.definition.comment.end.c" + }, + { + "match": "\\*", + "name": "comment.block.c" + } + ] + }, + "5": { + "name": "variable.other.asm.label.c" + }, + "6": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "7": { + "name": "comment.block.c punctuation.definition.comment.begin.c" + }, + "8": { + "name": "comment.block.c" + }, + "9": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.c punctuation.definition.comment.end.c" + }, + { + "match": "\\*", + "name": "comment.block.c" + } + ] + } + }, + "match": "\\[((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))([a-zA-Z_]\\w*)((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))\\]" + }, + { + "match": ":", + "name": "punctuation.separator.delimiter.colon.assembly.c" + }, + { + "include": "#comments" + } + ] + } + ] + } + ] + }, + "string_escaped_char": { + "patterns": [ + { + "match": "\\\\(\\\\|[abefnprtv'\"?]|[0-3]\\d{,2}|[4-7]\\d?|x[a-fA-F0-9]{,2}|u[a-fA-F0-9]{,4}|U[a-fA-F0-9]{,8})", + "name": "constant.character.escape.c" + }, + { + "match": "\\\\.", + "name": "invalid.illegal.unknown-escape.c" + } + ] + }, + "string_placeholder": { + "patterns": [ + { + "match": "%(\\d+\\$)?[#0\\- +']*[,;:_]?((-?\\d+)|\\*(-?\\d+\\$)?)?(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)?(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?[diouxXDOUeEfFgGaACcSspn%]", + "name": "constant.other.placeholder.c" + }, + { + "captures": { + "1": { + "name": "invalid.illegal.placeholder.c" + } + }, + "match": "(%)(?!\"\\s*(PRI|SCN))" + } + ] + }, + "strings": { + "patterns": [ + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.c" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.c" + } + }, + "name": "string.quoted.double.c", + "patterns": [ + { + "include": "#string_escaped_char" + }, + { + "include": "#string_placeholder" + }, + { + "include": "#line_continuation_character" + } + ] + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.c" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.c" + } + }, + "name": "string.quoted.single.c", + "patterns": [ + { + "include": "#string_escaped_char" + }, + { + "include": "#line_continuation_character" + } + ] + } + ] + }, + "switch_conditional_parentheses": { + "begin": "((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#inline_comment" + } + ] + }, + "2": { + "name": "comment.block.c punctuation.definition.comment.begin.c" + }, + "3": { + "name": "comment.block.c" + }, + "4": { + "patterns": [ + { + "match": "\\*\\/", + "name": "comment.block.c punctuation.definition.comment.end.c" + }, + { + "match": "\\*", + "name": "comment.block.c" + } + ] + }, + "5": { + "name": "punctuation.section.parens.begin.bracket.round.conditional.switch.c" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.parens.end.bracket.round.conditional.switch.c" + } + }, + "name": "meta.conditional.switch.c", + "patterns": [ + { + "include": "#evaluation_context" + }, + { + "include": "#c_conditional_context" + } + ] + }, + "switch_statement": { + "begin": "(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?|\\?\\?>)|(?=[;>\\[\\]=]))", + "name": "meta.block.switch.c", + "patterns": [ + { + "begin": "\\G ?", + "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "endCaptures": { + "1": { + "name": "punctuation.section.block.begin.bracket.curly.switch.c" + } + }, + "name": "meta.head.switch.c", + "patterns": [ + { + "include": "#switch_conditional_parentheses" + }, + { + "include": "$self" + } + ] + }, + { + "begin": "(?<=\\{|<%|\\?\\?<)", + "end": "(\\}|%>|\\?\\?>)", + "endCaptures": { + "1": { + "name": "punctuation.section.block.end.bracket.curly.switch.c" + } + }, + "name": "meta.body.switch.c", + "patterns": [ + { + "include": "#default_statement" + }, + { + "include": "#case_statement" + }, + { + "include": "$self" + }, + { + "include": "#block_innards" + } + ] + }, + { + "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", + "end": "[\\s\\n]*(?=;)", + "name": "meta.tail.switch.c", + "patterns": [ + { + "include": "$self" + } + ] + } + ] + }, + "vararg_ellipses": { + "match": "(?>>", + "name": "invalid.deprecated.combinator.css" + }, + { + "match": ">>|>|\\+|~", + "name": "keyword.operator.combinator.css" + } + ] + }, + "commas": { + "match": ",", + "name": "punctuation.separator.list.comma.css" + }, + "comment-block": { + "begin": "/\\*", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.css" + } + }, + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.css" + } + }, + "name": "comment.block.css" + }, + "escapes": { + "patterns": [ + { + "match": "\\\\[0-9a-fA-F]{1,6}", + "name": "constant.character.escape.codepoint.css" + }, + { + "begin": "\\\\$\\s*", + "end": "^(?<:=]|\\)|/\\*)" + }, + "media-query": { + "begin": "\\G", + "end": "(?=\\s*[{;])", + "patterns": [ + { + "include": "#comment-block" + }, + { + "include": "#escapes" + }, + { + "include": "#media-types" + }, + { + "match": "(?i)(?<=\\s|^|,|\\*/)(only|not)(?=\\s|{|/\\*|$)", + "name": "keyword.operator.logical.$1.media.css" + }, + { + "match": "(?i)(?<=\\s|^|\\*/|\\))and(?=\\s|/\\*|$)", + "name": "keyword.operator.logical.and.media.css" + }, + { + "match": ",(?:(?:\\s*,)+|(?=\\s*[;){]))", + "name": "invalid.illegal.comma.css" + }, + { + "include": "#commas" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.parameters.begin.bracket.round.css" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.css" + } + }, + "patterns": [ + { + "include": "#media-features" + }, + { + "include": "#media-feature-keywords" + }, + { + "match": ":", + "name": "punctuation.separator.key-value.css" + }, + { + "match": ">=|<=|=|<|>", + "name": "keyword.operator.comparison.css" + }, + { + "captures": { + "1": { + "name": "constant.numeric.css" + }, + "2": { + "name": "keyword.operator.arithmetic.css" + }, + "3": { + "name": "constant.numeric.css" + } + }, + "match": "(\\d+)\\s*(/)\\s*(\\d+)", + "name": "meta.ratio.css" + }, + { + "include": "#numeric-values" + }, + { + "include": "#comment-block" + } + ] + } + ] + }, + "media-query-list": { + "begin": "(?=\\s*[^{;])", + "end": "(?=\\s*[{;])", + "patterns": [ + { + "include": "#media-query" + } + ] + }, + "media-types": { + "captures": { + "1": { + "name": "support.constant.media.css" + }, + "2": { + "name": "invalid.deprecated.constant.media.css" + } + }, + "match": "(?i)(?<=^|\\s|,|\\*/)(?:(all|print|screen|speech)|(aural|braille|embossed|handheld|projection|tty|tv))(?=$|[{,\\s;]|/\\*)" + }, + "numeric-values": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.constant.css" + } + }, + "match": "(#)(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\\b", + "name": "constant.other.color.rgb-value.hex.css" + }, + { + "captures": { + "1": { + "name": "keyword.other.unit.percentage.css" + }, + "2": { + "name": "keyword.other.unit.${2:/downcase}.css" + } + }, + "match": "(?i)(?+~|]|/\\*)|(?:[-a-zA-Z_0-9]|[^\\x00-\\x7F]|\\\\(?:[0-9a-fA-F]{1,6}|.))*(?:[!\"'%&(*;+~|]|/\\*)", + "name": "entity.other.attribute-name.class.css" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.entity.css" + }, + "2": { + "patterns": [ + { + "include": "#escapes" + } + ] + } + }, + "match": "(\\#)(-?(?!\\d)(?:[-a-zA-Z0-9_]|[^\\x00-\\x7F]|\\\\(?:[0-9a-fA-F]{1,6}|.))+)(?=$|[\\s,.#)\\[:{>+~|]|/\\*)", + "name": "entity.other.attribute-name.id.css" + }, + { + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.entity.begin.bracket.square.css" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.entity.end.bracket.square.css" + } + }, + "name": "meta.attribute-selector.css", + "patterns": [ + { + "include": "#comment-block" + }, + { + "include": "#string" + }, + { + "captures": { + "1": { + "name": "storage.modifier.ignore-case.css" + } + }, + "match": "(?<=[\"'\\s]|^|\\*/)\\s*([iI])\\s*(?=[\\s\\]]|/\\*|$)" + }, + { + "captures": { + "1": { + "name": "string.unquoted.attribute-value.css", + "patterns": [ + { + "include": "#escapes" + } + ] + } + }, + "match": "(?<==)\\s*((?!/\\*)(?:[^\\\\\"'\\s\\]]|\\\\.)+)" + }, + { + "include": "#escapes" + }, + { + "match": "[~|^$*]?=", + "name": "keyword.operator.pattern.css" + }, + { + "match": "\\|", + "name": "punctuation.separator.css" + }, + { + "captures": { + "1": { + "name": "entity.other.namespace-prefix.css", + "patterns": [ + { + "include": "#escapes" + } + ] + } + }, + "match": "(-?(?!\\d)(?:[\\w-]|[^\\x00-\\x7F]|\\\\(?:[0-9a-fA-F]{1,6}|.))+|\\*)(?=\\|(?!\\s|=|$|\\])(?:-?(?!\\d)|[\\\\\\w-]|[^\\x00-\\x7F]))" + }, + { + "captures": { + "1": { + "name": "entity.other.attribute-name.css", + "patterns": [ + { + "include": "#escapes" + } + ] + } + }, + "match": "(-?(?!\\d)(?>[\\w-]|[^\\x00-\\x7F]|\\\\(?:[0-9a-fA-F]{1,6}|.))+)\\s*(?=[~|^\\]$*=]|/\\*)" + } + ] + }, + { + "include": "#pseudo-classes" + }, + { + "include": "#pseudo-elements" + }, + { + "include": "#functional-pseudo-classes" + }, + { + "match": "(?\\s,.#|){:\\[]|/\\*|$)", + "name": "entity.name.tag.css" + }, + "unicode-range": { + "captures": { + "0": { + "name": "constant.other.unicode-range.css" + }, + "1": { + "name": "punctuation.separator.dash.unicode-range.css" + } + }, + "match": "(?|<=|>=|==|!=|\\w(?:\\+|/|-|\\*|\\%)|\\w(?:\\+|/|-|\\*|\\%)=|\\|\\||\\&\\&)(?:\\s*)((?![\\[\\]]+)[0-9A-Za-z\\-_!\\.\\[\\]<>=\\*/+\\%:]+)(?:\\s*)(?=\\{))" + }, + "brackets": { + "patterns": [ + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.begin.bracket.curly.go" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.curly.go" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.begin.bracket.round.go" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.go" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.begin.bracket.square.go" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.square.go" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + } + ] + }, + "built_in_functions": { + "comment": "Built-in functions", + "patterns": [ + { + "match": "\\b(append|cap|close|complex|copy|delete|imag|len|panic|print|println|real|recover|min|max|clear)\\b(?=\\()", + "name": "entity.name.function.support.builtin.go" + }, + { + "begin": "(?:(\\bnew\\b)(\\())", + "beginCaptures": { + "1": { + "name": "entity.name.function.support.builtin.go" + }, + "2": { + "name": "punctuation.definition.begin.bracket.round.go" + } + }, + "comment": "new keyword", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.go" + } + }, + "patterns": [ + { + "include": "#functions" + }, + { + "include": "#struct_variables_types" + }, + { + "include": "#type-declarations" + }, + { + "include": "#generic_types" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + }, + { + "include": "$self" + } + ] + }, + { + "begin": "(?:(\\bmake\\b)(?:(\\()((?:(?:(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+(?:\\([^)]+\\))?)?(?:[\\[\\]\\*]+)?(?:(?!\\bmap\\b)(?:[\\w\\.]+))?(\\[(?:(?:[\\S]+)(?:(?:\\,\\s*(?:[\\S]+))*))?\\])?(?:\\,)?)?))", + "beginCaptures": { + "1": { + "name": "entity.name.function.support.builtin.go" + }, + "2": { + "name": "punctuation.definition.begin.bracket.round.go" + }, + "3": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#parameter-variable-types" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "make keyword", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.go" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + } + ] + }, + "comments": { + "patterns": [ + { + "begin": "(\\/\\*)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.go" + } + }, + "end": "(\\*\\/)", + "endCaptures": { + "1": { + "name": "punctuation.definition.comment.go" + } + }, + "name": "comment.block.go" + }, + { + "begin": "(\\/\\/)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.go" + } + }, + "end": "(?:\\n|$)", + "name": "comment.line.double-slash.go" + } + ] + }, + "delimiters": { + "patterns": [ + { + "match": "\\,", + "name": "punctuation.other.comma.go" + }, + { + "match": "\\.(?!\\.\\.)", + "name": "punctuation.other.period.go" + }, + { + "match": ":(?!=)", + "name": "punctuation.other.colon.go" + } + ] + }, + "double_parentheses_types": { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "match": "\\(", + "name": "punctuation.definition.begin.bracket.round.go" + }, + { + "match": "\\)", + "name": "punctuation.definition.end.bracket.round.go" + }, + { + "match": "\\[", + "name": "punctuation.definition.begin.bracket.square.go" + }, + { + "match": "\\]", + "name": "punctuation.definition.end.bracket.square.go" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "double parentheses types", + "match": "(?:(?\\-]+(?:\\s*)(?:\\/(?:\\/|\\*).*)?)$)" + }, + { + "include": "$self" + } + ] + }, + "function_param_types": { + "comment": "function parameter variables and types", + "patterns": [ + { + "include": "#struct_variables_types" + }, + { + "include": "#interface_variables_types" + }, + { + "include": "#type-declarations-without-brackets" + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.parameter.go" + } + ] + } + }, + "comment": "struct/interface type declaration", + "match": "((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)\\s+(?=(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?:[\\[\\]\\*]+)?\\b(?:struct|interface)\\b\\s*\\{)" + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.parameter.go" + } + ] + } + }, + "comment": "multiple parameters one type -with multilines", + "match": "(?:(?:(?<=\\()|^\\s*)((?:(?:\\b\\w+\\,\\s*)+)(?:/(?:/|\\*).*)?)$)" + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "match": "\\w+", + "name": "variable.parameter.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#parameter-variable-types" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "multiple params and types | multiple params one type | one param one type", + "match": "(?:((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)(?:\\s+)((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?:(?:(?:[\\w\\[\\]\\.\\*]+)?(?:(?:\\bfunc\\b\\((?:[^)]+)?\\))(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?:\\s*))+(?:(?:(?:[\\w\\*\\.\\[\\]]+)|(?:\\((?:[^)]+)?\\))))?)|(?:(?:[\\[\\]\\*]+)?[\\w\\*\\.]+(?:\\[(?:[^\\]]+)\\])?(?:[\\w\\.\\*]+)?)+)))" + }, + { + "include": "#parameter-variable-types" + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "other types", + "match": "([\\w\\.]+)" + }, + { + "include": "$self" + } + ] + }, + "functions": { + "begin": "(?:(\\bfunc\\b)(?=\\())", + "beginCaptures": { + "1": { + "name": "keyword.function.go" + } + }, + "comment": "Functions", + "end": "(?:(?<=\\))(\\s*(?:(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?((?:(?:\\s*(?:(?:[\\[\\]\\*]+)?[\\w\\.\\*]+)?(?:(?:\\[(?:(?:[\\w\\.\\*]+)?(?:\\[(?:[^\\]]+)?\\])?(?:\\,\\s+)?)+\\])|(?:\\((?:[^)]+)?\\)))?(?:[\\w\\.\\*]+)?)(?:\\s*)(?=\\{))|(?:\\s*(?:(?:(?:[\\[\\]\\*]+)?(?!\\bfunc\\b)(?:[\\w\\.\\*]+)(?:\\[(?:(?:[\\w\\.\\*]+)?(?:\\[(?:[^\\]]+)?\\])?(?:\\,\\s+)?)+\\])?(?:[\\w\\.\\*]+)?)|(?:\\((?:[^)]+)?\\)))))?)", + "endCaptures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#parameter-variable-types" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + }, + "patterns": [ + { + "include": "#parameter-variable-types" + } + ] + }, + "functions_inline": { + "captures": { + "1": { + "name": "keyword.function.go" + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.begin.bracket.round.go" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.go" + } + }, + "patterns": [ + { + "include": "#function_param_types" + }, + { + "include": "$self" + } + ] + }, + { + "match": "\\[", + "name": "punctuation.definition.begin.bracket.square.go" + }, + { + "match": "\\]", + "name": "punctuation.definition.end.bracket.square.go" + }, + { + "match": "\\{", + "name": "punctuation.definition.begin.bracket.curly.go" + }, + { + "match": "\\}", + "name": "punctuation.definition.end.bracket.curly.go" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "functions in-line with multi return types", + "match": "(?:(\\bfunc\\b)((?:\\((?:[^/]*?)\\))(?:\\s+)(?:\\((?:[^/]*?)\\)))(?:\\s+)(?=\\{))" + }, + "generic_param_types": { + "comment": "generic parameter variables and types", + "patterns": [ + { + "include": "#struct_variables_types" + }, + { + "include": "#interface_variables_types" + }, + { + "include": "#type-declarations-without-brackets" + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.parameter.go" + } + ] + } + }, + "comment": "struct/interface type declaration", + "match": "((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)\\s+(?=(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?:[\\[\\]\\*]+)?\\b(?:struct|interface)\\b\\s*\\{)" + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.parameter.go" + } + ] + } + }, + "comment": "multiple parameters one type -with multilines", + "match": "(?:(?:(?<=\\()|^\\s*)((?:(?:\\b\\w+\\,\\s*)+)(?:/(?:/|\\*).*)?)$)" + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "match": "\\w+", + "name": "variable.parameter.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#parameter-variable-types" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + }, + "3": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "multiple params and types | multiple types one param", + "match": "(?:((?:(?:\\b\\w+\\,\\s*)+)?\\b\\w+)(?:\\s+)((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?:(?:(?:[\\w\\[\\]\\.\\*]+)?(?:(?:\\bfunc\\b\\((?:[^)]+)?\\))(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?:\\s*))+(?:(?:(?:[\\w\\*\\.]+)|(?:\\((?:[^)]+)?\\))))?)|(?:(?:(?:[\\w\\*\\.\\~]+)|(?:\\[(?:(?:[\\w\\.\\*]+)?(?:\\[(?:[^\\]]+)?\\])?(?:\\,\\s+)?)+\\]))(?:[\\w\\.\\*]+)?)+)))" + }, + { + "include": "#parameter-variable-types" + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "other types", + "match": "(?:\\b([\\w\\.]+))" + }, + { + "include": "$self" + } + ] + }, + "generic_types": { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#parameter-variable-types" + } + ] + } + }, + "comment": "Generic support for all types", + "match": "(?:([\\w\\.\\*]+)(\\[(?:[^\\]]+)?\\]))" + }, + "group-functions": { + "comment": "all statements related to functions", + "patterns": [ + { + "include": "#function_declaration" + }, + { + "include": "#functions_inline" + }, + { + "include": "#functions" + }, + { + "include": "#built_in_functions" + }, + { + "include": "#support_functions" + } + ] + }, + "group-types": { + "comment": "all statements related to types", + "patterns": [ + { + "include": "#other_struct_interface_expressions" + }, + { + "include": "#type_assertion_inline" + }, + { + "include": "#struct_variables_types" + }, + { + "include": "#interface_variables_types" + }, + { + "include": "#single_type" + }, + { + "include": "#multi_types" + }, + { + "include": "#struct_interface_declaration" + }, + { + "include": "#double_parentheses_types" + }, + { + "include": "#switch_types" + }, + { + "include": "#type-declarations" + } + ] + }, + "group-variables": { + "comment": "all statements related to variables", + "patterns": [ + { + "include": "#var_const_assignment" + }, + { + "include": "#variable_assignment" + }, + { + "include": "#label_loop_variables" + }, + { + "include": "#slice_index_variables" + }, + { + "include": "#property_variables" + }, + { + "include": "#switch_select_case_variables" + }, + { + "include": "#other_variables" + } + ] + }, + "import": { + "comment": "import", + "patterns": [ + { + "begin": "\\b(import)\\s+", + "beginCaptures": { + "1": { + "name": "keyword.control.import.go" + } + }, + "comment": "import", + "end": "(?!\\G)", + "patterns": [ + { + "include": "#imports" + } + ] + } + ] + }, + "imports": { + "comment": "import package(s)", + "patterns": [ + { + "captures": { + "1": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "match": "(?:\\w+)", + "name": "variable.other.import.go" + } + ] + }, + "2": { + "name": "string.quoted.double.go" + }, + "3": { + "name": "punctuation.definition.string.begin.go" + }, + "4": { + "name": "entity.name.import.go" + }, + "5": { + "name": "punctuation.definition.string.end.go" + } + }, + "match": "(\\s*[\\w\\.]+)?\\s*((\")([^\"]*)(\"))" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.imports.begin.bracket.round.go" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.imports.end.bracket.round.go" + } + }, + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#imports" + } + ] + }, + { + "include": "$self" + } + ] + }, + "interface_variables_types": { + "begin": "(\\binterface\\b)\\s*(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.interface.go" + }, + "2": { + "name": "punctuation.definition.begin.bracket.curly.go" + } + }, + "comment": "interface variable types", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.curly.go" + } + }, + "patterns": [ + { + "include": "#interface_variables_types_field" + }, + { + "include": "$self" + } + ] + }, + "interface_variables_types_field": { + "comment": "interface variable type fields", + "patterns": [ + { + "include": "#support_functions" + }, + { + "include": "#type-declarations-without-brackets" + }, + { + "begin": "(?:([\\w\\.\\*]+)?(\\[))", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + }, + "2": { + "name": "punctuation.definition.begin.bracket.square.go" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.square.go" + } + }, + "patterns": [ + { + "include": "#generic_param_types" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.begin.bracket.round.go" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.go" + } + }, + "patterns": [ + { + "include": "#function_param_types" + } + ] + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "other types", + "match": "([\\w\\.]+)" + } + ] + }, + "keywords": { + "patterns": [ + { + "comment": "Flow control keywords", + "match": "\\b(break|case|continue|default|defer|else|fallthrough|for|go|goto|if|range|return|select|switch)\\b", + "name": "keyword.control.go" + }, + { + "match": "\\bchan\\b", + "name": "keyword.channel.go" + }, + { + "match": "\\bconst\\b", + "name": "keyword.const.go" + }, + { + "match": "\\bvar\\b", + "name": "keyword.var.go" + }, + { + "match": "\\bfunc\\b", + "name": "keyword.function.go" + }, + { + "match": "\\binterface\\b", + "name": "keyword.interface.go" + }, + { + "match": "\\bmap\\b", + "name": "keyword.map.go" + }, + { + "match": "\\bstruct\\b", + "name": "keyword.struct.go" + }, + { + "match": "\\bimport\\b", + "name": "keyword.control.import.go" + }, + { + "match": "\\btype\\b", + "name": "keyword.type.go" + } + ] + }, + "label_loop_variables": { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.other.label.go" + } + ] + } + }, + "comment": "labeled loop variable name", + "match": "((?:^\\s*\\w+:\\s*$)|(?:^\\s*(?:\\bbreak\\b|\\bgoto\\b|\\bcontinue\\b)\\s+\\w+(?:\\s*/(?:/|\\*)\\s*.*)?$))" + }, + "language_constants": { + "captures": { + "1": { + "name": "constant.language.boolean.go" + }, + "2": { + "name": "constant.language.null.go" + }, + "3": { + "name": "constant.language.iota.go" + } + }, + "comment": "Language constants", + "match": "\\b(?:(true|false)|(nil)|(iota))\\b" + }, + "map_types": { + "begin": "(?:(\\bmap\\b)(\\[))", + "beginCaptures": { + "1": { + "name": "keyword.map.go" + }, + "2": { + "name": "punctuation.definition.begin.bracket.square.go" + } + }, + "comment": "map types", + "end": "(?:(\\])((?:(?:(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?!(?:[\\[\\]\\*]+)?\\b(?:func|struct|map)\\b)(?:[\\*\\[\\]]+)?(?:[\\w\\.]+)(?:\\[(?:(?:[\\w\\.\\*\\[\\]{}]+)(?:(?:\\,\\s*(?:[\\w\\.\\*\\[\\]{}]+))*))?\\])?)?)", + "endCaptures": { + "1": { + "name": "punctuation.definition.end.bracket.square.go" + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "match": "\\[", + "name": "punctuation.definition.begin.bracket.square.go" + }, + { + "match": "\\]", + "name": "punctuation.definition.end.bracket.square.go" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + } + }, + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#parameter-variable-types" + }, + { + "include": "#functions" + }, + { + "match": "\\[", + "name": "punctuation.definition.begin.bracket.square.go" + }, + { + "match": "\\]", + "name": "punctuation.definition.end.bracket.square.go" + }, + { + "match": "\\{", + "name": "punctuation.definition.begin.bracket.curly.go" + }, + { + "match": "\\}", + "name": "punctuation.definition.end.bracket.curly.go" + }, + { + "match": "\\(", + "name": "punctuation.definition.begin.bracket.round.go" + }, + { + "match": "\\)", + "name": "punctuation.definition.end.bracket.round.go" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + }, + "multi_types": { + "begin": "(\\btype\\b)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.type.go" + }, + "2": { + "name": "punctuation.definition.begin.bracket.round.go" + } + }, + "comment": "multi type declaration", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.go" + } + }, + "patterns": [ + { + "include": "#struct_variables_types" + }, + { + "include": "#interface_variables_types" + }, + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#parameter-variable-types" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + }, + "numeric_literals": { + "captures": { + "0": { + "patterns": [ + { + "begin": "(?=.)", + "end": "(?:\\n|$)", + "patterns": [ + { + "captures": { + "1": { + "name": "constant.numeric.decimal.go", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric.go" + } + ] + }, + "10": { + "name": "keyword.other.unit.imaginary.go" + }, + "11": { + "name": "constant.numeric.decimal.go", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric.go" + } + ] + }, + "12": { + "name": "punctuation.separator.constant.numeric.go" + }, + "13": { + "name": "keyword.other.unit.exponent.decimal.go" + }, + "14": { + "name": "keyword.operator.plus.exponent.decimal.go" + }, + "15": { + "name": "keyword.operator.minus.exponent.decimal.go" + }, + "16": { + "name": "constant.numeric.exponent.decimal.go", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric.go" + } + ] + }, + "17": { + "name": "keyword.other.unit.imaginary.go" + }, + "18": { + "name": "constant.numeric.decimal.point.go" + }, + "19": { + "name": "constant.numeric.decimal.go", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric.go" + } + ] + }, + "2": { + "name": "punctuation.separator.constant.numeric.go" + }, + "20": { + "name": "punctuation.separator.constant.numeric.go" + }, + "21": { + "name": "keyword.other.unit.exponent.decimal.go" + }, + "22": { + "name": "keyword.operator.plus.exponent.decimal.go" + }, + "23": { + "name": "keyword.operator.minus.exponent.decimal.go" + }, + "24": { + "name": "constant.numeric.exponent.decimal.go", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric.go" + } + ] + }, + "25": { + "name": "keyword.other.unit.imaginary.go" + }, + "26": { + "name": "keyword.other.unit.hexadecimal.go" + }, + "27": { + "name": "constant.numeric.hexadecimal.go", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric.go" + } + ] + }, + "28": { + "name": "punctuation.separator.constant.numeric.go" + }, + "29": { + "name": "constant.numeric.hexadecimal.go" + }, + "3": { + "name": "constant.numeric.decimal.point.go" + }, + "30": { + "name": "constant.numeric.hexadecimal.go", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric.go" + } + ] + }, + "31": { + "name": "punctuation.separator.constant.numeric.go" + }, + "32": { + "name": "keyword.other.unit.exponent.hexadecimal.go" + }, + "33": { + "name": "keyword.operator.plus.exponent.hexadecimal.go" + }, + "34": { + "name": "keyword.operator.minus.exponent.hexadecimal.go" + }, + "35": { + "name": "constant.numeric.exponent.hexadecimal.go", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric.go" + } + ] + }, + "36": { + "name": "keyword.other.unit.imaginary.go" + }, + "37": { + "name": "keyword.other.unit.hexadecimal.go" + }, + "38": { + "name": "constant.numeric.hexadecimal.go", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric.go" + } + ] + }, + "39": { + "name": "punctuation.separator.constant.numeric.go" + }, + "4": { + "name": "constant.numeric.decimal.go", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric.go" + } + ] + }, + "40": { + "name": "keyword.other.unit.exponent.hexadecimal.go" + }, + "41": { + "name": "keyword.operator.plus.exponent.hexadecimal.go" + }, + "42": { + "name": "keyword.operator.minus.exponent.hexadecimal.go" + }, + "43": { + "name": "constant.numeric.exponent.hexadecimal.go", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric.go" + } + ] + }, + "44": { + "name": "keyword.other.unit.imaginary.go" + }, + "45": { + "name": "keyword.other.unit.hexadecimal.go" + }, + "46": { + "name": "constant.numeric.hexadecimal.go" + }, + "47": { + "name": "constant.numeric.hexadecimal.go", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric.go" + } + ] + }, + "48": { + "name": "punctuation.separator.constant.numeric.go" + }, + "49": { + "name": "keyword.other.unit.exponent.hexadecimal.go" + }, + "5": { + "name": "punctuation.separator.constant.numeric.go" + }, + "50": { + "name": "keyword.operator.plus.exponent.hexadecimal.go" + }, + "51": { + "name": "keyword.operator.minus.exponent.hexadecimal.go" + }, + "52": { + "name": "constant.numeric.exponent.hexadecimal.go", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric.go" + } + ] + }, + "53": { + "name": "keyword.other.unit.imaginary.go" + }, + "6": { + "name": "keyword.other.unit.exponent.decimal.go" + }, + "7": { + "name": "keyword.operator.plus.exponent.decimal.go" + }, + "8": { + "name": "keyword.operator.minus.exponent.decimal.go" + }, + "9": { + "name": "constant.numeric.exponent.decimal.go", + "patterns": [ + { + "match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])", + "name": "punctuation.separator.constant.numeric.go" + } + ] + } + }, + "match": "(?:(?:(?:(?:(?:\\G(?=[0-9.])(?!0[xXbBoO])(\\d(?:\\d|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)((?:(?<=\\d)\\.|\\.(?=\\d)))(\\d(?:\\d|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)?(?:(?=|<(?!<)|>(?!>))", + "name": "keyword.operator.comparison.go" + }, + { + "match": "(&&|\\|\\||!)", + "name": "keyword.operator.logical.go" + }, + { + "match": "(=|\\+=|-=|\\|=|\\^=|\\*=|/=|:=|%=|<<=|>>=|&\\^=|&=)", + "name": "keyword.operator.assignment.go" + }, + { + "match": "(\\+|-|\\*|/|%)", + "name": "keyword.operator.arithmetic.go" + }, + { + "match": "(&(?!\\^)|\\||\\^|&\\^|<<|>>|\\~)", + "name": "keyword.operator.arithmetic.bitwise.go" + }, + { + "match": "\\.\\.\\.", + "name": "keyword.operator.ellipsis.go" + } + ] + }, + "other_struct_interface_expressions": { + "comment": "struct and interface expression in-line (before curly bracket)", + "patterns": [ + { + "comment": "after control variables must be added exactly here, do not move it! (changing may not affect tests, so be careful!)", + "include": "#after_control_variables" + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + }, + "2": { + "patterns": [ + { + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.begin.bracket.square.go" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.square.go" + } + }, + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + }, + { + "include": "$self" + } + ] + } + ] + } + }, + "match": "(\\b[\\w\\.]+)(\\[(?:[^\\]]+)?\\])?(?=\\{)(?\\|\\&]+:)|(?::\\b[\\w\\.\\*+/\\-\\%<>\\|\\&]+))(?:\\b[\\w\\.\\*+/\\-\\%<>\\|\\&]+)?(?::\\b[\\w\\.\\*+/\\-\\%<>\\|\\&]+)?)(?=\\])" + }, + "statements": { + "patterns": [ + { + "include": "#package_name" + }, + { + "include": "#import" + }, + { + "include": "#syntax_errors" + }, + { + "include": "#group-functions" + }, + { + "include": "#group-types" + }, + { + "include": "#group-variables" + }, + { + "include": "#field_hover" + } + ] + }, + "storage_types": { + "patterns": [ + { + "match": "\\bbool\\b", + "name": "storage.type.boolean.go" + }, + { + "match": "\\bbyte\\b", + "name": "storage.type.byte.go" + }, + { + "match": "\\berror\\b", + "name": "storage.type.error.go" + }, + { + "match": "\\b(complex(64|128)|float(32|64)|u?int(8|16|32|64)?)\\b", + "name": "storage.type.numeric.go" + }, + { + "match": "\\brune\\b", + "name": "storage.type.rune.go" + }, + { + "match": "\\bstring\\b", + "name": "storage.type.string.go" + }, + { + "match": "\\buintptr\\b", + "name": "storage.type.uintptr.go" + }, + { + "match": "\\bany\\b", + "name": "entity.name.type.any.go" + } + ] + }, + "string_escaped_char": { + "patterns": [ + { + "match": "\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})", + "name": "constant.character.escape.go" + }, + { + "match": "\\\\[^0-7xuUabfnrtv\\'\"]", + "name": "invalid.illegal.unknown-escape.go" + } + ] + }, + "string_literals": { + "patterns": [ + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.go" + } + }, + "comment": "Interpreted string literals", + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.go" + } + }, + "name": "string.quoted.double.go", + "patterns": [ + { + "include": "#string_escaped_char" + }, + { + "include": "#string_placeholder" + } + ] + } + ] + }, + "string_placeholder": { + "patterns": [ + { + "match": "%(\\[\\d+\\])?([+#\\-0\\x20]{,2}((\\d+|\\*)?(\\.?(\\d+|\\*|(\\[\\d+\\])\\*?)?(\\[\\d+\\])?)?))?[vT%tbcdoqxXUbeEfFgGspw]", + "name": "constant.other.placeholder.go" + } + ] + }, + "struct_interface_declaration": { + "captures": { + "1": { + "name": "keyword.type.go" + }, + "2": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "struct, interface type declarations (related to: struct_variables_types, interface_variables_types)", + "match": "(?:(?:^\\s*)(\\btype\\b)(?:\\s*)([\\w\\.]+))" + }, + "struct_variable_types_fields_multi": { + "comment": "struct variable and type fields with multi lines", + "patterns": [ + { + "begin": "(?:((?:\\w+(?:\\,\\s*\\w+)*)(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?:\\s+)(?:[\\[\\]\\*]+)?)(\\bstruct\\b)(?:\\s*)(\\{))", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.other.property.go" + } + ] + }, + "2": { + "name": "keyword.struct.go" + }, + "3": { + "name": "punctuation.definition.begin.bracket.curly.go" + } + }, + "comment": "struct in struct types", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.curly.go" + } + }, + "patterns": [ + { + "include": "#struct_variables_types_fields" + }, + { + "include": "$self" + } + ] + }, + { + "begin": "(?:((?:\\w+(?:\\,\\s*\\w+)*)(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?:\\s+)(?:[\\[\\]\\*]+)?)(\\binterface\\b)(?:\\s*)(\\{))", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.other.property.go" + } + ] + }, + "2": { + "name": "keyword.interface.go" + }, + "3": { + "name": "punctuation.definition.begin.bracket.curly.go" + } + }, + "comment": "interface in struct types", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.curly.go" + } + }, + "patterns": [ + { + "include": "#interface_variables_types_field" + }, + { + "include": "$self" + } + ] + }, + { + "begin": "(?:((?:\\w+(?:\\,\\s*\\w+)*)(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?:\\s+)(?:[\\[\\]\\*]+)?)(\\bfunc\\b)(?:\\s*)(\\())", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.other.property.go" + } + ] + }, + "2": { + "name": "keyword.function.go" + }, + "3": { + "name": "punctuation.definition.begin.bracket.round.go" + } + }, + "comment": "function in struct types", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.go" + } + }, + "patterns": [ + { + "include": "#function_param_types" + }, + { + "include": "$self" + } + ] + }, + { + "include": "#parameter-variable-types" + } + ] + }, + "struct_variables_types": { + "begin": "(\\bstruct\\b)\\s*(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.struct.go" + }, + "2": { + "name": "punctuation.definition.begin.bracket.curly.go" + } + }, + "comment": "Struct variable type", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.curly.go" + } + }, + "patterns": [ + { + "include": "#struct_variables_types_fields" + }, + { + "include": "$self" + } + ] + }, + "struct_variables_types_fields": { + "comment": "Struct variable type fields", + "patterns": [ + { + "include": "#struct_variable_types_fields_multi" + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "one line - single type", + "match": "(?:(?<=\\{)\\s*((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?:[\\w\\.\\*\\[\\]]+))\\s*(?=\\}))" + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "variable.other.property.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "one line - property variables and types", + "match": "(?:(?<=\\{)\\s*((?:(?:\\w+\\,\\s*)+)?(?:\\w+\\s+))((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?:[\\w\\.\\*\\[\\]]+))\\s*(?=\\}))" + }, + { + "captures": { + "1": { + "patterns": [ + { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "variable.other.property.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + }, + "match": "(?:((?:(?:\\w+\\,\\s*)+)?(?:\\w+\\s+))?((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?:[\\S]+)(?:\\;)?))" + } + ] + } + }, + "comment": "one line with semicolon(;) without formatting gofmt - single type | property variables and types", + "match": "(?:(?<=\\{)((?:\\s*(?:(?:(?:\\w+\\,\\s*)+)?(?:\\w+\\s+))?(?:(?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?:[\\S]+)(?:\\;)?))+)\\s*(?=\\}))" + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "one type only", + "match": "(?:((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?(?:[\\w\\.\\*]+)\\s*)(?:(?=\\`|\\/|\")|$))" + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "variable.other.property.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#parameter-variable-types" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "property variables and types", + "match": "(?:((?:(?:\\w+\\,\\s*)+)?(?:\\w+\\s+))([^\\`\"\\/]+))" + } + ] + }, + "support_functions": { + "captures": { + "1": { + "name": "entity.name.function.support.go" + }, + "2": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\d\\w*", + "name": "invalid.illegal.identifier.go" + }, + { + "match": "\\w+", + "name": "entity.name.function.support.go" + } + ] + }, + "3": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "match": "\\[", + "name": "punctuation.definition.begin.bracket.square.go" + }, + { + "match": "\\]", + "name": "punctuation.definition.end.bracket.square.go" + }, + { + "match": "\\{", + "name": "punctuation.definition.begin.bracket.curly.go" + }, + { + "match": "\\}", + "name": "punctuation.definition.end.bracket.curly.go" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "Support Functions", + "match": "(?:(?:((?<=\\.)\\b\\w+)|(\\b\\w+))(\\[(?:(?:[\\w\\.\\*\\[\\]{}\"\\']+)(?:(?:\\,\\s*(?:[\\w\\.\\*\\[\\]{}]+))*))?\\])?(?=\\())" + }, + "switch_select_case_variables": { + "captures": { + "1": { + "name": "keyword.control.go" + }, + "2": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "include": "#support_functions" + }, + { + "include": "#variable_assignment" + }, + { + "match": "\\w+", + "name": "variable.other.go" + } + ] + } + }, + "comment": "variables after case control keyword in switch/select expression, to not scope them as property variables", + "match": "(?:(?:^\\s*(\\bcase\\b))(?:\\s+)([\\s\\S]+(?::)\\s*(?:/(?:/|\\*).*)?)$)" + }, + "switch_types": { + "begin": "(?<=\\bswitch\\b)(?:\\s*)(?:(\\w+\\s*:=)?\\s*([\\w\\.\\*()\\[\\]+/\\-\\%<>\\|\\&]+))(\\.\\(\\btype\\b\\)\\s*)(\\{)", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#operators" + }, + { + "match": "\\w+", + "name": "variable.other.assignment.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#support_functions" + }, + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "variable.other.go" + } + ] + }, + "3": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "include": "#brackets" + }, + { + "match": "\\btype\\b", + "name": "keyword.type.go" + } + ] + }, + "4": { + "name": "punctuation.definition.begin.bracket.curly.go" + } + }, + "comment": "switch type assertions, only highlights types after case keyword", + "end": "(?:\\})", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.curly.go" + } + }, + "patterns": [ + { + "captures": { + "1": { + "name": "keyword.control.go" + }, + "2": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + }, + "3": { + "name": "punctuation.other.colon.go" + }, + "4": { + "patterns": [ + { + "include": "#comments" + } + ] + } + }, + "comment": "types after case keyword with single line", + "match": "(?:^\\s*(\\bcase\\b))(?:\\s+)([\\w\\.\\,\\*=<>!\\s]+)(:)(\\s*/(?:/|\\*)\\s*.*)?$" + }, + { + "begin": "\\bcase\\b", + "beginCaptures": { + "0": { + "name": "keyword.control.go" + } + }, + "comment": "types after case keyword with multi lines", + "end": ":", + "endCaptures": { + "0": { + "name": "punctuation.other.colon.go" + } + }, + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + }, + { + "include": "$self" + } + ] + }, + "syntax_errors": { + "patterns": [ + { + "captures": { + "1": { + "name": "invalid.illegal.slice.go" + } + }, + "comment": "Syntax error using slices", + "match": "\\[\\](\\s+)" + }, + { + "comment": "Syntax error numeric literals", + "match": "\\b0[0-7]*[89]\\d*\\b", + "name": "invalid.illegal.numeric.go" + } + ] + }, + "terminators": { + "comment": "Terminators", + "match": ";", + "name": "punctuation.terminator.go" + }, + "type-declarations": { + "comment": "includes all type declarations", + "patterns": [ + { + "include": "#language_constants" + }, + { + "include": "#comments" + }, + { + "include": "#map_types" + }, + { + "include": "#brackets" + }, + { + "include": "#delimiters" + }, + { + "include": "#keywords" + }, + { + "include": "#operators" + }, + { + "include": "#runes" + }, + { + "include": "#storage_types" + }, + { + "include": "#raw_string_literals" + }, + { + "include": "#string_literals" + }, + { + "include": "#numeric_literals" + }, + { + "include": "#terminators" + } + ] + }, + "type-declarations-without-brackets": { + "comment": "includes all type declarations without brackets (in some cases, brackets need to be captured manually)", + "patterns": [ + { + "include": "#language_constants" + }, + { + "include": "#comments" + }, + { + "include": "#map_types" + }, + { + "include": "#delimiters" + }, + { + "include": "#keywords" + }, + { + "include": "#operators" + }, + { + "include": "#runes" + }, + { + "include": "#storage_types" + }, + { + "include": "#raw_string_literals" + }, + { + "include": "#string_literals" + }, + { + "include": "#numeric_literals" + }, + { + "include": "#terminators" + } + ] + }, + "type_assertion_inline": { + "captures": { + "1": { + "name": "keyword.type.go" + }, + "2": { + "patterns": [ + { + "include": "#type-declarations" + }, + { + "match": "(?:\\w+)", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "struct/interface types in-line (type assertion) | switch type keyword", + "match": "(?:(?<=\\.\\()(?:(\\btype\\b)|((?:(?:\\s*(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+)?[\\w\\.\\[\\]\\*]+))(?=\\)))" + }, + "var_const_assignment": { + "comment": "variable assignment with var and const keyword", + "patterns": [ + { + "captures": { + "1": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "match": "\\w+", + "name": "variable.other.assignment.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#generic_types" + }, + { + "match": "\\(", + "name": "punctuation.definition.begin.bracket.round.go" + }, + { + "match": "\\)", + "name": "punctuation.definition.end.bracket.round.go" + }, + { + "match": "\\[", + "name": "punctuation.definition.begin.bracket.square.go" + }, + { + "match": "\\]", + "name": "punctuation.definition.end.bracket.square.go" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + } + }, + "comment": "var and const with single type assignment", + "match": "(?:(?<=\\bvar\\b|\\bconst\\b)(?:\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+(?:\\([^)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:=)?)?)" + }, + { + "begin": "(?:(?<=\\bvar\\b|\\bconst\\b)(?:\\s*)(\\())", + "beginCaptures": { + "1": { + "name": "punctuation.definition.begin.bracket.round.go" + } + }, + "comment": "var and const with multi type assignment", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.go" + } + }, + "patterns": [ + { + "captures": { + "1": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "match": "\\w+", + "name": "variable.other.assignment.go" + } + ] + }, + "2": { + "patterns": [ + { + "include": "#type-declarations-without-brackets" + }, + { + "include": "#generic_types" + }, + { + "match": "\\(", + "name": "punctuation.definition.begin.bracket.round.go" + }, + { + "match": "\\)", + "name": "punctuation.definition.end.bracket.round.go" + }, + { + "match": "\\[", + "name": "punctuation.definition.begin.bracket.square.go" + }, + { + "match": "\\]", + "name": "punctuation.definition.end.bracket.square.go" + }, + { + "match": "\\w+", + "name": "entity.name.type.go" + } + ] + } + }, + "match": "(?:(?:^\\s*)(\\b[\\w\\.]+(?:\\,\\s*[\\w\\.]+)*)(?:\\s*)((?:(?:(?:[\\*\\[\\]]+)?(?:<-\\s*)?\\bchan\\b(?:\\s*<-)?\\s*)+(?:\\([^)]+\\))?)?(?!(?:[\\[\\]\\*]+)?\\b(?:struct|func|map)\\b)(?:[\\w\\.\\[\\]\\*]+(?:\\,\\s*[\\w\\.\\[\\]\\*]+)*)?(?:\\s*)(?:=)?)?)" + }, + { + "include": "$self" + } + ] + } + ] + }, + "variable_assignment": { + "comment": "variable assignment", + "patterns": [ + { + "captures": { + "0": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "match": "\\d\\w*", + "name": "invalid.illegal.identifier.go" + }, + { + "match": "\\w+", + "name": "variable.other.assignment.go" + } + ] + } + }, + "comment": "variable assignment with :=", + "match": "\\b\\w+(?:\\,\\s*\\w+)*(?=\\s*:=)" + }, + { + "captures": { + "0": { + "patterns": [ + { + "include": "#delimiters" + }, + { + "include": "#operators" + }, + { + "match": "\\d\\w*", + "name": "invalid.illegal.identifier.go" + }, + { + "match": "\\w+", + "name": "variable.other.assignment.go" + } + ] + } + }, + "comment": "variable assignment with =", + "match": "\\b[\\w\\.\\*]+(?:\\,\\s*[\\w\\.\\*]+)*(?=\\s*=(?!=))" + } + ] + } + }, + "scopeName": "source.go" +} \ No newline at end of file diff --git a/languages/html.json b/languages/html.json new file mode 100644 index 0000000..81ad0bf --- /dev/null +++ b/languages/html.json @@ -0,0 +1,2638 @@ +{ + "displayName": "HTML", + "injections": { + "R:text.html - (comment.block, text.html meta.embedded, meta.tag.*.*.html, meta.tag.*.*.*.html, meta.tag.*.*.*.*.html)": { + "comment": "Uses R: to ensure this matches after any other injections.", + "patterns": [ + { + "match": "<", + "name": "invalid.illegal.bad-angle-bracket.html" + } + ] + } + }, + "name": "html", + "patterns": [ + { + "include": "#xml-processing" + }, + { + "include": "#comment" + }, + { + "include": "#doctype" + }, + { + "include": "#cdata" + }, + { + "include": "#tags-valid" + }, + { + "include": "#tags-invalid" + }, + { + "include": "#entities" + } + ], + "repository": { + "attribute": { + "patterns": [ + { + "begin": "(s(hape|cope|t(ep|art)|ize(s)?|p(ellcheck|an)|elected|lot|andbox|rc(set|doc|lang)?)|h(ttp-equiv|i(dden|gh)|e(ight|aders)|ref(lang)?)|n(o(nce|validate|module)|ame)|c(h(ecked|arset)|ite|o(nt(ent(editable)?|rols)|ords|l(s(pan)?|or))|lass|rossorigin)|t(ype(mustmatch)?|itle|a(rget|bindex)|ranslate)|i(s(map)?|n(tegrity|putmode)|tem(scope|type|id|prop|ref)|d)|op(timum|en)|d(i(sabled|r(name)?)|ownload|e(coding|f(er|ault))|at(etime|a)|raggable)|usemap|p(ing|oster|la(ysinline|ceholder)|attern|reload)|enctype|value|kind|for(m(novalidate|target|enctype|action|method)?)?|w(idth|rap)|l(ist|o(op|w)|a(ng|bel))|a(s(ync)?|c(ce(sskey|pt(-charset)?)|tion)|uto(c(omplete|apitalize)|play|focus)|l(t|low(usermedia|paymentrequest|fullscreen))|bbr)|r(ows(pan)?|e(versed|quired|ferrerpolicy|l|adonly))|m(in(length)?|u(ted|ltiple)|e(thod|dia)|a(nifest|x(length)?)))(?![\\w:-])", + "beginCaptures": { + "0": { + "name": "entity.other.attribute-name.html" + } + }, + "comment": "HTML5 attributes, not event handlers", + "end": "(?=\\s*+[^=\\s])", + "name": "meta.attribute.$1.html", + "patterns": [ + { + "include": "#attribute-interior" + } + ] + }, + { + "begin": "style(?![\\w:-])", + "beginCaptures": { + "0": { + "name": "entity.other.attribute-name.html" + } + }, + "comment": "HTML5 style attribute", + "end": "(?=\\s*+[^=\\s])", + "name": "meta.attribute.style.html", + "patterns": [ + { + "begin": "=", + "beginCaptures": { + "0": { + "name": "punctuation.separator.key-value.html" + } + }, + "end": "(?<=[^\\s=])(?!\\s*=)|(?=/?>)", + "patterns": [ + { + "begin": "(?=[^\\s=<>`/]|/(?!>))", + "end": "(?!\\G)", + "name": "meta.embedded.line.css", + "patterns": [ + { + "captures": { + "0": { + "name": "source.css" + } + }, + "match": "([^\\s\"'=<>`/]|/(?!>))+", + "name": "string.unquoted.html" + }, + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.html" + } + }, + "contentName": "source.css", + "end": "(\")", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.html" + }, + "1": { + "name": "source.css" + } + }, + "name": "string.quoted.double.html", + "patterns": [ + { + "include": "#entities" + } + ] + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.html" + } + }, + "contentName": "source.css", + "end": "(')", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.html" + }, + "1": { + "name": "source.css" + } + }, + "name": "string.quoted.single.html", + "patterns": [ + { + "include": "#entities" + } + ] + } + ] + }, + { + "match": "=", + "name": "invalid.illegal.unexpected-equals-sign.html" + } + ] + } + ] + }, + { + "begin": "on(s(croll|t(orage|alled)|u(spend|bmit)|e(curitypolicyviolation|ek(ing|ed)|lect))|hashchange|c(hange|o(ntextmenu|py)|u(t|echange)|l(ick|ose)|an(cel|play(through)?))|t(imeupdate|oggle)|in(put|valid)|o(nline|ffline)|d(urationchange|r(op|ag(start|over|e(n(ter|d)|xit)|leave)?)|blclick)|un(handledrejection|load)|p(opstate|lay(ing)?|a(ste|use|ge(show|hide))|rogress)|e(nded|rror|mptied)|volumechange|key(down|up|press)|focus|w(heel|aiting)|l(oad(start|e(nd|d(data|metadata)))?|anguagechange)|a(uxclick|fterprint|bort)|r(e(s(ize|et)|jectionhandled)|atechange)|m(ouse(o(ut|ver)|down|up|enter|leave|move)|essage(error)?)|b(efore(unload|print)|lur))(?![\\w:-])", + "beginCaptures": { + "0": { + "name": "entity.other.attribute-name.html" + } + }, + "comment": "HTML5 attributes, event handlers", + "end": "(?=\\s*+[^=\\s])", + "name": "meta.attribute.event-handler.$1.html", + "patterns": [ + { + "begin": "=", + "beginCaptures": { + "0": { + "name": "punctuation.separator.key-value.html" + } + }, + "end": "(?<=[^\\s=])(?!\\s*=)|(?=/?>)", + "patterns": [ + { + "begin": "(?=[^\\s=<>`/]|/(?!>))", + "end": "(?!\\G)", + "name": "meta.embedded.line.js", + "patterns": [ + { + "captures": { + "0": { + "name": "source.js" + }, + "1": { + "patterns": [ + { + "include": "source.js" + } + ] + } + }, + "match": "(([^\\s\"'=<>`/]|/(?!>))+)", + "name": "string.unquoted.html" + }, + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.html" + } + }, + "contentName": "source.js", + "end": "(\")", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.html" + }, + "1": { + "name": "source.js" + } + }, + "name": "string.quoted.double.html", + "patterns": [ + { + "captures": { + "0": { + "patterns": [ + { + "include": "source.js" + } + ] + } + }, + "match": "([^\\n\"/]|/(?![/*]))+" + }, + { + "begin": "//", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.js" + } + }, + "end": "(?=\")|\\n", + "name": "comment.line.double-slash.js" + }, + { + "begin": "/\\*", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.js" + } + }, + "end": "(?=\")|\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.js" + } + }, + "name": "comment.block.js" + } + ] + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.html" + } + }, + "contentName": "source.js", + "end": "(')", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.html" + }, + "1": { + "name": "source.js" + } + }, + "name": "string.quoted.single.html", + "patterns": [ + { + "captures": { + "0": { + "patterns": [ + { + "include": "source.js" + } + ] + } + }, + "match": "([^\\n'/]|/(?![/*]))+" + }, + { + "begin": "//", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.js" + } + }, + "end": "(?=')|\\n", + "name": "comment.line.double-slash.js" + }, + { + "begin": "/\\*", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.js" + } + }, + "end": "(?=')|\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.js" + } + }, + "name": "comment.block.js" + } + ] + } + ] + }, + { + "match": "=", + "name": "invalid.illegal.unexpected-equals-sign.html" + } + ] + } + ] + }, + { + "begin": "(data-[a-z\\-]+)(?![\\w:-])", + "beginCaptures": { + "0": { + "name": "entity.other.attribute-name.html" + } + }, + "comment": "HTML5 attributes, data-*", + "end": "(?=\\s*+[^=\\s])", + "name": "meta.attribute.data-x.$1.html", + "patterns": [ + { + "include": "#attribute-interior" + } + ] + }, + { + "begin": "(align|bgcolor|border)(?![\\w:-])", + "beginCaptures": { + "0": { + "name": "invalid.deprecated.entity.other.attribute-name.html" + } + }, + "comment": "HTML attributes, deprecated", + "end": "(?=\\s*+[^=\\s])", + "name": "meta.attribute.$1.html", + "patterns": [ + { + "include": "#attribute-interior" + } + ] + }, + { + "begin": "([^\\x{0020}\"'<>/=\\x{0000}-\\x{001F}\\x{007F}-\\x{009F}\\x{FDD0}-\\x{FDEF}\\x{FFFE}\\x{FFFF}\\x{1FFFE}\\x{1FFFF}\\x{2FFFE}\\x{2FFFF}\\x{3FFFE}\\x{3FFFF}\\x{4FFFE}\\x{4FFFF}\\x{5FFFE}\\x{5FFFF}\\x{6FFFE}\\x{6FFFF}\\x{7FFFE}\\x{7FFFF}\\x{8FFFE}\\x{8FFFF}\\x{9FFFE}\\x{9FFFF}\\x{AFFFE}\\x{AFFFF}\\x{BFFFE}\\x{BFFFF}\\x{CFFFE}\\x{CFFFF}\\x{DFFFE}\\x{DFFFF}\\x{EFFFE}\\x{EFFFF}\\x{FFFFE}\\x{FFFFF}\\x{10FFFE}\\x{10FFFF}]+)", + "beginCaptures": { + "0": { + "name": "entity.other.attribute-name.html" + } + }, + "comment": "Anything else that is valid", + "end": "(?=\\s*+[^=\\s])", + "name": "meta.attribute.unrecognized.$1.html", + "patterns": [ + { + "include": "#attribute-interior" + } + ] + }, + { + "match": "[^\\s>]+", + "name": "invalid.illegal.character-not-allowed-here.html" + } + ] + }, + "attribute-interior": { + "patterns": [ + { + "begin": "=", + "beginCaptures": { + "0": { + "name": "punctuation.separator.key-value.html" + } + }, + "end": "(?<=[^\\s=])(?!\\s*=)|(?=/?>)", + "patterns": [ + { + "match": "([^\\s\"'=<>`/]|/(?!>))+", + "name": "string.unquoted.html" + }, + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.html" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.html" + } + }, + "name": "string.quoted.double.html", + "patterns": [ + { + "include": "#entities" + } + ] + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.html" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.html" + } + }, + "name": "string.quoted.single.html", + "patterns": [ + { + "include": "#entities" + } + ] + }, + { + "match": "=", + "name": "invalid.illegal.unexpected-equals-sign.html" + } + ] + } + ] + }, + "cdata": { + "begin": "", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.metadata.cdata.html" + }, + "comment": { + "begin": "", + "name": "comment.block.html", + "patterns": [ + { + "match": "\\G-?>", + "name": "invalid.illegal.characters-not-allowed-here.html" + }, + { + "match": ")", + "name": "invalid.illegal.characters-not-allowed-here.html" + }, + { + "match": "--!>", + "name": "invalid.illegal.characters-not-allowed-here.html" + } + ] + }, + "core-minus-invalid": { + "comment": "This should be the root pattern array includes minus #tags-invalid", + "patterns": [ + { + "include": "#xml-processing" + }, + { + "include": "#comment" + }, + { + "include": "#doctype" + }, + { + "include": "#cdata" + }, + { + "include": "#tags-valid" + }, + { + "include": "#entities" + } + ] + }, + "doctype": { + "begin": "", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.metadata.doctype.html", + "patterns": [ + { + "match": "\\G(?i:DOCTYPE)", + "name": "entity.name.tag.html" + }, + { + "begin": "\"", + "end": "\"", + "name": "string.quoted.double.html" + }, + { + "match": "[^\\s>]+", + "name": "entity.other.attribute-name.html" + } + ] + }, + "entities": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.entity.html" + }, + "912": { + "name": "punctuation.definition.entity.html" + } + }, + "comment": "Yes this is a bit ridiculous, there are quite a lot of these", + "match": "(&)(?=[a-zA-Z])((a(s(ymp(eq)?|cr|t)|n(d(slope|d|v|and)?|g(s(t|ph)|zarr|e|le|rt(vb(d)?)?|msd(a(h|c|d|e|f|a|g|b))?)?)|c(y|irc|d|ute|E)?|tilde|o(pf|gon)|uml|p(id|os|prox(eq)?|e|E|acir)?|elig|f(r)?|w(conint|int)|l(pha|e(ph|fsym))|acute|ring|grave|m(p|a(cr|lg))|breve)|A(s(sign|cr)|nd|MP|c(y|irc)|tilde|o(pf|gon)|uml|pplyFunction|fr|Elig|lpha|acute|ring|grave|macr|breve))|(B(scr|cy|opf|umpeq|e(cause|ta|rnoullis)|fr|a(ckslash|r(v|wed))|reve)|b(s(cr|im(e)?|ol(hsub|b)?|emi)|n(ot|e(quiv)?)|c(y|ong)|ig(s(tar|qcup)|c(irc|up|ap)|triangle(down|up)|o(times|dot|plus)|uplus|vee|wedge)|o(t(tom)?|pf|wtie|x(h(d|u|D|U)?|times|H(d|u|D|U)?|d(R|l|r|L)|u(R|l|r|L)|plus|D(R|l|r|L)|v(R|h|H|l|r|L)?|U(R|l|r|L)|V(R|h|H|l|r|L)?|minus|box))|Not|dquo|u(ll(et)?|mp(e(q)?|E)?)|prime|e(caus(e)?|t(h|ween|a)|psi|rnou|mptyv)|karow|fr|l(ock|k(1(2|4)|34)|a(nk|ck(square|triangle(down|left|right)?|lozenge)))|a(ck(sim(eq)?|cong|prime|epsilon)|r(vee|wed(ge)?))|r(eve|vbar)|brk(tbrk)?))|(c(s(cr|u(p(e)?|b(e)?))|h(cy|i|eck(mark)?)|ylcty|c(irc|ups(sm)?|edil|a(ps|ron))|tdot|ir(scir|c(eq|le(d(R|circ|S|dash|ast)|arrow(left|right)))?|e|fnint|E|mid)?|o(n(int|g(dot)?)|p(y(sr)?|f|rod)|lon(e(q)?)?|m(p(fn|le(xes|ment))?|ma(t)?))|dot|u(darr(l|r)|p(s|c(up|ap)|or|dot|brcap)?|e(sc|pr)|vee|wed|larr(p)?|r(vearrow(left|right)|ly(eq(succ|prec)|vee|wedge)|arr(m)?|ren))|e(nt(erdot)?|dil|mptyv)|fr|w(conint|int)|lubs(uit)?|a(cute|p(s|c(up|ap)|dot|and|brcup)?|r(on|et))|r(oss|arr))|C(scr|hi|c(irc|onint|edil|aron)|ircle(Minus|Times|Dot|Plus)|Hcy|o(n(tourIntegral|int|gruent)|unterClockwiseContourIntegral|p(f|roduct)|lon(e)?)|dot|up(Cap)?|OPY|e(nterDot|dilla)|fr|lo(seCurly(DoubleQuote|Quote)|ckwiseContourIntegral)|a(yleys|cute|p(italDifferentialD)?)|ross))|(d(s(c(y|r)|trok|ol)|har(l|r)|c(y|aron)|t(dot|ri(f)?)|i(sin|e|v(ide(ontimes)?|onx)?|am(s|ond(suit)?)?|gamma)|Har|z(cy|igrarr)|o(t(square|plus|eq(dot)?|minus)?|ublebarwedge|pf|wn(harpoon(left|right)|downarrows|arrow)|llar)|d(otseq|a(rr|gger))?|u(har|arr)|jcy|e(lta|g|mptyv)|f(isht|r)|wangle|lc(orn|rop)|a(sh(v)?|leth|rr|gger)|r(c(orn|rop)|bkarow)|b(karow|lac)|Arr)|D(s(cr|trok)|c(y|aron)|Scy|i(fferentialD|a(critical(Grave|Tilde|Do(t|ubleAcute)|Acute)|mond))|o(t(Dot|Equal)?|uble(Right(Tee|Arrow)|ContourIntegral|Do(t|wnArrow)|Up(DownArrow|Arrow)|VerticalBar|L(ong(RightArrow|Left(RightArrow|Arrow))|eft(RightArrow|Tee|Arrow)))|pf|wn(Right(TeeVector|Vector(Bar)?)|Breve|Tee(Arrow)?|arrow|Left(RightVector|TeeVector|Vector(Bar)?)|Arrow(Bar|UpArrow)?))|Zcy|el(ta)?|D(otrahd)?|Jcy|fr|a(shv|rr|gger)))|(e(s(cr|im|dot)|n(sp|g)|c(y|ir(c)?|olon|aron)|t(h|a)|o(pf|gon)|dot|u(ro|ml)|p(si(v|lon)?|lus|ar(sl)?)|e|D(ot|Dot)|q(s(im|lant(less|gtr))|c(irc|olon)|u(iv(DD)?|est|als)|vparsl)|f(Dot|r)|l(s(dot)?|inters|l)?|a(ster|cute)|r(Dot|arr)|g(s(dot)?|rave)?|x(cl|ist|p(onentiale|ectation))|m(sp(1(3|4))?|pty(set|v)?|acr))|E(s(cr|im)|c(y|irc|aron)|ta|o(pf|gon)|NG|dot|uml|TH|psilon|qu(ilibrium|al(Tilde)?)|fr|lement|acute|grave|x(ists|ponentialE)|m(pty(SmallSquare|VerySmallSquare)|acr)))|(f(scr|nof|cy|ilig|o(pf|r(k(v)?|all))|jlig|partint|emale|f(ilig|l(ig|lig)|r)|l(tns|lig|at)|allingdotseq|r(own|a(sl|c(1(2|8|3|4|5|6)|78|2(3|5)|3(8|4|5)|45|5(8|6)))))|F(scr|cy|illed(SmallSquare|VerySmallSquare)|o(uriertrf|pf|rAll)|fr))|(G(scr|c(y|irc|edil)|t|opf|dot|T|Jcy|fr|amma(d)?|reater(Greater|SlantEqual|Tilde|Equal(Less)?|FullEqual|Less)|g|breve)|g(s(cr|im(e|l)?)|n(sim|e(q(q)?)?|E|ap(prox)?)|c(y|irc)|t(c(c|ir)|dot|quest|lPar|r(sim|dot|eq(qless|less)|less|a(pprox|rr)))?|imel|opf|dot|jcy|e(s(cc|dot(o(l)?)?|l(es)?)?|q(slant|q)?|l)?|v(nE|ertneqq)|fr|E(l)?|l(j|E|a)?|a(cute|p|mma(d)?)|rave|g(g)?|breve))|(h(s(cr|trok|lash)|y(phen|bull)|circ|o(ok(leftarrow|rightarrow)|pf|arr|rbar|mtht)|e(llip|arts(uit)?|rcon)|ks(earow|warow)|fr|a(irsp|lf|r(dcy|r(cir|w)?)|milt)|bar|Arr)|H(s(cr|trok)|circ|ilbertSpace|o(pf|rizontalLine)|ump(DownHump|Equal)|fr|a(cek|t)|ARDcy))|(i(s(cr|in(s(v)?|dot|v|E)?)|n(care|t(cal|prod|e(rcal|gers)|larhk)?|odot|fin(tie)?)?|c(y|irc)?|t(ilde)?|i(nfin|i(nt|int)|ota)?|o(cy|ta|pf|gon)|u(kcy|ml)|jlig|prod|e(cy|xcl)|quest|f(f|r)|acute|grave|m(of|ped|a(cr|th|g(part|e|line))))|I(scr|n(t(e(rsection|gral))?|visible(Comma|Times))|c(y|irc)|tilde|o(ta|pf|gon)|dot|u(kcy|ml)|Ocy|Jlig|fr|Ecy|acute|grave|m(plies|a(cr|ginaryI))?))|(j(s(cr|ercy)|c(y|irc)|opf|ukcy|fr|math)|J(s(cr|ercy)|c(y|irc)|opf|ukcy|fr))|(k(scr|hcy|c(y|edil)|opf|jcy|fr|appa(v)?|green)|K(scr|c(y|edil)|Hcy|opf|Jcy|fr|appa))|(l(s(h|cr|trok|im(e|g)?|q(uo(r)?|b)|aquo)|h(ar(d|u(l)?)|blk)|n(sim|e(q(q)?)?|E|ap(prox)?)|c(y|ub|e(il|dil)|aron)|Barr|t(hree|c(c|ir)|imes|dot|quest|larr|r(i(e|f)?|Par))?|Har|o(ng(left(arrow|rightarrow)|rightarrow|mapsto)|times|z(enge|f)?|oparrow(left|right)|p(f|lus|ar)|w(ast|bar)|a(ng|rr)|brk)|d(sh|ca|quo(r)?|r(dhar|ushar))|ur(dshar|uhar)|jcy|par(lt)?|e(s(s(sim|dot|eq(qgtr|gtr)|approx|gtr)|cc|dot(o(r)?)?|g(es)?)?|q(slant|q)?|ft(harpoon(down|up)|threetimes|leftarrows|arrow(tail)?|right(squigarrow|harpoons|arrow(s)?))|g)?|v(nE|ertneqq)|f(isht|loor|r)|E(g)?|l(hard|corner|tri|arr)?|a(ng(d|le)?|cute|t(e(s)?|ail)?|p|emptyv|quo|rr(sim|hk|tl|pl|fs|lp|b(fs)?)?|gran|mbda)|r(har(d)?|corner|tri|arr|m)|g(E)?|m(idot|oust(ache)?)|b(arr|r(k(sl(d|u)|e)|ac(e|k))|brk)|A(tail|arr|rr))|L(s(h|cr|trok)|c(y|edil|aron)|t|o(ng(RightArrow|left(arrow|rightarrow)|rightarrow|Left(RightArrow|Arrow))|pf|wer(RightArrow|LeftArrow))|T|e(ss(Greater|SlantEqual|Tilde|EqualGreater|FullEqual|Less)|ft(Right(Vector|Arrow)|Ceiling|T(ee(Vector|Arrow)?|riangle(Bar|Equal)?)|Do(ubleBracket|wn(TeeVector|Vector(Bar)?))|Up(TeeVector|DownVector|Vector(Bar)?)|Vector(Bar)?|arrow|rightarrow|Floor|A(ngleBracket|rrow(RightArrow|Bar)?)))|Jcy|fr|l(eftarrow)?|a(ng|cute|placetrf|rr|mbda)|midot))|(M(scr|cy|inusPlus|opf|u|e(diumSpace|llintrf)|fr|ap)|m(s(cr|tpos)|ho|nplus|c(y|omma)|i(nus(d(u)?|b)?|cro|d(cir|dot|ast)?)|o(dels|pf)|dash|u(ltimap|map)?|p|easuredangle|DDot|fr|l(cp|dr)|a(cr|p(sto(down|up|left)?)?|l(t(ese)?|e)|rker)))|(n(s(hort(parallel|mid)|c(cue|e|r)?|im(e(q)?)?|u(cc(eq)?|p(set(eq(q)?)?|e|E)?|b(set(eq(q)?)?|e|E)?)|par|qsu(pe|be)|mid)|Rightarrow|h(par|arr|Arr)|G(t(v)?|g)|c(y|ong(dot)?|up|edil|a(p|ron))|t(ilde|lg|riangle(left(eq)?|right(eq)?)|gl)|i(s(d)?|v)?|o(t(ni(v(c|a|b))?|in(dot|v(c|a|b)|E)?)?|pf)|dash|u(m(sp|ero)?)?|jcy|p(olint|ar(sl|t|allel)?|r(cue|e(c(eq)?)?)?)|e(s(im|ear)|dot|quiv|ar(hk|r(ow)?)|xist(s)?|Arr)?|v(sim|infin|Harr|dash|Dash|l(t(rie)?|e|Arr)|ap|r(trie|Arr)|g(t|e))|fr|w(near|ar(hk|r(ow)?)|Arr)|V(dash|Dash)|l(sim|t(ri(e)?)?|dr|e(s(s)?|q(slant|q)?|ft(arrow|rightarrow))?|E|arr|Arr)|a(ng|cute|tur(al(s)?)?|p(id|os|prox|E)?|bla)|r(tri(e)?|ightarrow|arr(c|w)?|Arr)|g(sim|t(r)?|e(s|q(slant|q)?)?|E)|mid|L(t(v)?|eft(arrow|rightarrow)|l)|b(sp|ump(e)?))|N(scr|c(y|edil|aron)|tilde|o(nBreakingSpace|Break|t(R(ightTriangle(Bar|Equal)?|everseElement)|Greater(Greater|SlantEqual|Tilde|Equal|FullEqual|Less)?|S(u(cceeds(SlantEqual|Tilde|Equal)?|perset(Equal)?|bset(Equal)?)|quareSu(perset(Equal)?|bset(Equal)?))|Hump(DownHump|Equal)|Nested(GreaterGreater|LessLess)|C(ongruent|upCap)|Tilde(Tilde|Equal|FullEqual)?|DoubleVerticalBar|Precedes(SlantEqual|Equal)?|E(qual(Tilde)?|lement|xists)|VerticalBar|Le(ss(Greater|SlantEqual|Tilde|Equal|Less)?|ftTriangle(Bar|Equal)?))?|pf)|u|e(sted(GreaterGreater|LessLess)|wLine|gative(MediumSpace|Thi(nSpace|ckSpace)|VeryThinSpace))|Jcy|fr|acute))|(o(s(cr|ol|lash)|h(m|bar)|c(y|ir(c)?)|ti(lde|mes(as)?)|S|int|opf|d(sold|iv|ot|ash|blac)|uml|p(erp|lus|ar)|elig|vbar|f(cir|r)|l(c(ir|ross)|t|ine|arr)|a(st|cute)|r(slope|igof|or|d(er(of)?|f|m)?|v|arr)?|g(t|on|rave)|m(i(nus|cron|d)|ega|acr))|O(s(cr|lash)|c(y|irc)|ti(lde|mes)|opf|dblac|uml|penCurly(DoubleQuote|Quote)|ver(B(ar|rac(e|ket))|Parenthesis)|fr|Elig|acute|r|grave|m(icron|ega|acr)))|(p(s(cr|i)|h(i(v)?|one|mmat)|cy|i(tchfork|v)?|o(intint|und|pf)|uncsp|er(cnt|tenk|iod|p|mil)|fr|l(us(sim|cir|two|d(o|u)|e|acir|mn|b)?|an(ck(h)?|kv))|ar(s(im|l)|t|a(llel)?)?|r(sim|n(sim|E|ap)|cue|ime(s)?|o(d|p(to)?|f(surf|line|alar))|urel|e(c(sim|n(sim|eqq|approx)|curlyeq|eq|approx)?)?|E|ap)?|m)|P(s(cr|i)|hi|cy|i|o(incareplane|pf)|fr|lusMinus|artialD|r(ime|o(duct|portion(al)?)|ecedes(SlantEqual|Tilde|Equal)?)?))|(q(scr|int|opf|u(ot|est(eq)?|at(int|ernions))|prime|fr)|Q(scr|opf|UOT|fr))|(R(s(h|cr)|ho|c(y|edil|aron)|Barr|ight(Ceiling|T(ee(Vector|Arrow)?|riangle(Bar|Equal)?)|Do(ubleBracket|wn(TeeVector|Vector(Bar)?))|Up(TeeVector|DownVector|Vector(Bar)?)|Vector(Bar)?|arrow|Floor|A(ngleBracket|rrow(Bar|LeftArrow)?))|o(undImplies|pf)|uleDelayed|e(verse(UpEquilibrium|E(quilibrium|lement)))?|fr|EG|a(ng|cute|rr(tl)?)|rightarrow)|r(s(h|cr|q(uo(r)?|b)|aquo)|h(o(v)?|ar(d|u(l)?))|nmid|c(y|ub|e(il|dil)|aron)|Barr|t(hree|imes|ri(e|f|ltri)?)|i(singdotseq|ng|ght(squigarrow|harpoon(down|up)|threetimes|left(harpoons|arrows)|arrow(tail)?|rightarrows))|Har|o(times|p(f|lus|ar)|a(ng|rr)|brk)|d(sh|ca|quo(r)?|ldhar)|uluhar|p(polint|ar(gt)?)|e(ct|al(s|ine|part)?|g)|f(isht|loor|r)|l(har|arr|m)|a(ng(d|e|le)?|c(ute|e)|t(io(nals)?|ail)|dic|emptyv|quo|rr(sim|hk|c|tl|pl|fs|w|lp|ap|b(fs)?)?)|rarr|x|moust(ache)?|b(arr|r(k(sl(d|u)|e)|ac(e|k))|brk)|A(tail|arr|rr)))|(s(s(cr|tarf|etmn|mile)|h(y|c(hcy|y)|ort(parallel|mid)|arp)|c(sim|y|n(sim|E|ap)|cue|irc|polint|e(dil)?|E|a(p|ron))?|t(ar(f)?|r(ns|aight(phi|epsilon)))|i(gma(v|f)?|m(ne|dot|plus|e(q)?|l(E)?|rarr|g(E)?)?)|zlig|o(pf|ftcy|l(b(ar)?)?)|dot(e|b)?|u(ng|cc(sim|n(sim|eqq|approx)|curlyeq|eq|approx)?|p(s(im|u(p|b)|et(neq(q)?|eq(q)?)?)|hs(ol|ub)|1|n(e|E)|2|d(sub|ot)|3|plus|e(dot)?|E|larr|mult)?|m|b(s(im|u(p|b)|et(neq(q)?|eq(q)?)?)|n(e|E)|dot|plus|e(dot)?|E|rarr|mult)?)|pa(des(uit)?|r)|e(swar|ct|tm(n|inus)|ar(hk|r(ow)?)|xt|mi|Arr)|q(su(p(set(eq)?|e)?|b(set(eq)?|e)?)|c(up(s)?|ap(s)?)|u(f|ar(e|f))?)|fr(own)?|w(nwar|ar(hk|r(ow)?)|Arr)|larr|acute|rarr|m(t(e(s)?)?|i(d|le)|eparsl|a(shp|llsetminus))|bquo)|S(scr|hort(RightArrow|DownArrow|UpArrow|LeftArrow)|c(y|irc|edil|aron)?|tar|igma|H(cy|CHcy)|opf|u(c(hThat|ceeds(SlantEqual|Tilde|Equal)?)|p(set|erset(Equal)?)?|m|b(set(Equal)?)?)|OFTcy|q(uare(Su(perset(Equal)?|bset(Equal)?)|Intersection|Union)?|rt)|fr|acute|mallCircle))|(t(s(hcy|c(y|r)|trok)|h(i(nsp|ck(sim|approx))|orn|e(ta(sym|v)?|re(4|fore))|k(sim|ap))|c(y|edil|aron)|i(nt|lde|mes(d|b(ar)?)?)|o(sa|p(cir|f(ork)?|bot)?|ea)|dot|prime|elrec|fr|w(ixt|ohead(leftarrow|rightarrow))|a(u|rget)|r(i(sb|time|dot|plus|e|angle(down|q|left(eq)?|right(eq)?)?|minus)|pezium|ade)|brk)|T(s(cr|trok)|RADE|h(i(nSpace|ckSpace)|e(ta|refore))|c(y|edil|aron)|S(cy|Hcy)|ilde(Tilde|Equal|FullEqual)?|HORN|opf|fr|a(u|b)|ripleDot))|(u(scr|h(ar(l|r)|blk)|c(y|irc)|t(ilde|dot|ri(f)?)|Har|o(pf|gon)|d(har|arr|blac)|u(arr|ml)|p(si(h|lon)?|harpoon(left|right)|downarrow|uparrows|lus|arrow)|f(isht|r)|wangle|l(c(orn(er)?|rop)|tri)|a(cute|rr)|r(c(orn(er)?|rop)|tri|ing)|grave|m(l|acr)|br(cy|eve)|Arr)|U(scr|n(ion(Plus)?|der(B(ar|rac(e|ket))|Parenthesis))|c(y|irc)|tilde|o(pf|gon)|dblac|uml|p(si(lon)?|downarrow|Tee(Arrow)?|per(RightArrow|LeftArrow)|DownArrow|Equilibrium|arrow|Arrow(Bar|DownArrow)?)|fr|a(cute|rr(ocir)?)|ring|grave|macr|br(cy|eve)))|(v(s(cr|u(pn(e|E)|bn(e|E)))|nsu(p|b)|cy|Bar(v)?|zigzag|opf|dash|prop|e(e(eq|bar)?|llip|r(t|bar))|Dash|fr|ltri|a(ngrt|r(s(igma|u(psetneq(q)?|bsetneq(q)?))|nothing|t(heta|riangle(left|right))|p(hi|i|ropto)|epsilon|kappa|r(ho)?))|rtri|Arr)|V(scr|cy|opf|dash(l)?|e(e|r(yThinSpace|t(ical(Bar|Separator|Tilde|Line))?|bar))|Dash|vdash|fr|bar))|(w(scr|circ|opf|p|e(ierp|d(ge(q)?|bar))|fr|r(eath)?)|W(scr|circ|opf|edge|fr))|(X(scr|i|opf|fr)|x(s(cr|qcup)|h(arr|Arr)|nis|c(irc|up|ap)|i|o(time|dot|p(f|lus))|dtri|u(tri|plus)|vee|fr|wedge|l(arr|Arr)|r(arr|Arr)|map))|(y(scr|c(y|irc)|icy|opf|u(cy|ml)|en|fr|ac(y|ute))|Y(scr|c(y|irc)|opf|uml|Icy|Ucy|fr|acute|Acy))|(z(scr|hcy|c(y|aron)|igrarr|opf|dot|e(ta|etrf)|fr|w(nj|j)|acute)|Z(scr|c(y|aron)|Hcy|opf|dot|e(ta|roWidthSpace)|fr|acute)))(;)", + "name": "constant.character.entity.named.$2.html" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.entity.html" + }, + "3": { + "name": "punctuation.definition.entity.html" + } + }, + "match": "(&)#\\d+(;)", + "name": "constant.character.entity.numeric.decimal.html" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.entity.html" + }, + "3": { + "name": "punctuation.definition.entity.html" + } + }, + "match": "(&)#[xX][0-9a-fA-F]+(;)", + "name": "constant.character.entity.numeric.hexadecimal.html" + }, + { + "match": "&(?=[a-zA-Z0-9]+;)", + "name": "invalid.illegal.ambiguous-ampersand.html" + } + ] + }, + "math": { + "patterns": [ + { + "begin": "(?i)(<)(math)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(>))?", + "beginCaptures": { + "0": { + "name": "meta.tag.structure.$2.start.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "(?i)()", + "endCaptures": { + "0": { + "name": "meta.tag.structure.$2.end.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.element.structure.$2.html", + "patterns": [ + { + "begin": "(?)\\G", + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.structure.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "include": "#tags" + } + ] + } + ], + "repository": { + "attribute": { + "patterns": [ + { + "begin": "(s(hift|ymmetric|cript(sizemultiplier|level|minsize)|t(ackalign|retchy)|ide|u(pscriptshift|bscriptshift)|e(parator(s)?|lection)|rc)|h(eight|ref)|n(otation|umalign)|c(haralign|olumn(spa(n|cing)|width|lines|align)|lose|rossout)|i(n(dent(shift(first|last)?|target|align(first|last)?)|fixlinebreakstyle)|d)|o(pen|verflow)|d(i(splay(style)?|r)|e(nomalign|cimalpoint|pth))|position|e(dge|qual(columns|rows))|voffset|f(orm|ence|rame(spacing)?)|width|l(space|ine(thickness|leading|break(style|multchar)?)|o(ngdivstyle|cation)|ength|quote|argeop)|a(c(cent(under)?|tiontype)|l(t(text|img(-(height|valign|width))?)|ign(mentscope)?))|r(space|ow(spa(n|cing)|lines|align)|quote)|groupalign|x(link:href|mlns)|m(in(size|labelspacing)|ovablelimits|a(th(size|color|variant|background)|xsize))|bevelled)(?![\\w:-])", + "beginCaptures": { + "0": { + "name": "entity.other.attribute-name.html" + } + }, + "end": "(?=\\s*+[^=\\s])", + "name": "meta.attribute.$1.html", + "patterns": [ + { + "include": "#attribute-interior" + } + ] + }, + { + "begin": "([^\\x{0020}\"'<>/=\\x{0000}-\\x{001F}\\x{007F}-\\x{009F}\\x{FDD0}-\\x{FDEF}\\x{FFFE}\\x{FFFF}\\x{1FFFE}\\x{1FFFF}\\x{2FFFE}\\x{2FFFF}\\x{3FFFE}\\x{3FFFF}\\x{4FFFE}\\x{4FFFF}\\x{5FFFE}\\x{5FFFF}\\x{6FFFE}\\x{6FFFF}\\x{7FFFE}\\x{7FFFF}\\x{8FFFE}\\x{8FFFF}\\x{9FFFE}\\x{9FFFF}\\x{AFFFE}\\x{AFFFF}\\x{BFFFE}\\x{BFFFF}\\x{CFFFE}\\x{CFFFF}\\x{DFFFE}\\x{DFFFF}\\x{EFFFE}\\x{EFFFF}\\x{FFFFE}\\x{FFFFF}\\x{10FFFE}\\x{10FFFF}]+)", + "beginCaptures": { + "0": { + "name": "entity.other.attribute-name.html" + } + }, + "comment": "Anything else that is valid", + "end": "(?=\\s*+[^=\\s])", + "name": "meta.attribute.unrecognized.$1.html", + "patterns": [ + { + "include": "#attribute-interior" + } + ] + }, + { + "match": "[^\\s>]+", + "name": "invalid.illegal.character-not-allowed-here.html" + } + ] + }, + "tags": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#cdata" + }, + { + "captures": { + "0": { + "name": "meta.tag.structure.math.$2.void.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "match": "(?i)(<)(annotation|annotation-xml|semantics|menclose|merror|mfenced|mfrac|mpadded|mphantom|mroot|mrow|msqrt|mstyle|mmultiscripts|mover|mprescripts|msub|msubsup|msup|munder|munderover|none|mlabeledtr|mtable|mtd|mtr|mlongdiv|mscarries|mscarry|msgroup|msline|msrow|mstack|maction)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(/>))", + "name": "meta.element.structure.math.$2.html" + }, + { + "begin": "(?i)(<)(annotation|annotation-xml|semantics|menclose|merror|mfenced|mfrac|mpadded|mphantom|mroot|mrow|msqrt|mstyle|mmultiscripts|mover|mprescripts|msub|msubsup|msup|munder|munderover|none|mlabeledtr|mtable|mtd|mtr|mlongdiv|mscarries|mscarry|msgroup|msline|msrow|mstack|maction)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(>))?", + "beginCaptures": { + "0": { + "name": "meta.tag.structure.math.$2.start.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "(?i)()|(/>)|(?=)\\G", + "end": "(?=/>)|>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.structure.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "include": "#tags" + } + ] + }, + { + "captures": { + "0": { + "name": "meta.tag.inline.math.$2.void.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "match": "(?i)(<)(mi|mn|mo|ms|mspace|mtext|maligngroup|malignmark)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(/>))", + "name": "meta.element.inline.math.$2.html" + }, + { + "begin": "(?i)(<)(mi|mn|mo|ms|mspace|mtext|maligngroup|malignmark)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(>))?", + "beginCaptures": { + "0": { + "name": "meta.tag.inline.math.$2.start.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "(?i)()|(/>)|(?=)\\G", + "end": "(?=/>)|>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.inline.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "include": "#tags" + } + ] + }, + { + "captures": { + "0": { + "name": "meta.tag.object.math.$2.void.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "match": "(?i)(<)(mglyph)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(/>))", + "name": "meta.element.object.math.$2.html" + }, + { + "begin": "(?i)(<)(mglyph)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(>))?", + "beginCaptures": { + "0": { + "name": "meta.tag.object.math.$2.start.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "(?i)()|(/>)|(?=)\\G", + "end": "(?=/>)|>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.object.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "include": "#tags" + } + ] + }, + { + "captures": { + "0": { + "name": "meta.tag.other.invalid.void.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.illegal.unrecognized-tag.html" + }, + "4": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "6": { + "name": "punctuation.definition.tag.end.html" + } + }, + "match": "(?i)(<)(([\\w:]+))(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(/>))", + "name": "meta.element.other.invalid.html" + }, + { + "begin": "(?i)(<)((\\w[^\\s>]*))(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(>))?", + "beginCaptures": { + "0": { + "name": "meta.tag.other.invalid.start.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.illegal.unrecognized-tag.html" + }, + "4": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "6": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "(?i)()|(/>)|(?=)\\G", + "end": "(?=/>)|>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.other.invalid.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "include": "#tags" + } + ] + }, + { + "include": "#tags-invalid" + } + ] + } + } + }, + "svg": { + "patterns": [ + { + "begin": "(?i)(<)(svg)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(>))?", + "beginCaptures": { + "0": { + "name": "meta.tag.structure.$2.start.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "(?i)()", + "endCaptures": { + "0": { + "name": "meta.tag.structure.$2.end.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.element.structure.$2.html", + "patterns": [ + { + "begin": "(?)\\G", + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.structure.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "include": "#tags" + } + ] + } + ], + "repository": { + "attribute": { + "patterns": [ + { + "begin": "(s(hape-rendering|ystemLanguage|cale|t(yle|itchTiles|op-(color|opacity)|dDeviation|em(h|v)|artOffset|r(i(ng|kethrough-(thickness|position))|oke(-(opacity|dash(offset|array)|width|line(cap|join)|miterlimit))?))|urfaceScale|p(e(cular(Constant|Exponent)|ed)|acing|readMethod)|eed|lope)|h(oriz-(origin-x|adv-x)|eight|anging|ref(lang)?)|y(1|2|ChannelSelector)?|n(umOctaves|ame)|c(y|o(ntentS(criptType|tyleType)|lor(-(interpolation(-filters)?|profile|rendering))?)|ursor|l(ip(-(path|rule)|PathUnits)?|ass)|a(p-height|lcMode)|x)|t(ype|o|ext(-(decoration|anchor|rendering)|Length)|a(rget(X|Y)?|b(index|leValues))|ransform)|i(n(tercept|2)?|d(eographic)?|mage-rendering)|z(oomAndPan)?|o(p(erator|acity)|ver(flow|line-(thickness|position))|ffset|r(i(ent(ation)?|gin)|der))|d(y|i(splay|visor|ffuseConstant|rection)|ominant-baseline|ur|e(scent|celerate)|x)?|u(1|n(i(code(-(range|bidi))?|ts-per-em)|derline-(thickness|position))|2)|p(ing|oint(s(At(X|Y|Z))?|er-events)|a(nose-1|t(h(Length)?|tern(ContentUnits|Transform|Units))|int-order)|r(imitiveUnits|eserveA(spectRatio|lpha)))|e(n(d|able-background)|dgeMode|levation|x(ternalResourcesRequired|ponent))|v(i(sibility|ew(Box|Target))|-(hanging|ideographic|alphabetic|mathematical)|e(ctor-effect|r(sion|t-(origin-(y|x)|adv-y)))|alues)|k(1|2|3|e(y(Splines|Times|Points)|rn(ing|el(Matrix|UnitLength)))|4)?|f(y|il(ter(Res|Units)?|l(-(opacity|rule))?)|o(nt-(s(t(yle|retch)|ize(-adjust)?)|variant|family|weight)|rmat)|lood-(color|opacity)|r(om)?|x)|w(idth(s)?|ord-spacing|riting-mode)|l(i(ghting-color|mitingConeAngle)|ocal|e(ngthAdjust|tter-spacing)|ang)|a(scent|cc(umulate|ent-height)|ttribute(Name|Type)|zimuth|dditive|utoReverse|l(ignment-baseline|phabetic|lowReorder)|rabic-form|mplitude)|r(y|otate|e(s(tart|ult)|ndering-intent|peat(Count|Dur)|quired(Extensions|Features)|f(X|Y|errerPolicy)|l)|adius|x)?|g(1|2|lyph(Ref|-(name|orientation-(horizontal|vertical)))|radient(Transform|Units))|x(1|2|ChannelSelector|-height|link:(show|href|t(ype|itle)|a(ctuate|rcrole)|role)|ml:(space|lang|base))?|m(in|ode|e(thod|dia)|a(sk(ContentUnits|Units)?|thematical|rker(Height|-(start|end|mid)|Units|Width)|x))|b(y|ias|egin|ase(Profile|line-shift|Frequency)|box))(?![\\w:-])", + "beginCaptures": { + "0": { + "name": "entity.other.attribute-name.html" + } + }, + "end": "(?=\\s*+[^=\\s])", + "name": "meta.attribute.$1.html", + "patterns": [ + { + "include": "#attribute-interior" + } + ] + }, + { + "begin": "([^\\x{0020}\"'<>/=\\x{0000}-\\x{001F}\\x{007F}-\\x{009F}\\x{FDD0}-\\x{FDEF}\\x{FFFE}\\x{FFFF}\\x{1FFFE}\\x{1FFFF}\\x{2FFFE}\\x{2FFFF}\\x{3FFFE}\\x{3FFFF}\\x{4FFFE}\\x{4FFFF}\\x{5FFFE}\\x{5FFFF}\\x{6FFFE}\\x{6FFFF}\\x{7FFFE}\\x{7FFFF}\\x{8FFFE}\\x{8FFFF}\\x{9FFFE}\\x{9FFFF}\\x{AFFFE}\\x{AFFFF}\\x{BFFFE}\\x{BFFFF}\\x{CFFFE}\\x{CFFFF}\\x{DFFFE}\\x{DFFFF}\\x{EFFFE}\\x{EFFFF}\\x{FFFFE}\\x{FFFFF}\\x{10FFFE}\\x{10FFFF}]+)", + "beginCaptures": { + "0": { + "name": "entity.other.attribute-name.html" + } + }, + "comment": "Anything else that is valid", + "end": "(?=\\s*+[^=\\s])", + "name": "meta.attribute.unrecognized.$1.html", + "patterns": [ + { + "include": "#attribute-interior" + } + ] + }, + { + "match": "[^\\s>]+", + "name": "invalid.illegal.character-not-allowed-here.html" + } + ] + }, + "tags": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#cdata" + }, + { + "captures": { + "0": { + "name": "meta.tag.metadata.svg.$2.void.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "match": "(?i)(<)(color-profile|desc|metadata|script|style|title)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(/>))", + "name": "meta.element.metadata.svg.$2.html" + }, + { + "begin": "(?i)(<)(color-profile|desc|metadata|script|style|title)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(>))?", + "beginCaptures": { + "0": { + "name": "meta.tag.metadata.svg.$2.start.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "(?i)()|(/>)|(?=)\\G", + "end": "(?=/>)|>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.metadata.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "include": "#tags" + } + ] + }, + { + "captures": { + "0": { + "name": "meta.tag.structure.svg.$2.void.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "match": "(?i)(<)(animateMotion|clipPath|defs|feComponentTransfer|feDiffuseLighting|feMerge|feSpecularLighting|filter|g|hatch|linearGradient|marker|mask|mesh|meshgradient|meshpatch|meshrow|pattern|radialGradient|switch|text|textPath)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(/>))", + "name": "meta.element.structure.svg.$2.html" + }, + { + "begin": "(?i)(<)(animateMotion|clipPath|defs|feComponentTransfer|feDiffuseLighting|feMerge|feSpecularLighting|filter|g|hatch|linearGradient|marker|mask|mesh|meshgradient|meshpatch|meshrow|pattern|radialGradient|switch|text|textPath)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(>))?", + "beginCaptures": { + "0": { + "name": "meta.tag.structure.svg.$2.start.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "(?i)()|(/>)|(?=)\\G", + "end": "(?=/>)|>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.structure.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "include": "#tags" + } + ] + }, + { + "captures": { + "0": { + "name": "meta.tag.inline.svg.$2.void.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "match": "(?i)(<)(a|animate|discard|feBlend|feColorMatrix|feComposite|feConvolveMatrix|feDisplacementMap|feDistantLight|feDropShadow|feFlood|feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur|feMergeNode|feMorphology|feOffset|fePointLight|feSpotLight|feTile|feTurbulence|hatchPath|mpath|set|solidcolor|stop|tspan)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(/>))", + "name": "meta.element.inline.svg.$2.html" + }, + { + "begin": "(?i)(<)(a|animate|discard|feBlend|feColorMatrix|feComposite|feConvolveMatrix|feDisplacementMap|feDistantLight|feDropShadow|feFlood|feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur|feMergeNode|feMorphology|feOffset|fePointLight|feSpotLight|feTile|feTurbulence|hatchPath|mpath|set|solidcolor|stop|tspan)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(>))?", + "beginCaptures": { + "0": { + "name": "meta.tag.inline.svg.$2.start.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "(?i)()|(/>)|(?=)\\G", + "end": "(?=/>)|>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.inline.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "include": "#tags" + } + ] + }, + { + "captures": { + "0": { + "name": "meta.tag.object.svg.$2.void.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "match": "(?i)(<)(circle|ellipse|feImage|foreignObject|image|line|path|polygon|polyline|rect|symbol|use|view)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(/>))", + "name": "meta.element.object.svg.$2.html" + }, + { + "begin": "(?i)(<)(a|circle|ellipse|feImage|foreignObject|image|line|path|polygon|polyline|rect|symbol|use|view)(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(>))?", + "beginCaptures": { + "0": { + "name": "meta.tag.object.svg.$2.start.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "(?i)()|(/>)|(?=)\\G", + "end": "(?=/>)|>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.object.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "include": "#tags" + } + ] + }, + { + "captures": { + "0": { + "name": "meta.tag.other.svg.$2.void.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.deprecated.html" + }, + "4": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "6": { + "name": "punctuation.definition.tag.end.html" + } + }, + "match": "(?i)(<)((altGlyph|altGlyphDef|altGlyphItem|animateColor|animateTransform|cursor|font|font-face|font-face-format|font-face-name|font-face-src|font-face-uri|glyph|glyphRef|hkern|missing-glyph|tref|vkern))(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(/>))", + "name": "meta.element.other.svg.$2.html" + }, + { + "begin": "(?i)(<)((altGlyph|altGlyphDef|altGlyphItem|animateColor|animateTransform|cursor|font|font-face|font-face-format|font-face-name|font-face-src|font-face-uri|glyph|glyphRef|hkern|missing-glyph|tref|vkern))(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(>))?", + "beginCaptures": { + "0": { + "name": "meta.tag.other.svg.$2.start.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.deprecated.html" + }, + "4": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "6": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "(?i)()|(/>)|(?=)\\G", + "end": "(?=/>)|>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.other.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "include": "#tags" + } + ] + }, + { + "captures": { + "0": { + "name": "meta.tag.other.invalid.void.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.illegal.unrecognized-tag.html" + }, + "4": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "6": { + "name": "punctuation.definition.tag.end.html" + } + }, + "match": "(?i)(<)(([\\w:]+))(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(/>))", + "name": "meta.element.other.invalid.html" + }, + { + "begin": "(?i)(<)((\\w[^\\s>]*))(?=\\s|/?>)(?:(([^\"'>]|\"[^\"]*\"|'[^']*')*)(>))?", + "beginCaptures": { + "0": { + "name": "meta.tag.other.invalid.start.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.illegal.unrecognized-tag.html" + }, + "4": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "6": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "(?i)()|(/>)|(?=)\\G", + "end": "(?=/>)|>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.other.invalid.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "include": "#tags" + } + ] + }, + { + "include": "#tags-invalid" + } + ] + } + } + }, + "tags-invalid": { + "patterns": [ + { + "begin": "(]*))(?)", + "endCaptures": { + "1": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.other.$2.html", + "patterns": [ + { + "include": "#attribute" + } + ] + } + ] + }, + "tags-valid": { + "patterns": [ + { + "begin": "(^[ \\t]+)?(?=<(?i:style)\\b(?!-))", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.embedded.leading.html" + } + }, + "end": "(?!\\G)([ \\t]*$\\n?)?", + "endCaptures": { + "1": { + "name": "punctuation.whitespace.embedded.trailing.html" + } + }, + "patterns": [ + { + "begin": "(?i)(<)(style)(?=\\s|/?>)", + "beginCaptures": { + "0": { + "name": "meta.tag.metadata.style.start.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": "(?i)((<)/)(style)\\s*(>)", + "endCaptures": { + "0": { + "name": "meta.tag.metadata.style.end.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "source.css-ignored-vscode" + }, + "3": { + "name": "entity.name.tag.html" + }, + "4": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.embedded.block.html", + "patterns": [ + { + "begin": "\\G", + "captures": { + "1": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "(>)", + "name": "meta.tag.metadata.style.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?!\\G)", + "end": "(?=)", + "endCaptures": { + "0": { + "name": "meta.tag.metadata.script.end.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.embedded.block.html", + "patterns": [ + { + "begin": "\\G", + "end": "(?=/)", + "patterns": [ + { + "begin": "(>)", + "beginCaptures": { + "0": { + "name": "meta.tag.metadata.script.start.html" + }, + "1": { + "name": "punctuation.definition.tag.end.html" + } + }, + "end": "((<))(?=/(?i:script))", + "endCaptures": { + "0": { + "name": "meta.tag.metadata.script.end.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "source.js-ignored-vscode" + } + }, + "patterns": [ + { + "begin": "\\G", + "end": "(?=|type(?=[\\s=])(?!\\s*=\\s*(''|\"\"|('|\"|)(text/(javascript(1\\.[0-5])?|x-javascript|jscript|livescript|(x-)?ecmascript|babel)|application/((x-)?javascript|(x-)?ecmascript)|module)[\\s\"'>]))))", + "name": "meta.tag.metadata.script.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i:(?=type\\s*=\\s*('|\"|)text/(x-handlebars|(x-(handlebars-)?|ng-)?template|html)[\\s\"'>]))", + "end": "((<))(?=/(?i:script))", + "endCaptures": { + "0": { + "name": "meta.tag.metadata.script.end.html" + }, + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "text.html.basic" + } + }, + "patterns": [ + { + "begin": "\\G", + "end": "(>)", + "endCaptures": { + "1": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.metadata.script.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?!\\G)", + "end": "(?=)", + "endCaptures": { + "1": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.metadata.script.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?!\\G)", + "end": "(?=)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": "/?>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.metadata.$2.void.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)(<)(noscript|title)(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.metadata.$2.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.metadata.$2.end.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)(<)(col|hr|input)(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": "/?>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.structure.$2.void.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)(<)(address|article|aside|blockquote|body|button|caption|colgroup|datalist|dd|details|dialog|div|dl|dt|fieldset|figcaption|figure|footer|form|head|header|hgroup|html|h[1-6]|label|legend|li|main|map|menu|meter|nav|ol|optgroup|option|output|p|pre|progress|section|select|slot|summary|table|tbody|td|template|textarea|tfoot|th|thead|tr|ul)(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.structure.$2.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.structure.$2.end.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)(<)(area|br|wbr)(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": "/?>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.inline.$2.void.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)(<)(a|abbr|b|bdi|bdo|cite|code|data|del|dfn|em|i|ins|kbd|mark|q|rp|rt|ruby|s|samp|small|span|strong|sub|sup|time|u|var)(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.inline.$2.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.inline.$2.end.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)(<)(embed|img|param|source|track)(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": "/?>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.object.$2.void.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)(<)(audio|canvas|iframe|object|picture|video)(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.object.$2.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.object.$2.end.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)(<)((basefont|isindex))(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.deprecated.html" + } + }, + "end": "/?>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.metadata.$2.void.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)(<)((center|frameset|noembed|noframes))(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.deprecated.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.structure.$2.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.deprecated.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.structure.$2.end.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)(<)((acronym|big|blink|font|strike|tt|xmp))(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.deprecated.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.inline.$2.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.deprecated.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.inline.$2.end.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)(<)((frame))(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.deprecated.html" + } + }, + "end": "/?>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.object.$2.void.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)(<)((applet))(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.deprecated.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.object.$2.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.deprecated.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.object.$2.end.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)(<)((dir|keygen|listing|menuitem|plaintext|spacer))(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.illegal.no-longer-supported.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.other.$2.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "(?i)()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + }, + "3": { + "name": "invalid.illegal.no-longer-supported.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.other.$2.end.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "include": "#math" + }, + { + "include": "#svg" + }, + { + "begin": "(<)([a-zA-Z][.0-9_a-zA-Z\\x{00B7}\\x{00C0}-\\x{00D6}\\x{00D8}-\\x{00F6}\\x{00F8}-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}-\\x{200D}\\x{203F}-\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}]*-[\\-.0-9_a-zA-Z\\x{00B7}\\x{00C0}-\\x{00D6}\\x{00D8}-\\x{00F6}\\x{00F8}-\\x{037D}\\x{037F}-\\x{1FFF}\\x{200C}-\\x{200D}\\x{203F}-\\x{2040}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}]*)(?=\\s|/?>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": "/?>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.custom.start.html", + "patterns": [ + { + "include": "#attribute" + } + ] + }, + { + "begin": "()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.custom.end.html", + "patterns": [ + { + "include": "#attribute" + } + ] + } + ] + }, + "xml-processing": { + "begin": "(<\\?)(xml)", + "captures": { + "1": { + "name": "punctuation.definition.tag.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": "(\\?>)", + "name": "meta.tag.metadata.processing.xml.html", + "patterns": [ + { + "include": "#attribute" + } + ] + } + }, + "scopeName": "text.html.basic" +} \ No newline at end of file diff --git a/languages/javascript.json b/languages/javascript.json new file mode 100644 index 0000000..a8f766a --- /dev/null +++ b/languages/javascript.json @@ -0,0 +1,5987 @@ +{ + "displayName": "JavaScript", + "name": "javascript", + "patterns": [ + { + "include": "#directives" + }, + { + "include": "#statements" + }, + { + "include": "#shebang" + } + ], + "repository": { + "access-modifier": { + "match": "(?]|^await|[^\\._$0-9A-Za-z]await|^return|[^\\._$0-9A-Za-z]return|^yield|[^\\._$0-9A-Za-z]yield|^throw|[^\\._$0-9A-Za-z]throw|^in|[^\\._$0-9A-Za-z]in|^of|[^\\._$0-9A-Za-z]of|^typeof|[^\\._$0-9A-Za-z]typeof|&&|\\|\\||\\*)\\s*(\\{)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.block.js" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.js" + } + }, + "name": "meta.objectliteral.js", + "patterns": [ + { + "include": "#object-member" + } + ] + }, + "array-binding-pattern": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.js" + }, + "2": { + "name": "punctuation.definition.binding-pattern.array.js" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.array.js" + } + }, + "patterns": [ + { + "include": "#binding-element" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "array-binding-pattern-const": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.js" + }, + "2": { + "name": "punctuation.definition.binding-pattern.array.js" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.array.js" + } + }, + "patterns": [ + { + "include": "#binding-element-const" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "array-literal": { + "begin": "\\s*(\\[)", + "beginCaptures": { + "1": { + "name": "meta.brace.square.js" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "meta.brace.square.js" + } + }, + "name": "meta.array.literal.js", + "patterns": [ + { + "include": "#expression" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "arrow-function": { + "patterns": [ + { + "captures": { + "1": { + "name": "storage.modifier.async.js" + }, + "2": { + "name": "variable.parameter.js" + } + }, + "match": "(?:(?)", + "name": "meta.arrow.js" + }, + { + "begin": "(?:(?]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>)))", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js" + } + }, + "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)\\b)|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + "name": "meta.arrow.js", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-parameters" + }, + { + "include": "#function-parameters" + }, + { + "include": "#arrow-return-type" + }, + { + "include": "#possibly-arrow-return-type" + } + ] + }, + { + "begin": "=>", + "beginCaptures": { + "0": { + "name": "storage.type.function.arrow.js" + } + }, + "end": "((?<=\\}|\\S)(?)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])", + "name": "meta.arrow.js", + "patterns": [ + { + "include": "#single-line-comment-consuming-line-ending" + }, + { + "include": "#decl-block" + }, + { + "include": "#expression" + } + ] + } + ] + }, + "arrow-return-type": { + "begin": "(?<=\\))\\s*(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.js" + } + }, + "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)\\b)|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + "name": "meta.return.type.arrow.js", + "patterns": [ + { + "include": "#arrow-return-type-body" + } + ] + }, + "arrow-return-type-body": { + "patterns": [ + { + "begin": "(?<=[:])(?=\\s*\\{)", + "end": "(?<=\\})", + "patterns": [ + { + "include": "#type-object" + } + ] + }, + { + "include": "#type-predicate-operator" + }, + { + "include": "#type" + } + ] + }, + "async-modifier": { + "match": "(?\\s*$)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.js" + } + }, + "end": "(?=$)", + "name": "comment.line.triple-slash.directive.js", + "patterns": [ + { + "begin": "(<)(reference|amd-dependency|amd-module)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.directive.js" + }, + "2": { + "name": "entity.name.tag.directive.js" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.directive.js" + } + }, + "name": "meta.tag.js", + "patterns": [ + { + "match": "path|types|no-default-lib|lib|name|resolution-mode", + "name": "entity.other.attribute-name.directive.js" + }, + { + "match": "=", + "name": "keyword.operator.assignment.js" + }, + { + "include": "#string" + } + ] + } + ] + }, + "docblock": { + "patterns": [ + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "constant.language.access-type.jsdoc" + } + }, + "match": "((@)(?:access|api))\\s+(private|protected|public)\\b" + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "entity.name.type.instance.jsdoc" + }, + "4": { + "name": "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "5": { + "name": "constant.other.email.link.underline.jsdoc" + }, + "6": { + "name": "punctuation.definition.bracket.angle.end.jsdoc" + } + }, + "match": "((@)author)\\s+([^@\\s<>*/](?:[^@<>*/]|\\*[^/])*)(?:\\s*(<)([^>\\s]+)(>))?" + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "entity.name.type.instance.jsdoc" + }, + "4": { + "name": "keyword.operator.control.jsdoc" + }, + "5": { + "name": "entity.name.type.instance.jsdoc" + } + }, + "match": "((@)borrows)\\s+((?:[^@\\s*/]|\\*[^/])+)\\s+(as)\\s+((?:[^@\\s*/]|\\*[^/])+)" + }, + { + "begin": "((@)example)\\s+", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=@|\\*/)", + "name": "meta.example.jsdoc", + "patterns": [ + { + "match": "^\\s\\*\\s+" + }, + { + "begin": "\\G(<)caption(>)", + "beginCaptures": { + "0": { + "name": "entity.name.tag.inline.jsdoc" + }, + "1": { + "name": "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + "name": "punctuation.definition.bracket.angle.end.jsdoc" + } + }, + "contentName": "constant.other.description.jsdoc", + "end": "()|(?=\\*/)", + "endCaptures": { + "0": { + "name": "entity.name.tag.inline.jsdoc" + }, + "1": { + "name": "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + "name": "punctuation.definition.bracket.angle.end.jsdoc" + } + } + }, + { + "captures": { + "0": { + "name": "source.embedded.js" + } + }, + "match": "[^\\s@*](?:[^*]|\\*[^/])*" + } + ] + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "constant.language.symbol-type.jsdoc" + } + }, + "match": "((@)kind)\\s+(class|constant|event|external|file|function|member|mixin|module|namespace|typedef)\\b" + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.link.underline.jsdoc" + }, + "4": { + "name": "entity.name.type.instance.jsdoc" + } + }, + "match": "((@)see)\\s+(?:((?=https?://)(?:[^\\s*]|\\*[^/])+)|((?!https?://|(?:\\[[^\\[\\]]*\\])?{@(?:link|linkcode|linkplain|tutorial)\\b)(?:[^@\\s*/]|\\*[^/])+))" + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + } + }, + "match": "((@)template)\\s+([A-Za-z_$][\\w$.\\[\\]]*(?:\\s*,\\s*[A-Za-z_$][\\w$.\\[\\]]*)*)" + }, + { + "begin": "((@)template)\\s+(?={)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", + "patterns": [ + { + "include": "#jsdoctype" + }, + { + "match": "([A-Za-z_$][\\w$.\\[\\]]*)", + "name": "variable.other.jsdoc" + } + ] + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + } + }, + "match": "((@)(?:arg|argument|const|constant|member|namespace|param|var))\\s+([A-Za-z_$][\\w$.\\[\\]]*)" + }, + { + "begin": "((@)typedef)\\s+(?={)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", + "patterns": [ + { + "include": "#jsdoctype" + }, + { + "match": "(?:[^@\\s*/]|\\*[^/])+", + "name": "entity.name.type.instance.jsdoc" + } + ] + }, + { + "begin": "((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", + "patterns": [ + { + "include": "#jsdoctype" + }, + { + "match": "([A-Za-z_$][\\w$.\\[\\]]*)", + "name": "variable.other.jsdoc" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.optional-value.begin.bracket.square.jsdoc" + }, + "2": { + "name": "keyword.operator.assignment.jsdoc" + }, + "3": { + "name": "source.embedded.js" + }, + "4": { + "name": "punctuation.definition.optional-value.end.bracket.square.jsdoc" + }, + "5": { + "name": "invalid.illegal.syntax.jsdoc" + } + }, + "match": "(\\[)\\s*[\\w$]+(?:(?:\\[\\])?\\.[\\w$]+)*(?:\\s*(=)\\s*((?>\"(?:(?:\\*(?!/))|(?:\\\\(?!\"))|[^*\\\\])*?\"|'(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?'|\\[(?:(?:\\*(?!/))|[^*])*?\\]|(?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])*)*))?\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))", + "name": "variable.other.jsdoc" + } + ] + }, + { + "begin": "((@)(?:define|enum|exception|export|extends|lends|implements|modifies|namespace|private|protected|returns?|satisfies|suppress|this|throws|type|yields?))\\s+(?={)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", + "patterns": [ + { + "include": "#jsdoctype" + } + ] + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "entity.name.type.instance.jsdoc" + } + }, + "match": "((@)(?:alias|augments|callback|constructs|emits|event|fires|exports?|extends|external|function|func|host|lends|listens|interface|memberof!?|method|module|mixes|mixin|name|requires|see|this|typedef|uses))\\s+((?:[^{}@\\s*]|\\*[^/])+)" + }, + { + "begin": "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + }, + "4": { + "name": "punctuation.definition.string.begin.jsdoc" + } + }, + "contentName": "variable.other.jsdoc", + "end": "(\\3)|(?=$|\\*/)", + "endCaptures": { + "0": { + "name": "variable.other.jsdoc" + }, + "1": { + "name": "punctuation.definition.string.end.jsdoc" + } + } + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + } + }, + "match": "((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "match": "(@)(?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles|callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright|default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception|exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func|function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc|inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method|mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects|override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary|suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation|version|virtual|writeOnce|yields?)\\b", + "name": "storage.type.class.jsdoc" + }, + { + "include": "#inline-tags" + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "match": "((@)(?:[_$A-Za-z][_$0-9A-Za-z]*))(?=\\s+)" + } + ] + }, + "enum-declaration": { + "begin": "(?)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>)))))|(:\\s*((<)|([(]\\s*(([)])|(\\.\\.\\.)|([_$0-9A-Za-z]+\\s*(([:,?=])|([)]\\s*=>)))))))|(:\\s*(?(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(((async\\s+)?((function\\s*[(<*])|(function\\s+)|([_$A-Za-z][_$0-9A-Za-z]*\\s*=>)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>))))))" + }, + { + "captures": { + "1": { + "name": "storage.modifier.js" + }, + "2": { + "name": "keyword.operator.rest.js" + }, + "3": { + "name": "variable.parameter.js variable.language.this.js" + }, + "4": { + "name": "variable.parameter.js" + }, + "5": { + "name": "keyword.operator.optional.js" + } + }, + "match": "(?:(?]|\\|\\||\\&\\&|!==|$|((?>=|>>>=|\\|=", + "name": "keyword.operator.assignment.compound.bitwise.js" + }, + { + "match": "<<|>>>|>>", + "name": "keyword.operator.bitwise.shift.js" + }, + { + "match": "===|!==|==|!=", + "name": "keyword.operator.comparison.js" + }, + { + "match": "<=|>=|<>|<|>", + "name": "keyword.operator.relational.js" + }, + { + "captures": { + "1": { + "name": "keyword.operator.logical.js" + }, + "2": { + "name": "keyword.operator.assignment.compound.js" + }, + "3": { + "name": "keyword.operator.arithmetic.js" + } + }, + "match": "(?<=[_$0-9A-Za-z])(!)\\s*(?:(/=)|(?:(/)(?![/*])))" + }, + { + "match": "!|&&|\\|\\||\\?\\?", + "name": "keyword.operator.logical.js" + }, + { + "match": "\\&|~|\\^|\\|", + "name": "keyword.operator.bitwise.js" + }, + { + "match": "=", + "name": "keyword.operator.assignment.js" + }, + { + "match": "--", + "name": "keyword.operator.decrement.js" + }, + { + "match": "\\+\\+", + "name": "keyword.operator.increment.js" + }, + { + "match": "%|\\*|/|-|\\+", + "name": "keyword.operator.arithmetic.js" + }, + { + "begin": "(?<=[_$0-9A-Za-z)\\]])\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)+(?:(/=)|(?:(/)(?![/*]))))", + "end": "(?:(/=)|(?:(/)(?!\\*([^\\*]|(\\*[^\\/]))*\\*\\/)))", + "endCaptures": { + "1": { + "name": "keyword.operator.assignment.compound.js" + }, + "2": { + "name": "keyword.operator.arithmetic.js" + } + }, + "patterns": [ + { + "include": "#comment" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.operator.assignment.compound.js" + }, + "2": { + "name": "keyword.operator.arithmetic.js" + } + }, + "match": "(?<=[_$0-9A-Za-z)\\]])\\s*(?:(/=)|(?:(/)(?![/*])))" + } + ] + }, + "expressionPunctuations": { + "patterns": [ + { + "include": "#punctuation-comma" + }, + { + "include": "#punctuation-accessor" + } + ] + }, + "expressionWithoutIdentifiers": { + "patterns": [ + { + "include": "#jsx" + }, + { + "include": "#string" + }, + { + "include": "#regex" + }, + { + "include": "#comment" + }, + { + "include": "#function-expression" + }, + { + "include": "#class-expression" + }, + { + "include": "#arrow-function" + }, + { + "include": "#paren-expression-possibly-arrow" + }, + { + "include": "#cast" + }, + { + "include": "#ternary-expression" + }, + { + "include": "#new-expr" + }, + { + "include": "#instanceof-expr" + }, + { + "include": "#object-literal" + }, + { + "include": "#expression-operators" + }, + { + "include": "#function-call" + }, + { + "include": "#literal" + }, + { + "include": "#support-objects" + }, + { + "include": "#paren-expression" + } + ] + }, + "field-declaration": { + "begin": "(?)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>)))))|(:\\s*((<)|([(]\\s*(([)])|(\\.\\.\\.)|([_$0-9A-Za-z]+\\s*(([:,?=])|([)]\\s*=>)))))))|(:\\s*(?(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(((async\\s+)?((function\\s*[(<*])|(function\\s+)|([_$A-Za-z][_$0-9A-Za-z]*\\s*=>)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>))))))" + }, + { + "match": "\\#?[_$A-Za-z][_$0-9A-Za-z]*", + "name": "meta.definition.property.js variable.object.property.js" + }, + { + "match": "\\?", + "name": "keyword.operator.optional.js" + }, + { + "match": "!", + "name": "keyword.operator.definiteassignment.js" + } + ] + }, + "for-loop": { + "begin": "(?\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + "end": "(?<=\\))(?!(((([_$A-Za-z][_$0-9A-Za-z]*)(\\s*\\??\\.\\s*(\\#?[_$A-Za-z][_$0-9A-Za-z]*))*)|(\\??\\.\\s*\\#?[_$A-Za-z][_$0-9A-Za-z]*))|(?<=[)]))\\s*(?:(\\?\\.\\s*)|(!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + "patterns": [ + { + "begin": "(?=(([_$A-Za-z][_$0-9A-Za-z]*)(\\s*\\??\\.\\s*(\\#?[_$A-Za-z][_$0-9A-Za-z]*))*)|(\\??\\.\\s*\\#?[_$A-Za-z][_$0-9A-Za-z]*))", + "end": "(?=\\s*(?:(\\?\\.\\s*)|(!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + "name": "meta.function-call.js", + "patterns": [ + { + "include": "#function-call-target" + } + ] + }, + { + "include": "#comment" + }, + { + "include": "#function-call-optionals" + }, + { + "include": "#type-arguments" + }, + { + "include": "#paren-expression" + } + ] + }, + { + "begin": "(?=(((([_$A-Za-z][_$0-9A-Za-z]*)(\\s*\\??\\.\\s*(\\#?[_$A-Za-z][_$0-9A-Za-z]*))*)|(\\??\\.\\s*\\#?[_$A-Za-z][_$0-9A-Za-z]*))|(?<=[)]))(<\\s*[{\\[(]\\s*$))", + "end": "(?<=>)(?!(((([_$A-Za-z][_$0-9A-Za-z]*)(\\s*\\??\\.\\s*(\\#?[_$A-Za-z][_$0-9A-Za-z]*))*)|(\\??\\.\\s*\\#?[_$A-Za-z][_$0-9A-Za-z]*))|(?<=[)]))(<\\s*[{\\[(]\\s*$))", + "patterns": [ + { + "begin": "(?=(([_$A-Za-z][_$0-9A-Za-z]*)(\\s*\\??\\.\\s*(\\#?[_$A-Za-z][_$0-9A-Za-z]*))*)|(\\??\\.\\s*\\#?[_$A-Za-z][_$0-9A-Za-z]*))", + "end": "(?=(<\\s*[{\\[(]\\s*$))", + "name": "meta.function-call.js", + "patterns": [ + { + "include": "#function-call-target" + } + ] + }, + { + "include": "#comment" + }, + { + "include": "#function-call-optionals" + }, + { + "include": "#type-arguments" + } + ] + } + ] + }, + "function-call-optionals": { + "patterns": [ + { + "match": "\\?\\.", + "name": "meta.function-call.js punctuation.accessor.optional.js" + }, + { + "match": "!", + "name": "meta.function-call.js keyword.operator.definiteassignment.js" + } + ] + }, + "function-call-target": { + "patterns": [ + { + "include": "#support-function-call-identifiers" + }, + { + "match": "(\\#?[_$A-Za-z][_$0-9A-Za-z]*)", + "name": "entity.name.function.js" + } + ] + }, + "function-declaration": { + "begin": "(?)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>)))))" + }, + { + "captures": { + "1": { + "name": "punctuation.accessor.js" + }, + "2": { + "name": "punctuation.accessor.optional.js" + }, + "3": { + "name": "variable.other.constant.property.js" + } + }, + "match": "(?:(\\.)|(\\?\\.(?!\\s*[\\d])))\\s*(\\#?[A-Z][_$\\dA-Z]*)(?![_$0-9A-Za-z])" + }, + { + "captures": { + "1": { + "name": "punctuation.accessor.js" + }, + "2": { + "name": "punctuation.accessor.optional.js" + }, + "3": { + "name": "variable.other.property.js" + } + }, + "match": "(?:(\\.)|(\\?\\.(?!\\s*[\\d])))\\s*(\\#?[_$A-Za-z][_$0-9A-Za-z]*)" + }, + { + "match": "([A-Z][_$\\dA-Z]*)(?![_$0-9A-Za-z])", + "name": "variable.other.constant.js" + }, + { + "match": "[_$A-Za-z][_$0-9A-Za-z]*", + "name": "variable.other.readwrite.js" + } + ] + }, + "if-statement": { + "patterns": [ + { + "begin": "(?]|\\|\\||\\&\\&|!==|$|(===|!==|==|!=)|(([\\&\\~\\^\\|]\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s+instanceof(?![_$0-9A-Za-z])(?:(?=\\.\\.\\.)|(?!\\.)))|((?))", + "end": "(/>)|(?:())", + "endCaptures": { + "1": { + "name": "punctuation.definition.tag.end.js" + }, + "2": { + "name": "punctuation.definition.tag.begin.js" + }, + "3": { + "name": "entity.name.tag.namespace.js" + }, + "4": { + "name": "punctuation.separator.namespace.js" + }, + "5": { + "name": "entity.name.tag.js" + }, + "6": { + "name": "support.class.component.js" + }, + "7": { + "name": "punctuation.definition.tag.end.js" + } + }, + "name": "meta.tag.js", + "patterns": [ + { + "begin": "(<)\\s*(?:([_$A-Za-z][-_$0-9A-Za-z.]*)(?)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.js" + }, + "2": { + "name": "entity.name.tag.namespace.js" + }, + "3": { + "name": "punctuation.separator.namespace.js" + }, + "4": { + "name": "entity.name.tag.js" + }, + "5": { + "name": "support.class.component.js" + } + }, + "end": "(?=[/]?>)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-arguments" + }, + { + "include": "#jsx-tag-attributes" + } + ] + }, + { + "begin": "(>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.end.js" + } + }, + "contentName": "meta.jsx.children.js", + "end": "(?=|/\\*|//)" + }, + "jsx-tag-attributes": { + "begin": "\\s+", + "end": "(?=[/]?>)", + "name": "meta.tag.attributes.js", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#jsx-tag-attribute-name" + }, + { + "include": "#jsx-tag-attribute-assignment" + }, + { + "include": "#jsx-string-double-quoted" + }, + { + "include": "#jsx-string-single-quoted" + }, + { + "include": "#jsx-evaluated-code" + }, + { + "include": "#jsx-tag-attributes-illegal" + } + ] + }, + "jsx-tag-attributes-illegal": { + "match": "\\S+", + "name": "invalid.illegal.attribute.js" + }, + "jsx-tag-in-expression": { + "begin": "(?:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$0-9A-Za-z]await|^return|[^\\._$0-9A-Za-z]return|^default|[^\\._$0-9A-Za-z]default|^yield|[^\\._$0-9A-Za-z]yield|^)\\s*(?!<\\s*[_$A-Za-z][_$0-9A-Za-z]*((\\s+extends\\s+[^=>])|,))(?=(<)\\s*(?:([_$A-Za-z][-_$0-9A-Za-z.]*)(?))", + "end": "(?!(<)\\s*(?:([_$A-Za-z][-_$0-9A-Za-z.]*)(?))", + "patterns": [ + { + "include": "#jsx-tag" + } + ] + }, + "jsx-tag-without-attributes": { + "begin": "(<)\\s*(?:([_$A-Za-z][-_$0-9A-Za-z.]*)(?)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.js" + }, + "2": { + "name": "entity.name.tag.namespace.js" + }, + "3": { + "name": "punctuation.separator.namespace.js" + }, + "4": { + "name": "entity.name.tag.js" + }, + "5": { + "name": "support.class.component.js" + }, + "6": { + "name": "punctuation.definition.tag.end.js" + } + }, + "contentName": "meta.jsx.children.js", + "end": "()", + "endCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.js" + }, + "2": { + "name": "entity.name.tag.namespace.js" + }, + "3": { + "name": "punctuation.separator.namespace.js" + }, + "4": { + "name": "entity.name.tag.js" + }, + "5": { + "name": "support.class.component.js" + }, + "6": { + "name": "punctuation.definition.tag.end.js" + } + }, + "name": "meta.tag.without-attributes.js", + "patterns": [ + { + "include": "#jsx-children" + } + ] + }, + "jsx-tag-without-attributes-in-expression": { + "begin": "(?:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$0-9A-Za-z]await|^return|[^\\._$0-9A-Za-z]return|^default|[^\\._$0-9A-Za-z]default|^yield|[^\\._$0-9A-Za-z]yield|^)\\s*(?=(<)\\s*(?:([_$A-Za-z][-_$0-9A-Za-z.]*)(?))", + "end": "(?!(<)\\s*(?:([_$A-Za-z][-_$0-9A-Za-z.]*)(?))", + "patterns": [ + { + "include": "#jsx-tag-without-attributes" + } + ] + }, + "label": { + "patterns": [ + { + "begin": "([_$A-Za-z][_$0-9A-Za-z]*)\\s*(:)(?=\\s*\\{)", + "beginCaptures": { + "1": { + "name": "entity.name.label.js" + }, + "2": { + "name": "punctuation.separator.label.js" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#decl-block" + } + ] + }, + { + "captures": { + "1": { + "name": "entity.name.label.js" + }, + "2": { + "name": "punctuation.separator.label.js" + } + }, + "match": "([_$A-Za-z][_$0-9A-Za-z]*)\\s*(:)" + } + ] + }, + "literal": { + "patterns": [ + { + "include": "#numeric-literal" + }, + { + "include": "#boolean-literal" + }, + { + "include": "#null-literal" + }, + { + "include": "#undefined-literal" + }, + { + "include": "#numericConstant-literal" + }, + { + "include": "#array-literal" + }, + { + "include": "#this-literal" + }, + { + "include": "#super-literal" + } + ] + }, + "method-declaration": { + "patterns": [ + { + "begin": "(?]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*))?[(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.js" + }, + "2": { + "name": "storage.modifier.js" + }, + "3": { + "name": "storage.modifier.js" + }, + "4": { + "name": "storage.modifier.async.js" + }, + "5": { + "name": "keyword.operator.new.js" + }, + "6": { + "name": "keyword.generator.asterisk.js" + } + }, + "end": "(?=\\}|;|,|$)|(?<=\\})", + "name": "meta.method.declaration.js", + "patterns": [ + { + "include": "#method-declaration-name" + }, + { + "include": "#function-body" + } + ] + }, + { + "begin": "(?]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*))?[(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.js" + }, + "2": { + "name": "storage.modifier.js" + }, + "3": { + "name": "storage.modifier.js" + }, + "4": { + "name": "storage.modifier.async.js" + }, + "5": { + "name": "storage.type.property.js" + }, + "6": { + "name": "keyword.generator.asterisk.js" + } + }, + "end": "(?=\\}|;|,|$)|(?<=\\})", + "name": "meta.method.declaration.js", + "patterns": [ + { + "include": "#method-declaration-name" + }, + { + "include": "#function-body" + } + ] + } + ] + }, + "method-declaration-name": { + "begin": "(?=((\\b(?]|\\|\\||\\&\\&|!==|$|((?]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*))?[(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js" + }, + "2": { + "name": "storage.type.property.js" + }, + "3": { + "name": "keyword.generator.asterisk.js" + } + }, + "end": "(?=\\}|;|,)|(?<=\\})", + "name": "meta.method.declaration.js", + "patterns": [ + { + "include": "#method-declaration-name" + }, + { + "include": "#function-body" + }, + { + "begin": "(?]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*))?[(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js" + }, + "2": { + "name": "storage.type.property.js" + }, + "3": { + "name": "keyword.generator.asterisk.js" + } + }, + "end": "(?=\\(|<)", + "patterns": [ + { + "include": "#method-declaration-name" + } + ] + } + ] + }, + "object-member": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#object-literal-method-declaration" + }, + { + "begin": "(?=\\[)", + "end": "(?=:)|((?<=[\\]])(?=\\s*[(<]))", + "name": "meta.object.member.js meta.object-literal.key.js", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#array-literal" + } + ] + }, + { + "begin": "(?=[\\'\\\"\\`])", + "end": "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[(<,}])|(\\s+(as|satisifies)\\s+))))", + "name": "meta.object.member.js meta.object-literal.key.js", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + } + ] + }, + { + "begin": "(?=(\\b(?)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>))))))", + "name": "meta.object.member.js" + }, + { + "captures": { + "0": { + "name": "meta.object-literal.key.js" + } + }, + "match": "(?:[_$A-Za-z][_$0-9A-Za-z]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)", + "name": "meta.object.member.js" + }, + { + "begin": "\\.\\.\\.", + "beginCaptures": { + "0": { + "name": "keyword.operator.spread.js" + } + }, + "end": "(?=,|\\})", + "name": "meta.object.member.js", + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "captures": { + "1": { + "name": "variable.other.readwrite.js" + } + }, + "match": "([_$A-Za-z][_$0-9A-Za-z]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)", + "name": "meta.object.member.js" + }, + { + "captures": { + "1": { + "name": "keyword.control.as.js" + }, + "2": { + "name": "storage.modifier.js" + } + }, + "match": "(?]|\\|\\||\\&\\&|!==|$|^|((?]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)\\(\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#type-parameters" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.js" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.js" + } + }, + "patterns": [ + { + "include": "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + { + "begin": "(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js" + }, + "2": { + "name": "meta.brace.round.js" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.js" + } + }, + "patterns": [ + { + "include": "#expression-inside-possibly-arrow-parens" + } + ] + }, + { + "begin": "(?<=:)\\s*(async)?\\s*(?=<\\s*$)", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js" + } + }, + "end": "(?<=>)", + "patterns": [ + { + "include": "#type-parameters" + } + ] + }, + { + "begin": "(?<=>)\\s*(\\()(?=\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))", + "beginCaptures": { + "1": { + "name": "meta.brace.round.js" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.js" + } + }, + "patterns": [ + { + "include": "#expression-inside-possibly-arrow-parens" + } + ] + }, + { + "include": "#possibly-arrow-return-type" + }, + { + "include": "#expression" + } + ] + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#decl-block" + } + ] + }, + "parameter-array-binding-pattern": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.js" + }, + "2": { + "name": "punctuation.definition.binding-pattern.array.js" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.array.js" + } + }, + "patterns": [ + { + "include": "#parameter-binding-element" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "parameter-binding-element": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#numeric-literal" + }, + { + "include": "#regex" + }, + { + "include": "#parameter-object-binding-pattern" + }, + { + "include": "#parameter-array-binding-pattern" + }, + { + "include": "#destructuring-parameter-rest" + }, + { + "include": "#variable-initializer" + } + ] + }, + "parameter-name": { + "patterns": [ + { + "captures": { + "1": { + "name": "storage.modifier.js" + } + }, + "match": "(?)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>)))))|(:\\s*((<)|([(]\\s*(([)])|(\\.\\.\\.)|([_$0-9A-Za-z]+\\s*(([:,?=])|([)]\\s*=>)))))))|(:\\s*(?(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(((async\\s+)?((function\\s*[(<*])|(function\\s+)|([_$A-Za-z][_$0-9A-Za-z]*\\s*=>)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>))))))" + }, + { + "captures": { + "1": { + "name": "storage.modifier.js" + }, + "2": { + "name": "keyword.operator.rest.js" + }, + "3": { + "name": "variable.parameter.js variable.language.this.js" + }, + "4": { + "name": "variable.parameter.js" + }, + "5": { + "name": "keyword.operator.optional.js" + } + }, + "match": "(?:(?])", + "name": "meta.type.annotation.js", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, + "paren-expression": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.js" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.js" + } + }, + "patterns": [ + { + "include": "#expression" + } + ] + }, + "paren-expression-possibly-arrow": { + "patterns": [ + { + "begin": "(?<=[(=,])\\s*(async)?(?=\\s*((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*))?\\(\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + "begin": "(?<=[(=,]|=>|^return|[^\\._$0-9A-Za-z]return)\\s*(async)?(?=\\s*((((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*))?\\()|(<)|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)))\\s*$)", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + "include": "#possibly-arrow-return-type" + } + ] + }, + "paren-expression-possibly-arrow-with-typeparameters": { + "patterns": [ + { + "include": "#type-parameters" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.js" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.js" + } + }, + "patterns": [ + { + "include": "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + "possibly-arrow-return-type": { + "begin": "(?<=\\)|^)\\s*(:)(?=\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*=>)", + "beginCaptures": { + "1": { + "name": "meta.arrow.js meta.return.type.arrow.js keyword.operator.type.annotation.js" + } + }, + "contentName": "meta.arrow.js meta.return.type.arrow.js", + "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)\\b)|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + "patterns": [ + { + "include": "#arrow-return-type-body" + } + ] + }, + "property-accessor": { + "match": "(?|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[()]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\]|\\(([^)\\\\]|\\\\.)+\\))+\\/([dgimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.js" + } + }, + "end": "(/)([dgimsuy]*)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.js" + }, + "2": { + "name": "keyword.other.js" + } + }, + "name": "string.regexp.js", + "patterns": [ + { + "include": "#regexp" + } + ] + }, + { + "begin": "((?" + }, + { + "match": "[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??", + "name": "keyword.operator.quantifier.regexp" + }, + { + "match": "\\|", + "name": "keyword.operator.or.regexp" + }, + { + "begin": "(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?))?", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.regexp" + }, + "1": { + "name": "punctuation.definition.group.no-capture.regexp" + }, + "2": { + "name": "variable.other.regexp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.regexp" + } + }, + "name": "meta.group.regexp", + "patterns": [ + { + "include": "#regexp" + } + ] + }, + { + "begin": "(\\[)(\\^)?", + "beginCaptures": { + "1": { + "name": "punctuation.definition.character-class.regexp" + }, + "2": { + "name": "keyword.operator.negation.regexp" + } + }, + "end": "(\\])", + "endCaptures": { + "1": { + "name": "punctuation.definition.character-class.regexp" + } + }, + "name": "constant.other.character-class.set.regexp", + "patterns": [ + { + "captures": { + "1": { + "name": "constant.character.numeric.regexp" + }, + "2": { + "name": "constant.character.control.regexp" + }, + "3": { + "name": "constant.character.escape.backslash.regexp" + }, + "4": { + "name": "constant.character.numeric.regexp" + }, + "5": { + "name": "constant.character.control.regexp" + }, + "6": { + "name": "constant.character.escape.backslash.regexp" + } + }, + "match": "(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))", + "name": "constant.other.character-class.range.regexp" + }, + { + "include": "#regex-character-class" + } + ] + }, + { + "include": "#regex-character-class" + } + ] + }, + "return-type": { + "patterns": [ + { + "begin": "(?<=\\))\\s*(:)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.js" + } + }, + "end": "(?]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\())|(?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))" + }, + { + "captures": { + "1": { + "name": "support.type.object.module.js" + }, + "2": { + "name": "support.type.object.module.js" + }, + "3": { + "name": "punctuation.accessor.js" + }, + "4": { + "name": "punctuation.accessor.optional.js" + }, + "5": { + "name": "support.type.object.module.js" + } + }, + "match": "(?\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?`)", + "end": "(?=`)", + "patterns": [ + { + "begin": "(?=(([_$A-Za-z][_$0-9A-Za-z]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$A-Za-z][_$0-9A-Za-z]*))", + "end": "(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?`)", + "patterns": [ + { + "include": "#support-function-call-identifiers" + }, + { + "match": "([_$A-Za-z][_$0-9A-Za-z]*)", + "name": "entity.name.function.tagged-template.js" + } + ] + }, + { + "include": "#type-arguments" + } + ] + }, + { + "begin": "([_$A-Za-z][_$0-9A-Za-z]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)`)", + "beginCaptures": { + "1": { + "name": "entity.name.function.tagged-template.js" + } + }, + "end": "(?=`)", + "patterns": [ + { + "include": "#type-arguments" + } + ] + } + ] + }, + "template-substitution-element": { + "begin": "\\$\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.template-expression.begin.js" + } + }, + "contentName": "meta.embedded.line.js", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.template-expression.end.js" + } + }, + "name": "meta.template.expression.js", + "patterns": [ + { + "include": "#expression" + } + ] + }, + "template-type": { + "patterns": [ + { + "include": "#template-call" + }, + { + "begin": "([_$A-Za-z][_$0-9A-Za-z]*)?(`)", + "beginCaptures": { + "1": { + "name": "entity.name.function.tagged-template.js" + }, + "2": { + "name": "string.template.js punctuation.definition.string.template.begin.js" + } + }, + "contentName": "string.template.js", + "end": "`", + "endCaptures": { + "0": { + "name": "string.template.js punctuation.definition.string.template.end.js" + } + }, + "patterns": [ + { + "include": "#template-type-substitution-element" + }, + { + "include": "#string-character-escape" + } + ] + } + ] + }, + "template-type-substitution-element": { + "begin": "\\$\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.template-expression.begin.js" + } + }, + "contentName": "meta.embedded.line.js", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.template-expression.end.js" + } + }, + "name": "meta.template.expression.js", + "patterns": [ + { + "include": "#type" + } + ] + }, + "ternary-expression": { + "begin": "(?!\\?\\.\\s*[^\\d])(\\?)(?!\\?)", + "beginCaptures": { + "1": { + "name": "keyword.operator.ternary.js" + } + }, + "end": "\\s*(:)", + "endCaptures": { + "1": { + "name": "keyword.operator.ternary.js" + } + }, + "patterns": [ + { + "include": "#expression" + } + ] + }, + "this-literal": { + "match": "(?])|((?<=[}>\\])]|[_$A-Za-z])\\s*(?=\\{)))", + "name": "meta.type.annotation.js", + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "begin": "(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.js" + } + }, + "end": "(?])|(?=^\\s*$)|((?<=[}>\\])]|[_$A-Za-z])\\s*(?=\\{)))", + "name": "meta.type.annotation.js", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, + "type-arguments": { + "begin": "<", + "beginCaptures": { + "0": { + "name": "punctuation.definition.typeparameters.begin.js" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.typeparameters.end.js" + } + }, + "name": "meta.type.parameters.js", + "patterns": [ + { + "include": "#type-arguments-body" + } + ] + }, + "type-arguments-body": { + "patterns": [ + { + "captures": { + "0": { + "name": "keyword.operator.type.js" + } + }, + "match": "(?)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-parameters" + } + ] + }, + { + "begin": "(?))))))", + "end": "(?<=\\))", + "name": "meta.type.function.js", + "patterns": [ + { + "include": "#function-parameters" + } + ] + } + ] + }, + "type-function-return-type": { + "patterns": [ + { + "begin": "(=>)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "storage.type.function.arrow.js" + } + }, + "end": "(?)(?:?]|//|$)", + "name": "meta.type.function.return.js", + "patterns": [ + { + "include": "#type-function-return-type-core" + } + ] + }, + { + "begin": "=>", + "beginCaptures": { + "0": { + "name": "storage.type.function.arrow.js" + } + }, + "end": "(?)(?]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))", + "name": "meta.type.function.return.js", + "patterns": [ + { + "include": "#type-function-return-type-core" + } + ] + } + ] + }, + "type-function-return-type-core": { + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "(?<==>)(?=\\s*\\{)", + "end": "(?<=\\})", + "patterns": [ + { + "include": "#type-object" + } + ] + }, + { + "include": "#type-predicate-operator" + }, + { + "include": "#type" + } + ] + }, + "type-infer": { + "patterns": [ + { + "captures": { + "1": { + "name": "keyword.operator.expression.infer.js" + }, + "2": { + "name": "entity.name.type.js" + }, + "3": { + "name": "keyword.operator.expression.extends.js" + } + }, + "match": "(?)", + "endCaptures": { + "1": { + "name": "meta.type.parameters.js punctuation.definition.typeparameters.end.js" + } + }, + "patterns": [ + { + "include": "#type-arguments-body" + } + ] + }, + { + "begin": "([_$A-Za-z][_$0-9A-Za-z]*)\\s*(<)", + "beginCaptures": { + "1": { + "name": "entity.name.type.js" + }, + "2": { + "name": "meta.type.parameters.js punctuation.definition.typeparameters.begin.js" + } + }, + "contentName": "meta.type.parameters.js", + "end": "(>)", + "endCaptures": { + "1": { + "name": "meta.type.parameters.js punctuation.definition.typeparameters.end.js" + } + }, + "patterns": [ + { + "include": "#type-arguments-body" + } + ] + }, + { + "captures": { + "1": { + "name": "entity.name.type.module.js" + }, + "2": { + "name": "punctuation.accessor.js" + }, + "3": { + "name": "punctuation.accessor.optional.js" + } + }, + "match": "([_$A-Za-z][_$0-9A-Za-z]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[\\d])))" + }, + { + "match": "[_$A-Za-z][_$0-9A-Za-z]*", + "name": "entity.name.type.js" + } + ] + }, + "type-object": { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.js" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.js" + } + }, + "name": "meta.object.type.js", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#method-declaration" + }, + { + "include": "#indexer-declaration" + }, + { + "include": "#indexer-mapped-type-declaration" + }, + { + "include": "#field-declaration" + }, + { + "include": "#type-annotation" + }, + { + "begin": "\\.\\.\\.", + "beginCaptures": { + "0": { + "name": "keyword.operator.spread.js" + } + }, + "end": "(?=\\}|;|,|$)|(?<=\\})", + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#punctuation-semicolon" + }, + { + "include": "#type" + } + ] + }, + "type-operators": { + "patterns": [ + { + "include": "#typeof-operator" + }, + { + "include": "#type-infer" + }, + { + "begin": "([&|])(?=\\s*\\{)", + "beginCaptures": { + "0": { + "name": "keyword.operator.type.js" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#type-object" + } + ] + }, + { + "begin": "[&|]", + "beginCaptures": { + "0": { + "name": "keyword.operator.type.js" + } + }, + "end": "(?=\\S)" + }, + { + "match": "(?)", + "endCaptures": { + "1": { + "name": "punctuation.definition.typeparameters.end.js" + } + }, + "name": "meta.type.parameters.js", + "patterns": [ + { + "include": "#comment" + }, + { + "match": "(?)", + "name": "keyword.operator.assignment.js" + } + ] + }, + "type-paren-or-function-parameters": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.js" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.js" + } + }, + "name": "meta.type.paren.cover.js", + "patterns": [ + { + "captures": { + "1": { + "name": "storage.modifier.js" + }, + "2": { + "name": "keyword.operator.rest.js" + }, + "3": { + "name": "entity.name.function.js variable.language.this.js" + }, + "4": { + "name": "entity.name.function.js" + }, + "5": { + "name": "keyword.operator.optional.js" + } + }, + "match": "(?:(?)))))))|(:\\s*(?(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))))" + }, + { + "captures": { + "1": { + "name": "storage.modifier.js" + }, + "2": { + "name": "keyword.operator.rest.js" + }, + "3": { + "name": "variable.parameter.js variable.language.this.js" + }, + "4": { + "name": "variable.parameter.js" + }, + "5": { + "name": "keyword.operator.optional.js" + } + }, + "match": "(?:(?:&|{?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)\\b)|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)|var|while)\\b))", + "patterns": [ + { + "include": "#type-arguments" + }, + { + "include": "#expression" + } + ] + }, + "undefined-literal": { + "match": "(?)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>)))))|(:\\s*((<)|([(]\\s*(([)])|(\\.\\.\\.)|([_$0-9A-Za-z]+\\s*(([:,?=])|([)]\\s*=>)))))))|(:\\s*(?(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(((async\\s+)?((function\\s*[(<*])|(function\\s+)|([_$A-Za-z][_$0-9A-Za-z]*\\s*=>)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>))))))", + "beginCaptures": { + "1": { + "name": "meta.definition.variable.js variable.other.constant.js entity.name.function.js" + } + }, + "end": "(?=$|^|[;,=}]|((?)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>)))))|(:\\s*((<)|([(]\\s*(([)])|(\\.\\.\\.)|([_$0-9A-Za-z]+\\s*(([:,?=])|([)]\\s*=>)))))))|(:\\s*(?(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(((async\\s+)?((function\\s*[(<*])|(function\\s+)|([_$A-Za-z][_$0-9A-Za-z]*\\s*=>)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>))))))", + "beginCaptures": { + "1": { + "name": "meta.definition.variable.js entity.name.function.js" + }, + "2": { + "name": "keyword.operator.definiteassignment.js" + } + }, + "end": "(?=$|^|[;,=}]|((?\\s*$)", + "beginCaptures": { + "1": { + "name": "keyword.operator.assignment.js" + } + }, + "end": "(?=$|^|[,);}\\]]|((?]|^await|[^\\._$0-9A-Za-z]await|^return|[^\\._$0-9A-Za-z]return|^yield|[^\\._$0-9A-Za-z]yield|^throw|[^\\._$0-9A-Za-z]throw|^in|[^\\._$0-9A-Za-z]in|^of|[^\\._$0-9A-Za-z]of|^typeof|[^\\._$0-9A-Za-z]typeof|&&|\\|\\||\\*)\\s*(\\{)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.block.js.jsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.js.jsx" + } + }, + "name": "meta.objectliteral.js.jsx", + "patterns": [ + { + "include": "#object-member" + } + ] + }, + "array-binding-pattern": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.js.jsx" + }, + "2": { + "name": "punctuation.definition.binding-pattern.array.js.jsx" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.array.js.jsx" + } + }, + "patterns": [ + { + "include": "#binding-element" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "array-binding-pattern-const": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.js.jsx" + }, + "2": { + "name": "punctuation.definition.binding-pattern.array.js.jsx" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.array.js.jsx" + } + }, + "patterns": [ + { + "include": "#binding-element-const" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "array-literal": { + "begin": "\\s*(\\[)", + "beginCaptures": { + "1": { + "name": "meta.brace.square.js.jsx" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "meta.brace.square.js.jsx" + } + }, + "name": "meta.array.literal.js.jsx", + "patterns": [ + { + "include": "#expression" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "arrow-function": { + "patterns": [ + { + "captures": { + "1": { + "name": "storage.modifier.async.js.jsx" + }, + "2": { + "name": "variable.parameter.js.jsx" + } + }, + "match": "(?:(?)", + "name": "meta.arrow.js.jsx" + }, + { + "begin": "(?:(?]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>)))", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js.jsx" + } + }, + "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)\\b)|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + "name": "meta.arrow.js.jsx", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-parameters" + }, + { + "include": "#function-parameters" + }, + { + "include": "#arrow-return-type" + }, + { + "include": "#possibly-arrow-return-type" + } + ] + }, + { + "begin": "=>", + "beginCaptures": { + "0": { + "name": "storage.type.function.arrow.js.jsx" + } + }, + "end": "((?<=\\}|\\S)(?)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])", + "name": "meta.arrow.js.jsx", + "patterns": [ + { + "include": "#single-line-comment-consuming-line-ending" + }, + { + "include": "#decl-block" + }, + { + "include": "#expression" + } + ] + } + ] + }, + "arrow-return-type": { + "begin": "(?<=\\))\\s*(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.js.jsx" + } + }, + "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)\\b)|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + "name": "meta.return.type.arrow.js.jsx", + "patterns": [ + { + "include": "#arrow-return-type-body" + } + ] + }, + "arrow-return-type-body": { + "patterns": [ + { + "begin": "(?<=[:])(?=\\s*\\{)", + "end": "(?<=\\})", + "patterns": [ + { + "include": "#type-object" + } + ] + }, + { + "include": "#type-predicate-operator" + }, + { + "include": "#type" + } + ] + }, + "async-modifier": { + "match": "(?\\s*$)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.js.jsx" + } + }, + "end": "(?=$)", + "name": "comment.line.triple-slash.directive.js.jsx", + "patterns": [ + { + "begin": "(<)(reference|amd-dependency|amd-module)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.directive.js.jsx" + }, + "2": { + "name": "entity.name.tag.directive.js.jsx" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.directive.js.jsx" + } + }, + "name": "meta.tag.js.jsx", + "patterns": [ + { + "match": "path|types|no-default-lib|lib|name|resolution-mode", + "name": "entity.other.attribute-name.directive.js.jsx" + }, + { + "match": "=", + "name": "keyword.operator.assignment.js.jsx" + }, + { + "include": "#string" + } + ] + } + ] + }, + "docblock": { + "patterns": [ + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "constant.language.access-type.jsdoc" + } + }, + "match": "((@)(?:access|api))\\s+(private|protected|public)\\b" + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "entity.name.type.instance.jsdoc" + }, + "4": { + "name": "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "5": { + "name": "constant.other.email.link.underline.jsdoc" + }, + "6": { + "name": "punctuation.definition.bracket.angle.end.jsdoc" + } + }, + "match": "((@)author)\\s+([^@\\s<>*/](?:[^@<>*/]|\\*[^/])*)(?:\\s*(<)([^>\\s]+)(>))?" + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "entity.name.type.instance.jsdoc" + }, + "4": { + "name": "keyword.operator.control.jsdoc" + }, + "5": { + "name": "entity.name.type.instance.jsdoc" + } + }, + "match": "((@)borrows)\\s+((?:[^@\\s*/]|\\*[^/])+)\\s+(as)\\s+((?:[^@\\s*/]|\\*[^/])+)" + }, + { + "begin": "((@)example)\\s+", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=@|\\*/)", + "name": "meta.example.jsdoc", + "patterns": [ + { + "match": "^\\s\\*\\s+" + }, + { + "begin": "\\G(<)caption(>)", + "beginCaptures": { + "0": { + "name": "entity.name.tag.inline.jsdoc" + }, + "1": { + "name": "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + "name": "punctuation.definition.bracket.angle.end.jsdoc" + } + }, + "contentName": "constant.other.description.jsdoc", + "end": "()|(?=\\*/)", + "endCaptures": { + "0": { + "name": "entity.name.tag.inline.jsdoc" + }, + "1": { + "name": "punctuation.definition.bracket.angle.begin.jsdoc" + }, + "2": { + "name": "punctuation.definition.bracket.angle.end.jsdoc" + } + } + }, + { + "captures": { + "0": { + "name": "source.embedded.js.jsx" + } + }, + "match": "[^\\s@*](?:[^*]|\\*[^/])*" + } + ] + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "constant.language.symbol-type.jsdoc" + } + }, + "match": "((@)kind)\\s+(class|constant|event|external|file|function|member|mixin|module|namespace|typedef)\\b" + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.link.underline.jsdoc" + }, + "4": { + "name": "entity.name.type.instance.jsdoc" + } + }, + "match": "((@)see)\\s+(?:((?=https?://)(?:[^\\s*]|\\*[^/])+)|((?!https?://|(?:\\[[^\\[\\]]*\\])?{@(?:link|linkcode|linkplain|tutorial)\\b)(?:[^@\\s*/]|\\*[^/])+))" + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + } + }, + "match": "((@)template)\\s+([A-Za-z_$][\\w$.\\[\\]]*(?:\\s*,\\s*[A-Za-z_$][\\w$.\\[\\]]*)*)" + }, + { + "begin": "((@)template)\\s+(?={)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", + "patterns": [ + { + "include": "#jsdoctype" + }, + { + "match": "([A-Za-z_$][\\w$.\\[\\]]*)", + "name": "variable.other.jsdoc" + } + ] + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + } + }, + "match": "((@)(?:arg|argument|const|constant|member|namespace|param|var))\\s+([A-Za-z_$][\\w$.\\[\\]]*)" + }, + { + "begin": "((@)typedef)\\s+(?={)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", + "patterns": [ + { + "include": "#jsdoctype" + }, + { + "match": "(?:[^@\\s*/]|\\*[^/])+", + "name": "entity.name.type.instance.jsdoc" + } + ] + }, + { + "begin": "((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", + "patterns": [ + { + "include": "#jsdoctype" + }, + { + "match": "([A-Za-z_$][\\w$.\\[\\]]*)", + "name": "variable.other.jsdoc" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.optional-value.begin.bracket.square.jsdoc" + }, + "2": { + "name": "keyword.operator.assignment.jsdoc" + }, + "3": { + "name": "source.embedded.js.jsx" + }, + "4": { + "name": "punctuation.definition.optional-value.end.bracket.square.jsdoc" + }, + "5": { + "name": "invalid.illegal.syntax.jsdoc" + } + }, + "match": "(\\[)\\s*[\\w$]+(?:(?:\\[\\])?\\.[\\w$]+)*(?:\\s*(=)\\s*((?>\"(?:(?:\\*(?!/))|(?:\\\\(?!\"))|[^*\\\\])*?\"|'(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?'|\\[(?:(?:\\*(?!/))|[^*])*?\\]|(?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])*)*))?\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))", + "name": "variable.other.jsdoc" + } + ] + }, + { + "begin": "((@)(?:define|enum|exception|export|extends|lends|implements|modifies|namespace|private|protected|returns?|satisfies|suppress|this|throws|type|yields?))\\s+(?={)", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", + "patterns": [ + { + "include": "#jsdoctype" + } + ] + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "entity.name.type.instance.jsdoc" + } + }, + "match": "((@)(?:alias|augments|callback|constructs|emits|event|fires|exports?|extends|external|function|func|host|lends|listens|interface|memberof!?|method|module|mixes|mixin|name|requires|see|this|typedef|uses))\\s+((?:[^{}@\\s*]|\\*[^/])+)" + }, + { + "begin": "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))", + "beginCaptures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + }, + "4": { + "name": "punctuation.definition.string.begin.jsdoc" + } + }, + "contentName": "variable.other.jsdoc", + "end": "(\\3)|(?=$|\\*/)", + "endCaptures": { + "0": { + "name": "variable.other.jsdoc" + }, + "1": { + "name": "punctuation.definition.string.end.jsdoc" + } + } + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + }, + "3": { + "name": "variable.other.jsdoc" + } + }, + "match": "((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "match": "(@)(?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles|callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright|default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception|exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func|function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc|inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method|mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects|override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected|public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary|suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation|version|virtual|writeOnce|yields?)\\b", + "name": "storage.type.class.jsdoc" + }, + { + "include": "#inline-tags" + }, + { + "captures": { + "1": { + "name": "storage.type.class.jsdoc" + }, + "2": { + "name": "punctuation.definition.block.tag.jsdoc" + } + }, + "match": "((@)(?:[_$A-Za-z][_$0-9A-Za-z]*))(?=\\s+)" + } + ] + }, + "enum-declaration": { + "begin": "(?)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>)))))|(:\\s*((<)|([(]\\s*(([)])|(\\.\\.\\.)|([_$0-9A-Za-z]+\\s*(([:,?=])|([)]\\s*=>)))))))|(:\\s*(?(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(((async\\s+)?((function\\s*[(<*])|(function\\s+)|([_$A-Za-z][_$0-9A-Za-z]*\\s*=>)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>))))))" + }, + { + "captures": { + "1": { + "name": "storage.modifier.js.jsx" + }, + "2": { + "name": "keyword.operator.rest.js.jsx" + }, + "3": { + "name": "variable.parameter.js.jsx variable.language.this.js.jsx" + }, + "4": { + "name": "variable.parameter.js.jsx" + }, + "5": { + "name": "keyword.operator.optional.js.jsx" + } + }, + "match": "(?:(?]|\\|\\||\\&\\&|!==|$|((?>=|>>>=|\\|=", + "name": "keyword.operator.assignment.compound.bitwise.js.jsx" + }, + { + "match": "<<|>>>|>>", + "name": "keyword.operator.bitwise.shift.js.jsx" + }, + { + "match": "===|!==|==|!=", + "name": "keyword.operator.comparison.js.jsx" + }, + { + "match": "<=|>=|<>|<|>", + "name": "keyword.operator.relational.js.jsx" + }, + { + "captures": { + "1": { + "name": "keyword.operator.logical.js.jsx" + }, + "2": { + "name": "keyword.operator.assignment.compound.js.jsx" + }, + "3": { + "name": "keyword.operator.arithmetic.js.jsx" + } + }, + "match": "(?<=[_$0-9A-Za-z])(!)\\s*(?:(/=)|(?:(/)(?![/*])))" + }, + { + "match": "!|&&|\\|\\||\\?\\?", + "name": "keyword.operator.logical.js.jsx" + }, + { + "match": "\\&|~|\\^|\\|", + "name": "keyword.operator.bitwise.js.jsx" + }, + { + "match": "=", + "name": "keyword.operator.assignment.js.jsx" + }, + { + "match": "--", + "name": "keyword.operator.decrement.js.jsx" + }, + { + "match": "\\+\\+", + "name": "keyword.operator.increment.js.jsx" + }, + { + "match": "%|\\*|/|-|\\+", + "name": "keyword.operator.arithmetic.js.jsx" + }, + { + "begin": "(?<=[_$0-9A-Za-z)\\]])\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)+(?:(/=)|(?:(/)(?![/*]))))", + "end": "(?:(/=)|(?:(/)(?!\\*([^\\*]|(\\*[^\\/]))*\\*\\/)))", + "endCaptures": { + "1": { + "name": "keyword.operator.assignment.compound.js.jsx" + }, + "2": { + "name": "keyword.operator.arithmetic.js.jsx" + } + }, + "patterns": [ + { + "include": "#comment" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.operator.assignment.compound.js.jsx" + }, + "2": { + "name": "keyword.operator.arithmetic.js.jsx" + } + }, + "match": "(?<=[_$0-9A-Za-z)\\]])\\s*(?:(/=)|(?:(/)(?![/*])))" + } + ] + }, + "expressionPunctuations": { + "patterns": [ + { + "include": "#punctuation-comma" + }, + { + "include": "#punctuation-accessor" + } + ] + }, + "expressionWithoutIdentifiers": { + "patterns": [ + { + "include": "#jsx" + }, + { + "include": "#string" + }, + { + "include": "#regex" + }, + { + "include": "#comment" + }, + { + "include": "#function-expression" + }, + { + "include": "#class-expression" + }, + { + "include": "#arrow-function" + }, + { + "include": "#paren-expression-possibly-arrow" + }, + { + "include": "#cast" + }, + { + "include": "#ternary-expression" + }, + { + "include": "#new-expr" + }, + { + "include": "#instanceof-expr" + }, + { + "include": "#object-literal" + }, + { + "include": "#expression-operators" + }, + { + "include": "#function-call" + }, + { + "include": "#literal" + }, + { + "include": "#support-objects" + }, + { + "include": "#paren-expression" + } + ] + }, + "field-declaration": { + "begin": "(?)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>)))))|(:\\s*((<)|([(]\\s*(([)])|(\\.\\.\\.)|([_$0-9A-Za-z]+\\s*(([:,?=])|([)]\\s*=>)))))))|(:\\s*(?(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(((async\\s+)?((function\\s*[(<*])|(function\\s+)|([_$A-Za-z][_$0-9A-Za-z]*\\s*=>)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>))))))" + }, + { + "match": "\\#?[_$A-Za-z][_$0-9A-Za-z]*", + "name": "meta.definition.property.js.jsx variable.object.property.js.jsx" + }, + { + "match": "\\?", + "name": "keyword.operator.optional.js.jsx" + }, + { + "match": "!", + "name": "keyword.operator.definiteassignment.js.jsx" + } + ] + }, + "for-loop": { + "begin": "(?\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + "end": "(?<=\\))(?!(((([_$A-Za-z][_$0-9A-Za-z]*)(\\s*\\??\\.\\s*(\\#?[_$A-Za-z][_$0-9A-Za-z]*))*)|(\\??\\.\\s*\\#?[_$A-Za-z][_$0-9A-Za-z]*))|(?<=[)]))\\s*(?:(\\?\\.\\s*)|(!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + "patterns": [ + { + "begin": "(?=(([_$A-Za-z][_$0-9A-Za-z]*)(\\s*\\??\\.\\s*(\\#?[_$A-Za-z][_$0-9A-Za-z]*))*)|(\\??\\.\\s*\\#?[_$A-Za-z][_$0-9A-Za-z]*))", + "end": "(?=\\s*(?:(\\?\\.\\s*)|(!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?\\())", + "name": "meta.function-call.js.jsx", + "patterns": [ + { + "include": "#function-call-target" + } + ] + }, + { + "include": "#comment" + }, + { + "include": "#function-call-optionals" + }, + { + "include": "#type-arguments" + }, + { + "include": "#paren-expression" + } + ] + }, + { + "begin": "(?=(((([_$A-Za-z][_$0-9A-Za-z]*)(\\s*\\??\\.\\s*(\\#?[_$A-Za-z][_$0-9A-Za-z]*))*)|(\\??\\.\\s*\\#?[_$A-Za-z][_$0-9A-Za-z]*))|(?<=[)]))(<\\s*[{\\[(]\\s*$))", + "end": "(?<=>)(?!(((([_$A-Za-z][_$0-9A-Za-z]*)(\\s*\\??\\.\\s*(\\#?[_$A-Za-z][_$0-9A-Za-z]*))*)|(\\??\\.\\s*\\#?[_$A-Za-z][_$0-9A-Za-z]*))|(?<=[)]))(<\\s*[{\\[(]\\s*$))", + "patterns": [ + { + "begin": "(?=(([_$A-Za-z][_$0-9A-Za-z]*)(\\s*\\??\\.\\s*(\\#?[_$A-Za-z][_$0-9A-Za-z]*))*)|(\\??\\.\\s*\\#?[_$A-Za-z][_$0-9A-Za-z]*))", + "end": "(?=(<\\s*[{\\[(]\\s*$))", + "name": "meta.function-call.js.jsx", + "patterns": [ + { + "include": "#function-call-target" + } + ] + }, + { + "include": "#comment" + }, + { + "include": "#function-call-optionals" + }, + { + "include": "#type-arguments" + } + ] + } + ] + }, + "function-call-optionals": { + "patterns": [ + { + "match": "\\?\\.", + "name": "meta.function-call.js.jsx punctuation.accessor.optional.js.jsx" + }, + { + "match": "!", + "name": "meta.function-call.js.jsx keyword.operator.definiteassignment.js.jsx" + } + ] + }, + "function-call-target": { + "patterns": [ + { + "include": "#support-function-call-identifiers" + }, + { + "match": "(\\#?[_$A-Za-z][_$0-9A-Za-z]*)", + "name": "entity.name.function.js.jsx" + } + ] + }, + "function-declaration": { + "begin": "(?)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>)))))" + }, + { + "captures": { + "1": { + "name": "punctuation.accessor.js.jsx" + }, + "2": { + "name": "punctuation.accessor.optional.js.jsx" + }, + "3": { + "name": "variable.other.constant.property.js.jsx" + } + }, + "match": "(?:(\\.)|(\\?\\.(?!\\s*[\\d])))\\s*(\\#?[A-Z][_$\\dA-Z]*)(?![_$0-9A-Za-z])" + }, + { + "captures": { + "1": { + "name": "punctuation.accessor.js.jsx" + }, + "2": { + "name": "punctuation.accessor.optional.js.jsx" + }, + "3": { + "name": "variable.other.property.js.jsx" + } + }, + "match": "(?:(\\.)|(\\?\\.(?!\\s*[\\d])))\\s*(\\#?[_$A-Za-z][_$0-9A-Za-z]*)" + }, + { + "match": "([A-Z][_$\\dA-Z]*)(?![_$0-9A-Za-z])", + "name": "variable.other.constant.js.jsx" + }, + { + "match": "[_$A-Za-z][_$0-9A-Za-z]*", + "name": "variable.other.readwrite.js.jsx" + } + ] + }, + "if-statement": { + "patterns": [ + { + "begin": "(?]|\\|\\||\\&\\&|!==|$|(===|!==|==|!=)|(([\\&\\~\\^\\|]\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s+instanceof(?![_$0-9A-Za-z])(?:(?=\\.\\.\\.)|(?!\\.)))|((?))", + "end": "(/>)|(?:())", + "endCaptures": { + "1": { + "name": "punctuation.definition.tag.end.js.jsx" + }, + "2": { + "name": "punctuation.definition.tag.begin.js.jsx" + }, + "3": { + "name": "entity.name.tag.namespace.js.jsx" + }, + "4": { + "name": "punctuation.separator.namespace.js.jsx" + }, + "5": { + "name": "entity.name.tag.js.jsx" + }, + "6": { + "name": "support.class.component.js.jsx" + }, + "7": { + "name": "punctuation.definition.tag.end.js.jsx" + } + }, + "name": "meta.tag.js.jsx", + "patterns": [ + { + "begin": "(<)\\s*(?:([_$A-Za-z][-_$0-9A-Za-z.]*)(?)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.js.jsx" + }, + "2": { + "name": "entity.name.tag.namespace.js.jsx" + }, + "3": { + "name": "punctuation.separator.namespace.js.jsx" + }, + "4": { + "name": "entity.name.tag.js.jsx" + }, + "5": { + "name": "support.class.component.js.jsx" + } + }, + "end": "(?=[/]?>)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-arguments" + }, + { + "include": "#jsx-tag-attributes" + } + ] + }, + { + "begin": "(>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.end.js.jsx" + } + }, + "contentName": "meta.jsx.children.js.jsx", + "end": "(?=|/\\*|//)" + }, + "jsx-tag-attributes": { + "begin": "\\s+", + "end": "(?=[/]?>)", + "name": "meta.tag.attributes.js.jsx", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#jsx-tag-attribute-name" + }, + { + "include": "#jsx-tag-attribute-assignment" + }, + { + "include": "#jsx-string-double-quoted" + }, + { + "include": "#jsx-string-single-quoted" + }, + { + "include": "#jsx-evaluated-code" + }, + { + "include": "#jsx-tag-attributes-illegal" + } + ] + }, + "jsx-tag-attributes-illegal": { + "match": "\\S+", + "name": "invalid.illegal.attribute.js.jsx" + }, + "jsx-tag-in-expression": { + "begin": "(?:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$0-9A-Za-z]await|^return|[^\\._$0-9A-Za-z]return|^default|[^\\._$0-9A-Za-z]default|^yield|[^\\._$0-9A-Za-z]yield|^)\\s*(?!<\\s*[_$A-Za-z][_$0-9A-Za-z]*((\\s+extends\\s+[^=>])|,))(?=(<)\\s*(?:([_$A-Za-z][-_$0-9A-Za-z.]*)(?))", + "end": "(?!(<)\\s*(?:([_$A-Za-z][-_$0-9A-Za-z.]*)(?))", + "patterns": [ + { + "include": "#jsx-tag" + } + ] + }, + "jsx-tag-without-attributes": { + "begin": "(<)\\s*(?:([_$A-Za-z][-_$0-9A-Za-z.]*)(?)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.js.jsx" + }, + "2": { + "name": "entity.name.tag.namespace.js.jsx" + }, + "3": { + "name": "punctuation.separator.namespace.js.jsx" + }, + "4": { + "name": "entity.name.tag.js.jsx" + }, + "5": { + "name": "support.class.component.js.jsx" + }, + "6": { + "name": "punctuation.definition.tag.end.js.jsx" + } + }, + "contentName": "meta.jsx.children.js.jsx", + "end": "()", + "endCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.js.jsx" + }, + "2": { + "name": "entity.name.tag.namespace.js.jsx" + }, + "3": { + "name": "punctuation.separator.namespace.js.jsx" + }, + "4": { + "name": "entity.name.tag.js.jsx" + }, + "5": { + "name": "support.class.component.js.jsx" + }, + "6": { + "name": "punctuation.definition.tag.end.js.jsx" + } + }, + "name": "meta.tag.without-attributes.js.jsx", + "patterns": [ + { + "include": "#jsx-children" + } + ] + }, + "jsx-tag-without-attributes-in-expression": { + "begin": "(?:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$0-9A-Za-z]await|^return|[^\\._$0-9A-Za-z]return|^default|[^\\._$0-9A-Za-z]default|^yield|[^\\._$0-9A-Za-z]yield|^)\\s*(?=(<)\\s*(?:([_$A-Za-z][-_$0-9A-Za-z.]*)(?))", + "end": "(?!(<)\\s*(?:([_$A-Za-z][-_$0-9A-Za-z.]*)(?))", + "patterns": [ + { + "include": "#jsx-tag-without-attributes" + } + ] + }, + "label": { + "patterns": [ + { + "begin": "([_$A-Za-z][_$0-9A-Za-z]*)\\s*(:)(?=\\s*\\{)", + "beginCaptures": { + "1": { + "name": "entity.name.label.js.jsx" + }, + "2": { + "name": "punctuation.separator.label.js.jsx" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#decl-block" + } + ] + }, + { + "captures": { + "1": { + "name": "entity.name.label.js.jsx" + }, + "2": { + "name": "punctuation.separator.label.js.jsx" + } + }, + "match": "([_$A-Za-z][_$0-9A-Za-z]*)\\s*(:)" + } + ] + }, + "literal": { + "patterns": [ + { + "include": "#numeric-literal" + }, + { + "include": "#boolean-literal" + }, + { + "include": "#null-literal" + }, + { + "include": "#undefined-literal" + }, + { + "include": "#numericConstant-literal" + }, + { + "include": "#array-literal" + }, + { + "include": "#this-literal" + }, + { + "include": "#super-literal" + } + ] + }, + "method-declaration": { + "patterns": [ + { + "begin": "(?]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*))?[(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.js.jsx" + }, + "2": { + "name": "storage.modifier.js.jsx" + }, + "3": { + "name": "storage.modifier.js.jsx" + }, + "4": { + "name": "storage.modifier.async.js.jsx" + }, + "5": { + "name": "keyword.operator.new.js.jsx" + }, + "6": { + "name": "keyword.generator.asterisk.js.jsx" + } + }, + "end": "(?=\\}|;|,|$)|(?<=\\})", + "name": "meta.method.declaration.js.jsx", + "patterns": [ + { + "include": "#method-declaration-name" + }, + { + "include": "#function-body" + } + ] + }, + { + "begin": "(?]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*))?[(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.js.jsx" + }, + "2": { + "name": "storage.modifier.js.jsx" + }, + "3": { + "name": "storage.modifier.js.jsx" + }, + "4": { + "name": "storage.modifier.async.js.jsx" + }, + "5": { + "name": "storage.type.property.js.jsx" + }, + "6": { + "name": "keyword.generator.asterisk.js.jsx" + } + }, + "end": "(?=\\}|;|,|$)|(?<=\\})", + "name": "meta.method.declaration.js.jsx", + "patterns": [ + { + "include": "#method-declaration-name" + }, + { + "include": "#function-body" + } + ] + } + ] + }, + "method-declaration-name": { + "begin": "(?=((\\b(?]|\\|\\||\\&\\&|!==|$|((?]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*))?[(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js.jsx" + }, + "2": { + "name": "storage.type.property.js.jsx" + }, + "3": { + "name": "keyword.generator.asterisk.js.jsx" + } + }, + "end": "(?=\\}|;|,)|(?<=\\})", + "name": "meta.method.declaration.js.jsx", + "patterns": [ + { + "include": "#method-declaration-name" + }, + { + "include": "#function-body" + }, + { + "begin": "(?]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*))?[(])", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js.jsx" + }, + "2": { + "name": "storage.type.property.js.jsx" + }, + "3": { + "name": "keyword.generator.asterisk.js.jsx" + } + }, + "end": "(?=\\(|<)", + "patterns": [ + { + "include": "#method-declaration-name" + } + ] + } + ] + }, + "object-member": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#object-literal-method-declaration" + }, + { + "begin": "(?=\\[)", + "end": "(?=:)|((?<=[\\]])(?=\\s*[(<]))", + "name": "meta.object.member.js.jsx meta.object-literal.key.js.jsx", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#array-literal" + } + ] + }, + { + "begin": "(?=[\\'\\\"\\`])", + "end": "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[(<,}])|(\\s+(as|satisifies)\\s+))))", + "name": "meta.object.member.js.jsx meta.object-literal.key.js.jsx", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + } + ] + }, + { + "begin": "(?=(\\b(?)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>))))))", + "name": "meta.object.member.js.jsx" + }, + { + "captures": { + "0": { + "name": "meta.object-literal.key.js.jsx" + } + }, + "match": "(?:[_$A-Za-z][_$0-9A-Za-z]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)", + "name": "meta.object.member.js.jsx" + }, + { + "begin": "\\.\\.\\.", + "beginCaptures": { + "0": { + "name": "keyword.operator.spread.js.jsx" + } + }, + "end": "(?=,|\\})", + "name": "meta.object.member.js.jsx", + "patterns": [ + { + "include": "#expression" + } + ] + }, + { + "captures": { + "1": { + "name": "variable.other.readwrite.js.jsx" + } + }, + "match": "([_$A-Za-z][_$0-9A-Za-z]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)", + "name": "meta.object.member.js.jsx" + }, + { + "captures": { + "1": { + "name": "keyword.control.as.js.jsx" + }, + "2": { + "name": "storage.modifier.js.jsx" + } + }, + "match": "(?]|\\|\\||\\&\\&|!==|$|^|((?]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)\\(\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js.jsx" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#type-parameters" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.js.jsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.js.jsx" + } + }, + "patterns": [ + { + "include": "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + { + "begin": "(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js.jsx" + }, + "2": { + "name": "meta.brace.round.js.jsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.js.jsx" + } + }, + "patterns": [ + { + "include": "#expression-inside-possibly-arrow-parens" + } + ] + }, + { + "begin": "(?<=:)\\s*(async)?\\s*(?=<\\s*$)", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js.jsx" + } + }, + "end": "(?<=>)", + "patterns": [ + { + "include": "#type-parameters" + } + ] + }, + { + "begin": "(?<=>)\\s*(\\()(?=\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))", + "beginCaptures": { + "1": { + "name": "meta.brace.round.js.jsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.js.jsx" + } + }, + "patterns": [ + { + "include": "#expression-inside-possibly-arrow-parens" + } + ] + }, + { + "include": "#possibly-arrow-return-type" + }, + { + "include": "#expression" + } + ] + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#decl-block" + } + ] + }, + "parameter-array-binding-pattern": { + "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", + "beginCaptures": { + "1": { + "name": "keyword.operator.rest.js.jsx" + }, + "2": { + "name": "punctuation.definition.binding-pattern.array.js.jsx" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.binding-pattern.array.js.jsx" + } + }, + "patterns": [ + { + "include": "#parameter-binding-element" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "parameter-binding-element": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#string" + }, + { + "include": "#numeric-literal" + }, + { + "include": "#regex" + }, + { + "include": "#parameter-object-binding-pattern" + }, + { + "include": "#parameter-array-binding-pattern" + }, + { + "include": "#destructuring-parameter-rest" + }, + { + "include": "#variable-initializer" + } + ] + }, + "parameter-name": { + "patterns": [ + { + "captures": { + "1": { + "name": "storage.modifier.js.jsx" + } + }, + "match": "(?)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>)))))|(:\\s*((<)|([(]\\s*(([)])|(\\.\\.\\.)|([_$0-9A-Za-z]+\\s*(([:,?=])|([)]\\s*=>)))))))|(:\\s*(?(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(((async\\s+)?((function\\s*[(<*])|(function\\s+)|([_$A-Za-z][_$0-9A-Za-z]*\\s*=>)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>))))))" + }, + { + "captures": { + "1": { + "name": "storage.modifier.js.jsx" + }, + "2": { + "name": "keyword.operator.rest.js.jsx" + }, + "3": { + "name": "variable.parameter.js.jsx variable.language.this.js.jsx" + }, + "4": { + "name": "variable.parameter.js.jsx" + }, + "5": { + "name": "keyword.operator.optional.js.jsx" + } + }, + "match": "(?:(?])", + "name": "meta.type.annotation.js.jsx", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, + "paren-expression": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.js.jsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.js.jsx" + } + }, + "patterns": [ + { + "include": "#expression" + } + ] + }, + "paren-expression-possibly-arrow": { + "patterns": [ + { + "begin": "(?<=[(=,])\\s*(async)?(?=\\s*((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*))?\\(\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js.jsx" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + "begin": "(?<=[(=,]|=>|^return|[^\\._$0-9A-Za-z]return)\\s*(async)?(?=\\s*((((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*))?\\()|(<)|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)))\\s*$)", + "beginCaptures": { + "1": { + "name": "storage.modifier.async.js.jsx" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#paren-expression-possibly-arrow-with-typeparameters" + } + ] + }, + { + "include": "#possibly-arrow-return-type" + } + ] + }, + "paren-expression-possibly-arrow-with-typeparameters": { + "patterns": [ + { + "include": "#type-parameters" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.js.jsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.js.jsx" + } + }, + "patterns": [ + { + "include": "#expression-inside-possibly-arrow-parens" + } + ] + } + ] + }, + "possibly-arrow-return-type": { + "begin": "(?<=\\)|^)\\s*(:)(?=\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*=>)", + "beginCaptures": { + "1": { + "name": "meta.arrow.js.jsx meta.return.type.arrow.js.jsx keyword.operator.type.annotation.js.jsx" + } + }, + "contentName": "meta.arrow.js.jsx meta.return.type.arrow.js.jsx", + "end": "(?==>|\\{|(^\\s*(export|function|class|interface|let|var|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)\\b)|const|import|enum|namespace|module|type|abstract|declare)\\s+))", + "patterns": [ + { + "include": "#arrow-return-type-body" + } + ] + }, + "property-accessor": { + "match": "(?|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[()]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\]|\\(([^)\\\\]|\\\\.)+\\))+\\/([dgimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.js.jsx" + } + }, + "end": "(/)([dgimsuy]*)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.js.jsx" + }, + "2": { + "name": "keyword.other.js.jsx" + } + }, + "name": "string.regexp.js.jsx", + "patterns": [ + { + "include": "#regexp" + } + ] + }, + { + "begin": "((?" + }, + { + "match": "[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??", + "name": "keyword.operator.quantifier.regexp" + }, + { + "match": "\\|", + "name": "keyword.operator.or.regexp" + }, + { + "begin": "(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?))?", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.regexp" + }, + "1": { + "name": "punctuation.definition.group.no-capture.regexp" + }, + "2": { + "name": "variable.other.regexp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.regexp" + } + }, + "name": "meta.group.regexp", + "patterns": [ + { + "include": "#regexp" + } + ] + }, + { + "begin": "(\\[)(\\^)?", + "beginCaptures": { + "1": { + "name": "punctuation.definition.character-class.regexp" + }, + "2": { + "name": "keyword.operator.negation.regexp" + } + }, + "end": "(\\])", + "endCaptures": { + "1": { + "name": "punctuation.definition.character-class.regexp" + } + }, + "name": "constant.other.character-class.set.regexp", + "patterns": [ + { + "captures": { + "1": { + "name": "constant.character.numeric.regexp" + }, + "2": { + "name": "constant.character.control.regexp" + }, + "3": { + "name": "constant.character.escape.backslash.regexp" + }, + "4": { + "name": "constant.character.numeric.regexp" + }, + "5": { + "name": "constant.character.control.regexp" + }, + "6": { + "name": "constant.character.escape.backslash.regexp" + } + }, + "match": "(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))", + "name": "constant.other.character-class.range.regexp" + }, + { + "include": "#regex-character-class" + } + ] + }, + { + "include": "#regex-character-class" + } + ] + }, + "return-type": { + "patterns": [ + { + "begin": "(?<=\\))\\s*(:)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.js.jsx" + } + }, + "end": "(?]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\())|(?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))" + }, + { + "captures": { + "1": { + "name": "support.type.object.module.js.jsx" + }, + "2": { + "name": "support.type.object.module.js.jsx" + }, + "3": { + "name": "punctuation.accessor.js.jsx" + }, + "4": { + "name": "punctuation.accessor.optional.js.jsx" + }, + "5": { + "name": "support.type.object.module.js.jsx" + } + }, + "match": "(?\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?`)", + "end": "(?=`)", + "patterns": [ + { + "begin": "(?=(([_$A-Za-z][_$0-9A-Za-z]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$A-Za-z][_$0-9A-Za-z]*))", + "end": "(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)?`)", + "patterns": [ + { + "include": "#support-function-call-identifiers" + }, + { + "match": "([_$A-Za-z][_$0-9A-Za-z]*)", + "name": "entity.name.function.tagged-template.js.jsx" + } + ] + }, + { + "include": "#type-arguments" + } + ] + }, + { + "begin": "([_$A-Za-z][_$0-9A-Za-z]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>|<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$A-Za-z][_$0-9A-Za-z]*|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([<>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>(]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(?<==)>)*(?))*(?)*(?\\s*)`)", + "beginCaptures": { + "1": { + "name": "entity.name.function.tagged-template.js.jsx" + } + }, + "end": "(?=`)", + "patterns": [ + { + "include": "#type-arguments" + } + ] + } + ] + }, + "template-substitution-element": { + "begin": "\\$\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.template-expression.begin.js.jsx" + } + }, + "contentName": "meta.embedded.line.js.jsx", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.template-expression.end.js.jsx" + } + }, + "name": "meta.template.expression.js.jsx", + "patterns": [ + { + "include": "#expression" + } + ] + }, + "template-type": { + "patterns": [ + { + "include": "#template-call" + }, + { + "begin": "([_$A-Za-z][_$0-9A-Za-z]*)?(`)", + "beginCaptures": { + "1": { + "name": "entity.name.function.tagged-template.js.jsx" + }, + "2": { + "name": "string.template.js.jsx punctuation.definition.string.template.begin.js.jsx" + } + }, + "contentName": "string.template.js.jsx", + "end": "`", + "endCaptures": { + "0": { + "name": "string.template.js.jsx punctuation.definition.string.template.end.js.jsx" + } + }, + "patterns": [ + { + "include": "#template-type-substitution-element" + }, + { + "include": "#string-character-escape" + } + ] + } + ] + }, + "template-type-substitution-element": { + "begin": "\\$\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.template-expression.begin.js.jsx" + } + }, + "contentName": "meta.embedded.line.js.jsx", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.template-expression.end.js.jsx" + } + }, + "name": "meta.template.expression.js.jsx", + "patterns": [ + { + "include": "#type" + } + ] + }, + "ternary-expression": { + "begin": "(?!\\?\\.\\s*[^\\d])(\\?)(?!\\?)", + "beginCaptures": { + "1": { + "name": "keyword.operator.ternary.js.jsx" + } + }, + "end": "\\s*(:)", + "endCaptures": { + "1": { + "name": "keyword.operator.ternary.js.jsx" + } + }, + "patterns": [ + { + "include": "#expression" + } + ] + }, + "this-literal": { + "match": "(?])|((?<=[}>\\])]|[_$A-Za-z])\\s*(?=\\{)))", + "name": "meta.type.annotation.js.jsx", + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "begin": "(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.js.jsx" + } + }, + "end": "(?])|(?=^\\s*$)|((?<=[}>\\])]|[_$A-Za-z])\\s*(?=\\{)))", + "name": "meta.type.annotation.js.jsx", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, + "type-arguments": { + "begin": "<", + "beginCaptures": { + "0": { + "name": "punctuation.definition.typeparameters.begin.js.jsx" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.typeparameters.end.js.jsx" + } + }, + "name": "meta.type.parameters.js.jsx", + "patterns": [ + { + "include": "#type-arguments-body" + } + ] + }, + "type-arguments-body": { + "patterns": [ + { + "captures": { + "0": { + "name": "keyword.operator.type.js.jsx" + } + }, + "match": "(?)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-parameters" + } + ] + }, + { + "begin": "(?))))))", + "end": "(?<=\\))", + "name": "meta.type.function.js.jsx", + "patterns": [ + { + "include": "#function-parameters" + } + ] + } + ] + }, + "type-function-return-type": { + "patterns": [ + { + "begin": "(=>)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "storage.type.function.arrow.js.jsx" + } + }, + "end": "(?)(?:?]|//|$)", + "name": "meta.type.function.return.js.jsx", + "patterns": [ + { + "include": "#type-function-return-type-core" + } + ] + }, + { + "begin": "=>", + "beginCaptures": { + "0": { + "name": "storage.type.function.arrow.js.jsx" + } + }, + "end": "(?)(?]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))", + "name": "meta.type.function.return.js.jsx", + "patterns": [ + { + "include": "#type-function-return-type-core" + } + ] + } + ] + }, + "type-function-return-type-core": { + "patterns": [ + { + "include": "#comment" + }, + { + "begin": "(?<==>)(?=\\s*\\{)", + "end": "(?<=\\})", + "patterns": [ + { + "include": "#type-object" + } + ] + }, + { + "include": "#type-predicate-operator" + }, + { + "include": "#type" + } + ] + }, + "type-infer": { + "patterns": [ + { + "captures": { + "1": { + "name": "keyword.operator.expression.infer.js.jsx" + }, + "2": { + "name": "entity.name.type.js.jsx" + }, + "3": { + "name": "keyword.operator.expression.extends.js.jsx" + } + }, + "match": "(?)", + "endCaptures": { + "1": { + "name": "meta.type.parameters.js.jsx punctuation.definition.typeparameters.end.js.jsx" + } + }, + "patterns": [ + { + "include": "#type-arguments-body" + } + ] + }, + { + "begin": "([_$A-Za-z][_$0-9A-Za-z]*)\\s*(<)", + "beginCaptures": { + "1": { + "name": "entity.name.type.js.jsx" + }, + "2": { + "name": "meta.type.parameters.js.jsx punctuation.definition.typeparameters.begin.js.jsx" + } + }, + "contentName": "meta.type.parameters.js.jsx", + "end": "(>)", + "endCaptures": { + "1": { + "name": "meta.type.parameters.js.jsx punctuation.definition.typeparameters.end.js.jsx" + } + }, + "patterns": [ + { + "include": "#type-arguments-body" + } + ] + }, + { + "captures": { + "1": { + "name": "entity.name.type.module.js.jsx" + }, + "2": { + "name": "punctuation.accessor.js.jsx" + }, + "3": { + "name": "punctuation.accessor.optional.js.jsx" + } + }, + "match": "([_$A-Za-z][_$0-9A-Za-z]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[\\d])))" + }, + { + "match": "[_$A-Za-z][_$0-9A-Za-z]*", + "name": "entity.name.type.js.jsx" + } + ] + }, + "type-object": { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.block.js.jsx" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.js.jsx" + } + }, + "name": "meta.object.type.js.jsx", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#method-declaration" + }, + { + "include": "#indexer-declaration" + }, + { + "include": "#indexer-mapped-type-declaration" + }, + { + "include": "#field-declaration" + }, + { + "include": "#type-annotation" + }, + { + "begin": "\\.\\.\\.", + "beginCaptures": { + "0": { + "name": "keyword.operator.spread.js.jsx" + } + }, + "end": "(?=\\}|;|,|$)|(?<=\\})", + "patterns": [ + { + "include": "#type" + } + ] + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#punctuation-semicolon" + }, + { + "include": "#type" + } + ] + }, + "type-operators": { + "patterns": [ + { + "include": "#typeof-operator" + }, + { + "include": "#type-infer" + }, + { + "begin": "([&|])(?=\\s*\\{)", + "beginCaptures": { + "0": { + "name": "keyword.operator.type.js.jsx" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#type-object" + } + ] + }, + { + "begin": "[&|]", + "beginCaptures": { + "0": { + "name": "keyword.operator.type.js.jsx" + } + }, + "end": "(?=\\S)" + }, + { + "match": "(?)", + "endCaptures": { + "1": { + "name": "punctuation.definition.typeparameters.end.js.jsx" + } + }, + "name": "meta.type.parameters.js.jsx", + "patterns": [ + { + "include": "#comment" + }, + { + "match": "(?)", + "name": "keyword.operator.assignment.js.jsx" + } + ] + }, + "type-paren-or-function-parameters": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "meta.brace.round.js.jsx" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "meta.brace.round.js.jsx" + } + }, + "name": "meta.type.paren.cover.js.jsx", + "patterns": [ + { + "captures": { + "1": { + "name": "storage.modifier.js.jsx" + }, + "2": { + "name": "keyword.operator.rest.js.jsx" + }, + "3": { + "name": "entity.name.function.js.jsx variable.language.this.js.jsx" + }, + "4": { + "name": "entity.name.function.js.jsx" + }, + "5": { + "name": "keyword.operator.optional.js.jsx" + } + }, + "match": "(?:(?)))))))|(:\\s*(?(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))))" + }, + { + "captures": { + "1": { + "name": "storage.modifier.js.jsx" + }, + "2": { + "name": "keyword.operator.rest.js.jsx" + }, + "3": { + "name": "variable.parameter.js.jsx variable.language.this.js.jsx" + }, + "4": { + "name": "variable.parameter.js.jsx" + }, + "5": { + "name": "keyword.operator.optional.js.jsx" + } + }, + "match": "(?:(?:&|{?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)\\b)|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$A-Za-z])\\b)|var|while)\\b))", + "patterns": [ + { + "include": "#type-arguments" + }, + { + "include": "#expression" + } + ] + }, + "undefined-literal": { + "match": "(?)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>)))))|(:\\s*((<)|([(]\\s*(([)])|(\\.\\.\\.)|([_$0-9A-Za-z]+\\s*(([:,?=])|([)]\\s*=>)))))))|(:\\s*(?(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(((async\\s+)?((function\\s*[(<*])|(function\\s+)|([_$A-Za-z][_$0-9A-Za-z]*\\s*=>)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>))))))", + "beginCaptures": { + "1": { + "name": "meta.definition.variable.js.jsx variable.other.constant.js.jsx entity.name.function.js.jsx" + } + }, + "end": "(?=$|^|[;,=}]|((?)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>)))))|(:\\s*((<)|([(]\\s*(([)])|(\\.\\.\\.)|([_$0-9A-Za-z]+\\s*(([:,?=])|([)]\\s*=>)))))))|(:\\s*(?(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))))))|(:\\s*(=>|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(((async\\s+)?((function\\s*[(<*])|(function\\s+)|([_$A-Za-z][_$0-9A-Za-z]*\\s*=>)))|((async\\s*)?(((<\\s*$)|([(]\\s*((([{\\[]\\s*)?$)|((\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+\\s*)?=\\s*))))))|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([)]\\s*:)|((\\.\\.\\.\\s*)?[_$A-Za-z][_$0-9A-Za-z]*\\s*:)))|([<]\\s*[_$A-Za-z][_$0-9A-Za-z]*\\s+extends\\s*[^=>])|((<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|<\\s*(((const\\s+)?[_$A-Za-z])|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*>)*>)*>\\s*)?\\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$A-Za-z]|(\\{([^{}]|(\\{([^{}]|\\{[^{}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$A-Za-z]))([^()\\'\\\"\\`]|(\\(([^()]|(\\(([^()]|\\([^()]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\)(\\s*:\\s*([^<>(){}]|<([^<>]|<([^<>]|<[^<>]+>)+>)+>|\\([^()]+\\)|\\{[^{}]+\\})+)?\\s*=>))))))", + "beginCaptures": { + "1": { + "name": "meta.definition.variable.js.jsx entity.name.function.js.jsx" + }, + "2": { + "name": "keyword.operator.definiteassignment.js.jsx" + } + }, + "end": "(?=$|^|[;,=}]|((?\\s*$)", + "beginCaptures": { + "1": { + "name": "keyword.operator.assignment.js.jsx" + } + }, + "end": "(?=$|^|[,);}\\]]|((?)", + "name": "meta.namespace.php", + "patterns": [ + { + "include": "#comments" + }, + { + "captures": { + "0": { + "patterns": [ + { + "match": "\\\\", + "name": "punctuation.separator.inheritance.php" + } + ] + } + }, + "match": "(?i)[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+", + "name": "entity.name.type.namespace.php" + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.namespace.begin.bracket.curly.php" + } + }, + "end": "}|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.namespace.end.bracket.curly.php" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "match": "[^\\s]+", + "name": "invalid.illegal.identifier.php" + } + ] + }, + { + "match": "\\s+(?=use\\b)" + }, + { + "begin": "(?i)\\buse\\b", + "beginCaptures": { + "0": { + "name": "keyword.other.use.php" + } + }, + "end": "(?<=})|(?=;)|(?=\\?>)", + "name": "meta.use.php", + "patterns": [ + { + "match": "\\b(const|function)\\b", + "name": "storage.type.${1:/downcase}.php" + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.use.begin.bracket.curly.php" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.use.end.bracket.curly.php" + } + }, + "patterns": [ + { + "include": "#scope-resolution" + }, + { + "captures": { + "1": { + "name": "keyword.other.use-as.php" + }, + "2": { + "name": "storage.modifier.php" + }, + "3": { + "name": "entity.other.alias.php" + } + }, + "match": "(?i)\\b(as)\\s+(final|abstract|public|private|protected|static)\\s+([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)" + }, + { + "captures": { + "1": { + "name": "keyword.other.use-as.php" + }, + "2": { + "patterns": [ + { + "match": "^(?:final|abstract|public|private|protected|static)$", + "name": "storage.modifier.php" + }, + { + "match": ".+", + "name": "entity.other.alias.php" + } + ] + } + }, + "match": "(?i)\\b(as)\\s+([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)" + }, + { + "captures": { + "1": { + "name": "keyword.other.use-insteadof.php" + }, + "2": { + "name": "support.class.php" + } + }, + "match": "(?i)\\b(insteadof)\\s+([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)" + }, + { + "match": ";", + "name": "punctuation.terminator.expression.php" + }, + { + "include": "#use-inner" + } + ] + }, + { + "include": "#use-inner" + } + ] + }, + { + "begin": "(?i)\\b(trait)\\s+([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)", + "beginCaptures": { + "1": { + "name": "storage.type.trait.php" + }, + "2": { + "name": "entity.name.type.trait.php" + } + }, + "end": "}|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.trait.end.bracket.curly.php" + } + }, + "name": "meta.trait.php", + "patterns": [ + { + "include": "#comments" + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.trait.begin.bracket.curly.php" + } + }, + "contentName": "meta.trait.body.php", + "end": "(?=}|\\?>)", + "patterns": [ + { + "include": "$self" + } + ] + } + ] + }, + { + "begin": "(?i)\\b(interface)\\s+([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)", + "beginCaptures": { + "1": { + "name": "storage.type.interface.php" + }, + "2": { + "name": "entity.name.type.interface.php" + } + }, + "end": "}|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.interface.end.bracket.curly.php" + } + }, + "name": "meta.interface.php", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#interface-extends" + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.interface.begin.bracket.curly.php" + } + }, + "contentName": "meta.interface.body.php", + "end": "(?=}|\\?>)", + "patterns": [ + { + "include": "#class-constant" + }, + { + "include": "$self" + } + ] + } + ] + }, + { + "begin": "(?i)\\b(enum)\\s+([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)(?:\\s*(:)\\s*(int|string)\\b)?", + "beginCaptures": { + "1": { + "name": "storage.type.enum.php" + }, + "2": { + "name": "entity.name.type.enum.php" + }, + "3": { + "name": "keyword.operator.return-value.php" + }, + "4": { + "name": "keyword.other.type.php" + } + }, + "end": "}|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.enum.end.bracket.curly.php" + } + }, + "name": "meta.enum.php", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#class-implements" + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.enum.begin.bracket.curly.php" + } + }, + "contentName": "meta.enum.body.php", + "end": "(?=}|\\?>)", + "patterns": [ + { + "captures": { + "1": { + "name": "storage.modifier.php" + }, + "2": { + "name": "constant.enum.php" + } + }, + "match": "(?i)\\b(case)\\s*([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)" + }, + { + "include": "#class-constant" + }, + { + "include": "$self" + } + ] + } + ] + }, + { + "begin": "(?i)(?:\\b((?:(?:final|abstract|readonly)\\s+)*)(class)\\s+([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)|\\b(new)\\b\\s*(\\#\\[.*\\])?\\s*(?:(readonly)\\s+)?\\b(class)\\b)", + "beginCaptures": { + "1": { + "patterns": [ + { + "match": "final|abstract", + "name": "storage.modifier.${0:/downcase}.php" + }, + { + "match": "readonly", + "name": "storage.modifier.php" + } + ] + }, + "2": { + "name": "storage.type.class.php" + }, + "3": { + "name": "entity.name.type.class.php" + }, + "4": { + "name": "keyword.other.new.php" + }, + "5": { + "patterns": [ + { + "include": "#attribute" + } + ] + }, + "6": { + "name": "storage.modifier.php" + }, + "7": { + "name": "storage.type.class.php" + } + }, + "end": "}|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.class.end.bracket.curly.php" + } + }, + "name": "meta.class.php", + "patterns": [ + { + "begin": "(?<=class)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.arguments.begin.bracket.round.php" + } + }, + "end": "\\)|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.php" + } + }, + "name": "meta.function-call.php", + "patterns": [ + { + "include": "#named-arguments" + }, + { + "include": "$self" + } + ] + }, + { + "include": "#comments" + }, + { + "include": "#class-extends" + }, + { + "include": "#class-implements" + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.class.begin.bracket.curly.php" + } + }, + "contentName": "meta.class.body.php", + "end": "(?=}|\\?>)", + "patterns": [ + { + "include": "#class-constant" + }, + { + "include": "$self" + } + ] + } + ] + }, + { + "include": "#match_statement" + }, + { + "include": "#switch_statement" + }, + { + "captures": { + "1": { + "name": "keyword.control.yield-from.php" + } + }, + "match": "\\s*\\b(yield\\s+from)\\b" + }, + { + "captures": { + "1": { + "name": "keyword.control.${1:/downcase}.php" + } + }, + "match": "\\b(break|case|continue|declare|default|die|do|else(if)?|end(declare|for(each)?|if|switch|while)|exit|for(each)?|if|return|switch|use|while|yield)\\b" + }, + { + "begin": "(?i)\\b((?:require|include)(?:_once)?)(\\s+|(?=\\())", + "beginCaptures": { + "1": { + "name": "keyword.control.import.include.php" + } + }, + "end": "(?=\\s|;|$|\\?>)", + "name": "meta.include.php", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "\\b(catch)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.control.exception.catch.php" + }, + "2": { + "name": "punctuation.definition.parameters.begin.bracket.round.php" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.php" + } + }, + "name": "meta.catch.php", + "patterns": [ + { + "captures": { + "1": { + "patterns": [ + { + "match": "\\|", + "name": "punctuation.separator.delimiter.php" + }, + { + "begin": "(?i)(?=[\\\\a-z_\\x{7f}-\\x{10ffff}])", + "end": "(?i)([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)(?![a-z0-9_\\x{7f}-\\x{10ffff}\\\\])", + "endCaptures": { + "1": { + "name": "support.class.exception.php" + } + }, + "patterns": [ + { + "include": "#namespace" + } + ] + } + ] + }, + "2": { + "name": "variable.other.php" + }, + "3": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(?i)([a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+(?:\\s*\\|\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)*)\\s*((\\$+)[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)?" + } + ] + }, + { + "match": "\\b(catch|try|throw|exception|finally)\\b", + "name": "keyword.control.exception.php" + }, + { + "begin": "(?i)\\b(function)\\s*(?=&?\\s*\\()", + "beginCaptures": { + "1": { + "name": "storage.type.function.php" + } + }, + "end": "(?=\\s*{)", + "name": "meta.function.closure.php", + "patterns": [ + { + "include": "#comments" + }, + { + "begin": "(&)?\\s*(\\()", + "beginCaptures": { + "1": { + "name": "storage.modifier.reference.php" + }, + "2": { + "name": "punctuation.definition.parameters.begin.bracket.round.php" + } + }, + "contentName": "meta.function.parameters.php", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.php" + } + }, + "patterns": [ + { + "include": "#function-parameters" + } + ] + }, + { + "begin": "(?i)(use)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.other.function.use.php" + }, + "2": { + "name": "punctuation.definition.parameters.begin.bracket.round.php" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.php" + } + }, + "name": "meta.function.closure.use.php", + "patterns": [ + { + "match": ",", + "name": "punctuation.separator.delimiter.php" + }, + { + "captures": { + "1": { + "name": "variable.other.php" + }, + "2": { + "name": "storage.modifier.reference.php" + }, + "3": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(?i)((?:(&)\\s*)?(\\$+)[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)\\s*(?=,|\\))" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.operator.return-value.php" + }, + "2": { + "patterns": [ + { + "include": "#php-types" + } + ] + } + }, + "match": "(?i)(:)\\s*((?:\\?\\s*)?[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+|(?:[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+|\\(\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+(?:\\s*&\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)+\\s*\\))(?:\\s*[|&]\\s*(?:[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+|\\(\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+(?:\\s*&\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)+\\s*\\)))+)(?=\\s*(?:{|/[/*]|\\#|$))" + } + ] + }, + { + "begin": "(?i)\\b(fn)\\s*(?=&?\\s*\\()", + "beginCaptures": { + "1": { + "name": "storage.type.function.php" + } + }, + "end": "=>", + "endCaptures": { + "0": { + "name": "punctuation.definition.arrow.php" + } + }, + "name": "meta.function.closure.php", + "patterns": [ + { + "begin": "(?:(&)\\s*)?(\\()", + "beginCaptures": { + "1": { + "name": "storage.modifier.reference.php" + }, + "2": { + "name": "punctuation.definition.parameters.begin.bracket.round.php" + } + }, + "contentName": "meta.function.parameters.php", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.php" + } + }, + "patterns": [ + { + "include": "#function-parameters" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.operator.return-value.php" + }, + "2": { + "patterns": [ + { + "include": "#php-types" + } + ] + } + }, + "match": "(?i)(:)\\s*((?:\\?\\s*)?[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+|(?:[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+|\\(\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+(?:\\s*&\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)+\\s*\\))(?:\\s*[|&]\\s*(?:[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+|\\(\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+(?:\\s*&\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)+\\s*\\)))+)(?=\\s*(?:=>|/[/*]|\\#|$))" + } + ] + }, + { + "begin": "((?:(?:final|abstract|public|private|protected)\\s+)*)(function)\\s+(__construct)\\s*(\\()", + "beginCaptures": { + "1": { + "patterns": [ + { + "match": "final|abstract|public|private|protected", + "name": "storage.modifier.php" + } + ] + }, + "2": { + "name": "storage.type.function.php" + }, + "3": { + "name": "support.function.constructor.php" + }, + "4": { + "name": "punctuation.definition.parameters.begin.bracket.round.php" + } + }, + "contentName": "meta.function.parameters.php", + "end": "(?i)(\\))\\s*(:\\s*(?:\\?\\s*)?(?!\\s)[a-z0-9_\\x{7f}-\\x{10ffff}\\\\\\s\\|&()]+(?)", + "endCaptures": { + "0": { + "name": "punctuation.definition.array.end.bracket.round.php" + } + }, + "name": "meta.array.php", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.storage-type.begin.bracket.round.php" + }, + "2": { + "name": "storage.type.php" + }, + "3": { + "name": "punctuation.definition.storage-type.end.bracket.round.php" + } + }, + "match": "(?i)(\\()\\s*(array|real|double|float|int(?:eger)?|bool(?:ean)?|string|object|binary|unset)\\s*(\\))" + }, + { + "match": "(?i)\\b(array|real|double|float|int(eger)?|bool(ean)?|string|class|var|function|interface|trait|parent|self|object|mixed)\\b", + "name": "storage.type.php" + }, + { + "match": "(?i)\\b(global|abstract|const|final|private|protected|public|static)\\b", + "name": "storage.modifier.php" + }, + { + "include": "#object" + }, + { + "match": ";", + "name": "punctuation.terminator.expression.php" + }, + { + "match": ":", + "name": "punctuation.terminator.statement.php" + }, + { + "include": "#heredoc" + }, + { + "include": "#numbers" + }, + { + "match": "(?i)\\bclone\\b", + "name": "keyword.other.clone.php" + }, + { + "match": "\\.\\.\\.", + "name": "keyword.operator.spread.php" + }, + { + "match": "\\.=?", + "name": "keyword.operator.string.php" + }, + { + "match": "=>", + "name": "keyword.operator.key.php" + }, + { + "captures": { + "1": { + "name": "keyword.operator.assignment.php" + }, + "2": { + "name": "storage.modifier.reference.php" + }, + "3": { + "name": "storage.modifier.reference.php" + } + }, + "match": "(?i)(=)(&)|(&)(?=[$a-z_])" + }, + { + "match": "@", + "name": "keyword.operator.error-control.php" + }, + { + "match": "===|==|!==|!=|<>", + "name": "keyword.operator.comparison.php" + }, + { + "match": "=|\\+=|-=|\\*\\*?=|/=|%=|&=|\\|=|\\^=|<<=|>>=|\\?\\?=", + "name": "keyword.operator.assignment.php" + }, + { + "match": "<=>|<=|>=|<|>", + "name": "keyword.operator.comparison.php" + }, + { + "match": "--|\\+\\+", + "name": "keyword.operator.increment-decrement.php" + }, + { + "match": "-|\\+|\\*\\*?|/|%", + "name": "keyword.operator.arithmetic.php" + }, + { + "match": "(?i)(!|&&|\\|\\|)|\\b(and|or|xor|as)\\b", + "name": "keyword.operator.logical.php" + }, + { + "include": "#function-call" + }, + { + "match": "<<|>>|~|\\^|&|\\|", + "name": "keyword.operator.bitwise.php" + }, + { + "begin": "(?i)\\b(instanceof)\\s+(?=[\\\\$a-z_])", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.php" + } + }, + "end": "(?i)(?=[^\\\\$a-z0-9_\\x{7f}-\\x{10ffff}])", + "patterns": [ + { + "include": "#class-name" + }, + { + "include": "#variable-name" + } + ] + }, + { + "include": "#instantiation" + }, + { + "captures": { + "1": { + "name": "keyword.control.goto.php" + }, + "2": { + "name": "support.other.php" + } + }, + "match": "(?i)(goto)\\s+([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)" + }, + { + "captures": { + "1": { + "name": "entity.name.goto-label.php" + } + }, + "match": "(?i)^\\s*([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*(?)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.curly.php" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.php" + } + }, + "end": "\\]|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.php" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.begin.bracket.round.php" + } + }, + "end": "\\)|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.php" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "include": "#constants" + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.php" + } + ], + "repository": { + "attribute": { + "begin": "\\#\\[", + "end": "\\]", + "name": "meta.attribute.php", + "patterns": [ + { + "match": ",", + "name": "punctuation.separator.delimiter.php" + }, + { + "begin": "([a-zA-Z0-9_\\x{7f}-\\x{10ffff}\\\\]+)\\s*(\\()", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#attribute-name" + } + ] + }, + "2": { + "name": "punctuation.definition.arguments.begin.bracket.round.php" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.php" + } + }, + "patterns": [ + { + "include": "#named-arguments" + }, + { + "include": "$self" + } + ] + }, + { + "include": "#attribute-name" + } + ] + }, + "attribute-name": { + "patterns": [ + { + "begin": "(?i)(?=\\\\?[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*\\\\)", + "end": "(?i)([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)?(?![a-z0-9_\\x{7f}-\\x{10ffff}\\\\])", + "endCaptures": { + "1": { + "name": "support.attribute.php" + } + }, + "patterns": [ + { + "include": "#namespace" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.separator.inheritance.php" + } + }, + "match": "(?i)(\\\\)?\\b(Attribute|SensitiveParameter|AllowDynamicProperties|ReturnTypeWillChange)\\b", + "name": "support.attribute.builtin.php" + }, + { + "begin": "(?i)(?=[\\\\a-z_\\x{7f}-\\x{10ffff}])", + "end": "(?i)([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)?(?![a-z0-9_\\x{7f}-\\x{10ffff}\\\\])", + "endCaptures": { + "1": { + "name": "support.attribute.php" + } + }, + "patterns": [ + { + "include": "#namespace" + } + ] + } + ] + }, + "class-builtin": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.separator.inheritance.php" + } + }, + "match": "(?i)(\\\\)?\\b(Attribute|(APC|Append)Iterator|Array(Access|Iterator|Object)|Bad(Function|Method)CallException|(Caching|CallbackFilter)Iterator|Collator|Collectable|Cond|Countable|CURLFile|Date(Interval|Period|Time(Interface|Immutable|Zone)?)?|Directory(Iterator)?|DomainException|DOM(Attr|CdataSection|CharacterData|Comment|Document(Fragment)?|Element|EntityReference|Implementation|NamedNodeMap|Node(list)?|ProcessingInstruction|Text|XPath)|(Error)?Exception|EmptyIterator|finfo|Ev(Check|Child|Embed|Fork|Idle|Io|Loop|Periodic|Prepare|Signal|Stat|Timer|Watcher)?|Event(Base|Buffer(Event)?|SslContext|Http(Request|Connection)?|Config|DnsBase|Util|Listener)?|FANNConnection|(Filter|Filesystem)Iterator|Gender\\\\Gender|GlobIterator|Gmagick(Draw|Pixel)?|Haru(Annotation|Destination|Doc|Encoder|Font|Image|Outline|Page)|Http((Inflate|Deflate)?Stream|Message|Request(Pool)?|Response|QueryString)|HRTime\\\\(PerformanceCounter|StopWatch)|Intl(Calendar|((CodePoint|RuleBased)?Break|Parts)?Iterator|DateFormatter|TimeZone)|Imagick(Draw|Pixel(Iterator)?)?|InfiniteIterator|InvalidArgumentException|Iterator(Aggregate|Iterator)?|JsonSerializable|KTaglib_(MPEG_(File|AudioProperties)|Tag|ID3v2_(Tag|(AttachedPicture)?Frame))|Lapack|(Length|Locale|Logic)Exception|LimitIterator|Lua(Closure)?|Mongo(BinData|Client|Code|Collection|CommandCursor|Cursor(Exception)?|Date|DB(Ref)?|DeleteBatch|Grid(FS(Cursor|File)?)|Id|InsertBatch|Int(32|64)|Log|Pool|Regex|ResultException|Timestamp|UpdateBatch|Write(Batch|ConcernException))?|Memcache(d)?|MessageFormatter|MultipleIterator|Mutex|mysqli(_(driver|stmt|warning|result))?|MysqlndUh(Connection|PreparedStatement)|NoRewindIterator|Normalizer|NumberFormatter|OCI-(Collection|Lob)|OuterIterator|(OutOf(Bounds|Range)|Overflow)Exception|ParentIterator|PDO(Statement)?|Phar(Data|FileInfo)?|php_user_filter|Pool|QuickHash(Int(Set|StringHash)|StringIntHash)|Recursive(Array|Caching|Directory|Fallback|Filter|Iterator|Regex|Tree)?Iterator|Reflection(Class|Function(Abstract)?|Method|Object|Parameter|Property|(Zend)?Extension)?|RangeException|Reflector|RegexIterator|ResourceBundle|RuntimeException|RRD(Creator|Graph|Updater)|SAM(Connection|Message)|SCA(_(SoapProxy|LocalProxy))?|SDO_(DAS_(ChangeSummary|Data(Factory|Object)|Relational|Setting|XML(_Document)?)|Data(Factory|Object)|Exception|List|Model_(Property|ReflectionDataObject|Type)|Sequence)|SeekableIterator|Serializable|SessionHandler(Interface)?|SimpleXML(Iterator|Element)|SNMP|Soap(Client|Fault|Header|Param|Server|Var)|SphinxClient|Spoofchecker|Spl(DoublyLinkedList|Enum|File(Info|Object)|FixedArray|(Max|Min)?Heap|Observer|ObjectStorage|(Priority)?Queue|Stack|Subject|Type|TempFileObject)|SQLite(3(Result|Stmt)?|Database|Result|Unbuffered)|stdClass|streamWrapper|SVM(Model)?|Swish(Result(s)?|Search)?|Sync(Event|Mutex|ReaderWriter|Semaphore)|Thread(ed)?|tidy(Node)?|TokyoTyrant(Table|Iterator|Query)?|Transliterator|Traversable|UConverter|(Underflow|UnexpectedValue)Exception|V8Js(Exception)?|Varnish(Admin|Log|Stat)|Worker|Weak(Map|Ref)|XML(Diff\\\\(Base|DOM|File|Memory)|Reader|Writer)|XsltProcessor|Yaf_(Route_(Interface|Map|Regex|Rewrite|Simple|Supervar)|Action_Abstract|Application|Config_(Simple|Ini|Abstract)|Controller_Abstract|Dispatcher|Exception|Loader|Plugin_Abstract|Registry|Request_(Abstract|Simple|Http)|Response_Abstract|Router|Session|View_(Simple|Interface))|Yar_(Client(_Exception)?|Concurrent_Client|Server(_Exception)?)|ZipArchive|ZMQ(Context|Device|Poll|Socket)?)\\b", + "name": "support.class.builtin.php" + } + ] + }, + "class-constant": { + "patterns": [ + { + "captures": { + "1": { + "name": "storage.modifier.php" + }, + "2": { + "name": "constant.other.php" + } + }, + "match": "(?i)\\b(const)\\s*([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)" + } + ] + }, + "class-extends": { + "patterns": [ + { + "begin": "(?i)(extends)\\s+", + "beginCaptures": { + "1": { + "name": "storage.modifier.extends.php" + } + }, + "end": "(?i)(?=[^A-Za-z0-9_\\x{7f}-\\x{10ffff}\\\\])", + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#inheritance-single" + } + ] + } + ] + }, + "class-implements": { + "patterns": [ + { + "begin": "(?i)(implements)\\s+", + "beginCaptures": { + "1": { + "name": "storage.modifier.implements.php" + } + }, + "end": "(?i)(?={)", + "patterns": [ + { + "include": "#comments" + }, + { + "match": ",", + "name": "punctuation.separator.classes.php" + }, + { + "include": "#inheritance-single" + } + ] + } + ] + }, + "class-name": { + "patterns": [ + { + "begin": "(?i)(?=\\\\?[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*\\\\)", + "end": "(?i)([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)?(?![a-z0-9_\\x{7f}-\\x{10ffff}\\\\])", + "endCaptures": { + "1": { + "name": "support.class.php" + } + }, + "patterns": [ + { + "include": "#namespace" + } + ] + }, + { + "include": "#class-builtin" + }, + { + "begin": "(?i)(?=[\\\\a-z_\\x{7f}-\\x{10ffff}])", + "end": "(?i)([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)?(?![a-z0-9_\\x{7f}-\\x{10ffff}\\\\])", + "endCaptures": { + "1": { + "name": "support.class.php" + } + }, + "patterns": [ + { + "include": "#namespace" + } + ] + } + ] + }, + "comments": { + "patterns": [ + { + "begin": "/\\*\\*(?=\\s)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.php" + } + }, + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.php" + } + }, + "name": "comment.block.documentation.phpdoc.php", + "patterns": [ + { + "include": "#php_doc" + } + ] + }, + { + "begin": "/\\*", + "captures": { + "0": { + "name": "punctuation.definition.comment.php" + } + }, + "end": "\\*/", + "name": "comment.block.php" + }, + { + "begin": "(^\\s+)?(?=//)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.php" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "//", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.php" + } + }, + "end": "\\n|(?=\\?>)", + "name": "comment.line.double-slash.php" + } + ] + }, + { + "begin": "(^\\s+)?(?=#)(?!#\\[)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.php" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "#", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.php" + } + }, + "end": "\\n|(?=\\?>)", + "name": "comment.line.number-sign.php" + } + ] + } + ] + }, + "constants": { + "patterns": [ + { + "match": "(?i)\\b(TRUE|FALSE|NULL|__(FILE|DIR|FUNCTION|CLASS|METHOD|LINE|NAMESPACE)__|ON|OFF|YES|NO|NL|BR|TAB)\\b", + "name": "constant.language.php" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.inheritance.php" + } + }, + "match": "(\\\\)?\\b(DEFAULT_INCLUDE_PATH|EAR_(INSTALL|EXTENSION)_DIR|E_(ALL|COMPILE_(ERROR|WARNING)|CORE_(ERROR|WARNING)|DEPRECATED|ERROR|NOTICE|PARSE|RECOVERABLE_ERROR|STRICT|USER_(DEPRECATED|ERROR|NOTICE|WARNING)|WARNING)|PHP_(ROUND_HALF_(DOWN|EVEN|ODD|UP)|(MAJOR|MINOR|RELEASE)_VERSION|MAXPATHLEN|BINDIR|SHLIB_SUFFIX|SYSCONFDIR|SAPI|CONFIG_FILE_(PATH|SCAN_DIR)|INT_(MAX|SIZE)|ZTS|OS|OUTPUT_HANDLER_(START|CONT|END)|DEBUG|DATADIR|URL_(SCHEME|HOST|USER|PORT|PASS|PATH|QUERY|FRAGMENT)|PREFIX|EXTRA_VERSION|EXTENSION_DIR|EOL|VERSION(_ID)?|WINDOWS_(NT_(SERVER|DOMAIN_CONTROLLER|WORKSTATION)|VERSION_(MAJOR|MINOR)|BUILD|SUITEMASK|SP_(MAJOR|MINOR)|PRODUCTTYPE|PLATFORM)|LIBDIR|LOCALSTATEDIR)|STD(ERR|IN|OUT)|ZEND_(DEBUG_BUILD|THREAD_SAFE))\\b", + "name": "support.constant.core.php" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.inheritance.php" + } + }, + "match": "(\\\\)?\\b(__COMPILER_HALT_OFFSET__|AB(MON_(1|2|3|4|5|6|7|8|9|10|11|12)|DAY[1-7])|AM_STR|ASSERT_(ACTIVE|BAIL|CALLBACK_QUIET_EVAL|WARNING)|ALT_DIGITS|CASE_(UPPER|LOWER)|CHAR_MAX|CONNECTION_(ABORTED|NORMAL|TIMEOUT)|CODESET|COUNT_(NORMAL|RECURSIVE)|CREDITS_(ALL|DOCS|FULLPAGE|GENERAL|GROUP|MODULES|QA|SAPI)|CRYPT_(BLOWFISH|EXT_DES|MD5|SHA(256|512)|SALT_LENGTH|STD_DES)|CURRENCY_SYMBOL|D_(T_)?FMT|DATE_(ATOM|COOKIE|ISO8601|RFC(822|850|1036|1123|2822|3339)|RSS|W3C)|DAY_[1-7]|DECIMAL_POINT|DIRECTORY_SEPARATOR|ENT_(COMPAT|IGNORE|(NO)?QUOTES)|EXTR_(IF_EXISTS|OVERWRITE|PREFIX_(ALL|IF_EXISTS|INVALID|SAME)|REFS|SKIP)|ERA(_(D_(T_)?FMT)|T_FMT|YEAR)?|FRAC_DIGITS|GROUPING|HASH_HMAC|HTML_(ENTITIES|SPECIALCHARS)|INF|INFO_(ALL|CREDITS|CONFIGURATION|ENVIRONMENT|GENERAL|LICENSEMODULES|VARIABLES)|INI_(ALL|CANNER_(NORMAL|RAW)|PERDIR|SYSTEM|USER)|INT_(CURR_SYMBOL|FRAC_DIGITS)|LC_(ALL|COLLATE|CTYPE|MESSAGES|MONETARY|NUMERIC|TIME)|LOCK_(EX|NB|SH|UN)|LOG_(ALERT|AUTH(PRIV)?|CRIT|CRON|CONS|DAEMON|DEBUG|EMERG|ERR|INFO|LOCAL[1-7]|LPR|KERN|MAIL|NEWS|NODELAY|NOTICE|NOWAIT|ODELAY|PID|PERROR|WARNING|SYSLOG|UCP|USER)|M_(1_PI|SQRT(1_2|2|3|PI)|2_(SQRT)?PI|PI(_(2|4))?|E(ULER)?|LN(10|2|PI)|LOG(10|2)E)|MON_(1|2|3|4|5|6|7|8|9|10|11|12|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|N_(CS_PRECEDES|SEP_BY_SPACE|SIGN_POSN)|NAN|NEGATIVE_SIGN|NO(EXPR|STR)|P_(CS_PRECEDES|SEP_BY_SPACE|SIGN_POSN)|PM_STR|POSITIVE_SIGN|PATH(_SEPARATOR|INFO_(EXTENSION|(BASE|DIR|FILE)NAME))|RADIXCHAR|SEEK_(CUR|END|SET)|SORT_(ASC|DESC|LOCALE_STRING|REGULAR|STRING)|STR_PAD_(BOTH|LEFT|RIGHT)|T_FMT(_AMPM)?|THOUSEP|THOUSANDS_SEP|UPLOAD_ERR_(CANT_WRITE|EXTENSION|(FORM|INI)_SIZE|NO_(FILE|TMP_DIR)|OK|PARTIAL)|YES(EXPR|STR))\\b", + "name": "support.constant.std.php" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.inheritance.php" + } + }, + "match": "(\\\\)?\\b(GLOB_(MARK|BRACE|NO(SORT|CHECK|ESCAPE)|ONLYDIR|ERR|AVAILABLE_FLAGS)|XML_(SAX_IMPL|(DTD|DOCUMENT(_(FRAG|TYPE))?|HTML_DOCUMENT|NOTATION|NAMESPACE_DECL|PI|COMMENT|DATA_SECTION|TEXT)_NODE|OPTION_(SKIP_(TAGSTART|WHITE)|CASE_FOLDING|TARGET_ENCODING)|ERROR_((BAD_CHAR|(ATTRIBUTE_EXTERNAL|BINARY|PARAM|RECURSIVE)_ENTITY)_REF|MISPLACED_XML_PI|SYNTAX|NONE|NO_(MEMORY|ELEMENTS)|TAG_MISMATCH|INCORRECT_ENCODING|INVALID_TOKEN|DUPLICATE_ATTRIBUTE|UNCLOSED_(CDATA_SECTION|TOKEN)|UNDEFINED_ENTITY|UNKNOWN_ENCODING|JUNK_AFTER_DOC_ELEMENT|PARTIAL_CHAR|EXTERNAL_ENTITY_HANDLING|ASYNC_ENTITY)|ENTITY_(((REF|DECL)_)?NODE)|ELEMENT(_DECL)?_NODE|LOCAL_NAMESPACE|ATTRIBUTE_(NMTOKEN(S)?|NOTATION|NODE)|CDATA|ID(REF(S)?)?|DECL_NODE|ENTITY|ENUMERATION)|MHASH_(RIPEMD(128|160|256|320)|GOST|MD(2|4|5)|SHA(1|224|256|384|512)|SNEFRU256|HAVAL(128|160|192|224|256)|CRC23(B)?|TIGER(128|160)?|WHIRLPOOL|ADLER32)|MYSQL_(BOTH|NUM|CLIENT_(SSL|COMPRESS|IGNORE_SPACE|INTERACTIVE|ASSOC))|MYSQLI_(REPORT_(STRICT|INDEX|OFF|ERROR|ALL)|REFRESH_(GRANT|MASTER|BACKUP_LOG|STATUS|SLAVE|HOSTS|THREADS|TABLES|LOG)|READ_DEFAULT_(FILE|GROUP)|(GROUP|MULTIPLE_KEY|BINARY|BLOB)_FLAG|BOTH|STMT_ATTR_(CURSOR_TYPE|UPDATE_MAX_LENGTH|PREFETCH_ROWS)|STORE_RESULT|SERVER_QUERY_(NO_((GOOD_)?INDEX_USED)|WAS_SLOW)|SET_(CHARSET_NAME|FLAG)|NO_(DEFAULT_VALUE_FLAG|DATA)|NOT_NULL_FLAG|NUM(_FLAG)?|CURSOR_TYPE_(READ_ONLY|SCROLLABLE|NO_CURSOR|FOR_UPDATE)|CLIENT_(SSL|NO_SCHEMA|COMPRESS|IGNORE_SPACE|INTERACTIVE|FOUND_ROWS)|TYPE_(GEOMETRY|((MEDIUM|LONG|TINY)_)?BLOB|BIT|SHORT|STRING|SET|YEAR|NULL|NEWDECIMAL|NEWDATE|CHAR|TIME(STAMP)?|TINY|INT24|INTERVAL|DOUBLE|DECIMAL|DATE(TIME)?|ENUM|VAR_STRING|FLOAT|LONG(LONG)?)|TIME_STAMP_FLAG|INIT_COMMAND|ZEROFILL_FLAG|ON_UPDATE_NOW_FLAG|OPT_(NET_((CMD|READ)_BUFFER_SIZE)|CONNECT_TIMEOUT|INT_AND_FLOAT_NATIVE|LOCAL_INFILE)|DEBUG_TRACE_ENABLED|DATA_TRUNCATED|USE_RESULT|(ENUM|(PART|PRI|UNIQUE)_KEY|UNSIGNED)_FLAG|ASSOC|ASYNC|AUTO_INCREMENT_FLAG)|MCRYPT_(RC(2|6)|RIJNDAEL_(128|192|256)|RAND|GOST|XTEA|MODE_(STREAM|NOFB|CBC|CFB|OFB|ECB)|MARS|BLOWFISH(_COMPAT)?|SERPENT|SKIPJACK|SAFER(64|128|PLUS)|CRYPT|CAST_(128|256)|TRIPLEDES|THREEWAY|TWOFISH|IDEA|(3)?DES|DECRYPT|DEV_(U)?RANDOM|PANAMA|ENCRYPT|ENIGNA|WAKE|LOKI97|ARCFOUR(_IV)?)|STREAM_(REPORT_ERRORS|MUST_SEEK|MKDIR_RECURSIVE|BUFFER_(NONE|FULL|LINE)|SHUT_(RD)?WR|SOCK_(RDM|RAW|STREAM|SEQPACKET|DGRAM)|SERVER_(BIND|LISTEN)|NOTIFY_(REDIRECTED|RESOLVE|MIME_TYPE_IS|SEVERITY_(INFO|ERR|WARN)|COMPLETED|CONNECT|PROGRESS|FILE_SIZE_IS|FAILURE|AUTH_(REQUIRED|RESULT))|CRYPTO_METHOD_((SSLv2(3)?|SSLv3|TLS)_(CLIENT|SERVER))|CLIENT_((ASYNC_)?CONNECT|PERSISTENT)|CAST_(AS_STREAM|FOR_SELECT)|(IGNORE|IS)_URL|IPPROTO_(RAW|TCP|ICMP|IP|UDP)|OOB|OPTION_(READ_(BUFFER|TIMEOUT)|BLOCKING|WRITE_BUFFER)|URL_STAT_(LINK|QUIET)|USE_PATH|PEEK|PF_(INET(6)?|UNIX)|ENFORCE_SAFE_MODE|FILTER_(ALL|READ|WRITE))|SUNFUNCS_RET_(DOUBLE|STRING|TIMESTAMP)|SQLITE_(READONLY|ROW|MISMATCH|MISUSE|BOTH|BUSY|SCHEMA|NOMEM|NOTFOUND|NOTADB|NOLFS|NUM|CORRUPT|CONSTRAINT|CANTOPEN|TOOBIG|INTERRUPT|INTERNAL|IOERR|OK|DONE|PROTOCOL|PERM|ERROR|EMPTY|FORMAT|FULL|LOCKED|ABORT|ASSOC|AUTH)|SQLITE3_(BOTH|BLOB|NUM|NULL|TEXT|INTEGER|OPEN_(READ(ONLY|WRITE)|CREATE)|FLOAT_ASSOC)|CURL(M_(BAD_((EASY)?HANDLE)|CALL_MULTI_PERFORM|INTERNAL_ERROR|OUT_OF_MEMORY|OK)|MSG_DONE|SSH_AUTH_(HOST|NONE|DEFAULT|PUBLICKEY|PASSWORD|KEYBOARD)|CLOSEPOLICY_(SLOWEST|CALLBACK|OLDEST|LEAST_(RECENTLY_USED|TRAFFIC)|INFO_(REDIRECT_(COUNT|TIME)|REQUEST_SIZE|SSL_VERIFYRESULT|STARTTRANSFER_TIME|(SIZE|SPEED)_(DOWNLOAD|UPLOAD)|HTTP_CODE|HEADER_(OUT|SIZE)|NAMELOOKUP_TIME|CONNECT_TIME|CONTENT_(TYPE|LENGTH_(DOWNLOAD|UPLOAD))|CERTINFO|TOTAL_TIME|PRIVATE|PRETRANSFER_TIME|EFFECTIVE_URL|FILETIME)|OPT_(RESUME_FROM|RETURNTRANSFER|REDIR_PROTOCOLS|REFERER|READ(DATA|FUNCTION)|RANGE|RANDOM_FILE|MAX(CONNECTS|REDIRS)|BINARYTRANSFER|BUFFERSIZE|SSH_(HOST_PUBLIC_KEY_MD5|(PRIVATE|PUBLIC)_KEYFILE)|AUTH_TYPES)|SSL(CERT(TYPE|PASSWD)?|ENGINE(_DEFAULT)?|VERSION|KEY(TYPE|PASSWD)?)|SSL_(CIPHER_LIST|VERIFY(HOST|PEER))|STDERR|HTTP(GET|HEADER|200ALIASES|_VERSION|PROXYTUNNEL|AUTH)|HEADER(FUNCTION)?|NO(BODY|SIGNAL|PROGRESS)|NETRC|CRLF|CONNECTTIMEOUT(_MS)?|COOKIE(SESSION|JAR|FILE)?|CUSTOMREQUEST|CERTINFO|CLOSEPOLICY|CA(INFO|PATH)|TRANSFERTEXT|TCP_NODELAY|TIME(CONDITION|OUT(_MS)?|VALUE)|INTERFACE|INFILE(SIZE)?|IPRESOLVE|DNS_(CACHE_TIMEOUT|USE_GLOBAL_CACHE)|URL|USER(AGENT|PWD)|UNRESTRICTED_AUTH|UPLOAD|PRIVATE|PROGRESSFUNCTION|PROXY(TYPE|USERPWD|PORT|AUTH)?|PROTOCOLS|PORT|POST(REDIR|QUOTE|FIELDS)?|PUT|EGDSOCKET|ENCODING|VERBOSE|KRB4LEVEL|KEYPASSWD|QUOTE|FRESH_CONNECT|FTP(APPEND|LISTONLY|PORT|SSLAUTH)|FTP_(SSL|SKIP_PASV_IP|CREATE_MISSING_DIRS|USE_EP(RT|SV)|FILEMETHOD)|FILE(TIME)?|FORBID_REUSE|FOLLOWLOCATION|FAILONERROR|WRITE(FUNCTION|HEADER)|LOW_SPEED_(LIMIT|TIME)|AUTOREFERER)|PROXY_(HTTP|SOCKS(4|5))|PROTO_(SCP|SFTP|HTTP(S)?|TELNET|TFTP|DICT|FTP(S)?|FILE|LDAP(S)?|ALL)|E_((RECV|READ)_ERROR|GOT_NOTHING|MALFORMAT_USER|BAD_(CONTENT_ENCODING|CALLING_ORDER|PASSWORD_ENTERED|FUNCTION_ARGUMENT)|SSH|SSL_(CIPHER|CONNECT_ERROR|CERTPROBLEM|CACERT|PEER_CERTIFICATE|ENGINE_(NOTFOUND|SETFAILED))|SHARE_IN_USE|SEND_ERROR|HTTP_(RANGE_ERROR|NOT_FOUND|PORT_FAILED|POST_ERROR)|COULDNT_(RESOLVE_(HOST|PROXY)|CONNECT)|TOO_MANY_REDIRECTS|TELNET_OPTION_SYNTAX|OBSOLETE|OUT_OF_MEMORY|OPERATION|TIMEOUTED|OK|URL_MALFORMAT(_USER)?|UNSUPPORTED_PROTOCOL|UNKNOWN_TELNET_OPTION|PARTIAL_FILE|FTP_(BAD_DOWNLOAD_RESUME|SSL_FAILED|COULDNT_(RETR_FILE|GET_SIZE|STOR_FILE|SET_(BINARY|ASCII)|USE_REST)|CANT_(GET_HOST|RECONNECT)|USER_PASSWORD_INCORRECT|PORT_FAILED|QUOTE_ERROR|WRITE_ERROR|WEIRD_((PASS|PASV|SERVER|USER)_REPLY|227_FORMAT)|ACCESS_DENIED)|FILESIZE_EXCEEDED|FILE_COULDNT_READ_FILE|FUNCTION_NOT_FOUND|FAILED_INIT|WRITE_ERROR|LIBRARY_NOT_FOUND|LDAP_(SEARCH_FAILED|CANNOT_BIND|INVALID_URL)|ABORTED_BY_CALLBACK)|VERSION_NOW|FTP(METHOD_(MULTI|SINGLE|NO)CWD|SSL_(ALL|NONE|CONTROL|TRY)|AUTH_(DEFAULT|SSL|TLS))|AUTH_(ANY(SAFE)?|BASIC|DIGEST|GSSNEGOTIATE|NTLM))|CURL_(HTTP_VERSION_(1_(0|1)|NONE)|NETRC_(REQUIRED|IGNORED|OPTIONAL)|TIMECOND_(IF(UN)?MODSINCE|LASTMOD)|IPRESOLVE_(V(4|6)|WHATEVER)|VERSION_(SSL|IPV6|KERBEROS4|LIBZ))|IMAGETYPE_(GIF|XBM|BMP|SWF|COUNT|TIFF_(MM|II)|ICO|IFF|UNKNOWN|JB2|JPX|JP2|JPC|JPEG(2000)?|PSD|PNG|WBMP)|INPUT_(REQUEST|GET|SERVER|SESSION|COOKIE|POST|ENV)|ICONV_(MIME_DECODE_(STRICT|CONTINUE_ON_ERROR)|IMPL|VERSION)|DNS_(MX|SRV|SOA|HINFO|NS|NAPTR|CNAME|TXT|PTR|ANY|ALL|AAAA|A(6)?)|DOM(STRING_SIZE_ERR)|DOM_((SYNTAX|HIERARCHY_REQUEST|NO_(MODIFICATION_ALLOWED|DATA_ALLOWED)|NOT_(FOUND|SUPPORTED)|NAMESPACE|INDEX_SIZE|USE_ATTRIBUTE|VALID_(MODIFICATION|STATE|CHARACTER|ACCESS)|PHP|VALIDATION|WRONG_DOCUMENT)_ERR)|JSON_(HEX_(TAG|QUOT|AMP|APOS)|NUMERIC_CHECK|ERROR_(SYNTAX|STATE_MISMATCH|NONE|CTRL_CHAR|DEPTH|UTF8)|FORCE_OBJECT)|PREG_((D_UTF8(_OFFSET)?|NO|INTERNAL|(BACKTRACK|RECURSION)_LIMIT)_ERROR|GREP_INVERT|SPLIT_(NO_EMPTY|(DELIM|OFFSET)_CAPTURE)|SET_ORDER|OFFSET_CAPTURE|PATTERN_ORDER)|PSFS_(PASS_ON|ERR_FATAL|FEED_ME|FLAG_(NORMAL|FLUSH_(CLOSE|INC)))|PCRE_VERSION|POSIX_((F|R|W|X)_OK|S_IF(REG|BLK|SOCK|CHR|IFO))|FNM_(NOESCAPE|CASEFOLD|PERIOD|PATHNAME)|FILTER_(REQUIRE_(SCALAR|ARRAY)|NULL_ON_FAILURE|CALLBACK|DEFAULT|UNSAFE_RAW|SANITIZE_(MAGIC_QUOTES|STRING|STRIPPED|SPECIAL_CHARS|NUMBER_(INT|FLOAT)|URL|EMAIL|ENCODED|FULL_SPCIAL_CHARS)|VALIDATE_(REGEXP|BOOLEAN|INT|IP|URL|EMAIL|FLOAT)|FORCE_ARRAY|FLAG_(SCHEME_REQUIRED|STRIP_(BACKTICK|HIGH|LOW)|HOST_REQUIRED|NONE|NO_(RES|PRIV)_RANGE|ENCODE_QUOTES|IPV(4|6)|PATH_REQUIRED|EMPTY_STRING_NULL|ENCODE_(HIGH|LOW|AMP)|QUERY_REQUIRED|ALLOW_(SCIENTIFIC|HEX|THOUSAND|OCTAL|FRACTION)))|FILE_(BINARY|SKIP_EMPTY_LINES|NO_DEFAULT_CONTEXT|TEXT|IGNORE_NEW_LINES|USE_INCLUDE_PATH|APPEND)|FILEINFO_(RAW|MIME(_(ENCODING|TYPE))?|SYMLINK|NONE|CONTINUE|DEVICES|PRESERVE_ATIME)|FORCE_(DEFLATE|GZIP)|LIBXML_(XINCLUDE|NSCLEAN|NO(XMLDECL|BLANKS|NET|CDATA|ERROR|EMPTYTAG|ENT|WARNING)|COMPACT|DTD(VALID|LOAD|ATTR)|((DOTTED|LOADED)_)?VERSION|PARSEHUGE|ERR_(NONE|ERROR|FATAL|WARNING)))\\b", + "name": "support.constant.ext.php" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.inheritance.php" + } + }, + "match": "(\\\\)?\\b(T_(RETURN|REQUIRE(_ONCE)?|GOTO|GLOBAL|(MINUS|MOD|MUL|XOR)_EQUAL|METHOD_C|ML_COMMENT|BREAK|BOOL_CAST|BOOLEAN_(AND|OR)|BAD_CHARACTER|SR(_EQUAL)?|STRING(_CAST|VARNAME)?|START_HEREDOC|STATIC|SWITCH|SL(_EQUAL)?|HALT_COMPILER|NS_(C|SEPARATOR)|NUM_STRING|NEW|NAMESPACE|CHARACTER|COMMENT|CONSTANT(_ENCAPSED_STRING)?|CONCAT_EQUAL|CONTINUE|CURLY_OPEN|CLOSE_TAG|CLONE|CLASS(_C)?|CASE|CATCH|TRY|THROW|IMPLEMENTS|ISSET|IS_((GREATER|SMALLER)_OR_EQUAL|(NOT_)?(IDENTICAL|EQUAL))|INSTANCEOF|INCLUDE(_ONCE)?|INC|INT_CAST|INTERFACE|INLINE_HTML|IF|OR_EQUAL|OBJECT_(CAST|OPERATOR)|OPEN_TAG(_WITH_ECHO)?|OLD_FUNCTION|DNUMBER|DIR|DIV_EQUAL|DOC_COMMENT|DOUBLE_(ARROW|CAST|COLON)|DOLLAR_OPEN_CURLY_BRACES|DO|DEC|DECLARE|DEFAULT|USE|UNSET(_CAST)?|PRINT|PRIVATE|PROTECTED|PUBLIC|PLUS_EQUAL|PAAMAYIM_NEKUDOTAYIM|EXTENDS|EXIT|EMPTY|ENCAPSED_AND_WHITESPACE|END(SWITCH|IF|DECLARE|FOR(EACH)?|WHILE)|END_HEREDOC|ECHO|EVAL|ELSE(IF)?|VAR(IABLE)?|FINAL|FILE|FOR(EACH)?|FUNC_C|FUNCTION|WHITESPACE|WHILE|LNUMBER|LIST|LINE|LOGICAL_(AND|OR|XOR)|ARRAY_(CAST)?|ABSTRACT|AS|AND_EQUAL))\\b", + "name": "support.constant.parser-token.php" + }, + { + "match": "(?i)[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*", + "name": "constant.other.php" + } + ] + }, + "function-call": { + "patterns": [ + { + "begin": "(\\\\?(?)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.php" + } + }, + "name": "meta.function-call.php", + "patterns": [ + { + "include": "#named-arguments" + }, + { + "include": "$self" + } + ] + }, + { + "begin": "(\\\\)?(?)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.php" + } + }, + "name": "meta.function-call.php", + "patterns": [ + { + "include": "#named-arguments" + }, + { + "include": "$self" + } + ] + }, + { + "match": "(?i)\\b(print|echo)\\b", + "name": "support.function.construct.output.php" + } + ] + }, + "function-parameters": { + "patterns": [ + { + "include": "#attribute" + }, + { + "include": "#comments" + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.php" + }, + { + "captures": { + "1": { + "patterns": [ + { + "include": "#php-types" + } + ] + }, + "2": { + "name": "variable.other.php" + }, + "3": { + "name": "storage.modifier.reference.php" + }, + "4": { + "name": "keyword.operator.variadic.php" + }, + "5": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(?i)(?:((?:\\?\\s*)?[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+|(?:[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+|\\(\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+(?:\\s*&\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)+\\s*\\))(?:\\s*[|&]\\s*(?:[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+|\\(\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+(?:\\s*&\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)+\\s*\\)))+)\\s+)?((?:(&)\\s*)?(\\.\\.\\.)(\\$)[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)(?=\\s*(?:,|\\)|/[/*]|\\#|$))", + "name": "meta.function.parameter.variadic.php" + }, + { + "begin": "(?i)((?:\\?\\s*)?[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+|(?:[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+|\\(\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+(?:\\s*&\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)+\\s*\\))(?:\\s*[|&]\\s*(?:[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+|\\(\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+(?:\\s*&\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)+\\s*\\)))+)\\s+((?:(&)\\s*)?(\\$)[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#php-types" + } + ] + }, + "2": { + "name": "variable.other.php" + }, + "3": { + "name": "storage.modifier.reference.php" + }, + "4": { + "name": "punctuation.definition.variable.php" + } + }, + "end": "(?=\\s*(?:,|\\)|/[/*]|\\#))", + "name": "meta.function.parameter.typehinted.php", + "patterns": [ + { + "begin": "=", + "beginCaptures": { + "0": { + "name": "keyword.operator.assignment.php" + } + }, + "end": "(?=\\s*(?:,|\\)|/[/*]|\\#))", + "patterns": [ + { + "include": "#parameter-default-types" + } + ] + } + ] + }, + { + "captures": { + "1": { + "name": "variable.other.php" + }, + "2": { + "name": "storage.modifier.reference.php" + }, + "3": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(?i)((?:(&)\\s*)?(\\$)[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)(?=\\s*(?:,|\\)|/[/*]|\\#|$))", + "name": "meta.function.parameter.no-default.php" + }, + { + "begin": "(?i)((?:(&)\\s*)?(\\$)[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)\\s*(=)\\s*", + "beginCaptures": { + "1": { + "name": "variable.other.php" + }, + "2": { + "name": "storage.modifier.reference.php" + }, + "3": { + "name": "punctuation.definition.variable.php" + }, + "4": { + "name": "keyword.operator.assignment.php" + } + }, + "end": "(?=\\s*(?:,|\\)|/[/*]|\\#))", + "name": "meta.function.parameter.default.php", + "patterns": [ + { + "include": "#parameter-default-types" + } + ] + } + ] + }, + "heredoc": { + "patterns": [ + { + "begin": "(?i)(?=<<<\\s*(\"?)([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)(\\1)\\s*$)", + "end": "(?!\\G)", + "name": "string.unquoted.heredoc.php", + "patterns": [ + { + "include": "#heredoc_interior" + } + ] + }, + { + "begin": "(?=<<<\\s*'([a-zA-Z_]+\\w*)'\\s*$)", + "end": "(?!\\G)", + "name": "string.unquoted.nowdoc.php", + "patterns": [ + { + "include": "#nowdoc_interior" + } + ] + } + ] + }, + "heredoc_interior": { + "patterns": [ + { + "begin": "(<<<)\\s*(\"?)(HTML)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "text.html", + "end": "^\\s*(\\3)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.html", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "text.html.basic" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(XML)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "text.xml", + "end": "^\\s*(\\3)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.xml", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "text.xml" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)([DS]QL)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.sql", + "end": "^\\s*(\\3)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.sql", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "source.sql" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(JAVASCRIPT|JS)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.js", + "end": "^\\s*(\\3)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.js", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "source.js" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(JSON)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.json", + "end": "^\\s*(\\3)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.json", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "source.json" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(CSS)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.css", + "end": "^\\s*(\\3)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.css", + "patterns": [ + { + "include": "#interpolation" + }, + { + "include": "source.css" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(REGEXP?)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "string.regexp.heredoc.php", + "end": "^\\s*(\\3)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "patterns": [ + { + "include": "#interpolation" + }, + { + "match": "(\\\\){1,2}[.$^\\[\\]{}]", + "name": "constant.character.escape.regex.php" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repitition.php" + }, + "3": { + "name": "punctuation.definition.arbitrary-repitition.php" + } + }, + "match": "({)\\d+(,\\d+)?(})", + "name": "string.regexp.arbitrary-repitition.php" + }, + { + "begin": "\\[(?:\\^?\\])?", + "captures": { + "0": { + "name": "punctuation.definition.character-class.php" + } + }, + "end": "\\]", + "name": "string.regexp.character-class.php", + "patterns": [ + { + "match": "\\\\[\\\\'\\[\\]]", + "name": "constant.character.escape.php" + } + ] + }, + { + "match": "[$^+*]", + "name": "keyword.operator.regexp.php" + }, + { + "begin": "(?i)(?<=^|\\s)(#)\\s(?=[[a-z0-9_\\x{7f}-\\x{10ffff},. \\t?!-][^\\x{00}-\\x{7f}]]*$)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.php" + } + }, + "end": "$", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.php" + } + }, + "name": "comment.line.number-sign.php" + } + ] + }, + { + "begin": "(<<<)\\s*(\"?)(BLADE)(\\2)(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "text.html.php.blade", + "end": "^\\s*(\\3)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "name": "meta.embedded.php.blade", + "patterns": [ + { + "include": "#interpolation" + } + ] + }, + { + "begin": "(?i)(<<<)\\s*(\"?)([a-z_\\x{7f}-\\x{10ffff}]+[a-z0-9_\\x{7f}-\\x{10ffff}]*)(\\2)(\\s*)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.php" + }, + "3": { + "name": "keyword.operator.heredoc.php" + }, + "5": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "end": "^\\s*(\\3)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "1": { + "name": "keyword.operator.heredoc.php" + } + }, + "patterns": [ + { + "include": "#interpolation" + } + ] + } + ] + }, + "inheritance-single": { + "patterns": [ + { + "begin": "(?i)(?=\\\\?[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*\\\\)", + "end": "(?i)([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)?(?=[^a-z0-9_\\x{7f}-\\x{10ffff}\\\\])", + "endCaptures": { + "1": { + "name": "entity.other.inherited-class.php" + } + }, + "patterns": [ + { + "include": "#namespace" + } + ] + }, + { + "include": "#class-builtin" + }, + { + "include": "#namespace" + }, + { + "match": "(?i)[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*", + "name": "entity.other.inherited-class.php" + } + ] + }, + "instantiation": { + "begin": "(?i)(new)\\s+(?!class\\b)", + "beginCaptures": { + "1": { + "name": "keyword.other.new.php" + } + }, + "end": "(?i)(?=[^a-z0-9_\\x{7f}-\\x{10ffff}\\\\])", + "patterns": [ + { + "match": "(?i)(parent|static|self)(?![a-z0-9_\\x{7f}-\\x{10ffff}])", + "name": "storage.type.php" + }, + { + "include": "#class-name" + }, + { + "include": "#variable-name" + } + ] + }, + "interface-extends": { + "patterns": [ + { + "begin": "(?i)(extends)\\s+", + "beginCaptures": { + "1": { + "name": "storage.modifier.extends.php" + } + }, + "end": "(?i)(?={)", + "patterns": [ + { + "include": "#comments" + }, + { + "match": ",", + "name": "punctuation.separator.classes.php" + }, + { + "include": "#inheritance-single" + } + ] + } + ] + }, + "interpolation": { + "patterns": [ + { + "match": "\\\\[0-7]{1,3}", + "name": "constant.character.escape.octal.php" + }, + { + "match": "\\\\x[0-9A-Fa-f]{1,2}", + "name": "constant.character.escape.hex.php" + }, + { + "match": "\\\\u{[0-9A-Fa-f]+}", + "name": "constant.character.escape.unicode.php" + }, + { + "match": "\\\\[nrtvef$\\\\]", + "name": "constant.character.escape.php" + }, + { + "begin": "{(?=\\$.*?})", + "beginCaptures": { + "0": { + "name": "punctuation.definition.variable.php" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.variable.php" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "include": "#variable-name" + } + ] + }, + "interpolation_double_quoted": { + "patterns": [ + { + "match": "\\\\\"", + "name": "constant.character.escape.php" + }, + { + "include": "#interpolation" + } + ] + }, + "invoke-call": { + "captures": { + "1": { + "name": "variable.other.php" + }, + "2": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(?i)((\\$+)[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)(?=\\s*\\()", + "name": "meta.function-call.invoke.php" + }, + "match_statement": { + "patterns": [ + { + "match": "\\s+(?=match\\b)" + }, + { + "begin": "\\bmatch\\b", + "beginCaptures": { + "0": { + "name": "keyword.control.match.php" + } + }, + "end": "}|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.section.match-block.end.bracket.curly.php" + } + }, + "name": "meta.match-statement.php", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.match-expression.begin.bracket.round.php" + } + }, + "end": "\\)|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.match-expression.end.bracket.round.php" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.section.match-block.begin.bracket.curly.php" + } + }, + "end": "(?=}|\\?>)", + "patterns": [ + { + "match": "=>", + "name": "keyword.definition.arrow.php" + }, + { + "include": "$self" + } + ] + } + ] + } + ] + }, + "named-arguments": { + "captures": { + "1": { + "name": "entity.name.variable.parameter.php" + }, + "2": { + "name": "punctuation.separator.colon.php" + } + }, + "match": "(?i)(?<=^|\\(|,)\\s*([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)\\s*(:)(?!:)" + }, + "namespace": { + "begin": "(?i)(?:(namespace)|[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)?(\\\\)", + "beginCaptures": { + "1": { + "name": "variable.language.namespace.php" + }, + "2": { + "name": "punctuation.separator.inheritance.php" + } + }, + "end": "(?i)(?![a-z0-9_\\x{7f}-\\x{10ffff}]*\\\\)", + "name": "support.other.namespace.php", + "patterns": [ + { + "match": "\\\\", + "name": "punctuation.separator.inheritance.php" + } + ] + }, + "nowdoc_interior": { + "patterns": [ + { + "begin": "(<<<)\\s*'(HTML)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "text.html", + "end": "^\\s*(\\2)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.html", + "patterns": [ + { + "include": "text.html.basic" + } + ] + }, + { + "begin": "(<<<)\\s*'(XML)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "text.xml", + "end": "^\\s*(\\2)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.xml", + "patterns": [ + { + "include": "text.xml" + } + ] + }, + { + "begin": "(<<<)\\s*'([DS]QL)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.sql", + "end": "^\\s*(\\2)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.sql", + "patterns": [ + { + "include": "source.sql" + } + ] + }, + { + "begin": "(<<<)\\s*'(JAVASCRIPT|JS)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.js", + "end": "^\\s*(\\2)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.js", + "patterns": [ + { + "include": "source.js" + } + ] + }, + { + "begin": "(<<<)\\s*'(JSON)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.json", + "end": "^\\s*(\\2)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.json", + "patterns": [ + { + "include": "source.json" + } + ] + }, + { + "begin": "(<<<)\\s*'(CSS)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "source.css", + "end": "^\\s*(\\2)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.css", + "patterns": [ + { + "include": "source.css" + } + ] + }, + { + "begin": "(<<<)\\s*'(REGEXP?)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "string.regexp.nowdoc.php", + "end": "^\\s*(\\2)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "patterns": [ + { + "match": "(\\\\){1,2}[.$^\\[\\]{}]", + "name": "constant.character.escape.regex.php" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repitition.php" + }, + "3": { + "name": "punctuation.definition.arbitrary-repitition.php" + } + }, + "match": "({)\\d+(,\\d+)?(})", + "name": "string.regexp.arbitrary-repitition.php" + }, + { + "begin": "\\[(?:\\^?\\])?", + "captures": { + "0": { + "name": "punctuation.definition.character-class.php" + } + }, + "end": "\\]", + "name": "string.regexp.character-class.php", + "patterns": [ + { + "match": "\\\\[\\\\'\\[\\]]", + "name": "constant.character.escape.php" + } + ] + }, + { + "match": "[$^+*]", + "name": "keyword.operator.regexp.php" + }, + { + "begin": "(?i)(?<=^|\\s)(#)\\s(?=[[a-z0-9_\\x{7f}-\\x{10ffff},. \\t?!-][^\\x{00}-\\x{7f}]]*$)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.php" + } + }, + "end": "$", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.php" + } + }, + "name": "comment.line.number-sign.php" + } + ] + }, + { + "begin": "(<<<)\\s*'(BLADE)'(\\s*)$", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.php" + }, + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "contentName": "text.html.php.blade", + "end": "^\\s*(\\2)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.php" + }, + "1": { + "name": "keyword.operator.nowdoc.php" + } + }, + "name": "meta.embedded.php.blade" + }, + { + "begin": "(?i)(<<<)\\s*'([a-z_\\x{7f}-\\x{10ffff}]+[a-z0-9_\\x{7f}-\\x{10ffff}]*)'(\\s*)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.php" + }, + "2": { + "name": "keyword.operator.nowdoc.php" + }, + "3": { + "name": "invalid.illegal.trailing-whitespace.php" + } + }, + "end": "^\\s*(\\2)(?![A-Za-z0-9_\\x{7f}-\\x{10ffff}])", + "endCaptures": { + "1": { + "name": "keyword.operator.nowdoc.php" + } + } + } + ] + }, + "null_coalescing": { + "match": "\\?\\?", + "name": "keyword.operator.null-coalescing.php" + }, + "numbers": { + "patterns": [ + { + "match": "0[xX][0-9a-fA-F]+(?:_[0-9a-fA-F]+)*", + "name": "constant.numeric.hex.php" + }, + { + "match": "0[bB][01]+(?:_[01]+)*", + "name": "constant.numeric.binary.php" + }, + { + "match": "0[oO][0-7]+(?:_[0-7]+)*", + "name": "constant.numeric.octal.php" + }, + { + "match": "0(?:_?[0-7]+)+", + "name": "constant.numeric.octal.php" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.decimal.period.php" + }, + "2": { + "name": "punctuation.separator.decimal.period.php" + } + }, + "match": "(?:(?:\\d+(?:_\\d+)*)?(\\.)\\d+(?:_\\d+)*(?:[eE][+-]?\\d+(?:_\\d+)*)?|\\d+(?:_\\d+)*(\\.)(?:\\d+(?:_\\d+)*)?(?:[eE][+-]?\\d+(?:_\\d+)*)?|\\d+(?:_\\d+)*[eE][+-]?\\d+(?:_\\d+)*)", + "name": "constant.numeric.decimal.php" + }, + { + "match": "0|[1-9](?:_?\\d+)*", + "name": "constant.numeric.decimal.php" + } + ] + }, + "object": { + "patterns": [ + { + "begin": "(\\??->)\\s*(\\$?{)", + "beginCaptures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "punctuation.definition.variable.php" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.variable.php" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "(?i)(\\??->)\\s*([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "entity.name.function.php" + }, + "3": { + "name": "punctuation.definition.arguments.begin.bracket.round.php" + } + }, + "end": "\\)|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.php" + } + }, + "name": "meta.method-call.php", + "patterns": [ + { + "include": "#named-arguments" + }, + { + "include": "$self" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "variable.other.property.php" + }, + "3": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(?i)(\\??->)\\s*((\\$+)?[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)?" + } + ] + }, + "parameter-default-types": { + "patterns": [ + { + "include": "#strings" + }, + { + "include": "#numbers" + }, + { + "include": "#string-backtick" + }, + { + "include": "#variables" + }, + { + "match": "=>", + "name": "keyword.operator.key.php" + }, + { + "match": "=", + "name": "keyword.operator.assignment.php" + }, + { + "match": "&(?=\\s*\\$)", + "name": "storage.modifier.reference.php" + }, + { + "begin": "(array)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "support.function.construct.php" + }, + "2": { + "name": "punctuation.definition.array.begin.bracket.round.php" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.array.end.bracket.round.php" + } + }, + "name": "meta.array.php", + "patterns": [ + { + "include": "#parameter-default-types" + } + ] + }, + { + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "punctuation.section.array.begin.php" + } + }, + "end": "\\]|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.section.array.end.php" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "include": "#instantiation" + }, + { + "begin": "(?i)(?=[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+(::)\\s*([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)?)", + "end": "(?i)(::)\\s*([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)?", + "endCaptures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "constant.other.class.php" + } + }, + "patterns": [ + { + "include": "#class-name" + } + ] + }, + { + "include": "#constants" + } + ] + }, + "php-types": { + "patterns": [ + { + "match": "\\?", + "name": "keyword.operator.nullable-type.php" + }, + { + "match": "[|&]", + "name": "punctuation.separator.delimiter.php" + }, + { + "match": "(?i)\\b(null|int|float|bool|string|array|object|callable|iterable|true|false|mixed|void)\\b", + "name": "keyword.other.type.php" + }, + { + "match": "(?i)\\b(parent|self)\\b", + "name": "storage.type.php" + }, + { + "match": "\\(", + "name": "punctuation.definition.type.begin.bracket.round.php" + }, + { + "match": "\\)", + "name": "punctuation.definition.type.end.bracket.round.php" + }, + { + "include": "#class-name" + } + ] + }, + "php_doc": { + "patterns": [ + { + "match": "^(?!\\s*\\*).*?(?:(?=\\*/)|$\\n?)", + "name": "invalid.illegal.missing-asterisk.phpdoc.php" + }, + { + "captures": { + "1": { + "name": "keyword.other.phpdoc.php" + }, + "3": { + "name": "storage.modifier.php" + }, + "4": { + "name": "invalid.illegal.wrong-access-type.phpdoc.php" + } + }, + "match": "^\\s*\\*\\s*(@access)\\s+((public|private|protected)|(.+))\\s*$" + }, + { + "captures": { + "1": { + "name": "keyword.other.phpdoc.php" + }, + "2": { + "name": "markup.underline.link.php" + } + }, + "match": "(@xlink)\\s+(.+)\\s*$" + }, + { + "begin": "(@(?:global|param|property(-(read|write))?|return|throws|var))\\s+(?=[?A-Za-z_\\x{7f}-\\x{10ffff}\\\\]|\\()", + "beginCaptures": { + "1": { + "name": "keyword.other.phpdoc.php" + } + }, + "contentName": "meta.other.type.phpdoc.php", + "end": "(?=\\s|\\*/)", + "patterns": [ + { + "include": "#php_doc_types_array_multiple" + }, + { + "include": "#php_doc_types_array_single" + }, + { + "include": "#php_doc_types" + } + ] + }, + { + "match": "@(api|abstract|author|category|copyright|example|global|inherit[Dd]oc|internal|license|link|method|property(-(read|write))?|package|param|return|see|since|source|static|subpackage|throws|todo|var|version|uses|deprecated|final|ignore)\\b", + "name": "keyword.other.phpdoc.php" + }, + { + "captures": { + "1": { + "name": "keyword.other.phpdoc.php" + } + }, + "match": "{(@(link|inherit[Dd]oc)).+?}", + "name": "meta.tag.inline.phpdoc.php" + } + ] + }, + "php_doc_types": { + "captures": { + "0": { + "patterns": [ + { + "match": "\\?", + "name": "keyword.operator.nullable-type.php" + }, + { + "match": "\\b(string|integer|int|boolean|bool|float|double|object|mixed|array|resource|void|null|callback|false|true|self|static)\\b", + "name": "keyword.other.type.php" + }, + { + "include": "#class-name" + }, + { + "match": "[|&]", + "name": "punctuation.separator.delimiter.php" + }, + { + "match": "\\(", + "name": "punctuation.definition.type.begin.bracket.round.php" + }, + { + "match": "\\)", + "name": "punctuation.definition.type.end.bracket.round.php" + } + ] + } + }, + "match": "(?i)\\??[a-z_\\x{7f}-\\x{10ffff}\\\\][a-z0-9_\\x{7f}-\\x{10ffff}\\\\]*([|&]\\??[a-z_\\x{7f}-\\x{10ffff}\\\\][a-z0-9_\\x{7f}-\\x{10ffff}\\\\]*)*" + }, + "php_doc_types_array_multiple": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.type.begin.bracket.round.phpdoc.php" + } + }, + "end": "(\\))(\\[\\])|(?=\\*/)", + "endCaptures": { + "1": { + "name": "punctuation.definition.type.end.bracket.round.phpdoc.php" + }, + "2": { + "name": "keyword.other.array.phpdoc.php" + } + }, + "patterns": [ + { + "include": "#php_doc_types_array_multiple" + }, + { + "include": "#php_doc_types_array_single" + }, + { + "include": "#php_doc_types" + }, + { + "match": "[|&]", + "name": "punctuation.separator.delimiter.php" + } + ] + }, + "php_doc_types_array_single": { + "captures": { + "1": { + "patterns": [ + { + "include": "#php_doc_types" + } + ] + }, + "2": { + "name": "keyword.other.array.phpdoc.php" + } + }, + "match": "(?i)([a-z_\\x{7f}-\\x{10ffff}\\\\][a-z0-9_\\x{7f}-\\x{10ffff}\\\\]*)(\\[\\])" + }, + "regex-double-quoted": { + "begin": "\"/(?=(\\\\.|[^\"/])++/[imsxeADSUXu]*\")", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.php" + } + }, + "end": "(/)([imsxeADSUXu]*)(\")", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.php" + } + }, + "name": "string.regexp.double-quoted.php", + "patterns": [ + { + "match": "(\\\\){1,2}[.$^\\[\\]{}]", + "name": "constant.character.escape.regex.php" + }, + { + "include": "#interpolation_double_quoted" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repetition.php" + }, + "3": { + "name": "punctuation.definition.arbitrary-repetition.php" + } + }, + "match": "({)\\d+(,\\d+)?(})", + "name": "string.regexp.arbitrary-repetition.php" + }, + { + "begin": "\\[(?:\\^?\\])?", + "captures": { + "0": { + "name": "punctuation.definition.character-class.php" + } + }, + "end": "\\]", + "name": "string.regexp.character-class.php", + "patterns": [ + { + "include": "#interpolation_double_quoted" + } + ] + }, + { + "match": "[$^+*]", + "name": "keyword.operator.regexp.php" + } + ] + }, + "regex-single-quoted": { + "begin": "'/(?=(\\\\(?:\\\\(?:\\\\[\\\\']?|[^'])|.)|[^'/])++/[imsxeADSUXu]*')", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.php" + } + }, + "end": "(/)([imsxeADSUXu]*)(')", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.php" + } + }, + "name": "string.regexp.single-quoted.php", + "patterns": [ + { + "include": "#single_quote_regex_escape" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.arbitrary-repetition.php" + }, + "3": { + "name": "punctuation.definition.arbitrary-repetition.php" + } + }, + "match": "({)\\d+(,\\d+)?(})", + "name": "string.regexp.arbitrary-repetition.php" + }, + { + "begin": "\\[(?:\\^?\\])?", + "captures": { + "0": { + "name": "punctuation.definition.character-class.php" + } + }, + "end": "\\]", + "name": "string.regexp.character-class.php" + }, + { + "match": "[$^+*]", + "name": "keyword.operator.regexp.php" + } + ] + }, + "scope-resolution": { + "patterns": [ + { + "captures": { + "1": { + "patterns": [ + { + "match": "\\b(self|static|parent)\\b", + "name": "storage.type.php" + }, + { + "include": "#class-name" + }, + { + "include": "#variable-name" + } + ] + } + }, + "match": "([A-Za-z_\\x{7f}-\\x{10ffff}\\\\][A-Za-z0-9_\\x{7f}-\\x{10ffff}\\\\]*)(?=\\s*::)" + }, + { + "begin": "(?i)(::)\\s*([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "entity.name.function.php" + }, + "3": { + "name": "punctuation.definition.arguments.begin.bracket.round.php" + } + }, + "end": "\\)|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.php" + } + }, + "name": "meta.method-call.static.php", + "patterns": [ + { + "include": "#named-arguments" + }, + { + "include": "$self" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "keyword.other.class.php" + } + }, + "match": "(?i)(::)\\s*(class)\\b" + }, + { + "captures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "variable.other.class.php" + }, + "3": { + "name": "punctuation.definition.variable.php" + }, + "4": { + "name": "constant.other.class.php" + } + }, + "match": "(?i)(::)\\s*(?:((\\$+)[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)|([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*))?" + } + ] + }, + "single_quote_regex_escape": { + "match": "\\\\(?:\\\\(?:\\\\[\\\\']?|[^'])|.)", + "name": "constant.character.escape.php" + }, + "sql-string-double-quoted": { + "begin": "\"\\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER|AND|WITH)\\b)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.php" + } + }, + "contentName": "source.sql.embedded.php", + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.php" + } + }, + "name": "string.quoted.double.sql.php", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.comment.sql" + } + }, + "match": "(#)(\\\\\"|[^\"])*(?=\"|$)", + "name": "comment.line.number-sign.sql" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.comment.sql" + } + }, + "match": "(--)(\\\\\"|[^\"])*(?=\"|$)", + "name": "comment.line.double-dash.sql" + }, + { + "match": "\\\\[\\\\\"`']", + "name": "constant.character.escape.php" + }, + { + "match": "'(?=((\\\\')|[^'\"])*(\"|$))", + "name": "string.quoted.single.unclosed.sql" + }, + { + "match": "`(?=((\\\\`)|[^`\"])*(\"|$))", + "name": "string.quoted.other.backtick.unclosed.sql" + }, + { + "begin": "'", + "end": "'", + "name": "string.quoted.single.sql", + "patterns": [ + { + "include": "#interpolation_double_quoted" + } + ] + }, + { + "begin": "`", + "end": "`", + "name": "string.quoted.other.backtick.sql", + "patterns": [ + { + "include": "#interpolation_double_quoted" + } + ] + }, + { + "include": "#interpolation_double_quoted" + }, + { + "include": "source.sql" + } + ] + }, + "sql-string-single-quoted": { + "begin": "'\\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER|AND|WITH)\\b)", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.php" + } + }, + "contentName": "source.sql.embedded.php", + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.php" + } + }, + "name": "string.quoted.single.sql.php", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.comment.sql" + } + }, + "match": "(#)(\\\\'|[^'])*(?='|$)", + "name": "comment.line.number-sign.sql" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.comment.sql" + } + }, + "match": "(--)(\\\\'|[^'])*(?='|$)", + "name": "comment.line.double-dash.sql" + }, + { + "match": "\\\\[\\\\'`\"]", + "name": "constant.character.escape.php" + }, + { + "match": "`(?=((\\\\`)|[^`'])*('|$))", + "name": "string.quoted.other.backtick.unclosed.sql" + }, + { + "match": "\"(?=((\\\\\")|[^\"'])*('|$))", + "name": "string.quoted.double.unclosed.sql" + }, + { + "include": "source.sql" + } + ] + }, + "string-backtick": { + "begin": "`", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.php" + } + }, + "end": "`", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.php" + } + }, + "name": "string.interpolated.php", + "patterns": [ + { + "match": "\\\\`", + "name": "constant.character.escape.php" + }, + { + "include": "#interpolation" + } + ] + }, + "string-double-quoted": { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.php" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.php" + } + }, + "name": "string.quoted.double.php", + "patterns": [ + { + "include": "#interpolation_double_quoted" + } + ] + }, + "string-single-quoted": { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.php" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.php" + } + }, + "name": "string.quoted.single.php", + "patterns": [ + { + "match": "\\\\[\\\\']", + "name": "constant.character.escape.php" + } + ] + }, + "strings": { + "patterns": [ + { + "include": "#regex-double-quoted" + }, + { + "include": "#sql-string-double-quoted" + }, + { + "include": "#string-double-quoted" + }, + { + "include": "#regex-single-quoted" + }, + { + "include": "#sql-string-single-quoted" + }, + { + "include": "#string-single-quoted" + } + ] + }, + "support": { + "patterns": [ + { + "match": "(?i)\\bapc_(store|sma_info|compile_file|clear_cache|cas|cache_info|inc|dec|define_constants|delete(_file)?|exists|fetch|load_constants|add|bin_(dump|load)(file)?)\\b", + "name": "support.function.apc.php" + }, + { + "match": "(?i)\\b(shuffle|sizeof|sort|next|nat(case)?sort|count|compact|current|in_array|usort|uksort|uasort|pos|prev|end|each|extract|ksort|key(_exists)?|krsort|list|asort|arsort|rsort|reset|range|array(_(shift|sum|splice|search|slice|chunk|change_key_case|count_values|column|combine|(diff|intersect)(_(u)?(key|assoc))?|u(diff|intersect)(_(u)?assoc)?|unshift|unique|pop|push|pad|product|values|keys|key_exists|filter|fill(_keys)?|flip|walk(_recursive)?|reduce|replace(_recursive)?|reverse|rand|multisort|merge(_recursive)?|map)?))\\b", + "name": "support.function.array.php" + }, + { + "match": "(?i)\\b(show_source|sys_getloadavg|sleep|highlight_(file|string)|constant|connection_(aborted|status)|time_(nanosleep|sleep_until)|ignore_user_abort|die|define(d)?|usleep|uniqid|unpack|__halt_compiler|php_(check_syntax|strip_whitespace)|pack|eval|exit|get_browser)\\b", + "name": "support.function.basic_functions.php" + }, + { + "match": "(?i)\\bbc(scale|sub|sqrt|comp|div|pow(mod)?|add|mod|mul)\\b", + "name": "support.function.bcmath.php" + }, + { + "match": "(?i)\\bblenc_encrypt\\b", + "name": "support.function.blenc.php" + }, + { + "match": "(?i)\\bbz(compress|close|open|decompress|errstr|errno|error|flush|write|read)\\b", + "name": "support.function.bz2.php" + }, + { + "match": "(?i)\\b((French|Gregorian|Jewish|Julian)ToJD|cal_(to_jd|info|days_in_month|from_jd)|unixtojd|jdto(unix|jewish)|easter_(date|days)|JD(MonthName|To(Gregorian|Julian|French)|DayOfWeek))\\b", + "name": "support.function.calendar.php" + }, + { + "match": "(?i)\\b(class_alias|all_user_method(_array)?|is_(a|subclass_of)|__autoload|(class|interface|method|property|trait)_exists|get_(class(_(vars|methods))?|(called|parent)_class|object_vars|declared_(classes|interfaces|traits)))\\b", + "name": "support.function.classobj.php" + }, + { + "match": "(?i)\\b(com_(create_guid|print_typeinfo|event_sink|load_typelib|get_active_object|message_pump)|variant_(sub|set(_type)?|not|neg|cast|cat|cmp|int|idiv|imp|or|div|date_(from|to)_timestamp|pow|eqv|fix|and|add|abs|round|get_type|xor|mod|mul))\\b", + "name": "support.function.com.php" + }, + { + "match": "(?i)\\b(isset|unset|eval|empty|list)\\b", + "name": "support.function.construct.php" + }, + { + "match": "(?i)\\b(print|echo)\\b", + "name": "support.function.construct.output.php" + }, + { + "match": "(?i)\\bctype_(space|cntrl|digit|upper|punct|print|lower|alnum|alpha|graph|xdigit)\\b", + "name": "support.function.ctype.php" + }, + { + "match": "(?i)\\bcurl_(share_(close|init|setopt)|strerror|setopt(_array)?|copy_handle|close|init|unescape|pause|escape|errno|error|exec|version|file_create|reset|getinfo|multi_(strerror|setopt|select|close|init|info_read|(add|remove)_handle|getcontent|exec))\\b", + "name": "support.function.curl.php" + }, + { + "match": "(?i)\\b(strtotime|str[fp]time|checkdate|time|timezone_name_(from_abbr|get)|idate|timezone_((location|offset|transitions|version)_get|(abbreviations|identifiers)_list|open)|date(_(sun(rise|set)|sun_info|sub|create(_(immutable_)?from_format)?|timestamp_(get|set)|timezone_(get|set)|time_set|isodate_set|interval_(create_from_date_string|format)|offset_get|diff|default_timezone_(get|set)|date_set|parse(_from_format)?|format|add|get_last_errors|modify))?|localtime|get(date|timeofday)|gm(strftime|date|mktime)|microtime|mktime)\\b", + "name": "support.function.datetime.php" + }, + { + "match": "(?i)\\bdba_(sync|handlers|nextkey|close|insert|optimize|open|delete|popen|exists|key_split|firstkey|fetch|list|replace)\\b", + "name": "support.function.dba.php" + }, + { + "match": "(?i)\\bdbx_(sort|connect|compare|close|escape_string|error|query|fetch_row)\\b", + "name": "support.function.dbx.php" + }, + { + "match": "(?i)\\b(scandir|chdir|chroot|closedir|opendir|dir|rewinddir|readdir|getcwd)\\b", + "name": "support.function.dir.php" + }, + { + "match": "(?i)\\beio_(sync(fs)?|sync_file_range|symlink|stat(vfs)?|sendfile|set_min_parallel|set_max_(idle|poll_(reqs|time)|parallel)|seek|n(threads|op|pending|reqs|ready)|chown|chmod|custom|close|cancel|truncate|init|open|dup2|unlink|utime|poll|event_loop|f(sync|stat(vfs)?|chown|chmod|truncate|datasync|utime|allocate)|write|lstat|link|rename|realpath|read(ahead|dir|link)?|rmdir|get_(event_stream|last_error)|grp(_(add|cancel|limit))?|mknod|mkdir|busy)\\b", + "name": "support.function.eio.php" + }, + { + "match": "(?i)\\benchant_(dict_(store_replacement|suggest|check|is_in_session|describe|quick_check|add_to_(personal|session)|get_error)|broker_(set_ordering|init|dict_exists|describe|free(_dict)?|list_dicts|request_(pwl_)?dict|get_error))\\b", + "name": "support.function.enchant.php" + }, + { + "match": "(?i)\\b(split(i)?|sql_regcase|ereg(i)?(_replace)?)\\b", + "name": "support.function.ereg.php" + }, + { + "match": "(?i)\\b((restore|set)_(error_handler|exception_handler)|trigger_error|debug_(print_)?backtrace|user_error|error_(log|reporting|get_last))\\b", + "name": "support.function.errorfunc.php" + }, + { + "match": "(?i)\\b(shell_exec|system|passthru|proc_(nice|close|terminate|open|get_status)|escapeshell(arg|cmd)|exec)\\b", + "name": "support.function.exec.php" + }, + { + "match": "(?i)\\b(exif_(thumbnail|tagname|imagetype|read_data)|read_exif_data)\\b", + "name": "support.function.exif.php" + }, + { + "match": "(?i)\\bfann_((duplicate|length|merge|shuffle|subset)_train_data|scale_(train(_data)?|(input|output)(_train_data)?)|set_(scaling_params|sarprop_(step_error_(shift|threshold_factor)|temperature|weight_decay_shift)|cascade_(num_candidate_groups|candidate_(change_fraction|limit|stagnation_epochs)|output_(change_fraction|stagnation_epochs)|weight_multiplier|activation_(functions|steepnesses)|(max|min)_(cand|out)_epochs)|callback|training_algorithm|train_(error|stop)_function|(input|output)_scaling_params|error_log|quickprop_(decay|mu)|weight(_array)?|learning_(momentum|rate)|bit_fail_limit|activation_(function|steepness)(_(hidden|layer|output))?|rprop_((decrease|increase)_factor|delta_(max|min|zero)))|save(_train)?|num_(input|output)_train_data|copy|clear_scaling_params|cascadetrain_on_(file|data)|create_((sparse|shortcut|standard)(_array)?|train(_from_callback)?|from_file)|test(_data)?|train(_(on_(file|data)|epoch))?|init_weights|descale_(input|output|train)|destroy(_train)?|print_error|run|reset_(MSE|err(no|str))|read_train_from_file|randomize_weights|get_(sarprop_(step_error_(shift|threshold_factor)|temperature|weight_decay_shift)|num_(input|output|layers)|network_type|MSE|connection_(array|rate)|bias_array|bit_fail(_limit)?|cascade_(num_(candidates|candidate_groups)|(candidate|output)_(change_fraction|limit|stagnation_epochs)|weight_multiplier|activation_(functions|steepnesses)(_count)?|(max|min)_(cand|out)_epochs)|total_(connections|neurons)|training_algorithm|train_(error|stop)_function|err(no|str)|quickprop_(decay|mu)|learning_(momentum|rate)|layer_array|activation_(function|steepness)|rprop_((decrease|increase)_factor|delta_(max|min|zero))))\\b", + "name": "support.function.fann.php" + }, + { + "match": "(?i)\\b(symlink|stat|set_file_buffer|chown|chgrp|chmod|copy|clearstatcache|touch|tempnam|tmpfile|is_(dir|(uploaded_)?file|executable|link|readable|writ(e)?able)|disk_(free|total)_space|diskfreespace|dirname|delete|unlink|umask|pclose|popen|pathinfo|parse_ini_(file|string)|fscanf|fstat|fseek|fnmatch|fclose|ftell|ftruncate|file(size|[acm]time|type|inode|owner|perms|group)?|file_(exists|(get|put)_contents)|f(open|puts|putcsv|passthru|eof|flush|write|lock|read|gets(s)?|getc(sv)?)|lstat|lchown|lchgrp|link(info)?|rename|rewind|read(file|link)|realpath(_cache_(get|size))?|rmdir|glob|move_uploaded_file|mkdir|basename)\\b", + "name": "support.function.file.php" + }, + { + "match": "(?i)\\b(finfo_(set_flags|close|open|file|buffer)|mime_content_type)\\b", + "name": "support.function.fileinfo.php" + }, + { + "match": "(?i)\\bfilter_(has_var|input(_array)?|id|var(_array)?|list)\\b", + "name": "support.function.filter.php" + }, + { + "match": "(?i)\\bfastcgi_finish_request\\b", + "name": "support.function.fpm.php" + }, + { + "match": "(?i)\\b(call_user_(func|method)(_array)?|create_function|unregister_tick_function|forward_static_call(_array)?|function_exists|func_(num_args|get_arg(s)?)|register_(shutdown|tick)_function|get_defined_functions)\\b", + "name": "support.function.funchand.php" + }, + { + "match": "(?i)\\b((n)?gettext|textdomain|d((n)?gettext|c(n)?gettext)|bind(textdomain|_textdomain_codeset))\\b", + "name": "support.function.gettext.php" + }, + { + "match": "(?i)\\bgmp_(scan[01]|strval|sign|sub|setbit|sqrt(rem)?|hamdist|neg|nextprime|com|clrbit|cmp|testbit|intval|init|invert|import|or|div(exact)?|div_(q|qr|r)|jacobi|popcount|pow(m)?|perfect_square|prob_prime|export|fact|legendre|and|add|abs|root(rem)?|random(_(bits|range))?|gcd(ext)?|xor|mod|mul)\\b", + "name": "support.function.gmp.php" + }, + { + "match": "(?i)\\bhash(_(hmac(_file)?|copy|init|update(_(file|stream))?|pbkdf2|equals|file|final|algos))?\\b", + "name": "support.function.hash.php" + }, + { + "match": "(?i)\\b(http_(support|send_(status|stream|content_(disposition|type)|data|file|last_modified)|head|negotiate_(charset|content_type|language)|chunked_decode|cache_(etag|last_modified)|throttle|inflate|deflate|date|post_(data|fields)|put_(data|file|stream)|persistent_handles_(count|clean|ident)|parse_(cookie|headers|message|params)|redirect|request(_(method_(exists|name|(un)?register)|body_encode))?|get(_request_(headers|body(_stream)?))?|match_(etag|modified|request_header)|build_(cookie|str|url))|ob_(etag|deflate|inflate)handler)\\b", + "name": "support.function.http.php" + }, + { + "match": "(?i)\\b(iconv(_(str(pos|len|rpos)|substr|(get|set)_encoding|mime_(decode(_headers)?|encode)))?|ob_iconv_handler)\\b", + "name": "support.function.iconv.php" + }, + { + "match": "(?i)\\biis_((start|stop)_(service|server)|set_(script_map|server_rights|dir_security|app_settings)|(add|remove)_server|get_(script_map|service_state|server_(rights|by_(comment|path))|dir_security))\\b", + "name": "support.function.iisfunc.php" + }, + { + "match": "(?i)\\b(iptc(embed|parse)|(jpeg|png)2wbmp|gd_info|getimagesize(fromstring)?|image(s[xy]|scale|(char|string)(up)?|set(style|thickness|tile|interpolation|pixel|brush)|savealpha|convolution|copy(resampled|resized|merge(gray)?)?|colors(forindex|total)|color(set|closest(alpha|hwb)?|transparent|deallocate|(allocate|exact|resolve)(alpha)?|at|match)|crop(auto)?|create(truecolor|from(string|jpeg|png|wbmp|webp|gif|gd(2(part)?)?|xpm|xbm))?|types|ttf(bbox|text)|truecolortopalette|istruecolor|interlace|2wbmp|destroy|dashedline|jpeg|_type_to_(extension|mime_type)|ps(slantfont|text|(encode|extend|free|load)font|bbox)|png|polygon|palette(copy|totruecolor)|ellipse|ft(text|bbox)|filter|fill|filltoborder|filled(arc|ellipse|polygon|rectangle)|font(height|width)|flip|webp|wbmp|line|loadfont|layereffect|antialias|affine(matrix(concat|get))?|alphablending|arc|rotate|rectangle|gif|gd(2)?|gammacorrect|grab(screen|window)|xbm))\\b", + "name": "support.function.image.php" + }, + { + "match": "(?i)\\b(sys_get_temp_dir|set_(time_limit|include_path|magic_quotes_runtime)|cli_(get|set)_process_title|ini_(alter|get(_all)?|restore|set)|zend_(thread_id|version|logo_guid)|dl|php(credits|info|version)|php_(sapi_name|ini_(scanned_files|loaded_file)|uname|logo_guid)|putenv|extension_loaded|version_compare|assert(_options)?|restore_include_path|gc_(collect_cycles|disable|enable(d)?)|getopt|get_(cfg_var|current_user|defined_constants|extension_funcs|include_path|included_files|loaded_extensions|magic_quotes_(gpc|runtime)|required_files|resources)|get(env|lastmod|rusage|my(inode|[gup]id))|memory_get_(peak_)?usage|main|magic_quotes_runtime)\\b", + "name": "support.function.info.php" + }, + { + "match": "(?i)\\bibase_(set_event_handler|service_(attach|detach)|server_info|num_(fields|params)|name_result|connect|commit(_ret)?|close|trans|delete_user|drop_db|db_info|pconnect|param_info|prepare|err(code|msg)|execute|query|field_info|fetch_(assoc|object|row)|free_(event_handler|query|result)|wait_event|add_user|affected_rows|rollback(_ret)?|restore|gen_id|modify_user|maintain_db|backup|blob_(cancel|close|create|import|info|open|echo|add|get))\\b", + "name": "support.function.interbase.php" + }, + { + "match": "(?i)\\b(normalizer_(normalize|is_normalized)|idn_to_(unicode|utf8|ascii)|numfmt_(set_(symbol|(text_)?attribute|pattern)|create|(parse|format)(_currency)?|get_(symbol|(text_)?attribute|pattern|error_(code|message)|locale))|collator_(sort(_with_sort_keys)?|set_(attribute|strength)|compare|create|asort|get_(strength|sort_key|error_(code|message)|locale|attribute))|transliterator_(create(_(inverse|from_rules))?|transliterate|list_ids|get_error_(code|message))|intl(cal|tz)_get_error_(code|message)|intl_(is_failure|error_name|get_error_(code|message))|datefmt_(set_(calendar|lenient|pattern|timezone(_id)?)|create|is_lenient|parse|format(_object)?|localtime|get_(calendar(_object)?|time(type|zone(_id)?)|datetype|pattern|error_(code|message)|locale))|locale_(set_default|compose|canonicalize|parse|filter_matches|lookup|accept_from_http|get_(script|display_(script|name|variant|language|region)|default|primary_language|keywords|all_variants|region))|resourcebundle_(create|count|locales|get(_(error_(code|message)))?)|grapheme_(str(i?str|r?i?pos|len)|substr|extract)|msgfmt_(set_pattern|create|(format|parse)(_message)?|get_(pattern|error_(code|message)|locale)))\\b", + "name": "support.function.intl.php" + }, + { + "match": "(?i)\\bjson_(decode|encode|last_error(_msg)?)\\b", + "name": "support.function.json.php" + }, + { + "match": "(?i)\\bldap_(start|tls|sort|search|sasl_bind|set_(option|rebind_proc)|(first|next)_(attribute|entry|reference)|connect|control_paged_result(_response)?|count_entries|compare|close|t61_to_8859|8859_to_t61|dn2ufn|delete|unbind|parse_(reference|result)|escape|errno|err2str|error|explode_dn|bind|free_result|list|add|rename|read|get_(option|dn|entries|values(_len)?|attributes)|modify(_batch)?|mod_(add|del|replace))\\b", + "name": "support.function.ldap.php" + }, + { + "match": "(?i)\\blibxml_(set_(streams_context|external_entity_loader)|clear_errors|disable_entity_loader|use_internal_errors|get_(errors|last_error))\\b", + "name": "support.function.libxml.php" + }, + { + "match": "(?i)\\b(ezmlm_hash|mail)\\b", + "name": "support.function.mail.php" + }, + { + "match": "(?i)\\b((a)?(cos|sin|tan)(h)?|sqrt|srand|hypot|hexdec|ceil|is_(nan|(in)?finite)|octdec|dec(hex|oct|bin)|deg2rad|pi|pow|exp(m1)?|floor|fmod|lcg_value|log(1(p|0))?|atan2|abs|round|rand|rad2deg|getrandmax|mt_(srand|rand|getrandmax)|max|min|bindec|base_convert)\\b", + "name": "support.function.math.php" + }, + { + "match": "(?i)\\bmb_(str(cut|str|to(lower|upper)|istr|ipos|imwidth|pos|width|len|rchr|richr|ripos|rpos)|substitute_character|substr(_count)?|split|send_mail|http_(input|output)|check_encoding|convert_(case|encoding|kana|variables)|internal_encoding|output_handler|decode_(numericentity|mimeheader)|detect_(encoding|order)|parse_str|preferred_mime_name|encoding_aliases|encode_(numericentity|mimeheader)|ereg(i(_replace)?)?|ereg_(search(_(get(pos|regs)|init|regs|(set)?pos))?|replace(_callback)?|match)|list_encodings|language|regex_(set_options|encoding)|get_info)\\b", + "name": "support.function.mbstring.php" + }, + { + "match": "(?i)\\b(mcrypt_(cfb|create_iv|cbc|ofb|decrypt|encrypt|ecb|list_(algorithms|modes)|generic(_((de)?init|end))?|enc_(self_test|is_block_(algorithm|algorithm_mode|mode)|get_(supported_key_sizes|(block|iv|key)_size|(algorithms|modes)_name))|get_(cipher_name|(block|iv|key)_size)|module_(close|self_test|is_block_(algorithm|algorithm_mode|mode)|open|get_(supported_key_sizes|algo_(block|key)_size)))|mdecrypt_generic)\\b", + "name": "support.function.mcrypt.php" + }, + { + "match": "(?i)\\bmemcache_debug\\b", + "name": "support.function.memcache.php" + }, + { + "match": "(?i)\\bmhash(_(count|keygen_s2k|get_(hash_name|block_size)))?\\b", + "name": "support.function.mhash.php" + }, + { + "match": "(?i)\\b(log_(cmd_(insert|delete|update)|killcursor|write_batch|reply|getmore)|bson_(decode|encode))\\b", + "name": "support.function.mongo.php" + }, + { + "match": "(?i)\\bmysql_(stat|set_charset|select_db|num_(fields|rows)|connect|client_encoding|close|create_db|escape_string|thread_id|tablename|insert_id|info|data_seek|drop_db|db_(name|query)|unbuffered_query|pconnect|ping|errno|error|query|field_(seek|name|type|table|flags|len)|fetch_(object|field|lengths|assoc|array|row)|free_result|list_(tables|dbs|processes|fields)|affected_rows|result|real_escape_string|get_(client|host|proto|server)_info)\\b", + "name": "support.function.mysql.php" + }, + { + "match": "(?i)\\bmysqli_(ssl_set|store_result|stat|send_(query|long_data)|set_(charset|opt|local_infile_(default|handler))|stmt_(store_result|send_long_data|next_result|close|init|data_seek|prepare|execute|fetch|free_result|attr_(get|set)|result_metadata|reset|get_(result|warnings)|more_results|bind_(param|result))|select_db|slave_query|savepoint|next_result|change_user|character_set_name|connect|commit|client_encoding|close|thread_safe|init|options|(enable|disable)_(reads_from_master|rpl_parse)|dump_debug_info|debug|data_seek|use_result|ping|poll|param_count|prepare|escape_string|execute|embedded_server_(start|end)|kill|query|field_seek|free_result|autocommit|rollback|report|refresh|fetch(_(object|fields|field(_direct)?|assoc|all|array|row))?|rpl_(parse_enabled|probe|query_type)|release_savepoint|reap_async_query|real_(connect|escape_string|query)|more_results|multi_query|get_(charset|connection_stats|client_(stats|info|version)|cache_stats|warnings|links_stats|metadata)|master_query|bind_(param|result)|begin_transaction)\\b", + "name": "support.function.mysqli.php" + }, + { + "match": "(?i)\\bmysqlnd_memcache_(set|get_config)\\b", + "name": "support.function.mysqlnd-memcache.php" + }, + { + "match": "(?i)\\bmysqlnd_ms_(set_(user_pick_server|qos)|dump_servers|query_is_select|fabric_select_(shard|global)|get_(stats|last_(used_connection|gtid))|xa_(commit|rollback|gc|begin)|match_wild)\\b", + "name": "support.function.mysqlnd-ms.php" + }, + { + "match": "(?i)\\bmysqlnd_qc_(set_(storage_handler|cache_condition|is_select|user_handlers)|clear_cache|get_(normalized_query_trace_log|core_stats|cache_info|query_trace_log|available_handlers))\\b", + "name": "support.function.mysqlnd-qc.php" + }, + { + "match": "(?i)\\bmysqlnd_uh_(set_(statement|connection)_proxy|convert_to_mysqlnd)\\b", + "name": "support.function.mysqlnd-uh.php" + }, + { + "match": "(?i)\\b(syslog|socket_(set_(blocking|timeout)|get_status)|set(raw)?cookie|http_response_code|openlog|headers_(list|sent)|header(_(register_callback|remove))?|checkdnsrr|closelog|inet_(ntop|pton)|ip2long|openlog|dns_(check_record|get_(record|mx))|define_syslog_variables|(p)?fsockopen|long2ip|get(servby(name|port)|host(name|by(name(l)?|addr))|protoby(name|number)|mxrr))\\b", + "name": "support.function.network.php" + }, + { + "match": "(?i)\\bnsapi_(virtual|response_headers|request_headers)\\b", + "name": "support.function.nsapi.php" + }, + { + "match": "(?i)\\b(oci(statementtype|setprefetch|serverversion|savelob(file)?|numcols|new(collection|cursor|descriptor)|nlogon|column(scale|size|name|type(raw)?|isnull|precision)|coll(size|trim|assign(elem)?|append|getelem|max)|commit|closelob|cancel|internaldebug|definebyname|plogon|parse|error|execute|fetch(statement|into)?|free(statement|collection|cursor|desc)|write(temporarylob|lobtofile)|loadlob|log(on|off)|rowcount|rollback|result|bindbyname)|oci_(statement_type|set_(client_(info|identifier)|prefetch|edition|action|module_name)|server_version|num_(fields|rows)|new_(connect|collection|cursor|descriptor)|connect|commit|client_version|close|cancel|internal_debug|define_by_name|pconnect|password_change|parse|error|execute|bind_(array_)?by_name|field_(scale|size|name|type(_raw)?|is_null|precision)|fetch(_(object|assoc|all|array|row))?|free_(statement|descriptor)|lob_(copy|is_equal)|rollback|result|get_implicit_resultset))\\b", + "name": "support.function.oci8.php" + }, + { + "match": "(?i)\\bopcache_(compile_file|invalidate|reset|get_(status|configuration))\\b", + "name": "support.function.opcache.php" + }, + { + "match": "(?i)\\bopenssl_(sign|spki_(new|export(_challenge)?|verify)|seal|csr_(sign|new|export(_to_file)?|get_(subject|public_key))|cipher_iv_length|open|dh_compute_key|digest|decrypt|public_(decrypt|encrypt)|encrypt|error_string|pkcs12_(export(_to_file)?|read)|pkcs7_(sign|decrypt|encrypt|verify)|verify|free_key|random_pseudo_bytes|pkey_(new|export(_to_file)?|free|get_(details|public|private))|private_(decrypt|encrypt)|pbkdf2|get_((cipher|md)_methods|cert_locations|(public|private)key)|x509_(check_private_key|checkpurpose|parse|export(_to_file)?|fingerprint|free|read))\\b", + "name": "support.function.openssl.php" + }, + { + "match": "(?i)\\b(output_(add_rewrite_var|reset_rewrite_vars)|flush|ob_(start|clean|implicit_flush|end_(clean|flush)|flush|list_handlers|gzhandler|get_(status|contents|clean|flush|length|level)))\\b", + "name": "support.function.output.php" + }, + { + "match": "(?i)\\bpassword_(hash|needs_rehash|verify|get_info)\\b", + "name": "support.function.password.php" + }, + { + "match": "(?i)\\bpcntl_(strerror|signal(_dispatch)?|sig(timedwait|procmask|waitinfo)|setpriority|errno|exec|fork|w(stopsig|termsig|if(stopped|signaled|exited))|wait(pid)?|alarm|getpriority|get_last_error)\\b", + "name": "support.function.pcntl.php" + }, + { + "match": "(?i)\\bpg_(socket|send_(prepare|execute|query(_params)?)|set_(client_encoding|error_verbosity)|select|host|num_(fields|rows)|consume_input|connection_(status|reset|busy)|connect(_poll)?|convert|copy_(from|to)|client_encoding|close|cancel_query|tty|transaction_status|trace|insert|options|delete|dbname|untrace|unescape_bytea|update|pconnect|ping|port|put_line|parameter_status|prepare|version|query(_params)?|escape_(string|identifier|literal|bytea)|end_copy|execute|flush|free_result|last_(notice|error|oid)|field_(size|num|name|type(_oid)?|table|is_null|prtlen)|affected_rows|result_(status|seek|error(_field)?)|fetch_(object|assoc|all(_columns)?|array|row|result)|get_(notify|pid|result)|meta_data|lo_(seek|close|create|tell|truncate|import|open|unlink|export|write|read(_all)?)|)\\b", + "name": "support.function.pgsql.php" + }, + { + "match": "(?i)\\b(virtual|getallheaders|apache_((get|set)env|note|child_terminate|lookup_uri|response_headers|reset_timeout|request_headers|get_(version|modules)))\\b", + "name": "support.function.php_apache.php" + }, + { + "match": "(?i)\\bdom_import_simplexml\\b", + "name": "support.function.php_dom.php" + }, + { + "match": "(?i)\\bftp_(ssl_connect|systype|site|size|set_option|nlist|nb_(continue|f?(put|get))|ch(dir|mod)|connect|cdup|close|delete|put|pwd|pasv|exec|quit|f(put|get)|login|alloc|rename|raw(list)?|rmdir|get(_option)?|mdtm|mkdir)\\b", + "name": "support.function.php_ftp.php" + }, + { + "match": "(?i)\\bimap_((create|delete|list|rename|scan)(mailbox)?|status|sort|subscribe|set_quota|set(flag_full|acl)|search|savebody|num_(recent|msg)|check|close|clearflag_full|thread|timeout|open|header(info)?|headers|append|alerts|reopen|8bit|unsubscribe|undelete|utf7_(decode|encode)|utf8|uid|ping|errors|expunge|qprint|gc|fetch(structure|header|text|mime|body)|fetch_overview|lsub|list(scan|subscribed)|last_error|rfc822_(parse_(headers|adrlist)|write_address)|get(subscribed|acl|mailboxes)|get_quota(root)?|msgno|mime_header_decode|mail_(copy|compose|move)|mail|mailboxmsginfo|binary|body(struct)?|base64)\\b", + "name": "support.function.php_imap.php" + }, + { + "match": "(?i)\\bmssql_(select_db|num_(fields|rows)|next_result|connect|close|init|data_seek|pconnect|execute|query|field_(seek|name|type|length)|fetch_(object|field|assoc|array|row|batch)|free_(statement|result)|rows_affected|result|guid_string|get_last_message|min_(error|message)_severity|bind)\\b", + "name": "support.function.php_mssql.php" + }, + { + "match": "(?i)\\bodbc_(statistics|specialcolumns|setoption|num_(fields|rows)|next_result|connect|columns|columnprivileges|commit|cursor|close(_all)?|tables|tableprivileges|do|data_source|pconnect|primarykeys|procedures|procedurecolumns|prepare|error(msg)?|exec(ute)?|field_(scale|num|name|type|precision|len)|foreignkeys|free_result|fetch_(into|object|array|row)|longreadlen|autocommit|rollback|result(_all)?|gettypeinfo|binmode)\\b", + "name": "support.function.php_odbc.php" + }, + { + "match": "(?i)\\bpreg_(split|quote|filter|last_error|replace(_callback)?|grep|match(_all)?)\\b", + "name": "support.function.php_pcre.php" + }, + { + "match": "(?i)\\b(spl_(classes|object_hash|autoload(_(call|unregister|extensions|functions|register))?)|class_(implements|uses|parents)|iterator_(count|to_array|apply))\\b", + "name": "support.function.php_spl.php" + }, + { + "match": "(?i)\\bzip_(close|open|entry_(name|compressionmethod|compressedsize|close|open|filesize|read)|read)\\b", + "name": "support.function.php_zip.php" + }, + { + "match": "(?i)\\bposix_(strerror|set(s|e?u|[ep]?g)id|ctermid|ttyname|times|isatty|initgroups|uname|errno|kill|access|get(sid|cwd|uid|pid|ppid|pwnam|pwuid|pgid|pgrp|euid|egid|login|rlimit|gid|grnam|groups|grgid)|get_last_error|mknod|mkfifo)\\b", + "name": "support.function.posix.php" + }, + { + "match": "(?i)\\bset(thread|proc)title\\b", + "name": "support.function.proctitle.php" + }, + { + "match": "(?i)\\bpspell_(store_replacement|suggest|save_wordlist|new(_(config|personal))?|check|clear_session|config_(save_repl|create|ignore|(data|dict)_dir|personal|runtogether|repl|mode)|add_to_(session|personal))\\b", + "name": "support.function.pspell.php" + }, + { + "match": "(?i)\\breadline(_(completion_function|clear_history|callback_(handler_(install|remove)|read_char)|info|on_new_line|write_history|list_history|add_history|redisplay|read_history))?\\b", + "name": "support.function.readline.php" + }, + { + "match": "(?i)\\brecode(_(string|file))?\\b", + "name": "support.function.recode.php" + }, + { + "match": "(?i)\\brrd(c_disconnect|_(create|tune|info|update|error|version|first|fetch|last(update)?|restore|graph|xport))\\b", + "name": "support.function.rrd.php" + }, + { + "match": "(?i)\\b(shm_((get|has|remove|put)_var|detach|attach|remove)|sem_(acquire|release|remove|get)|ftok|msg_((get|remove|set|stat)_queue|send|queue_exists|receive))\\b", + "name": "support.function.sem.php" + }, + { + "match": "(?i)\\bsession_(status|start|set_(save_handler|cookie_params)|save_path|name|commit|cache_(expire|limiter)|is_registered|id|destroy|decode|unset|unregister|encode|write_close|abort|reset|register(_shutdown)?|regenerate_id|get_cookie_params|module_name)\\b", + "name": "support.function.session.php" + }, + { + "match": "(?i)\\bshmop_(size|close|open|delete|write|read)\\b", + "name": "support.function.shmop.php" + }, + { + "match": "(?i)\\bsimplexml_(import_dom|load_(string|file))\\b", + "name": "support.function.simplexml.php" + }, + { + "match": "(?i)\\b(snmp(walk(oid)?|realwalk|get(next)?|set)|snmp_(set_(valueretrieval|quick_print|enum_print|oid_(numeric_print|output_format))|read_mib|get_(valueretrieval|quick_print))|snmp[23]_(set|walk|real_walk|get(next)?))\\b", + "name": "support.function.snmp.php" + }, + { + "match": "(?i)\\b(is_soap_fault|use_soap_error_handler)\\b", + "name": "support.function.soap.php" + }, + { + "match": "(?i)\\bsocket_(shutdown|strerror|send(to|msg)?|set_((non)?block|option)|select|connect|close|clear_error|bind|create(_(pair|listen))?|cmsg_space|import_stream|write|listen|last_error|accept|recv(from|msg)?|read|get(peer|sock)name|get_option)\\b", + "name": "support.function.sockets.php" + }, + { + "match": "(?i)\\bsqlite_(single_query|seek|has_(more|prev)|num_(fields|rows)|next|changes|column|current|close|create_(aggregate|function)|open|unbuffered_query|udf_(decode|encode)_binary|popen|prev|escape_string|error_string|exec|valid|key|query|field_name|factory|fetch_(string|single|column_types|object|all|array)|lib(encoding|version)|last_(insert_rowid|error)|array_query|rewind|busy_timeout)\\b", + "name": "support.function.sqlite.php" + }, + { + "match": "(?i)\\bsqlsrv_(send_stream_data|server_info|has_rows|num_(fields|rows)|next_result|connect|configure|commit|client_info|close|cancel|prepare|errors|execute|query|field_metadata|fetch(_(array|object))?|free_stmt|rows_affected|rollback|get_(config|field)|begin_transaction)\\b", + "name": "support.function.sqlsrv.php" + }, + { + "match": "(?i)\\bstats_(harmonic_mean|covariance|standard_deviation|skew|cdf_(noncentral_(chisquare|f)|negative_binomial|chisquare|cauchy|t|uniform|poisson|exponential|f|weibull|logistic|laplace|gamma|binomial|beta)|stat_(noncentral_t|correlation|innerproduct|independent_t|powersum|percentile|paired_t|gennch|binomial_coef)|dens_(normal|negative_binomial|chisquare|cauchy|t|pmf_(hypergeometric|poisson|binomial)|exponential|f|weibull|logistic|laplace|gamma|beta)|den_uniform|variance|kurtosis|absolute_deviation|rand_(setall|phrase_to_seeds|ranf|get_seeds|gen_(noncentral_[ft]|noncenral_chisquare|normal|chisquare|t|int|i(uniform|poisson|binomial(_negative)?)|exponential|f(uniform)?|gamma|beta)))\\b", + "name": "support.function.stats.php" + }, + { + "match": "(?i)\\b(set_socket_blocking|stream_(socket_(shutdown|sendto|server|client|pair|enable_crypto|accept|recvfrom|get_name)|set_(chunk_size|timeout|(read|write)_buffer|blocking)|select|notification_callback|supports_lock|context_(set_(option|default|params)|create|get_(options|default|params))|copy_to_stream|is_local|encoding|filter_(append|prepend|register|remove)|wrapper_((un)?register|restore)|resolve_include_path|register_wrapper|get_(contents|transports|filters|wrappers|line|meta_data)|bucket_(new|prepend|append|make_writeable)))\\b", + "name": "support.function.streamsfuncs.php" + }, + { + "match": "(?i)\\b(money_format|md5(_file)?|metaphone|bin2hex|sscanf|sha1(_file)?|str(str|c?spn|n(at)?(case)?cmp|chr|coll|(case)?cmp|to(upper|lower)|tok|tr|istr|pos|pbrk|len|rchr|ri?pos|rev)|str_(getcsv|ireplace|pad|repeat|replace|rot13|shuffle|split|word_count)|strip(c?slashes|os)|strip_tags|similar_text|soundex|substr(_(count|compare|replace))?|setlocale|html(specialchars(_decode)?|entities)|html_entity_decode|hex2bin|hebrev(c)?|number_format|nl2br|nl_langinfo|chop|chunk_split|chr|convert_(cyr_string|uu(decode|encode))|count_chars|crypt|crc32|trim|implode|ord|uc(first|words)|join|parse_str|print(f)?|echo|explode|v?[fs]?printf|quoted_printable_(decode|encode)|quotemeta|wordwrap|lcfirst|[lr]trim|localeconv|levenshtein|addc?slashes|get_html_translation_table)\\b", + "name": "support.function.string.php" + }, + { + "match": "(?i)\\bsybase_(set_message_handler|select_db|num_(fields|rows)|connect|close|deadlock_retry_count|data_seek|unbuffered_query|pconnect|query|field_seek|fetch_(object|field|assoc|array|row)|free_result|affected_rows|result|get_last_message|min_(client|error|message|server)_severity)\\b", + "name": "support.function.sybase.php" + }, + { + "match": "(?i)\\b(taint|is_tainted|untaint)\\b", + "name": "support.function.taint.php" + }, + { + "match": "(?i)\\b(tidy_((get|set)opt|set_encoding|save_config|config_count|clean_repair|is_(xhtml|xml)|diagnose|(access|error|warning)_count|load_config|reset_config|(parse|repair)_(string|file)|get_(status|html(_ver)?|head|config|output|opt_doc|root|release|body))|ob_tidyhandler)\\b", + "name": "support.function.tidy.php" + }, + { + "match": "(?i)\\btoken_(name|get_all)\\b", + "name": "support.function.tokenizer.php" + }, + { + "match": "(?i)\\btrader_(stoch(f|r|rsi)?|stddev|sin(h)?|sum|sub|set_(compat|unstable_period)|sqrt|sar(ext)?|sma|ht_(sine|trend(line|mode)|dc(period|phase)|phasor)|natr|cci|cos(h)?|correl|cdl(shootingstar|shortline|sticksandwich|stalledpattern|spinningtop|separatinglines|hikkake(mod)?|highwave|homingpigeon|hangingman|harami(cross)?|hammer|concealbabyswall|counterattack|closingmarubozu|thrusting|tasukigap|takuri|tristar|inneck|invertedhammer|identical3crows|2crows|onneck|doji(star)?|darkcloudcover|dragonflydoji|unique3river|upsidegap2crows|3(starsinsouth|inside|outside|whitesoldiers|linestrike|blackcrows)|piercing|engulfing|evening(doji)?star|kicking(bylength)?|longline|longleggeddoji|ladderbottom|advanceblock|abandonedbaby|risefall3methods|rickshawman|gapsidesidewhite|gravestonedoji|xsidegap3methods|morning(doji)?star|mathold|matchinglow|marubozu|belthold|breakaway)|ceil|cmo|tsf|typprice|t3|tema|tan(h)?|trix|trima|trange|obv|div|dema|dx|ultosc|ppo|plus_d[im]|errno|exp|ema|var|kama|floor|wclprice|willr|wma|ln|log10|bop|beta|bbands|linearreg(_(slope|intercept|angle))?|asin|acos|atan|atr|adosc|ad|add|adx(r)?|apo|avgprice|aroon(osc)?|rsi|roc|rocp|rocr(100)?|get_(compat|unstable_period)|min(index)?|minus_d[im]|minmax(index)?|mid(point|price)|mom|mult|medprice|mfi|macd(ext|fix)?|mavp|max(index)?|ma(ma)?)\\b", + "name": "support.function.trader.php" + }, + { + "match": "(?i)\\buopz_(copy|compose|implement|overload|delete|undefine|extend|function|flags|restore|rename|redefine|backup)\\b", + "name": "support.function.uopz.php" + }, + { + "match": "(?i)\\b(http_build_query|(raw)?url(decode|encode)|parse_url|get_(headers|meta_tags)|base64_(decode|encode))\\b", + "name": "support.function.url.php" + }, + { + "match": "(?i)\\b(strval|settype|serialize|(bool|double|float)val|debug_zval_dump|intval|import_request_variables|isset|is_(scalar|string|null|numeric|callable|int(eger)?|object|double|float|long|array|resource|real|bool)|unset|unserialize|print_r|empty|var_(dump|export)|gettype|get_(defined_vars|resource_type))\\b", + "name": "support.function.var.php" + }, + { + "match": "(?i)\\bwddx_(serialize_(value|vars)|deserialize|packet_(start|end)|add_vars)\\b", + "name": "support.function.wddx.php" + }, + { + "match": "(?i)\\bxhprof_(sample_)?(disable|enable)\\b", + "name": "support.function.xhprof.php" + }, + { + "match": "(?i)\\b(utf8_(decode|encode)|xml_(set_((notation|(end|start)_namespace|unparsed_entity)_decl_handler|(character_data|default|element|external_entity_ref|processing_instruction)_handler|object)|parse(_into_struct)?|parser_((get|set)_option|create(_ns)?|free)|error_string|get_(current_((column|line)_number|byte_index)|error_code)))\\b", + "name": "support.function.xml.php" + }, + { + "match": "(?i)\\bxmlrpc_(server_(call_method|create|destroy|add_introspection_data|register_(introspection_callback|method))|is_fault|decode(_request)?|parse_method_descriptions|encode(_request)?|(get|set)_type)\\b", + "name": "support.function.xmlrpc.php" + }, + { + "match": "(?i)\\bxmlwriter_((end|start|write)_(comment|cdata|dtd(_(attlist|entity|element))?|document|pi|attribute|element)|(start|write)_(attribute|element)_ns|write_raw|set_indent(_string)?|text|output_memory|open_(memory|uri)|full_end_element|flush|)\\b", + "name": "support.function.xmlwriter.php" + }, + { + "match": "(?i)\\b(zlib_(decode|encode|get_coding_type)|readgzfile|gz(seek|compress|close|tell|inflate|open|decode|deflate|uncompress|puts|passthru|encode|eof|file|write|rewind|read|getc|getss?))\\b", + "name": "support.function.zlib.php" + }, + { + "match": "(?i)\\bis_int(eger)?\\b", + "name": "support.function.alias.php" + } + ] + }, + "switch_statement": { + "patterns": [ + { + "match": "\\s+(?=switch\\b)" + }, + { + "begin": "\\bswitch\\b(?!\\s*\\(.*\\)\\s*:)", + "beginCaptures": { + "0": { + "name": "keyword.control.switch.php" + } + }, + "end": "}|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.section.switch-block.end.bracket.curly.php" + } + }, + "name": "meta.switch-statement.php", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.switch-expression.begin.bracket.round.php" + } + }, + "end": "\\)|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.switch-expression.end.bracket.round.php" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.section.switch-block.begin.bracket.curly.php" + } + }, + "end": "(?=}|\\?>)", + "patterns": [ + { + "include": "$self" + } + ] + } + ] + } + ] + }, + "ternary_expression": { + "begin": "\\?", + "beginCaptures": { + "0": { + "name": "keyword.operator.ternary.php" + } + }, + "end": "(?[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*))\\s*(?:(\\??->)\\s*(\\g)|(\\[)(?:(\\d+)|((\\$)\\g)|([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*))(\\]))?" + }, + { + "captures": { + "1": { + "name": "variable.other.php" + }, + "2": { + "name": "punctuation.definition.variable.php" + }, + "4": { + "name": "punctuation.definition.variable.php" + } + }, + "match": "(?i)((\\${)(?[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)(}))" + } + ] + }, + "variables": { + "patterns": [ + { + "include": "#var_language" + }, + { + "include": "#var_global" + }, + { + "include": "#var_global_safer" + }, + { + "include": "#var_basic" + }, + { + "begin": "\\${(?=.*?})", + "beginCaptures": { + "0": { + "name": "punctuation.definition.variable.php" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.variable.php" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + } + ] + } + }, + "scopeName": "source.php" +} \ No newline at end of file diff --git a/languages/rust.json b/languages/rust.json new file mode 100644 index 0000000..a3ae0e3 --- /dev/null +++ b/languages/rust.json @@ -0,0 +1,1184 @@ +{ + "displayName": "Rust", + "name": "rust", + "patterns": [ + { + "begin": "(<)(\\[)", + "beginCaptures": { + "1": { + "name": "punctuation.brackets.angle.rust" + }, + "2": { + "name": "punctuation.brackets.square.rust" + } + }, + "comment": "boxed slice literal", + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.brackets.angle.rust" + } + }, + "patterns": [ + { + "include": "#block-comments" + }, + { + "include": "#comments" + }, + { + "include": "#gtypes" + }, + { + "include": "#lvariables" + }, + { + "include": "#lifetimes" + }, + { + "include": "#punctuation" + }, + { + "include": "#types" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.operator.macro.dollar.rust" + }, + "3": { + "name": "keyword.other.crate.rust" + }, + "4": { + "name": "entity.name.type.metavariable.rust" + }, + "6": { + "name": "keyword.operator.key-value.rust" + }, + "7": { + "name": "variable.other.metavariable.specifier.rust" + } + }, + "comment": "macro type metavariables", + "match": "(\\$)((crate)|([A-Z][A-Za-z0-9_]*))((:)(block|expr|ident|item|lifetime|literal|meta|path?|stmt|tt|ty|vis))?", + "name": "meta.macro.metavariable.type.rust", + "patterns": [ + { + "include": "#keywords" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.operator.macro.dollar.rust" + }, + "2": { + "name": "variable.other.metavariable.name.rust" + }, + "4": { + "name": "keyword.operator.key-value.rust" + }, + "5": { + "name": "variable.other.metavariable.specifier.rust" + } + }, + "comment": "macro metavariables", + "match": "(\\$)([a-z][A-Za-z0-9_]*)((:)(block|expr|ident|item|lifetime|literal|meta|path?|stmt|tt|ty|vis))?", + "name": "meta.macro.metavariable.rust", + "patterns": [ + { + "include": "#keywords" + } + ] + }, + { + "captures": { + "1": { + "name": "entity.name.function.macro.rules.rust" + }, + "3": { + "name": "entity.name.function.macro.rust" + }, + "4": { + "name": "entity.name.type.macro.rust" + }, + "5": { + "name": "punctuation.brackets.curly.rust" + } + }, + "comment": "macro rules", + "match": "\\b(macro_rules!)\\s+(([a-z0-9_]+)|([A-Z][a-z0-9_]*))\\s+(\\{)", + "name": "meta.macro.rules.rust" + }, + { + "captures": { + "1": { + "name": "storage.type.rust" + }, + "2": { + "name": "entity.name.module.rust" + } + }, + "comment": "modules", + "match": "(mod)\\s+((?:r#(?!crate|[Ss]elf|super))?[a-z][A-Za-z0-9_]*)" + }, + { + "begin": "\\b(extern)\\s+(crate)", + "beginCaptures": { + "1": { + "name": "storage.type.rust" + }, + "2": { + "name": "keyword.other.crate.rust" + } + }, + "comment": "external crate imports", + "end": ";", + "endCaptures": { + "0": { + "name": "punctuation.semi.rust" + } + }, + "name": "meta.import.rust", + "patterns": [ + { + "include": "#block-comments" + }, + { + "include": "#comments" + }, + { + "include": "#keywords" + }, + { + "include": "#punctuation" + } + ] + }, + { + "begin": "\\b(use)\\s", + "beginCaptures": { + "1": { + "name": "keyword.other.rust" + } + }, + "comment": "use statements", + "end": ";", + "endCaptures": { + "0": { + "name": "punctuation.semi.rust" + } + }, + "name": "meta.use.rust", + "patterns": [ + { + "include": "#block-comments" + }, + { + "include": "#comments" + }, + { + "include": "#keywords" + }, + { + "include": "#namespaces" + }, + { + "include": "#punctuation" + }, + { + "include": "#types" + }, + { + "include": "#lvariables" + } + ] + }, + { + "include": "#block-comments" + }, + { + "include": "#comments" + }, + { + "include": "#attributes" + }, + { + "include": "#lvariables" + }, + { + "include": "#constants" + }, + { + "include": "#gtypes" + }, + { + "include": "#functions" + }, + { + "include": "#types" + }, + { + "include": "#keywords" + }, + { + "include": "#lifetimes" + }, + { + "include": "#macros" + }, + { + "include": "#namespaces" + }, + { + "include": "#punctuation" + }, + { + "include": "#strings" + }, + { + "include": "#variables" + } + ], + "repository": { + "attributes": { + "begin": "(#)(!?)(\\[)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.attribute.rust" + }, + "3": { + "name": "punctuation.brackets.attribute.rust" + } + }, + "comment": "attributes", + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.brackets.attribute.rust" + } + }, + "name": "meta.attribute.rust", + "patterns": [ + { + "include": "#block-comments" + }, + { + "include": "#comments" + }, + { + "include": "#keywords" + }, + { + "include": "#lifetimes" + }, + { + "include": "#punctuation" + }, + { + "include": "#strings" + }, + { + "include": "#gtypes" + }, + { + "include": "#types" + } + ] + }, + "block-comments": { + "patterns": [ + { + "comment": "empty block comments", + "match": "/\\*\\*/", + "name": "comment.block.rust" + }, + { + "begin": "/\\*\\*", + "comment": "block documentation comments", + "end": "\\*/", + "name": "comment.block.documentation.rust", + "patterns": [ + { + "include": "#block-comments" + } + ] + }, + { + "begin": "/\\*(?!\\*)", + "comment": "block comments", + "end": "\\*/", + "name": "comment.block.rust", + "patterns": [ + { + "include": "#block-comments" + } + ] + } + ] + }, + "comments": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.comment.rust" + } + }, + "comment": "documentation comments", + "match": "(///).*$", + "name": "comment.line.documentation.rust" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.comment.rust" + } + }, + "comment": "line comments", + "match": "(//).*$", + "name": "comment.line.double-slash.rust" + } + ] + }, + "constants": { + "patterns": [ + { + "comment": "ALL CAPS constants", + "match": "\\b[A-Z]{2}[A-Z0-9_]*\\b", + "name": "constant.other.caps.rust" + }, + { + "captures": { + "1": { + "name": "storage.type.rust" + }, + "2": { + "name": "constant.other.caps.rust" + } + }, + "comment": "constant declarations", + "match": "\\b(const)\\s+([A-Z][A-Za-z0-9_]*)\\b" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.dot.decimal.rust" + }, + "2": { + "name": "keyword.operator.exponent.rust" + }, + "3": { + "name": "keyword.operator.exponent.sign.rust" + }, + "4": { + "name": "constant.numeric.decimal.exponent.mantissa.rust" + }, + "5": { + "name": "entity.name.type.numeric.rust" + } + }, + "comment": "decimal integers and floats", + "match": "\\b\\d[\\d_]*(\\.?)[\\d_]*(?:(E|e)([+-]?)([\\d_]+))?(f32|f64|i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b", + "name": "constant.numeric.decimal.rust" + }, + { + "captures": { + "1": { + "name": "entity.name.type.numeric.rust" + } + }, + "comment": "hexadecimal integers", + "match": "\\b0x[\\da-fA-F_]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b", + "name": "constant.numeric.hex.rust" + }, + { + "captures": { + "1": { + "name": "entity.name.type.numeric.rust" + } + }, + "comment": "octal integers", + "match": "\\b0o[0-7_]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b", + "name": "constant.numeric.oct.rust" + }, + { + "captures": { + "1": { + "name": "entity.name.type.numeric.rust" + } + }, + "comment": "binary integers", + "match": "\\b0b[01_]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b", + "name": "constant.numeric.bin.rust" + }, + { + "comment": "booleans", + "match": "\\b(true|false)\\b", + "name": "constant.language.bool.rust" + } + ] + }, + "escapes": { + "captures": { + "1": { + "name": "constant.character.escape.backslash.rust" + }, + "2": { + "name": "constant.character.escape.bit.rust" + }, + "3": { + "name": "constant.character.escape.unicode.rust" + }, + "4": { + "name": "constant.character.escape.unicode.punctuation.rust" + }, + "5": { + "name": "constant.character.escape.unicode.punctuation.rust" + } + }, + "comment": "escapes: ASCII, byte, Unicode, quote, regex", + "match": "(\\\\)(?:(?:(x[0-7][\\da-fA-F])|(u(\\{)[\\da-fA-F]{4,6}(\\}))|.))", + "name": "constant.character.escape.rust" + }, + "functions": { + "patterns": [ + { + "captures": { + "1": { + "name": "keyword.other.rust" + }, + "2": { + "name": "punctuation.brackets.round.rust" + } + }, + "comment": "pub as a function", + "match": "\\b(pub)(\\()" + }, + { + "begin": "\\b(fn)\\s+((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)((\\()|(<))", + "beginCaptures": { + "1": { + "name": "keyword.other.fn.rust" + }, + "2": { + "name": "entity.name.function.rust" + }, + "4": { + "name": "punctuation.brackets.round.rust" + }, + "5": { + "name": "punctuation.brackets.angle.rust" + } + }, + "comment": "function definition", + "end": "(\\{)|(;)", + "endCaptures": { + "1": { + "name": "punctuation.brackets.curly.rust" + }, + "2": { + "name": "punctuation.semi.rust" + } + }, + "name": "meta.function.definition.rust", + "patterns": [ + { + "include": "#block-comments" + }, + { + "include": "#comments" + }, + { + "include": "#keywords" + }, + { + "include": "#lvariables" + }, + { + "include": "#constants" + }, + { + "include": "#gtypes" + }, + { + "include": "#functions" + }, + { + "include": "#lifetimes" + }, + { + "include": "#macros" + }, + { + "include": "#namespaces" + }, + { + "include": "#punctuation" + }, + { + "include": "#strings" + }, + { + "include": "#types" + }, + { + "include": "#variables" + } + ] + }, + { + "begin": "((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.rust" + }, + "2": { + "name": "punctuation.brackets.round.rust" + } + }, + "comment": "function/method calls, chaining", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.brackets.round.rust" + } + }, + "name": "meta.function.call.rust", + "patterns": [ + { + "include": "#block-comments" + }, + { + "include": "#comments" + }, + { + "include": "#attributes" + }, + { + "include": "#keywords" + }, + { + "include": "#lvariables" + }, + { + "include": "#constants" + }, + { + "include": "#gtypes" + }, + { + "include": "#functions" + }, + { + "include": "#lifetimes" + }, + { + "include": "#macros" + }, + { + "include": "#namespaces" + }, + { + "include": "#punctuation" + }, + { + "include": "#strings" + }, + { + "include": "#types" + }, + { + "include": "#variables" + } + ] + }, + { + "begin": "((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)(?=::<.*>\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.rust" + } + }, + "comment": "function/method calls with turbofish", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.brackets.round.rust" + } + }, + "name": "meta.function.call.rust", + "patterns": [ + { + "include": "#block-comments" + }, + { + "include": "#comments" + }, + { + "include": "#attributes" + }, + { + "include": "#keywords" + }, + { + "include": "#lvariables" + }, + { + "include": "#constants" + }, + { + "include": "#gtypes" + }, + { + "include": "#functions" + }, + { + "include": "#lifetimes" + }, + { + "include": "#macros" + }, + { + "include": "#namespaces" + }, + { + "include": "#punctuation" + }, + { + "include": "#strings" + }, + { + "include": "#types" + }, + { + "include": "#variables" + } + ] + } + ] + }, + "gtypes": { + "patterns": [ + { + "comment": "option types", + "match": "\\b(Some|None)\\b", + "name": "entity.name.type.option.rust" + }, + { + "comment": "result types", + "match": "\\b(Ok|Err)\\b", + "name": "entity.name.type.result.rust" + } + ] + }, + "interpolations": { + "captures": { + "1": { + "name": "punctuation.definition.interpolation.rust" + }, + "2": { + "name": "punctuation.definition.interpolation.rust" + } + }, + "comment": "curly brace interpolations", + "match": "({)[^\"{}]*(})", + "name": "meta.interpolation.rust" + }, + "keywords": { + "patterns": [ + { + "comment": "control flow keywords", + "match": "\\b(await|break|continue|do|else|for|if|loop|match|return|try|while|yield)\\b", + "name": "keyword.control.rust" + }, + { + "comment": "storage keywords", + "match": "\\b(extern|let|macro|mod)\\b", + "name": "keyword.other.rust storage.type.rust" + }, + { + "comment": "const keyword", + "match": "\\b(const)\\b", + "name": "storage.modifier.rust" + }, + { + "comment": "type keyword", + "match": "\\b(type)\\b", + "name": "keyword.declaration.type.rust storage.type.rust" + }, + { + "comment": "enum keyword", + "match": "\\b(enum)\\b", + "name": "keyword.declaration.enum.rust storage.type.rust" + }, + { + "comment": "trait keyword", + "match": "\\b(trait)\\b", + "name": "keyword.declaration.trait.rust storage.type.rust" + }, + { + "comment": "struct keyword", + "match": "\\b(struct)\\b", + "name": "keyword.declaration.struct.rust storage.type.rust" + }, + { + "comment": "storage modifiers", + "match": "\\b(abstract|static)\\b", + "name": "storage.modifier.rust" + }, + { + "comment": "other keywords", + "match": "\\b(as|async|become|box|dyn|move|final|gen|impl|in|override|priv|pub|ref|typeof|union|unsafe|unsized|use|virtual|where)\\b", + "name": "keyword.other.rust" + }, + { + "comment": "fn", + "match": "\\bfn\\b", + "name": "keyword.other.fn.rust" + }, + { + "comment": "crate", + "match": "\\bcrate\\b", + "name": "keyword.other.crate.rust" + }, + { + "comment": "mut", + "match": "\\bmut\\b", + "name": "storage.modifier.mut.rust" + }, + { + "comment": "logical operators", + "match": "(\\^|\\||\\|\\||&&|<<|>>|!)(?!=)", + "name": "keyword.operator.logical.rust" + }, + { + "comment": "logical AND, borrow references", + "match": "&(?![&=])", + "name": "keyword.operator.borrow.and.rust" + }, + { + "comment": "assignment operators", + "match": "(\\+=|-=|\\*=|/=|%=|\\^=|&=|\\|=|<<=|>>=)", + "name": "keyword.operator.assignment.rust" + }, + { + "comment": "single equal", + "match": "(?])=(?!=|>)", + "name": "keyword.operator.assignment.equal.rust" + }, + { + "comment": "comparison operators", + "match": "(=(=)?(?!>)|!=|<=|(?=)", + "name": "keyword.operator.comparison.rust" + }, + { + "comment": "math operators", + "match": "(([+%]|(\\*(?!\\w)))(?!=))|(-(?!>))|(/(?!/))", + "name": "keyword.operator.math.rust" + }, + { + "captures": { + "1": { + "name": "punctuation.brackets.round.rust" + }, + "2": { + "name": "punctuation.brackets.square.rust" + }, + "3": { + "name": "punctuation.brackets.curly.rust" + }, + "4": { + "name": "keyword.operator.comparison.rust" + }, + "5": { + "name": "punctuation.brackets.round.rust" + }, + "6": { + "name": "punctuation.brackets.square.rust" + }, + "7": { + "name": "punctuation.brackets.curly.rust" + } + }, + "comment": "less than, greater than (special case)", + "match": "(?:\\b|(?:(\\))|(\\])|(\\})))[ \\t]+([<>])[ \\t]+(?:\\b|(?:(\\()|(\\[)|(\\{)))" + }, + { + "comment": "namespace operator", + "match": "::", + "name": "keyword.operator.namespace.rust" + }, + { + "captures": { + "1": { + "name": "keyword.operator.dereference.rust" + } + }, + "comment": "dereference asterisk", + "match": "(\\*)(?=\\w+)" + }, + { + "comment": "subpattern binding", + "match": "@", + "name": "keyword.operator.subpattern.rust" + }, + { + "comment": "dot access", + "match": "\\.(?!\\.)", + "name": "keyword.operator.access.dot.rust" + }, + { + "comment": "ranges, range patterns", + "match": "\\.{2}(=|\\.)?", + "name": "keyword.operator.range.rust" + }, + { + "comment": "colon", + "match": ":(?!:)", + "name": "keyword.operator.key-value.rust" + }, + { + "comment": "dashrocket, skinny arrow", + "match": "->|<-", + "name": "keyword.operator.arrow.skinny.rust" + }, + { + "comment": "hashrocket, fat arrow", + "match": "=>", + "name": "keyword.operator.arrow.fat.rust" + }, + { + "comment": "dollar macros", + "match": "\\$", + "name": "keyword.operator.macro.dollar.rust" + }, + { + "comment": "question mark operator, questionably sized, macro kleene matcher", + "match": "\\?", + "name": "keyword.operator.question.rust" + } + ] + }, + "lifetimes": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.lifetime.rust" + }, + "2": { + "name": "entity.name.type.lifetime.rust" + } + }, + "comment": "named lifetime parameters", + "match": "(['])([a-zA-Z_][0-9a-zA-Z_]*)(?!['])\\b" + }, + { + "captures": { + "1": { + "name": "keyword.operator.borrow.rust" + }, + "2": { + "name": "punctuation.definition.lifetime.rust" + }, + "3": { + "name": "entity.name.type.lifetime.rust" + } + }, + "comment": "borrowing references to named lifetimes", + "match": "(\\&)(['])([a-zA-Z_][0-9a-zA-Z_]*)(?!['])\\b" + } + ] + }, + "lvariables": { + "patterns": [ + { + "comment": "self", + "match": "\\b[Ss]elf\\b", + "name": "variable.language.self.rust" + }, + { + "comment": "super", + "match": "\\bsuper\\b", + "name": "variable.language.super.rust" + } + ] + }, + "macros": { + "patterns": [ + { + "captures": { + "2": { + "name": "entity.name.function.macro.rust" + }, + "3": { + "name": "entity.name.type.macro.rust" + } + }, + "comment": "macros", + "match": "(([a-z_][A-Za-z0-9_]*!)|([A-Z_][A-Za-z0-9_]*!))", + "name": "meta.macro.rust" + } + ] + }, + "namespaces": { + "patterns": [ + { + "captures": { + "1": { + "name": "entity.name.namespace.rust" + }, + "2": { + "name": "keyword.operator.namespace.rust" + } + }, + "comment": "namespace (non-type, non-function path segment)", + "match": "(?]", + "name": "punctuation.brackets.angle.rust" + } + ] + }, + "strings": { + "patterns": [ + { + "begin": "(b?)(\")", + "beginCaptures": { + "1": { + "name": "string.quoted.byte.raw.rust" + }, + "2": { + "name": "punctuation.definition.string.rust" + } + }, + "comment": "double-quoted strings and byte strings", + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.rust" + } + }, + "name": "string.quoted.double.rust", + "patterns": [ + { + "include": "#escapes" + }, + { + "include": "#interpolations" + } + ] + }, + { + "begin": "(b?r)(#*)(\")", + "beginCaptures": { + "1": { + "name": "string.quoted.byte.raw.rust" + }, + "2": { + "name": "punctuation.definition.string.raw.rust" + }, + "3": { + "name": "punctuation.definition.string.rust" + } + }, + "comment": "double-quoted raw strings and raw byte strings", + "end": "(\")(\\2)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.rust" + }, + "2": { + "name": "punctuation.definition.string.raw.rust" + } + }, + "name": "string.quoted.double.rust" + }, + { + "begin": "(b)?(')", + "beginCaptures": { + "1": { + "name": "string.quoted.byte.raw.rust" + }, + "2": { + "name": "punctuation.definition.char.rust" + } + }, + "comment": "characters and bytes", + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.char.rust" + } + }, + "name": "string.quoted.single.char.rust", + "patterns": [ + { + "include": "#escapes" + } + ] + } + ] + }, + "types": { + "patterns": [ + { + "captures": { + "1": { + "name": "entity.name.type.numeric.rust" + } + }, + "comment": "numeric types", + "match": "(?", + "endCaptures": { + "0": { + "name": "punctuation.brackets.angle.rust" + } + }, + "patterns": [ + { + "include": "#block-comments" + }, + { + "include": "#comments" + }, + { + "include": "#keywords" + }, + { + "include": "#lvariables" + }, + { + "include": "#lifetimes" + }, + { + "include": "#punctuation" + }, + { + "include": "#types" + }, + { + "include": "#variables" + } + ] + }, + { + "comment": "primitive types", + "match": "\\b(bool|char|str)\\b", + "name": "entity.name.type.primitive.rust" + }, + { + "captures": { + "1": { + "name": "keyword.declaration.trait.rust storage.type.rust" + }, + "2": { + "name": "entity.name.type.trait.rust" + } + }, + "comment": "trait declarations", + "match": "\\b(trait)\\s+(_?[A-Z][A-Za-z0-9_]*)\\b" + }, + { + "captures": { + "1": { + "name": "keyword.declaration.struct.rust storage.type.rust" + }, + "2": { + "name": "entity.name.type.struct.rust" + } + }, + "comment": "struct declarations", + "match": "\\b(struct)\\s+(_?[A-Z][A-Za-z0-9_]*)\\b" + }, + { + "captures": { + "1": { + "name": "keyword.declaration.enum.rust storage.type.rust" + }, + "2": { + "name": "entity.name.type.enum.rust" + } + }, + "comment": "enum declarations", + "match": "\\b(enum)\\s+(_?[A-Z][A-Za-z0-9_]*)\\b" + }, + { + "captures": { + "1": { + "name": "keyword.declaration.type.rust storage.type.rust" + }, + "2": { + "name": "entity.name.type.declaration.rust" + } + }, + "comment": "type declarations", + "match": "\\b(type)\\s+(_?[A-Z][A-Za-z0-9_]*)\\b" + }, + { + "comment": "types", + "match": "\\b_?[A-Z][A-Za-z0-9_]*\\b(?!!)", + "name": "entity.name.type.rust" + } + ] + }, + "variables": { + "patterns": [ + { + "comment": "variables", + "match": "\\b(?&;<>()$`\\\\\"'<\\|]+)(?!>))" + }, + { + "include": "#normal_context" + } + ] + }, + "arithmetic_double": { + "patterns": [ + { + "begin": "\\(\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.arithmetic.double.shell" + } + }, + "end": "\\)(?:\\s*)\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.arithmetic.double.shell" + } + }, + "name": "meta.arithmetic.shell", + "patterns": [ + { + "include": "#math" + }, + { + "include": "#string" + } + ] + } + ] + }, + "arithmetic_no_dollar": { + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.arithmetic.single.shell" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.arithmetic.single.shell" + } + }, + "name": "meta.arithmetic.shell", + "patterns": [ + { + "include": "#math" + }, + { + "include": "#string" + } + ] + } + ] + }, + "array_access_inline": { + "captures": { + "1": { + "name": "punctuation.section.array.shell" + }, + "2": { + "patterns": [ + { + "include": "#special_expansion" + }, + { + "include": "#string" + }, + { + "include": "#variable" + } + ] + }, + "3": { + "name": "punctuation.section.array.shell" + } + }, + "match": "(?:(\\[)([^\\[\\]]+)(\\]))" + }, + "array_value": { + "begin": "(?:[ \\t]*+)(?:((?|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect\t|nocorrect$|readonly |readonly\t|readonly$|function |function\t|function$|foreach |foreach\t|foreach$|coproc |coproc\t|coproc$|logout |logout\t|logout$|export |export\t|export$|select |select\t|select$|repeat |repeat\t|repeat$|pushd |pushd\t|pushd$|until |until\t|until$|while |while\t|while$|local |local\t|local$|case |case\t|case$|done |done\t|done$|elif |elif\t|elif$|else |else\t|else$|esac |esac\t|esac$|popd |popd\t|popd$|then |then\t|then$|time |time\t|time$|for |for\t|for$|end |end\t|end$|fi |fi\t|fi$|do |do\t|do$|in |in\t|in$|if |if\t|if$))(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))|((?!\"|'|\\\\\\n?$)(?:[^!'\"<> \\t\\n\\r]+?)))(?:(?= |\\t)|(?:(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?]+))" + }, + { + "begin": "(?:(?:\\G|(?|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect\t|nocorrect$|readonly |readonly\t|readonly$|function |function\t|function$|foreach |foreach\t|foreach$|coproc |coproc\t|coproc$|logout |logout\t|logout$|export |export\t|export$|select |select\t|select$|repeat |repeat\t|repeat$|pushd |pushd\t|pushd$|until |until\t|until$|while |while\t|while$|local |local\t|local$|case |case\t|case$|done |done\t|done$|elif |elif\t|elif$|else |else\t|else$|esac |esac\t|esac$|popd |popd\t|popd$|then |then\t|then$|time |time\t|time$|for |for\t|for$|end |end\t|end$|fi |fi\t|fi$|do |do\t|do$|in |in\t|in$|if |if\t|if$)(?!\\\\\\n?$)))", + "beginCaptures": {}, + "end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?|&&|\\|\\|", + "name": "keyword.operator.logical.shell" + }, + { + "match": "(?[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|:|,|=|[*/%+\\-&^|]=|<<=|>>=", + "name": "keyword.operator.arithmetic.shell" + }, + { + "match": "0[xX][0-9A-Fa-f]+", + "name": "constant.numeric.hex.shell" + }, + { + "match": ";", + "name": "punctuation.separator.semicolon.range" + }, + { + "match": "0\\d+", + "name": "constant.numeric.octal.shell" + }, + { + "match": "\\d{1,2}#[0-9a-zA-Z@_]+", + "name": "constant.numeric.other.shell" + }, + { + "match": "\\d+", + "name": "constant.numeric.integer.shell" + }, + { + "match": "(?[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|:|,|=|[*/%+\\-&^|]=|<<=|>>=", + "name": "keyword.operator.arithmetic.shell" + }, + { + "match": "0[xX][0-9A-Fa-f]+", + "name": "constant.numeric.hex.shell" + }, + { + "match": "0\\d+", + "name": "constant.numeric.octal.shell" + }, + { + "match": "\\d{1,2}#[0-9a-zA-Z@_]+", + "name": "constant.numeric.other.shell" + }, + { + "match": "\\d+", + "name": "constant.numeric.integer.shell" + } + ] + }, + "misc_ranges": { + "patterns": [ + { + "include": "#logical_expression_single" + }, + { + "include": "#logical_expression_double" + }, + { + "include": "#subshell_dollar" + }, + { + "begin": "(?|#|\\n|$|;|[ \\t]))))", + "beginCaptures": { + "1": { + "name": "string.unquoted.argument.shell constant.other.option.dash.shell" + }, + "2": { + "name": "string.unquoted.argument.shell constant.other.option.shell" + } + }, + "contentName": "string.unquoted.argument constant.other.option", + "end": "(?:(?=[ \\t])|(?:(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?>?)(?:[ \\t]*+)([^ \\t\\n>&;<>()$`\\\\\"'<\\|]+))" + }, + "redirect_number": { + "captures": { + "1": { + "name": "keyword.operator.redirect.stdout.shell" + }, + "2": { + "name": "keyword.operator.redirect.stderr.shell" + }, + "3": { + "name": "keyword.operator.redirect.$3.shell" + } + }, + "match": "(?<=[ \\t])(?:(?:(1)|(2)|(\\d+))(?=>))" + }, + "redirection": { + "patterns": [ + { + "begin": "[><]\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.shell" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.shell" + } + }, + "name": "string.interpolated.process-substitution.shell", + "patterns": [ + { + "include": "#initial_context" + } + ] + }, + { + "match": "(?])(&>|\\d*>&\\d*|\\d*(>>|>|<)|\\d*<&|\\d*<>)(?![<>])", + "name": "keyword.operator.redirect.shell" + } + ] + }, + "regex_comparison": { + "match": "=~", + "name": "keyword.operator.logical.regex.shell" + }, + "regexp": { + "patterns": [ + { + "match": "(?:.+)" + } + ] + }, + "simple_options": { + "captures": { + "0": { + "patterns": [ + { + "captures": { + "1": { + "name": "string.unquoted.argument.shell constant.other.option.dash.shell" + }, + "2": { + "name": "string.unquoted.argument.shell constant.other.option.shell" + } + }, + "match": "(?:[ \\t]++)(-)(\\w+)" + } + ] + } + }, + "match": "(?:(?:[ \\t]++)-(?:\\w+))*" + }, + "simple_unquoted": { + "match": "[^ \\t\\n>&;<>()$`\\\\\"'<\\|]", + "name": "string.unquoted.shell" + }, + "special_expansion": { + "match": "!|:[-=?]?|\\*|@|##|#|%%|%|\\/", + "name": "keyword.operator.expansion.shell" + }, + "start_of_command": { + "match": "(?:(?:[ \\t]*+)(?:(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!nocorrect |nocorrect\t|nocorrect$|readonly |readonly\t|readonly$|function |function\t|function$|foreach |foreach\t|foreach$|coproc |coproc\t|coproc$|logout |logout\t|logout$|export |export\t|export$|select |select\t|select$|repeat |repeat\t|repeat$|pushd |pushd\t|pushd$|until |until\t|until$|while |while\t|while$|local |local\t|local$|case |case\t|case$|done |done\t|done$|elif |elif\t|elif$|else |else\t|else$|esac |esac\t|esac$|popd |popd\t|popd$|then |then\t|then$|time |time\t|time$|for |for\t|for$|end |end\t|end$|fi |fi\t|fi$|do |do\t|do$|in |in\t|in$|if |if\t|if$)(?!\\\\\\n?$)))" + }, + "string": { + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.shell" + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.shell" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.shell" + } + }, + "name": "string.quoted.single.shell" + }, + { + "begin": "\\$?\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.shell" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.shell" + } + }, + "name": "string.quoted.double.shell", + "patterns": [ + { + "match": "\\\\[$\\n`\"\\\\]", + "name": "constant.character.escape.shell" + }, + { + "include": "#variable" + }, + { + "include": "#interpolation" + } + ] + }, + { + "begin": "\\$'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.shell" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.shell" + } + }, + "name": "string.quoted.single.dollar.shell", + "patterns": [ + { + "match": "\\\\(?:a|b|e|f|n|r|t|v|\\\\|')", + "name": "constant.character.escape.ansi-c.shell" + }, + { + "match": "\\\\\\d{3}\"", + "name": "constant.character.escape.octal.shell" + }, + { + "match": "\\\\x[0-9a-fA-F]{2}\"", + "name": "constant.character.escape.hex.shell" + }, + { + "match": "\\\\c.\"", + "name": "constant.character.escape.control-char.shell" + } + ] + } + ] + }, + "subshell_dollar": { + "patterns": [ + { + "begin": "(?:\\$\\()", + "beginCaptures": { + "0": { + "name": "punctuation.definition.subshell.single.shell" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.subshell.single.shell" + } + }, + "name": "meta.scope.subshell", + "patterns": [ + { + "include": "#parenthese" + }, + { + "include": "#initial_context" + } + ] + } + ] + }, + "support": { + "patterns": [ + { + "match": "(?<=^|;|&|\\s)(?::|\\.)(?=\\s|;|&|$)", + "name": "support.function.builtin.shell" + } + ] + }, + "typical_statements": { + "patterns": [ + { + "include": "#assignment_statement" + }, + { + "include": "#case_statement" + }, + { + "include": "#for_statement" + }, + { + "include": "#while_statement" + }, + { + "include": "#function_definition" + }, + { + "include": "#command_statement" + }, + { + "include": "#line_continuation" + }, + { + "include": "#arithmetic_double" + }, + { + "include": "#normal_context" + } + ] + }, + "variable": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.variable.shell variable.parameter.positional.all.shell" + }, + "2": { + "name": "variable.parameter.positional.all.shell" + } + }, + "match": "(?:(\\$)(\\@(?!\\w)))" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.shell variable.parameter.positional.shell" + }, + "2": { + "name": "variable.parameter.positional.shell" + } + }, + "match": "(?:(\\$)(\\d(?!\\w)))" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.shell variable.language.special.shell" + }, + "2": { + "name": "variable.language.special.shell" + } + }, + "match": "(?:(\\$)([-*#?$!0_](?!\\w)))" + }, + { + "begin": "(?:(\\$)(\\{)(?:[ \\t]*+)(?=\\d))", + "beginCaptures": { + "1": { + "name": "punctuation.definition.variable.shell variable.parameter.positional.shell" + }, + "2": { + "name": "punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell" + } + }, + "contentName": "meta.parameter-expansion", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell" + } + }, + "patterns": [ + { + "include": "#special_expansion" + }, + { + "include": "#array_access_inline" + }, + { + "match": "\\d+", + "name": "variable.parameter.positional.shell" + }, + { + "match": "(?'\"%@`]]|[?:-]\\S)([^\\s:]|:\\S|\\s+(?![#\\s]))*\\s*:(\\s|$))", + "end": "(?=\\s*$|\\s+\\#|\\s*:(\\s|$))", + "patterns": [ + { + "include": "#flow-scalar-plain-out-implicit-type" + }, + { + "begin": "[^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]|[?:-]\\S", + "beginCaptures": { + "0": { + "name": "entity.name.tag.yaml" + } + }, + "contentName": "entity.name.tag.yaml", + "end": "(?=\\s*$|\\s+\\#|\\s*:(\\s|$))", + "name": "string.unquoted.plain.out.yaml" + } + ] + }, + { + "match": ":(?=\\s|$)", + "name": "punctuation.separator.key-value.mapping.yaml" + } + ] + }, + "block-scalar": { + "begin": "(?:(\\|)|(>))([1-9])?([-+])?(.*\\n?)", + "beginCaptures": { + "1": { + "name": "keyword.control.flow.block-scalar.literal.yaml" + }, + "2": { + "name": "keyword.control.flow.block-scalar.folded.yaml" + }, + "3": { + "name": "constant.numeric.indentation-indicator.yaml" + }, + "4": { + "name": "storage.modifier.chomping-indicator.yaml" + }, + "5": { + "patterns": [ + { + "include": "#comment" + }, + { + "match": ".+", + "name": "invalid.illegal.expected-comment-or-newline.yaml" + } + ] + } + }, + "end": "^(?=\\S)|(?!\\G)", + "patterns": [ + { + "begin": "^([ ]+)(?! )", + "end": "^(?!\\1|\\s*$)", + "name": "string.unquoted.block.yaml" + } + ] + }, + "block-sequence": { + "match": "(-)(?!\\S)", + "name": "punctuation.definition.block.sequence.item.yaml" + }, + "comment": { + "begin": "(?:(^[ \\t]*)|[ \\t]+)(?=#\\p{Print}*$)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.yaml" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "#", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.yaml" + } + }, + "end": "\\n", + "name": "comment.line.number-sign.yaml" + } + ] + }, + "directive": { + "begin": "^%", + "beginCaptures": { + "0": { + "name": "punctuation.definition.directive.begin.yaml" + } + }, + "end": "(?=$|[ \\t]+($|#))", + "name": "meta.directive.yaml", + "patterns": [ + { + "captures": { + "1": { + "name": "keyword.other.directive.yaml.yaml" + }, + "2": { + "name": "constant.numeric.yaml-version.yaml" + } + }, + "match": "\\G(YAML)[ \\t]+(\\d+\\.\\d+)" + }, + { + "captures": { + "1": { + "name": "keyword.other.directive.tag.yaml" + }, + "2": { + "name": "storage.type.tag-handle.yaml" + }, + "3": { + "name": "support.type.tag-prefix.yaml" + } + }, + "match": "\\G(TAG)(?:[ \\t]+((?:!(?:[0-9A-Za-z\\-]*!)?))(?:[ \\t]+(!(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]])*|(?![,!\\[\\]{}])(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]])+))?)?" + }, + { + "captures": { + "1": { + "name": "support.other.directive.reserved.yaml" + }, + "2": { + "name": "string.unquoted.directive-name.yaml" + }, + "3": { + "name": "string.unquoted.directive-parameter.yaml" + } + }, + "match": "\\G(\\w+)(?:[ \\t]+(\\w+)(?:[ \\t]+(\\w+))?)?" + }, + { + "match": "\\S+", + "name": "invalid.illegal.unrecognized.yaml" + } + ] + }, + "flow-alias": { + "captures": { + "1": { + "name": "keyword.control.flow.alias.yaml" + }, + "2": { + "name": "punctuation.definition.alias.yaml" + }, + "3": { + "name": "variable.other.alias.yaml" + }, + "4": { + "name": "invalid.illegal.character.anchor.yaml" + } + }, + "match": "((\\*))([^\\s\\[\\]/{/},]+)([^\\s\\]},]\\S*)?" + }, + "flow-collection": { + "patterns": [ + { + "include": "#flow-sequence" + }, + { + "include": "#flow-mapping" + } + ] + }, + "flow-mapping": { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.mapping.begin.yaml" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.mapping.end.yaml" + } + }, + "name": "meta.flow-mapping.yaml", + "patterns": [ + { + "include": "#prototype" + }, + { + "match": ",", + "name": "punctuation.separator.mapping.yaml" + }, + { + "include": "#flow-pair" + } + ] + }, + "flow-node": { + "patterns": [ + { + "include": "#prototype" + }, + { + "include": "#flow-alias" + }, + { + "include": "#flow-collection" + }, + { + "include": "#flow-scalar" + } + ] + }, + "flow-pair": { + "patterns": [ + { + "begin": "\\?", + "beginCaptures": { + "0": { + "name": "punctuation.definition.key-value.begin.yaml" + } + }, + "end": "(?=[},\\]])", + "name": "meta.flow-pair.explicit.yaml", + "patterns": [ + { + "include": "#prototype" + }, + { + "include": "#flow-pair" + }, + { + "include": "#flow-node" + }, + { + "begin": ":(?=\\s|$|[\\[\\]{},])", + "beginCaptures": { + "0": { + "name": "punctuation.separator.key-value.mapping.yaml" + } + }, + "end": "(?=[},\\]])", + "patterns": [ + { + "include": "#flow-value" + } + ] + } + ] + }, + { + "begin": "(?=(?:[^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]|[?:-][^\\s[\\[\\]{},]])([^\\s:[\\[\\]{},]]|:[^\\s[\\[\\]{},]]|\\s+(?![#\\s]))*\\s*:(\\s|$))", + "end": "(?=\\s*$|\\s+\\#|\\s*:(\\s|$)|\\s*:[\\[\\]{},]|\\s*[\\[\\]{},])", + "name": "meta.flow-pair.key.yaml", + "patterns": [ + { + "include": "#flow-scalar-plain-in-implicit-type" + }, + { + "begin": "[^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]|[?:-][^\\s[\\[\\]{},]]", + "beginCaptures": { + "0": { + "name": "entity.name.tag.yaml" + } + }, + "contentName": "entity.name.tag.yaml", + "end": "(?=\\s*$|\\s+\\#|\\s*:(\\s|$)|\\s*:[\\[\\]{},]|\\s*[\\[\\]{},])", + "name": "string.unquoted.plain.in.yaml" + } + ] + }, + { + "include": "#flow-node" + }, + { + "begin": ":(?=\\s|$|[\\[\\]{},])", + "captures": { + "0": { + "name": "punctuation.separator.key-value.mapping.yaml" + } + }, + "end": "(?=[},\\]])", + "name": "meta.flow-pair.yaml", + "patterns": [ + { + "include": "#flow-value" + } + ] + } + ] + }, + "flow-scalar": { + "patterns": [ + { + "include": "#flow-scalar-double-quoted" + }, + { + "include": "#flow-scalar-single-quoted" + }, + { + "include": "#flow-scalar-plain-in" + } + ] + }, + "flow-scalar-double-quoted": { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.yaml" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.yaml" + } + }, + "name": "string.quoted.double.yaml", + "patterns": [ + { + "match": "\\\\([0abtnvfre \"/\\\\N_Lp]|x\\d\\d|u\\d{4}|U\\d{8})", + "name": "constant.character.escape.yaml" + }, + { + "match": "\\\\\\n", + "name": "constant.character.escape.double-quoted.newline.yaml" + } + ] + }, + "flow-scalar-plain-in": { + "patterns": [ + { + "include": "#flow-scalar-plain-in-implicit-type" + }, + { + "begin": "[^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]|[?:-][^\\s[\\[\\]{},]]", + "end": "(?=\\s*$|\\s+\\#|\\s*:(\\s|$)|\\s*:[\\[\\]{},]|\\s*[\\[\\]{},])", + "name": "string.unquoted.plain.in.yaml" + } + ] + }, + "flow-scalar-plain-in-implicit-type": { + "patterns": [ + { + "captures": { + "1": { + "name": "constant.language.null.yaml" + }, + "2": { + "name": "constant.language.boolean.yaml" + }, + "3": { + "name": "constant.numeric.integer.yaml" + }, + "4": { + "name": "constant.numeric.float.yaml" + }, + "5": { + "name": "constant.other.timestamp.yaml" + }, + "6": { + "name": "constant.language.value.yaml" + }, + "7": { + "name": "constant.language.merge.yaml" + } + }, + "match": "(?:(null|Null|NULL|~)|(y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)|((?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?(?:0|[1-9][0-9_]*)|[-+]?0x[0-9a-fA-F_]+|[-+]?[1-9][0-9_]*(?::[0-5]?\\d)+))|((?:[-+]?(?:\\d[0-9_]*)?\\.[0-9.]*(?:[eE][-+]\\d+)?|[-+]?\\d[0-9_]*(?::[0-5]?\\d)+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN)))|((?:\\d{4}-\\d{2}-\\d{2}|\\d{4}-\\d{1,2}-\\d{1,2}(?:[Tt]|[ \\t]+)\\d{1,2}:\\d{2}:\\d{2}(?:\\.\\d*)?(?:(?:[ \\t]*)Z|[-+]\\d{1,2}(?::\\d{1,2})?)?))|(=)|(<<))(?:(?=\\s*$|\\s+\\#|\\s*:(\\s|$)|\\s*:[\\[\\]{},]|\\s*[\\[\\]{},]))" + } + ] + }, + "flow-scalar-plain-out": { + "patterns": [ + { + "include": "#flow-scalar-plain-out-implicit-type" + }, + { + "begin": "[^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]|[?:-]\\S", + "end": "(?=\\s*$|\\s+\\#|\\s*:(\\s|$))", + "name": "string.unquoted.plain.out.yaml" + } + ] + }, + "flow-scalar-plain-out-implicit-type": { + "patterns": [ + { + "captures": { + "1": { + "name": "constant.language.null.yaml" + }, + "2": { + "name": "constant.language.boolean.yaml" + }, + "3": { + "name": "constant.numeric.integer.yaml" + }, + "4": { + "name": "constant.numeric.float.yaml" + }, + "5": { + "name": "constant.other.timestamp.yaml" + }, + "6": { + "name": "constant.language.value.yaml" + }, + "7": { + "name": "constant.language.merge.yaml" + } + }, + "match": "(?:(null|Null|NULL|~)|(y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)|((?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?(?:0|[1-9][0-9_]*)|[-+]?0x[0-9a-fA-F_]+|[-+]?[1-9][0-9_]*(?::[0-5]?\\d)+))|((?:[-+]?(?:\\d[0-9_]*)?\\.[0-9.]*(?:[eE][-+]\\d+)?|[-+]?\\d[0-9_]*(?::[0-5]?\\d)+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN)))|((?:\\d{4}-\\d{2}-\\d{2}|\\d{4}-\\d{1,2}-\\d{1,2}(?:[Tt]|[ \\t]+)\\d{1,2}:\\d{2}:\\d{2}(?:\\.\\d*)?(?:(?:[ \\t]*)Z|[-+]\\d{1,2}(?::\\d{1,2})?)?))|(=)|(<<))(?:(?=\\s*$|\\s+\\#|\\s*:(\\s|$)))" + } + ] + }, + "flow-scalar-single-quoted": { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.yaml" + } + }, + "end": "'(?!')", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.yaml" + } + }, + "name": "string.quoted.single.yaml", + "patterns": [ + { + "match": "''", + "name": "constant.character.escape.single-quoted.yaml" + } + ] + }, + "flow-sequence": { + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.sequence.begin.yaml" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.sequence.end.yaml" + } + }, + "name": "meta.flow-sequence.yaml", + "patterns": [ + { + "include": "#prototype" + }, + { + "match": ",", + "name": "punctuation.separator.sequence.yaml" + }, + { + "include": "#flow-pair" + }, + { + "include": "#flow-node" + } + ] + }, + "flow-value": { + "patterns": [ + { + "begin": "\\G(?![},\\]])", + "end": "(?=[},\\]])", + "name": "meta.flow-pair.value.yaml", + "patterns": [ + { + "include": "#flow-node" + } + ] + } + ] + }, + "node": { + "patterns": [ + { + "include": "#block-node" + } + ] + }, + "property": { + "begin": "(?=!|&)", + "end": "(?!\\G)", + "name": "meta.property.yaml", + "patterns": [ + { + "captures": { + "1": { + "name": "keyword.control.property.anchor.yaml" + }, + "2": { + "name": "punctuation.definition.anchor.yaml" + }, + "3": { + "name": "entity.name.type.anchor.yaml" + }, + "4": { + "name": "invalid.illegal.character.anchor.yaml" + } + }, + "match": "\\G((&))([^\\s\\[\\]/{/},]+)(\\S+)?" + }, + { + "match": "\\G(?:!<(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]])+>|(?:!(?:[0-9A-Za-z\\-]*!)?)(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\\-#;/?:@&=+$_.~*'()])+|!)(?= |\\t|$)", + "name": "storage.type.tag-handle.yaml" + }, + { + "match": "\\S+", + "name": "invalid.illegal.tag-handle.yaml" + } + ] + }, + "prototype": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#property" + } + ] + } + }, + "scopeName": "source.yaml" +} \ No newline at end of file diff --git a/meta/.gitignore b/meta/.gitignore new file mode 100644 index 0000000..25c8fdb --- /dev/null +++ b/meta/.gitignore @@ -0,0 +1,2 @@ +node_modules +package-lock.json \ No newline at end of file diff --git a/meta/input.txt b/meta/input.txt new file mode 100644 index 0000000..309c877 --- /dev/null +++ b/meta/input.txt @@ -0,0 +1 @@ +name: "Hello, world!" \ No newline at end of file diff --git a/meta/package.json b/meta/package.json new file mode 100644 index 0000000..7431cb0 --- /dev/null +++ b/meta/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "devDependencies": { + "vscode-oniguruma": "^2.0.1", + "vscode-textmate": "^9.1.0" + } +} diff --git a/meta/textmate.js b/meta/textmate.js new file mode 100644 index 0000000..f0e7b8e --- /dev/null +++ b/meta/textmate.js @@ -0,0 +1,66 @@ +const fs = require("fs"); +const path = require("path"); +const vsctm = require("vscode-textmate"); +const oniguruma = require("vscode-oniguruma"); + +function readFile(path) { + return new Promise((resolve, reject) => { + fs.readFile(path, (error, data) => + error ? reject(error) : resolve(data) + ); + }); +} + +const wasmBin = fs.readFileSync( + path.join(__dirname, "./node_modules/vscode-oniguruma/release/onig.wasm") +).buffer; + +const vscodeOnigurumaLib = oniguruma.loadWASM(wasmBin).then(() => { + return { + createOnigScanner(patterns) { + return new oniguruma.OnigScanner(patterns); + }, + createOnigString(s) { + return new oniguruma.OnigString(s); + }, + }; +}); + +const registry = new vsctm.Registry({ + onigLib: vscodeOnigurumaLib, + loadGrammar: (scopeName) => { + const map = { + "source.yaml": "yaml.json", + }; + + const file = map[scopeName]; + const p = path.join(__dirname, `../languages/${file}`); + + return readFile(p).then(data => { + return vsctm.parseRawGrammar(data.toString(), p); + }) + }, +}); + +// Load the JavaScript grammar and any other grammars included by it async. +registry.loadGrammar("source.yaml").then((grammar) => { + const text = fs.readFileSync(path.join(__dirname, "./input.txt")).toString().split("\n"); + + let ruleStack = vsctm.INITIAL; + + for (let i = 0; i < text.length; i++) { + const line = text[i]; + const lineTokens = grammar.tokenizeLine(line, ruleStack); + // console.log(`\nTokenizing line: ${line}`); + // for (let j = 0; j < lineTokens.tokens.length; j++) { + // const token = lineTokens.tokens[j]; + // console.log( + // ` - token from ${token.startIndex} to ${token.endIndex} ` + + // `(${line.substring(token.startIndex, token.endIndex)}) ` + + // `with scopes ${token.scopes.join(", ")}` + // ); + // } + + ruleStack = lineTokens.ruleStack; + } +}); diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..b9d6b28 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + level: 5 + + paths: + - src \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..7d0904f --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,18 @@ + + + + + ./tests + + + + + ./app + ./src + + + diff --git a/samples/blade.sample b/samples/blade.sample new file mode 100644 index 0000000..aed054f --- /dev/null +++ b/samples/blade.sample @@ -0,0 +1,47 @@ + + + + + + {!! $post->html !!} + + @unless($post->isTweet()) + @if($post->external_url) +

+ + Read more + [{{ $post->external_url_host }}] +

+ @endif + @endunless +
+ + @include('front.newsletter.partials.block', [ + 'class' => 'mb-8', + ]) + +
+ @include('front.posts.partials.comments') +
+ + + + + + + @foreach($post->tags as $tag) + + @endforeach + + + + + + + + + + +
+ +{{-- From https://freek.dev/2024-how-to-render-markdown-with-perfectly-highlighted-code-snippets --}} \ No newline at end of file diff --git a/samples/c.sample b/samples/c.sample new file mode 100644 index 0000000..ddd0625 --- /dev/null +++ b/samples/c.sample @@ -0,0 +1,52 @@ +#include + +#define ARR_LEN 7 + +void qsort(int v[], int left, int right); +void printArr(int v[], int len); + +int main() +{ + int i; + int v[ARR_LEN] = { 4, 3, 1, 7, 9, 6, 2 }; + printArr(v, ARR_LEN); + qsort(v, 0, ARR_LEN-1); + printArr(v, ARR_LEN); + return 0; +} + +void qsort(int v[], int left, int right) +{ + int i, last; + void swap(int v[], int i, int j); + + if (left >= right) + return; + swap(v, left, (left + right) / 2); + last = left; + for (i = left+1; i <= right; i++) + if (v[i] < v[left]) + swap(v, ++last, i); + swap(v, left, last); + qsort(v, left, last-1); + qsort(v, last+1, right); +} + +void swap(int v[], int i, int j) +{ + int temp; + + temp = v[i]; + v[i] = v[j]; + v[j] = temp; +} + +void printArr(int v[], int len) +{ + int i; + for (i = 0; i < len; i++) + printf("%d ", v[i]); + printf("\n"); +} + +// From https://github.com/Heatwave/The-C-Programming-Language-2nd-Edition/blob/master/chapter-4-functions-and-program-structure/8.qsort.c \ No newline at end of file diff --git a/samples/css.sample b/samples/css.sample new file mode 100644 index 0000000..a68147d --- /dev/null +++ b/samples/css.sample @@ -0,0 +1,46 @@ +html { + margin: 0; + background: black; + height: 100%; +} + +body { + margin: 0; + width: 100%; + height: inherit; +} + +/* the three main rows going down the page */ + +body > div { + height: 25%; +} + +.thumb { + float: left; + width: 25%; + height: 100%; + object-fit: cover; +} + +.main { + display: none; +} + +.blowup { + display: block; + position: absolute; + object-fit: contain; + object-position: center; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 2000; +} + +.darken { + opacity: 0.4; +} + +/* From https://github.com/mdn/css-examples/blob/main/object-fit-gallery/style.css */ diff --git a/samples/go.sample b/samples/go.sample new file mode 100644 index 0000000..0af7005 --- /dev/null +++ b/samples/go.sample @@ -0,0 +1,18 @@ +package main + +import ( + "fmt" + "log" + "net/http" +) + +func handler(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:]) +} + +func main() { + http.HandleFunc("/", handler) + log.Fatal(http.ListenAndServe(":8080", nil)) +} + +// From https://golang.org/doc/articles/wiki/#tmp_3 \ No newline at end of file diff --git a/samples/html.sample b/samples/html.sample new file mode 100644 index 0000000..1a3cf64 --- /dev/null +++ b/samples/html.sample @@ -0,0 +1,52 @@ + + + + + + MDN Web Docs Example: Toggling full-screen mode + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + diff --git a/samples/javascript.sample b/samples/javascript.sample new file mode 100644 index 0000000..764b8bf --- /dev/null +++ b/samples/javascript.sample @@ -0,0 +1,151 @@ +// --- Demonstration of imports --- + +// Importing named exports and the default export +import defaultAnimal, { person, add } from './module.js'; + +// Importing everything from the module as an alias +import * as Module from './module.js'; + + +// --- Demonstration of exports --- + +// Named exports +export const person = { name: "Alice", age: 30 }; + +export function add(x, y = 0) { + return x + y; +} + +// Default export +const defaultAnimal = { name: "Default Animal" }; +export default defaultAnimal; + +// Generator function +export function* idGenerator() { + let id = 0; + while (true) { + yield id++; + } +} + +// Using typeof for runtime type checks +console.log(typeof person); // object +console.log(add(2, 3)); // 5 +console.log(defaultAnimal); // { name: "Default Animal" } + +// Emulating 'satisfies' behavior using runtime checks +function createAnimal(animal) { + if (typeof animal.name === 'string') { + return animal; // Ensures the animal has a 'name' property + } + throw new Error("Animal must have a name"); +} + +const dog = createAnimal({ name: "Buddy", breed: "Golden Retriever" }); +console.log(dog); // { name: 'Buddy', breed: 'Golden Retriever' } + +// Generator usage +const generator = Module.idGenerator(); +console.log(generator.next().value); // 0 +console.log(generator.next().value); // 1 +console.log(generator.next().value); // 2 + +// Handling a generic-like behavior by allowing any type and runtime checks +function identity(arg) { + return arg; +} + +let str = identity("Hello"); +let num = identity(42); +console.log(str, num); // "Hello", 42 + +// Emulating default generics by using default parameters +function wrapInArray(value = "") { + return [value]; +} + +const stringArray = wrapInArray(); // Default is empty string +const numberArray = wrapInArray(42); // Passes 42 explicitly +console.log(stringArray, numberArray); // [""] , [42] + +// --- for-of and for-in loops --- + +// for-of: Iterates over iterable objects like arrays, strings, maps, etc. +const fruits = ["apple", "banana", "cherry"]; +for (const fruit of fruits) { + console.log(fruit); // Outputs: apple, banana, cherry +} + +// for-in: Iterates over enumerable properties of an object +const car = { make: "Tesla", model: "Model S", year: 2021 }; +for (const key in car) { + if (car.hasOwnProperty(key)) { + console.log(`${key}: ${car[key]}`); // Outputs key-value pairs of car object + } +} + +// --- IIFE (Immediately Invoked Function Expression) --- + +(function () { + console.log("This IIFE runs immediately after it's defined."); + const privateVar = "I'm private inside the IIFE!"; + console.log(privateVar); // Accessing the private variable inside the IIFE +})(); + +// --- Using a generator to loop indefinitely --- +function* infiniteGenerator() { + let i = 0; + while (true) { + yield i++; + } +} + +const gen = infiniteGenerator(); +console.log(gen.next().value); // 0 +console.log(gen.next().value); // 1 + +// --- Async and Await --- + +async function fetchData(url) { + try { + const response = await fetch(url); + if (!response.ok) { + throw new Error('Network response was not ok'); + } + const data = await response.json(); + return data; + } catch (error) { + console.error('There has been a problem with your fetch operation:', error); + } +} + +// Example usage of async function +fetchData('https://jsonplaceholder.typicode.com/todos/1') + .then(data => console.log(data)) // Outputs fetched data + .catch(error => console.error(error)); + +// JSDoc type annotations +/** + * @typedef {Object} Task + * @property {string} title + * @property {boolean} completed + */ + +/** + * Create a task + * @param {Task} task + * @returns {Task} + */ +function createTask(task) { + return task; +} + +const myTask = createTask({ + title: "Learn JavaScript", + completed: false, +}); +console.log(myTask); + +// Importing everything as a namespace (simulated for demonstration) +console.log(Module.person); // { name: "Alice", age: 30 } +console.log(Module.add(10, 20)); // 30 diff --git a/samples/json.sample b/samples/json.sample new file mode 100644 index 0000000..62415ef --- /dev/null +++ b/samples/json.sample @@ -0,0 +1,38 @@ +{ + "squadName": "Super hero squad", + "homeTown": "Metro City", + "formed": 2016, + "secretBase": "Super tower", + "active": true, + "members": [ + { + "name": "Molecule Man", + "age": 29, + "secretIdentity": "Dan Jukes", + "powers": ["Radiation resistance", "Turning tiny", "Radiation blast"] + }, + { + "name": "Madame Uppercut", + "age": 39, + "secretIdentity": "Jane Wilson", + "powers": [ + "Million tonne punch", + "Damage resistance", + "Superhuman reflexes" + ] + }, + { + "name": "Eternal Flame", + "age": 1000000, + "secretIdentity": "Unknown", + "powers": [ + "Immortality", + "Heat Immunity", + "Inferno", + "Teleportation", + "Interdimensional travel" + ] + } + ], + "from": "https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON" +} diff --git a/samples/jsx.sample b/samples/jsx.sample new file mode 100644 index 0000000..1f420e0 --- /dev/null +++ b/samples/jsx.sample @@ -0,0 +1,30 @@ +function Item({ name, isPacked }) { + if (isPacked) { + return null; + } + return
  • {name}
  • ; +} + +export default function PackingList() { + return ( +
    +

    Sally Ride's Packing List

    +
      + + + +
    +
    + ); +} + +// From https://react.dev/learn/conditional-rendering diff --git a/samples/php.sample b/samples/php.sample new file mode 100644 index 0000000..b9af3eb --- /dev/null +++ b/samples/php.sample @@ -0,0 +1,29 @@ +command('inspire')->hourly(); + } + + /** + * Register the commands for the application. + */ + protected function commands(): void + { + $this->load(__DIR__.'/Commands'); + + require base_path('routes/console.php'); + } +} + +// From https://github.com/laravel/laravel/blob/10.x/app/Console/Kernel.php diff --git a/samples/rust.sample b/samples/rust.sample new file mode 100644 index 0000000..bbc3f4f --- /dev/null +++ b/samples/rust.sample @@ -0,0 +1,39 @@ +// Unlike C/C++, there's no restriction on the order of function definitions +fn main() { + // We can use this function here, and define it somewhere later + fizzbuzz_to(100); +} + +// Function that returns a boolean value +fn is_divisible_by(lhs: u32, rhs: u32) -> bool { + // Corner case, early return + if rhs == 0 { + return false; + } + + // This is an expression, the `return` keyword is not necessary here + lhs % rhs == 0 +} + +// Functions that "don't" return a value, actually return the unit type `()` +fn fizzbuzz(n: u32) -> () { + if is_divisible_by(n, 15) { + println!("fizzbuzz"); + } else if is_divisible_by(n, 3) { + println!("fizz"); + } else if is_divisible_by(n, 5) { + println!("buzz"); + } else { + println!("{}", n); + } +} + +// When a function returns `()`, the return type can be omitted from the +// signature +fn fizzbuzz_to(n: u32) { + for n in 1..=n { + fizzbuzz(n); + } +} + +// From https://doc.rust-lang.org/rust-by-example/fn.html diff --git a/samples/sample.php b/samples/sample.php new file mode 100644 index 0000000..78072c3 --- /dev/null +++ b/samples/sample.php @@ -0,0 +1,66 @@ +codeToTokens($sample, $grammar); +$html = (new Phiki($repository))->codeToHtml($sample, $grammar, 'github-dark'); + +?> + + + + + + + + Phiki Sample Explorer + + + + + + +
    +

    + Phiki Sample Explorer +

    +
    + +
    +
    + +
    + + + + +
    + + + \ No newline at end of file diff --git a/samples/shellscript.sample b/samples/shellscript.sample new file mode 100644 index 0000000..a72e6de --- /dev/null +++ b/samples/shellscript.sample @@ -0,0 +1 @@ +echo "$program" diff --git a/samples/toml.sample b/samples/toml.sample new file mode 100644 index 0000000..5b82e9b --- /dev/null +++ b/samples/toml.sample @@ -0,0 +1,26 @@ +# This is a TOML document + +title = "TOML Example" + +[owner] +name = "Tom Preston-Werner" +dob = 1979-05-27T07:32:00-08:00 +age = 0x123FFF + +[database] +enabled = true +ports = [ 8000, 8001, 8002 ] +data = [ ["delta", "phi"], [3.14] ] +temp_targets = { cpu = 79.5, case = 72.0 } + +[servers] + +[servers.alpha] +ip = "10.0.0.1" +role = "frontend" + +[servers.beta] +ip = "10.0.0.2" +role = "backend" + +# From https://toml.io/en/ diff --git a/samples/yaml.sample b/samples/yaml.sample new file mode 100644 index 0000000..2b80453 --- /dev/null +++ b/samples/yaml.sample @@ -0,0 +1,50 @@ +name: Check dist/ + +on: + push: + branches: + - main + paths-ignore: + - '**.md' + pull_request: + paths-ignore: + - '**.md' + +jobs: + check-dist: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set Node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16.x + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Rebuild the dist/ directory + run: | + npm run build:compile + npm run build:package + + - name: Compare the expected and actual dist/ directories + run: | + if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then + echo "Detected uncommitted changes after build. See status below:" + git diff + exit 1 + fi + id: diff + + # If index.js was different than expected, upload the expected version as an artifact + - uses: actions/upload-artifact@v3 + if: ${{ failure() && steps.diff.conclusion == 'failure' }} + with: + name: dist + path: dist/ + +# From https://github.com/actions/add-to-project/blob/main/.github/workflows/check-dist.yml \ No newline at end of file diff --git a/src/CommonMark/CodeBlockRenderer.php b/src/CommonMark/CodeBlockRenderer.php new file mode 100644 index 0000000..1341ee1 --- /dev/null +++ b/src/CommonMark/CodeBlockRenderer.php @@ -0,0 +1,29 @@ +getInfoWords()[0]; + + return $this->phiki->codeToHtml($node->getLiteral(), $grammar, $this->theme); + } +} \ No newline at end of file diff --git a/src/CommonMark/PhikiExtension.php b/src/CommonMark/PhikiExtension.php new file mode 100644 index 0000000..752c3eb --- /dev/null +++ b/src/CommonMark/PhikiExtension.php @@ -0,0 +1,22 @@ +addRenderer(FencedCode::class, new CodeBlockRenderer($this->theme, $this->phiki), 10); + } +} \ No newline at end of file diff --git a/src/Contracts/ContainsCapturesInterface.php b/src/Contracts/ContainsCapturesInterface.php new file mode 100644 index 0000000..8c7e4b1 --- /dev/null +++ b/src/Contracts/ContainsCapturesInterface.php @@ -0,0 +1,18 @@ +patterns; + } + + public function hasPatterns(): bool + { + return count($this->patterns) > 0; + } + + public function tryMatch(Tokenizer $tokenizer, string $lineText, int $linePosition, ?int $cannotExceed = null): MatchedPattern|false + { + if (preg_match('/'.$this->begin->get().'/u', $lineText, $matches, PREG_OFFSET_CAPTURE, $linePosition) !== 1) { + return false; + } + + if ($cannotExceed !== null && $matches[0][1] > $cannotExceed) { + return false; + } + + return new MatchedPattern($this, $matches); + } + + public function scope(): ?array + { + return $this->name ? explode(' ', $this->name) : null; + } + + public function hasCaptures(): bool + { + return count($this->beginCaptures) > 0 || count($this->captures) > 0; + } + + public function getCaptures(): array + { + return count($this->beginCaptures) > 0 ? $this->beginCaptures : $this->captures; + } + + public function createEndPattern(MatchedPattern $self): EndPattern + { + return new EndPattern( + $self, + $this->end, + $this->name, + $this->contentName, + $this->endCaptures, + $this->captures, + $this->patterns, + ); + } +} diff --git a/src/Grammar/Capture.php b/src/Grammar/Capture.php new file mode 100644 index 0000000..a3d183e --- /dev/null +++ b/src/Grammar/Capture.php @@ -0,0 +1,29 @@ +patterns; + } + + public function hasPatterns(): bool + { + return count($this->patterns) > 0; + } + + public function scope(): ?array + { + return $this->name ? explode(' ', $this->name) : null; + } +} diff --git a/src/Grammar/CollectionPattern.php b/src/Grammar/CollectionPattern.php new file mode 100644 index 0000000..9967227 --- /dev/null +++ b/src/Grammar/CollectionPattern.php @@ -0,0 +1,67 @@ +patterns; + } + + public function hasPatterns(): bool + { + return count($this->patterns) > 0; + } + + public function tryMatch(Tokenizer $tokenizer, string $lineText, int $linePosition, ?int $cannotExceed = null): MatchedPattern|false + { + $closest = false; + $offset = $linePosition; + + foreach ($this->getPatterns() as $pattern) { + $matched = $pattern->tryMatch($tokenizer, $lineText, $linePosition, $cannotExceed); + + if ($matched === false) { + continue; + } + + if ($matched->offset() === $linePosition) { + return $matched; + } + + if ($closest === false) { + $closest = $matched; + $offset = $matched->offset(); + + continue; + } + + if ($matched->offset() < $offset) { + $closest = $matched; + $offset = $matched->offset(); + + continue; + } + } + + return $closest; + } + + public function scope(): null + { + return null; + } +} diff --git a/src/Grammar/EndPattern.php b/src/Grammar/EndPattern.php new file mode 100644 index 0000000..392ed59 --- /dev/null +++ b/src/Grammar/EndPattern.php @@ -0,0 +1,67 @@ +patterns; + } + + public function hasPatterns(): bool + { + return count($this->patterns) > 0; + } + + public function getCaptures(): array + { + $captures = count($this->endCaptures) > 0 ? $this->endCaptures : $this->captures; + + return $captures; + } + + public function hasCaptures(): bool + { + return count($this->endCaptures) > 0 || count($this->captures) > 0; + } + + public function tryMatch(Tokenizer $tokenizer, string $lineText, int $linePosition, ?int $cannotExceed = null): MatchedPattern|false + { + $regex = preg_replace_callback('/\\\\(\d+)/', function ($matches) { + return $this->begin->matches[$matches[1]][0] ?? $matches[0]; + }, $this->end->get()); + + if (preg_match('/'.$regex.'/u', $lineText, $matches, PREG_OFFSET_CAPTURE, $linePosition) !== 1) { + return false; + } + + if ($cannotExceed !== null && $matches[0][1] > $cannotExceed) { + return false; + } + + return new MatchedPattern($this, $matches); + } + + public function scope(): ?array + { + return $this->name ? explode(' ', $this->name) : null; + } +} diff --git a/src/Grammar/Grammar.php b/src/Grammar/Grammar.php new file mode 100644 index 0000000..2256999 --- /dev/null +++ b/src/Grammar/Grammar.php @@ -0,0 +1,66 @@ + $repository + * @param Injections\Injection[] $injections + */ + public function __construct( + public string $scopeName, + public array $patterns, + public array $repository, + public array $injections, + ) {} + + /** @return Injections\Injection[] */ + public function getInjections(): array + { + return $this->injections; + } + + public function hasInjections(): bool + { + return count($this->injections) > 0; + } + + public function getPatterns(): array + { + return $this->patterns; + } + + public function hasPatterns(): bool + { + return count($this->patterns) > 0; + } + + public function tryMatch(Tokenizer $tokenizer, string $lineText, int $linePosition, ?int $cannotExceed = null): MatchedPattern|false + { + return $tokenizer->matchUsing($lineText, $this->getPatterns()); + } + + public function resolve(string $reference): ?Pattern + { + return $this->repository[$reference] ?? null; + } + + public function scope(): ?string + { + return $this->scopeName; + } + + public static function parse(array $grammar): static + { + $parser = new GrammarParser; + + return $parser->parse($grammar); + } +} diff --git a/src/Grammar/IncludePattern.php b/src/Grammar/IncludePattern.php new file mode 100644 index 0000000..fac1747 --- /dev/null +++ b/src/Grammar/IncludePattern.php @@ -0,0 +1,56 @@ +resolve($this); + + if ($resolved !== null) { + return $resolved->tryMatch($tokenizer, $lineText, $linePosition, $cannotExceed); + } + + if ($tokenizer->isInStrictMode()) { + throw UnrecognisedReferenceException::make($this->reference, $this->scopeName); + } + + return false; + } + + public function isSelf(): bool + { + return $this->reference === '$self'; + } + + public function isBase(): bool + { + return $this->reference === '$base'; + } + + public function getReference(): ?string + { + return $this->reference; + } + + public function getScopeName(): ?string + { + return $this->scopeName; + } + + public function scope(): null + { + return null; + } +} diff --git a/src/Grammar/Injections/Composite.php b/src/Grammar/Injections/Composite.php new file mode 100644 index 0000000..91b55c4 --- /dev/null +++ b/src/Grammar/Injections/Composite.php @@ -0,0 +1,50 @@ + $expressions + */ + public function __construct( + public array $expressions, + ) {} + + public function getPrefix(array $scopes): ?Prefix + { + if (! $this->matches($scopes)) { + return null; + } + + return $this->expressions[0]->getPrefix($scopes); + } + + public function matches(array $scopes): bool + { + $carry = false; + + foreach ($this->expressions as $expression) { + if ( + ($carry && $expression->operator === Operator::Or) || + (! $carry && $expression->operator === Operator::And) || + (! $carry && $expression->operator === Operator::Not) + ) { + continue; + } + + $matches = $expression->matches($scopes); + + match ($expression->operator) { + Operator::None => $carry = $matches, + Operator::And => $carry = $carry && $matches, + Operator::Or => $carry = $carry || $matches, + Operator::Not => $carry = $carry && ! $matches, + }; + } + + return $carry; + } +} diff --git a/src/Grammar/Injections/Expression.php b/src/Grammar/Injections/Expression.php new file mode 100644 index 0000000..e5b9fb3 --- /dev/null +++ b/src/Grammar/Injections/Expression.php @@ -0,0 +1,34 @@ +matches($scopes)) { + return null; + } + + return $this->child->getPrefix($scopes); + } + + public function matches(array $scopes): bool + { + $result = $this->child->matches($scopes); + + if ($this->negated) { + return !$result; + } + + return $result; + } +} diff --git a/src/Grammar/Injections/Filter.php b/src/Grammar/Injections/Filter.php new file mode 100644 index 0000000..e3e1e46 --- /dev/null +++ b/src/Grammar/Injections/Filter.php @@ -0,0 +1,27 @@ +matches($scopes)) { + return null; + } + + return $this->prefix; + } + + public function matches(array $scopes): bool + { + return $this->child->matches($scopes); + } +} diff --git a/src/Grammar/Injections/Group.php b/src/Grammar/Injections/Group.php new file mode 100644 index 0000000..d8181bb --- /dev/null +++ b/src/Grammar/Injections/Group.php @@ -0,0 +1,26 @@ +matches($scopes)) { + return null; + } + + return $this->child->getPrefix($scopes); + } + + public function matches(array $scopes): bool + { + return $this->child->matches($scopes); + } +} diff --git a/src/Grammar/Injections/Injection.php b/src/Grammar/Injections/Injection.php new file mode 100644 index 0000000..fde4b1f --- /dev/null +++ b/src/Grammar/Injections/Injection.php @@ -0,0 +1,29 @@ +selector; + } + + public function getPrefix(array $scopes): ?Prefix + { + return $this->selector->getPrefix($scopes); + } + + public function matches(array $scopes): bool + { + return $this->selector->matches($scopes); + } +} diff --git a/src/Grammar/Injections/Operator.php b/src/Grammar/Injections/Operator.php new file mode 100644 index 0000000..f442dfe --- /dev/null +++ b/src/Grammar/Injections/Operator.php @@ -0,0 +1,11 @@ +scopes[$index]; + + foreach ($scopes as $scope) { + $scope = Scope::fromString($scope); + + if ($current->matches($scope)) { + $current = $this->scopes[++$index] ?? null; + } + + if ($current === null) { + return true; + } + } + + return false; + } +} diff --git a/src/Grammar/Injections/Prefix.php b/src/Grammar/Injections/Prefix.php new file mode 100644 index 0000000..ccb4668 --- /dev/null +++ b/src/Grammar/Injections/Prefix.php @@ -0,0 +1,9 @@ +parts as $i => $part) { + if ($part === '*') { + continue; + } + + if ($part !== ($scope->parts[$i] ?? null)) { + return false; + } + } + + return true; + } + + public function __toString(): string + { + return implode('.', $this->parts); + } + + public static function fromString(string $scope): self + { + return new self(explode('.', $scope)); + } +} diff --git a/src/Grammar/Injections/Selector.php b/src/Grammar/Injections/Selector.php new file mode 100644 index 0000000..000ecf6 --- /dev/null +++ b/src/Grammar/Injections/Selector.php @@ -0,0 +1,37 @@ + $composites + */ + public function __construct( + public array $composites, + ) {} + + public function getPrefix(array $scopes): ?Prefix + { + foreach ($this->composites as $composite) { + if ($composite->matches($scopes)) { + return $composite->getPrefix($scopes); + } + } + + return null; + } + + public function matches(array $scopes): bool + { + foreach ($this->composites as $composite) { + if ($composite->matches($scopes)) { + return true; + } + } + + return false; + } +} diff --git a/src/Grammar/MatchPattern.php b/src/Grammar/MatchPattern.php new file mode 100644 index 0000000..75a9450 --- /dev/null +++ b/src/Grammar/MatchPattern.php @@ -0,0 +1,49 @@ +match->get().'/u', $lineText, $matches, PREG_OFFSET_CAPTURE, $linePosition) !== 1) { + return false; + } + + if ($cannotExceed !== null && $matches[0][1] > $cannotExceed) { + return false; + } + + return new MatchedPattern($this, $matches); + } + + public function getCaptures(): array + { + return $this->captures; + } + + public function hasCaptures(): bool + { + return count($this->captures) > 0; + } + + public function scope(): ?array + { + return $this->name ? explode(' ', $this->name) : null; + } +} diff --git a/src/Grammar/Pattern.php b/src/Grammar/Pattern.php new file mode 100644 index 0000000..5cf0f4c --- /dev/null +++ b/src/Grammar/Pattern.php @@ -0,0 +1,23 @@ +scope(); + + if ($scope === null) { + return $scopes; + } + + if (! is_array($scope)) { + $scope = [$scope]; + } + + return array_merge($scopes, $scope); + } +} diff --git a/src/GrammarParser.php b/src/GrammarParser.php new file mode 100644 index 0000000..5e3246f --- /dev/null +++ b/src/GrammarParser.php @@ -0,0 +1,300 @@ +scopeName = $scopeName = $grammar['scopeName']; + + $patterns = $this->patterns($grammar['patterns'] ?? []); + $repository = []; + + foreach ($grammar['repository'] ?? [] as $name => $pattern) { + $repository[$name] = $this->pattern($pattern); + } + + $injections = []; + + foreach ($grammar['injections'] ?? [] as $selector => $injection) { + $injections[] = $this->injection($selector, $injection); + } + + return new Grammar($scopeName, $patterns, $repository, $injections); + } + + protected function pattern(array $pattern): Pattern + { + if (isset($pattern['match'])) { + return new MatchPattern( + new Regex($pattern['match']), + $pattern['name'] ?? null, + $this->captures($pattern['captures'] ?? []), + injection: $this->injection, + ); + } + + if (isset($pattern['begin'], $pattern['end'])) { + return new BeginEndPattern( + new Regex($pattern['begin']), + new Regex($pattern['end']), + $pattern['name'] ?? null, + $pattern['contentName'] ?? null, + $this->captures($pattern['beginCaptures'] ?? []), + $this->captures($pattern['endCaptures'] ?? []), + $this->captures($pattern['captures'] ?? []), + $this->patterns($pattern['patterns'] ?? []), + injection: $this->injection, + ); + } + + if (isset($pattern['include'])) { + if (str_starts_with($pattern['include'], '#')) { + [$reference, $scopeName] = [substr($pattern['include'], 1), $this->scopeName]; + } elseif ($pattern['include'] === '$self') { + [$reference, $scopeName] = ['$self', $this->scopeName]; + } elseif ($pattern['include'] === '$base') { + [$reference, $scopeName] = ['$base', null]; + } elseif (str_contains($pattern['include'], '#')) { + [$scopeName, $reference] = explode('#', $pattern['include']); + } else { + [$reference, $scopeName] = [null, $pattern['include']]; + } + + return new IncludePattern($reference, $scopeName, injection: $this->injection,); + } + + if (isset($pattern['patterns'])) { + return new CollectionPattern($this->patterns($pattern['patterns']), injection: $this->injection); + } + + throw new UnreachableException('Unknown pattern type: '.json_encode($pattern)); + } + + protected function patterns(array $patterns): array + { + $result = []; + + foreach ($patterns as $pattern) { + $result[] = $this->pattern($pattern); + } + + return $result; + } + + protected function captures(array $captures): array + { + $result = []; + + foreach ($captures as $index => $capture) { + $result[$index] = $this->capture($capture, $index); + } + + return $result; + } + + protected function capture(array $capture, string $index): Capture + { + return new Capture($index, $capture['name'] ?? null, $this->patterns($capture['patterns'] ?? [])); + } + + protected function injection(string $selector, array $injection): Injection + { + $input = new class($selector) implements InjectionSelectorParserInputInterface + { + private string $selector; + + private int $offset = 0; + + public function __construct(string $selector) + { + // Remove whitespace from the selector so we don't need to skip it in the parser. + // Only exception is when the whitespace is between two letters, because it means + // it's part of a path / scope pattern. + $this->selector = preg_replace('/(?selector[$this->offset] ?? null; + } + + public function peek(): ?string + { + return $this->selector[$this->offset + 1] ?? null; + } + + public function next(): void + { + $this->offset++; + } + }; + + $this->injection = true; + + $selector = $this->selector($input); + $pattern = $this->pattern($injection); + + $this->injection = false; + + return new Injection($selector, $pattern); + } + + protected function selector(InjectionSelectorParserInputInterface $input): Selector + { + $composites = [$this->composite($input)]; + + while ($input->current() === ',') { + $input->next(); + $composites[] = $this->composite($input); + } + + return new Selector($composites); + } + + protected function composite(InjectionSelectorParserInputInterface $input): Composite + { + $expressions = [$this->expression($input)]; + + while ($input->current() !== null && in_array($input->current(), ['&', '|', '-'])) { + $operator = match ($input->current()) { + '&' => Operator::And, + '|' => Operator::Or, + '-' => Operator::Not, + default => throw new UnreachableException('Unrecognised operator in selector: '.$input->current()), + }; + + $input->next(); + + $expressions[] = $this->expression($input, $operator); + } + + return new Composite($expressions); + } + + protected function expression(InjectionSelectorParserInputInterface $input, Operator $operator = Operator::None): Expression + { + $negated = false; + + if ($input->current() === '-') { + $negated = true; + $input->next(); + } + + if (in_array($input->current(), ['L', 'R']) && $input->peek() === ':') { + $child = $this->filter($input); + } elseif ($input->current() === '(') { + $child = $this->group($input); + } else { + $child = $this->path($input); + } + + return new Expression($child, $operator, $negated); + } + + protected function filter(InjectionSelectorParserInputInterface $input): Filter + { + $prefix = match ($input->current()) { + 'L' => Prefix::Left, + 'R' => Prefix::Right, + default => throw new UnreachableException('Unrecognised prefix in filter: '.$input->current()), + }; + + $input->next(); + $input->next(); + + if ($input->current() === '(') { + $child = $this->group($input); + } else { + $child = $this->path($input); + } + + return new Filter($child, $prefix); + } + + protected function group(InjectionSelectorParserInputInterface $input): Group + { + if ($input->current() !== '(') { + throw new UnreachableException('Expected "(" in group.'); + } + + $input->next(); + + $child = $this->selector($input); + + if ($input->current() !== ')') { + throw new UnreachableException('Expected ")" in group.'); + } + + $input->next(); + + return new Group($child); + } + + protected function path(InjectionSelectorParserInputInterface $input): Path + { + $scopes = [$this->scope($input)]; + + while ($input->current() === ' ') { + while ($input->current() === ' ') { + $input->next(); + } + + $scopes[] = $this->scope($input); + } + + return new Path($scopes); + } + + protected function scope(InjectionSelectorParserInputInterface $input): Scope + { + $parts = []; + + do { + if ($input->current() === '.') { + $input->next(); + } + + $part = ''; + + while ($input->current() !== null && (ctype_alpha($input->current()) || $input->current() === '*')) { + $part .= $input->current(); + $input->next(); + } + + $parts[] = $part; + } while ($input->current() === '.'); + + return new Scope($parts); + } +} diff --git a/src/GrammarRepository.php b/src/GrammarRepository.php new file mode 100644 index 0000000..5875feb --- /dev/null +++ b/src/GrammarRepository.php @@ -0,0 +1,100 @@ + __DIR__.'/../languages/blade.json', + 'php' => __DIR__.'/../languages/php.json', + 'html' => __DIR__.'/../languages/html.json', + 'shellscript' => __DIR__.'/../languages/shellscript.json', + 'javascript' => __DIR__.'/../languages/javascript.json', + 'css' => __DIR__.'/../languages/css.json', + 'json' => __DIR__.'/../languages/json.json', + 'c' => __DIR__.'/../languages/c.json', + 'toml' => __DIR__.'/../languages/toml.json', + 'rust' => __DIR__.'/../languages/rust.json', + 'yaml' => __DIR__.'/../languages/yaml.json', + 'go' => __DIR__.'/../languages/go.json', + 'jsx' => __DIR__.'/../languages/jsx.json', + 'txt' => __DIR__ . '/../languages/txt.json', + ]; + + protected array $scopesToGrammar = [ + 'text.html.basic' => 'html', + 'text.html.php.blade' => 'blade', + 'source.php' => 'php', + 'source.shell' => 'shellscript', + 'source.js' => 'javascript', + 'source.css' => 'css', + 'source.json' => 'json', + 'source.c' => 'c', + 'source.toml' => 'toml', + 'source.rust' => 'rust', + 'source.yaml' => 'yaml', + 'source.go' => 'go', + 'source.js.jsx' => 'jsx', + 'text.txt' => 'txt', + ]; + + protected array $aliases = [ + 'bash' => 'shellscript', + 'js' => 'javascript', + 'yml' => 'yaml', + 'golang' => 'go', + 'text' => 'txt', + 'plaintext' => 'txt', + ]; + + public function get(string $name): Grammar + { + if (! $this->has($name)) { + throw UnrecognisedGrammarException::make($name); + } + + $name = $this->aliases[$name] ?? $name; + $grammar = $this->grammars[$name]; + + if ($grammar instanceof Grammar) { + return $grammar; + } + + $parser = new GrammarParser; + + return $this->grammars[$name] = $parser->parse(json_decode(file_get_contents($grammar), true)); + } + + public function getFromScope(string $scope): Grammar + { + if (! isset($this->scopesToGrammar[$scope])) { + throw UnrecognisedGrammarException::make($scope); + } + + return $this->get($this->scopesToGrammar[$scope]); + } + + public function has(string $name): bool + { + return isset($this->grammars[$name]) || isset($this->aliases[$name]); + } + + public function alias(string $alias, string $target): void + { + $this->aliases[$alias] = $target; + } + + public function register(string $name, string|Grammar $pathOrGrammar): void + { + $this->grammars[$name] = $pathOrGrammar; + } + + public function getAllGrammarNames(): array + { + return array_keys($this->grammars); + } +} diff --git a/src/HighlightedToken.php b/src/HighlightedToken.php new file mode 100644 index 0000000..a68de8b --- /dev/null +++ b/src/HighlightedToken.php @@ -0,0 +1,11 @@ + $line) { + foreach ($line as $token) { + $scopes = array_reverse($token->scopes); + $settings = null; + + foreach ($scopes as $scope) { + $resolved = $this->styles->resolve($scope); + + if ($resolved !== null) { + $settings = $resolved; + break; + } + } + + $highlightedTokens[$i][] = new HighlightedToken($token, $settings); + } + } + + return $highlightedTokens; + } +} diff --git a/src/HtmlGenerator.php b/src/HtmlGenerator.php new file mode 100644 index 0000000..5adb729 --- /dev/null +++ b/src/HtmlGenerator.php @@ -0,0 +1,34 @@ +> $highlightedTokens + */ + public function generate(array $highlightedTokens): string + { + $html = sprintf( + '
    ',
    +            $this->styles->name,
    +            $this->styles->baseTokenSettings()->toStyleString(),
    +        );
    +
    +        foreach ($highlightedTokens as $line) {
    +            $html .= '';
    +
    +            foreach ($line as $token) {
    +                $html .= sprintf('%s', $token->settings?->toStyleString(), htmlspecialchars($token->token->text));
    +            }
    +
    +            $html .= '';
    +        }
    +
    +        return $html.'
    '; + } +} diff --git a/src/MatchedPattern.php b/src/MatchedPattern.php new file mode 100644 index 0000000..9eb35cf --- /dev/null +++ b/src/MatchedPattern.php @@ -0,0 +1,39 @@ +matches[0][0]; + } + + public function end(): int + { + return $this->matches[0][1] + strlen($this->matches[0][0]); + } + + /** + * Get the start position of the matched pattern. + */ + public function offset(): int + { + return $this->matches[0][1]; + } + + public function getCaptureGroup(int|string $index): ?array + { + return $this->matches[$index] ?? null; + } +} diff --git a/src/Phiki.php b/src/Phiki.php new file mode 100644 index 0000000..37f7eb3 --- /dev/null +++ b/src/Phiki.php @@ -0,0 +1,42 @@ +grammarRepository->get($grammar) : $grammar; + + $tokenizer = new Tokenizer($grammar, $this->grammarRepository, $this->strictMode); + + return $tokenizer->tokenize($code); + } + + public function codeToHtml(string $code, string|Grammar $grammar, string $theme): string + { + $tokens = $this->codeToTokens($code, $grammar); + + $theme = $this->themeRepository->get($theme); + $styles = new ThemeStyles($theme); + $highlighter = new Highlighter($styles); + $htmlGenerator = new HtmlGenerator($styles); + + return $htmlGenerator->generate($highlighter->highlight($tokens)); + } + + public static function default(): self + { + return new self(new GrammarRepository, new ThemeRepository); + } +} diff --git a/src/Regex.php b/src/Regex.php new file mode 100644 index 0000000..cac8a32 --- /dev/null +++ b/src/Regex.php @@ -0,0 +1,82 @@ + '0-9A-Za-z', + 'alpha' => 'A-Za-z', + 'alphabetic' => 'A-Za-z', + 'blank' => '\\s', + 'greek' => '\\p{Greek}', + 'print' => '\\p{L}\\p{N}\\p{P}\\p{S}\\p{Zs}', + 'word' => '\\w', + ]; + + public function __construct( + protected string $pattern, + protected ?string $lowered = null, + ) {} + + public function get(): string + { + if ($this->lowered !== null) { + return $this->lowered; + } + + $pattern = preg_replace('/(?pattern); + $pattern = $this->convertEscapeSequences($pattern); + $pattern = $this->convertUnicodeProperties($pattern); + $pattern = $this->escapeInvalidLeadingRangeCharacter($pattern); + $pattern = $this->escapeUnescapedCloseSetCharacters($pattern); + + return $this->lowered = $pattern; + } + + protected function convertEscapeSequences(string $pattern): string + { + // Convert \h to [0-9A-Fa-f]. + $pattern = preg_replace('/\\\\h/', '[0-9A-Fa-f]', $pattern); + + // Convert \H to [^0-9A-Fa-f]. + $pattern = preg_replace('/\\\\H/', '[^0-9A-Fa-f]', $pattern); + + return $pattern; + } + + protected function convertUnicodeProperties(string $pattern): string + { + // Convert \p{xx} to PCRE-compatible \p{xx}. + $pattern = preg_replace_callback('/\\\p\{([a-zA-Z]+)\}/', function (array $matches) { + $property = strtolower($matches[1]); + + if (isset(self::SLASH_P_MAP[$property])) { + return '[' . self::SLASH_P_MAP[$property] . ']'; + } + + return $matches[0]; + }, $pattern); + + return $pattern; + } + + protected function escapeInvalidLeadingRangeCharacter(string $pattern): string + { + // Escape invalid leading range function characters, e.g. [-...]. + $pattern = preg_replace('/\[(? __DIR__.'/../themes/github-dark.json', + ]; + + public function get(string $name): array + { + if (! $this->has($name)) { + throw UnrecognisedThemeException::make($name); + } + + $theme = $this->themes[$name]; + + if (is_array($theme)) { + return $theme; + } + + return $this->themes[$name] = json_decode(file_get_contents($theme), true); + } + + public function has(string $name): bool + { + return isset($this->themes[$name]); + } + + public function register(string $name, string|array $pathOrTheme): void + { + $this->themes[$name] = $pathOrTheme; + } +} diff --git a/src/ThemeStyles.php b/src/ThemeStyles.php new file mode 100644 index 0000000..79496a3 --- /dev/null +++ b/src/ThemeStyles.php @@ -0,0 +1,91 @@ +, tokenColors: array, settings: array}>|null} $theme + */ + public function __construct(array $theme) + { + $this->name = $theme['name'] ?? ''; + $this->backgroundColor = $theme['colors']['editor.background']; + $this->foregroundColor = $theme['colors']['editor.foreground']; + + /** @var array */ + $tokenColors = []; + + foreach ($theme['tokenColors'] ?? [] as $tokenColor) { + $settings = $tokenColor['settings']; + $scopes = Arr::wrap($tokenColor['scope']); + + foreach ($scopes as $scope) { + $parts = explode('.', $scope); + $current = &$tokenColors; + + foreach ($parts as $part) { + if (! isset($current[$part])) { + $current[$part] = []; + } + + $current = &$current[$part]; + } + + $current['*'] = $settings; + } + } + + $this->tokenColors = $tokenColors; + } + + public function baseTokenSettings(): TokenSettings + { + return new TokenSettings( + background: $this->backgroundColor, + foreground: $this->foregroundColor, + fontStyle: null, + ); + } + + public function resolve(string $scope): ?TokenSettings + { + $parts = explode('.', $scope); + $current = $this->tokenColors; + + foreach ($parts as $part) { + // Can't find the right part here, break. + if (! isset($current[$part])) { + break; + } + + if (! isset($current[$part]['*'])) { + break; + } + + $current = $current[$part]; + } + + if (! isset($current['*'])) { + return null; + } + + $settings = $current['*']; + + return new TokenSettings( + background: $settings['background'] ?? null, + foreground: $settings['foreground'] ?? null, + fontStyle: $settings['fontStyle'] ?? null, + ); + } +} diff --git a/src/Token.php b/src/Token.php new file mode 100644 index 0000000..c9a544d --- /dev/null +++ b/src/Token.php @@ -0,0 +1,13 @@ +background)) { + $styles['background-color'] = $this->background; + } + + if (isset($this->foreground)) { + $styles['color'] = $this->foreground; + } + + $fontStyles = explode(' ', $this->fontStyle ?? ''); + + foreach ($fontStyles as $fontStyle) { + if ($fontStyle === 'underline') { + $styles['text-decoration'] = 'underline'; + } + + if ($fontStyle === 'italic') { + $styles['font-style'] = 'italic'; + } + + if ($fontStyle === 'bold') { + $styles['font-weight'] = 'bold'; + } + + if ($fontStyle === 'strikethrough') { + $styles['text-decoration'] = 'line-through'; + } + } + + $styleString = ''; + + foreach ($styles as $property => $value) { + $styleString .= "{$property}: {$value};"; + } + + return $styleString; + } +} diff --git a/src/Tokenizer.php b/src/Tokenizer.php new file mode 100644 index 0000000..6f22909 --- /dev/null +++ b/src/Tokenizer.php @@ -0,0 +1,661 @@ +tokens = []; + $this->scopeStack = preg_split('/\s+/', $this->grammar->scopeName); + $this->patternStack = [$this->grammar]; + + $lines = preg_split("/\R/", $input); + + foreach ($lines as $line => $lineText) { + $this->tokenizeLine($line, $lineText."\n"); + } + + return $this->tokens; + } + + public function tokenizeLine(int $line, string $lineText): void + { + $this->linePosition = 0; + + while ($this->linePosition < strlen($lineText)) { + $root = end($this->patternStack); + $matched = $this->match($lineText); + $endIsMatched = false; + + // FIXME: Move all of this end pattern checking into the `match` method! + // Some patterns will include `$self`. Since we're not fixing all patterns to match at the end of the previous match + // we need to check if we're looking for an `end` pattern that is closer than the matched subpattern. + if ($matched !== false && $root instanceof EndPattern && $endMatched = $root->tryMatch($this, $lineText, $this->linePosition)) { + if ($endMatched->offset() <= $matched->offset()) { + $matched = $endMatched; + $endIsMatched = true; + } + } + + // We didn't find a matching subpattern and we're looking for an `end` pattern. + // If we find it on this line, we need to pop it off the stack and process the end pattern. + if ($matched === false && $root instanceof EndPattern && $matched = $root->tryMatch($this, $lineText, $this->linePosition)) { + $endIsMatched = true; + } + + // No match found, advance to the end of the line. + if ($matched === false) { + $this->tokens[$line][] = new Token( + $this->scopeStack, + substr($lineText, $this->linePosition), + $this->linePosition, + strlen($lineText) - 1, + ); + + $this->hasActiveInjection = false; + + break; + } + + // We've found a match for an `end` here. We need to remove it from the stack. + // It's important that we do this here since we don't want to have an effect + // on any capture patterns etc. + if ($endIsMatched) { + array_pop($this->patternStack); + + if ($root->contentName) { + array_pop($this->scopeStack); + } + } + + // Match found – process pattern rules and continue. + $this->process($matched, $line, $lineText); + + if ($endIsMatched && $root->scope() && count($this->scopeStack) > 1) { + foreach ($root->scope() as $_) { + array_pop($this->scopeStack); + } + } + + $this->hasActiveInjection = false; + } + } + + public function matchUsing(string $lineText, array $patterns): MatchedPattern|false + { + $patternStack = $this->patternStack; + + $this->patternStack = [new CollectionPattern($patterns)]; + + $matched = $this->match($lineText); + + $this->patternStack = $patternStack; + + return $matched; + } + + public function match(string $lineText): MatchedPattern|false + { + $closest = false; + $offset = $this->linePosition; + $root = end($this->patternStack); + + if (! $root instanceof PatternCollectionInterface) { + throw new IndeterminateStateException('Root patterns must contain child patterns and implement '.PatternCollectionInterface::class); + } + + $patterns = $root->getPatterns(); + + if ($this->hasActiveInjection === false && $this->grammar->hasInjections()) { + foreach ($this->grammar->getInjections() as $injection) { + if (! $injection->matches($this->scopeStack)) { + continue; + } + + $prefix = $injection->getPrefix($this->scopeStack); + + if ($prefix === Prefix::Left) { + $patterns = [$injection->pattern, ...$patterns]; + } elseif ($prefix === null || $prefix === Prefix::Right) { + $patterns = [...$patterns, $injection->pattern]; + } + + $this->hasActiveInjection = true; + break; + } + } + + foreach ($patterns as $pattern) { + $matched = $pattern->tryMatch($this, $lineText, $this->linePosition); + + // No match found. Move on to next pattern. + if ($matched === false) { + continue; + } + + if ($closest !== false && $pattern instanceof BeginEndPattern && $matched->text() === '') { + $this->patternStack[] = $pattern->createEndPattern($matched); + + $nextMatch = $this->match($lineText); + + array_pop($this->patternStack); + + if ($nextMatch !== false && $nextMatch->pattern instanceof EndPattern && $nextMatch->text() === '') { + continue; + } + } + + // Match found and is same as current position. Return it. + if ($matched->offset() === $this->linePosition) { + return $matched; + } + + // First match found. Set it as the closest one. + if ($closest === false) { + $closest = $matched; + $offset = $matched->offset(); + + continue; + } + + // Match found, closer than previous one. + if ($matched->offset() < $offset) { + $closest = $matched; + $offset = $matched->offset(); + + continue; + } + } + + return $closest; + } + + public function resolve(IncludePattern $pattern): ?Pattern + { + // "include": "$self" + if ($pattern->isSelf()) { + return $this->grammarRepository->getFromScope($pattern->getScopeName() ?? $this->grammar->scopeName); + } + + // "include": "$base" + if ($pattern->isBase()) { + return $this->grammar; + } + + // "include": "#name" + if ($pattern->getReference() && $pattern->getScopeName() === $this->grammar->scopeName) { + return $this->grammar->resolve($pattern->getReference()); + } + + // "include": "scope#name" + if ($pattern->getReference() && $pattern->getScopeName() !== $this->grammar->scopeName) { + return $this->grammarRepository->getFromScope($pattern->getScopeName())->resolve($pattern->getReference()); + } + + // "include": "scope" + return $this->grammarRepository->getFromScope($pattern->getScopeName()); + } + + protected function process(MatchedPattern $matched, int $line, string $lineText): void + { + if ($matched->offset() > $this->linePosition) { + $this->tokens[$line][] = new Token( + $matched->pattern instanceof EndPattern && $matched->pattern->contentName !== null ? [...$this->scopeStack, $matched->pattern->contentName] : $this->scopeStack, + substr($lineText, $this->linePosition, $matched->offset() - $this->linePosition), + $this->linePosition, + $matched->offset(), + ); + + $this->linePosition = $matched->offset(); + } + + if ($matched->pattern instanceof MatchPattern && $matched->pattern->hasCaptures()) { + if ($matched->pattern->scope()) { + $this->scopeStack = [...$this->scopeStack, ...$this->processScope($matched->pattern->scope(), $matched)]; + } + + $this->captures($matched, $line, $lineText); + + if ($this->linePosition < $matched->end()) { + $this->tokens[$line][] = new Token( + $this->scopeStack, + substr($lineText, $this->linePosition, $matched->end() - $this->linePosition), + $this->linePosition, + $matched->end(), + ); + + $this->linePosition = $matched->end(); + } + + if ($matched->pattern->scope()) { + foreach ($matched->pattern->scope() as $_) { + array_pop($this->scopeStack); + } + } + } elseif ($matched->pattern instanceof MatchPattern) { + if ($matched->text() !== '') { + $this->tokens[$line][] = new Token( + $matched->pattern->produceScopes($this->scopeStack), + $matched->text(), + $matched->offset(), + $matched->end(), + ); + } + + $this->linePosition = $matched->end(); + } + + if ($matched->pattern instanceof BeginEndPattern) { + if ($matched->pattern->scope()) { + $this->scopeStack = [...$this->scopeStack, ...$this->processScope($matched->pattern->scope(), $matched)]; + } + + if ($matched->pattern->hasCaptures()) { + $this->captures($matched, $line, $lineText); + } else { + if ($matched->text() !== '') { + $this->tokens[$line][] = new Token( + $this->scopeStack, + $matched->text(), + $matched->offset(), + $matched->end(), + ); + } + + $this->linePosition = $matched->end(); + } + + $endPattern = $matched->pattern->createEndPattern($matched); + + if ($matched->pattern->contentName) { + $this->scopeStack[] = $matched->pattern->contentName; + } + + if ($endPattern->hasPatterns()) { + $this->patternStack[] = $endPattern; + + return; + } + + if ($matched->pattern->contentName) { + array_pop($this->scopeStack); + } + + $endMatched = $endPattern->tryMatch($this, $lineText, $this->linePosition); + + // If we can't see the `end` pattern, we should just return. + if ($endMatched === false) { + $this->patternStack[] = $endPattern; + + return; + } + + // If we can see the `end` pattern, we should process it. + $this->process($endMatched, $line, $lineText); + + if ($matched->pattern->scope()) { + foreach ($matched->pattern->scope() as $_) { + array_pop($this->scopeStack); + } + } + } + + if ($matched->pattern instanceof EndPattern) { + // FIXME: This is a bit of hack. There's a bug somewhere that is incorrectly popping the end scope off + // of the stack before we're done with that specific scope. This will prevent this from happening. + if ($matched->pattern->scope()) { + $potentialMatchedPatternScopes = $this->processScope($matched->pattern->scope(), $matched->pattern->begin); + + foreach ($potentialMatchedPatternScopes as $potentialScope) { + if (! in_array($potentialScope, $this->scopeStack)) { + $this->scopeStack = [...$this->scopeStack, $potentialScope]; + } + } + } + + if ($matched->pattern->hasCaptures()) { + $this->captures($matched, $line, $lineText); + } else { + if ($matched->text() !== '') { + $this->tokens[$line][] = new Token( + $this->scopeStack, + $matched->text(), + $matched->offset(), + $matched->end(), + ); + } + } + + $this->linePosition = $matched->end(); + } + } + + protected function captures(MatchedPattern $pattern, int $line, string $lineText): void + { + if (! $pattern->pattern instanceof ContainsCapturesInterface) { + throw new IndeterminateStateException('Patterns must implement '.ContainsCapturesInterface::class.' in order to process captures.'); + } + + $captures = $pattern->pattern->getCaptures(); + + foreach ($captures as $capture) { + $group = $pattern->getCaptureGroup($capture->index); + + if ($group === null || $group[1] === -1) { + continue; + } + + $groupLength = strlen($group[0]); + $groupStart = $group[1]; + $groupEnd = $group[1] + $groupLength; + + if ($groupStart > $this->linePosition) { + $this->tokens[$line][] = new Token( + $this->scopeStack, + substr($lineText, $this->linePosition, $groupStart - $this->linePosition), + $this->linePosition, + $groupStart, + ); + + $this->linePosition = $groupStart; + } + + if ($capture->scope()) { + $this->scopeStack = [...$this->scopeStack, ...$this->processScope($capture->scope(), $pattern)]; + } + + if ($capture->hasPatterns()) { + // Until we reach the end of the capture group. + while ($this->linePosition < $groupEnd) { + $closest = false; + $closestOffset = $this->linePosition; + + foreach ($capture->getPatterns() as $capturePattern) { + $matched = $capturePattern->tryMatch($this, $lineText, $this->linePosition, cannotExceed: $groupEnd); + + // No match found. Move on to next pattern. + if ($matched === false) { + continue; + } + + // FIXME: I think there's a better way to do this. + // Because we're trying to match the capture groups subpattern against the entire line of text, + // it will sometimes consume text beyond the capture group. This is a hack to prevent that, but + // I think we need to find a better way of doing these subpattern matches. + if ($matched->end() > $groupEnd) { + $matched->matches[0][0] = substr($matched->matches[0][0], 0, $groupEnd - $matched->end()); + } + + // Match found and is same as current position. Return it. + if ($matched->offset() === $this->linePosition) { + $closest = $matched; + $closestOffset = $this->linePosition + $matched->offset(); + + break; + } + + // First match found. Set it as the closest one. + if ($closest === false) { + $closest = $matched; + $closestOffset = $matched->offset(); + + continue; + } + + // Match found, closer than previous one. + if ($matched->offset() < $closestOffset) { + $closest = $matched; + $closestOffset = $matched->offset(); + + continue; + } + } + + // No match found for this capture groups set of subpatterns. + // Advance to the end of the capture group. + if ($closest === false) { + $this->tokens[$line][] = new Token( + $this->scopeStack, + substr($lineText, $this->linePosition, $groupEnd - $this->linePosition), + $this->linePosition, + $groupEnd, + ); + + $this->linePosition = $groupEnd; + + break; + } + + if ($closest->pattern instanceof MatchPattern) { + $this->process($closest, $line, $lineText); + } elseif ($closest->pattern instanceof BeginEndPattern) { + $this->beginStack[] = $closest; + + if ($closest->pattern->scope()) { + $this->scopeStack = [...$this->scopeStack, ...$this->processScope($closest->pattern->scope(), $closest)]; + } + + if ($closest->pattern->hasCaptures()) { + $this->captures($closest, $line, $lineText); + } else { + if ($closest->text() !== '') { + $this->tokens[$line][] = new Token( + $this->scopeStack, + $closest->text(), + $closest->offset(), + $closest->end(), + ); + } + + $this->linePosition = $closest->end(); + } + + $endPattern = $closest->pattern->createEndPattern($closest); + + if ($endPattern->hasPatterns()) { + $onlyPatternsPattern = new CollectionPattern($endPattern->getPatterns()); + + while ($this->linePosition < $groupEnd) { + $subPatternMatched = $onlyPatternsPattern->tryMatch($this, $lineText, $this->linePosition, $groupEnd); + $endIsMatched = false; + + if ($subPatternMatched !== false && $endPattern instanceof EndPattern && $endPattern->tryMatch($this, $lineText, $this->linePosition) !== false) { + $endMatched = $endPattern->tryMatch($this, $lineText, $this->linePosition); + + if ($endMatched->offset() <= $subPatternMatched->offset() && $endMatched->text() !== '') { + $subPatternMatched = $endMatched; + $endIsMatched = true; + } + } + + if ($subPatternMatched === false && $endPattern instanceof EndPattern && $subPatternMatched = $endPattern->tryMatch($this, $lineText, $this->linePosition)) { + $endIsMatched = true; + } + + // No subpatterns matched. End not matched, consume the line. + if ($subPatternMatched === false) { + $this->tokens[$line][] = new Token( + $this->scopeStack, + substr($lineText, $this->linePosition, $groupEnd - $this->linePosition), + $this->linePosition, + $groupEnd, + ); + } + + $this->process($subPatternMatched, $line, $lineText); + + if ($subPatternMatched->pattern->scope()) { + foreach ($subPatternMatched->pattern->scope() as $_) { + array_pop($this->scopeStack); + } + } + + if ($endIsMatched && $endPattern->scope()) { + foreach ($endPattern->scope() as $_) { + array_pop($this->scopeStack); + } + } + } + + continue; + } + + $endMatched = $endPattern->tryMatch($this, $lineText, $this->linePosition); + + // If we can't see the `end` pattern, we should just continue. + if ($endMatched === false) { + throw new UnreachableException('End pattern cannot be found.'); + } + + // If we can see the `end` pattern, we should process it. + $this->process($endMatched, $line, $lineText); + + if ($closest->pattern->scope()) { + foreach ($closest->pattern->scope() as $_) { + array_pop($this->scopeStack); + } + } + + array_pop($this->beginStack); + } + } + + $this->linePosition = $groupEnd; + } elseif ($group[0] !== '') { + $token = new Token( + $this->scopeStack, + $group[0], + $groupStart, + $groupEnd, + ); + + if ($token->start < $this->linePosition) { + $newTokens = []; + + for ($i = count($this->tokens[$line]) - 1; $i >= 0; $i--) { + $previous = $this->tokens[$line][$i]; + + // New token starts before this token. + if ($token->start < $previous->start) { + continue; + } + + // New token ends after this token. This should in theory never happen since this capture group is nested + // meaning it can't theoretically end after the target token. + if ($token->end > $previous->end) { + break; + } + + $newPrevious = clone $previous; + $newPrevious->text = substr($previous->text, 0, $token->start - $previous->start); + $newPrevious->end = $token->start; + + if ($newPrevious->text !== '') { + $newTokens[] = $newPrevious; + } + + $token->scopes = $this->mergeScopes($previous->scopes, $token->scopes); + + $newTokens[] = $token; + + $postText = substr($previous->text, $token->end - $previous->start); + $postStart = $token->end; + + if ($postText !== '') { + $newTokens[] = new Token( + $previous->scopes, + $postText, + $postStart, + $previous->end, + ); + } + + array_splice($this->tokens[$line], $i, 1, $newTokens); + } + } else { + $this->tokens[$line][] = $token; + $this->linePosition = $groupEnd; + } + } + + if ($capture->scope()) { + foreach ($capture->scope() as $_) { + array_pop($this->scopeStack); + } + } + } + + if ($this->linePosition < $pattern->end()) { + $this->tokens[$line][] = new Token( + $this->scopeStack, + substr($lineText, $this->linePosition, $pattern->end() - $this->linePosition), + $this->linePosition, + $pattern->end(), + ); + + $this->linePosition = $pattern->end(); + } + } + + protected function mergeScopes(array $a, array $b): array + { + $scopes = array_merge($a, $b); + + return array_values(array_unique($scopes)); + } + + protected function processScope(string|array $scope, MatchedPattern $pattern): array + { + $scopes = is_array($scope) ? $scope : [$scope]; + + return array_map(function (string $scope) use ($pattern) { + return preg_replace_callback('/\\$(\d+)/', function ($matches) use ($pattern) { + $group = $pattern->getCaptureGroup($matches[1]); + + if ($group === null) { + return $matches[0]; + } + + return $group[0]; + }, $scope); + }, $scopes); + } + + public function isInStrictMode(): bool + { + return $this->strictMode; + } +} diff --git a/tests/Fixtures/example.json b/tests/Fixtures/example.json new file mode 100644 index 0000000..d02d1b4 --- /dev/null +++ b/tests/Fixtures/example.json @@ -0,0 +1,3 @@ +{ + "scopeName": "source.example" +} \ No newline at end of file diff --git a/tests/Fixtures/theme.json b/tests/Fixtures/theme.json new file mode 100644 index 0000000..166d795 --- /dev/null +++ b/tests/Fixtures/theme.json @@ -0,0 +1,6 @@ +{ + "colors": { + "editor.background": "#1e1e1e", + "editor.foreground": "#d4d4d4" + } +} \ No newline at end of file diff --git a/tests/Languages/HtmlTest.php b/tests/Languages/HtmlTest.php new file mode 100644 index 0000000..841006e --- /dev/null +++ b/tests/Languages/HtmlTest.php @@ -0,0 +1,89 @@ +'); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['text.html.basic', 'meta.tag.structure.div.start.html', 'punctuation.definition.tag.begin.html'], '<', 0, 1), + new Token(['text.html.basic', 'meta.tag.structure.div.start.html', 'entity.name.tag.html'], 'div', 1, 4), + new Token(['text.html.basic', 'meta.tag.structure.div.start.html', 'punctuation.definition.tag.end.html'], '>', 4, 5), + new Token(['text.html.basic', 'meta.tag.structure.div.end.html', 'punctuation.definition.tag.begin.html'], '', 10, 11), + new Token(['text.html.basic'], "\n", 11, 11), + ], + ]); + }); + + it('correctly tokenizes a basic tag with text in between', function () { + $tokens = html('

    Hello, world!

    '); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'punctuation.definition.tag.begin.html'], '<', 0, 1), + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'entity.name.tag.html'], 'h1', 1, 3), + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'punctuation.definition.tag.end.html'], '>', 3, 4), + new Token(['text.html.basic'], 'Hello, world!', 4, 17), + new Token(['text.html.basic', 'meta.tag.structure.h1.end.html', 'punctuation.definition.tag.begin.html'], '', 21, 22), + new Token(['text.html.basic'], "\n", 22, 22), + ], + ]); + }); + + it('correctly tokenizes a tag with valueless attributes', function () { + $tokens = html('

    '); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'punctuation.definition.tag.begin.html'], '<', 0, 1), + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'entity.name.tag.html'], 'h1', 1, 3), + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html'], ' ', 3, 4), + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'meta.attribute.hidden.html', 'entity.other.attribute-name.html'], 'hidden', 4, 10), + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'punctuation.definition.tag.end.html'], '>', 10, 11), + new Token(['text.html.basic', 'meta.tag.structure.h1.end.html', 'punctuation.definition.tag.begin.html'], '', 15, 16), + new Token(['text.html.basic'], "\n", 16, 16), + ], + ]); + }); + + it('correctly tokenizes a tag with valued attributes', function () { + $tokens = html('

    '); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'punctuation.definition.tag.begin.html'], '<', 0, 1), + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'entity.name.tag.html'], 'h1', 1, 3), + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html'], ' ', 3, 4), + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'meta.attribute.class.html', 'entity.other.attribute-name.html'], 'class', 4, 9), + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'meta.attribute.class.html', 'punctuation.separator.key-value.html'], '=', 9, 10), + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'meta.attribute.class.html', 'string.quoted.double.html', 'punctuation.definition.string.begin.html'], '"', 10, 11), + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'meta.attribute.class.html', 'string.quoted.double.html'], 'foo', 11, 14), + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'meta.attribute.class.html', 'string.quoted.double.html', 'punctuation.definition.string.end.html'], '"', 14, 15), + new Token(['text.html.basic', 'meta.tag.structure.h1.start.html', 'punctuation.definition.tag.end.html'], '>', 15, 16), + new Token(['text.html.basic', 'meta.tag.structure.h1.end.html', 'punctuation.definition.tag.begin.html'], '', 20, 21), + new Token(['text.html.basic'], "\n", 21, 21), + ], + ]); + }); +}); + +function html(string $input): array +{ + $tokenizer = new Tokenizer( + Grammar::parse(json_decode(file_get_contents(__DIR__.'/../../languages/html.json'), true)) + ); + + return $tokenizer->tokenize($input); +} diff --git a/tests/Languages/JavascriptTest.php b/tests/Languages/JavascriptTest.php new file mode 100644 index 0000000..932ec2e --- /dev/null +++ b/tests/Languages/JavascriptTest.php @@ -0,0 +1,23 @@ +toEqualCanonicalizing([ + [ + new Token(['source.js', 'comment.line.double-slash.js', 'punctuation.definition.comment.js'], '//', 0, 2), + new Token(['source.js', 'comment.line.double-slash.js'], ' This is a comment.', 2, 21), + new Token(['source.js'], "\n", 21, 21), + ] + ]); + }); +}); + +function js(string $input): array +{ + return Phiki::default()->codeToTokens($input, 'javascript'); +} \ No newline at end of file diff --git a/tests/Languages/PhpTest.php b/tests/Languages/PhpTest.php new file mode 100644 index 0000000..66dc9fb --- /dev/null +++ b/tests/Languages/PhpTest.php @@ -0,0 +1,181 @@ +toEqualCanonicalizing([ + [ + new Token(['source.php', 'string.quoted.double.php', 'punctuation.definition.string.begin.php'], '"', 0, 1), + new Token(['source.php', 'string.quoted.double.php'], 'Hello, world!', 1, 14), + new Token(['source.php', 'string.quoted.double.php', 'punctuation.definition.string.end.php'], '"', 14, 15), + new Token(['source.php'], "\n", 15, 15), + ], + ]); + }); + + it('correctly tokenizes a simple variable', function () { + $tokens = php('$name'); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.php', 'variable.other.php', 'punctuation.definition.variable.php'], '$', 0, 1), + new Token(['source.php', 'variable.other.php'], 'name', 1, 5), + new Token(['source.php'], "\n", 5, 5), + ], + ]); + }); + + it('correctly tokenizes a double-quoted string with interpolation', function () { + $tokens = php('"Hello, {$name}!"'); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.php', 'string.quoted.double.php', 'punctuation.definition.string.begin.php'], '"', 0, 1), + new Token(['source.php', 'string.quoted.double.php'], 'Hello, ', 1, 8), + new Token(['source.php', 'string.quoted.double.php', 'punctuation.definition.variable.php'], '{', 8, 9), + new Token(['source.php', 'string.quoted.double.php', 'variable.other.php', 'punctuation.definition.variable.php'], '$', 9, 10), + new Token(['source.php', 'string.quoted.double.php', 'variable.other.php'], 'name', 10, 14), + new Token(['source.php', 'string.quoted.double.php', 'punctuation.definition.variable.php'], '}', 14, 15), + new Token(['source.php', 'string.quoted.double.php'], '!', 15, 16), + new Token(['source.php', 'string.quoted.double.php', 'punctuation.definition.string.end.php'], '"', 16, 17), + new Token(['source.php'], "\n", 17, 17), + ], + ]); + }); + + it('correctly tokenizes a class with extends', function () { + $tokens = php('class A extends B {}'); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.php', 'meta.class.php', 'storage.type.class.php'], 'class', 0, 5), + new Token(['source.php', 'meta.class.php'], ' ', 5, 6), + new Token(['source.php', 'meta.class.php', 'entity.name.type.class.php'], 'A', 6, 7), + new Token(['source.php', 'meta.class.php'], ' ', 7, 8), + new Token(['source.php', 'meta.class.php', 'storage.modifier.extends.php'], 'extends', 8, 15), + new Token(['source.php', 'meta.class.php'], ' ', 15, 16), + new Token(['source.php', 'meta.class.php', 'entity.other.inherited-class.php'], 'B', 16, 17), + new Token(['source.php', 'meta.class.php'], ' ', 17, 18), + new Token(['source.php', 'meta.class.php', 'punctuation.definition.class.begin.bracket.curly.php'], '{', 18, 19), + new Token(['source.php', 'meta.class.php', 'punctuation.definition.class.end.bracket.curly.php'], '}', 19, 20), + new Token(['source.php'], "\n", 20, 20), + ], + ]); + }); + + it('correctly tokenizes a top-level use statement without namespace separators', function () { + $tokens = php('use A;'); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.php', 'meta.use.php', 'keyword.other.use.php'], 'use', 0, 3), + new Token(['source.php', 'meta.use.php'], ' ', 3, 4), + new Token(['source.php', 'meta.use.php', 'support.class.php'], 'A', 4, 5), + new Token(['source.php', 'punctuation.terminator.expression.php'], ';', 5, 6), + new Token(['source.php'], "\n", 6, 6), + ], + ]); + }); + + it('correctly tokenizes a top-level use statement with namespace separators', function () { + $tokens = php('use A\\B\\C;'); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.php', 'meta.use.php', 'keyword.other.use.php'], 'use', 0, 3), + new Token(['source.php', 'meta.use.php'], ' ', 3, 4), + new Token(['source.php', 'meta.use.php', 'support.other.namespace.php'], 'A', 4, 5), + new Token(['source.php', 'meta.use.php', 'support.other.namespace.php', 'punctuation.separator.inheritance.php'], '\\', 5, 6), + new Token(['source.php', 'meta.use.php', 'support.other.namespace.php'], 'B', 6, 7), + new Token(['source.php', 'meta.use.php', 'support.other.namespace.php', 'punctuation.separator.inheritance.php'], '\\', 7, 8), + new Token(['source.php', 'meta.use.php', 'support.class.php'], 'C', 8, 9), + new Token(['source.php', 'punctuation.terminator.expression.php'], ';', 9, 10), + new Token(['source.php'], "\n", 10, 10), + ], + ]); + }); + + it('correctly tokenizes a function statement with a typed parameter', function () { + $tokens = php('function a(B $b) {}'); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.php', 'meta.function.php', 'storage.type.function.php'], 'function', 0, 8), + new Token(['source.php', 'meta.function.php'], ' ', 8, 9), + new Token(['source.php', 'meta.function.php', 'entity.name.function.php'], 'a', 9, 10), + new Token(['source.php', 'meta.function.php', 'punctuation.definition.parameters.begin.bracket.round.php'], '(', 10, 11), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php', 'support.class.php'], 'B', 11, 12), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php'], ' ', 12, 13), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php', 'variable.other.php', 'punctuation.definition.variable.php'], '$', 13, 14), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php', 'variable.other.php'], 'b', 14, 15), + new Token(['source.php', 'meta.function.php', 'punctuation.definition.parameters.end.bracket.round.php'], ')', 15, 16), + new Token(['source.php'], ' ', 16, 17), + new Token(['source.php', 'punctuation.definition.begin.bracket.curly.php'], '{', 17, 18), + new Token(['source.php', 'punctuation.definition.end.bracket.curly.php'], '}', 18, 19), + new Token(['source.php'], "\n", 19, 19), + ], + ]); + }); + + it('correctly tokenizes a function statement with a qualified typed parameter', function () { + $tokens = php('function a(A\B $b) {}'); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.php', 'meta.function.php', 'storage.type.function.php'], 'function', 0, 8), + new Token(['source.php', 'meta.function.php'], ' ', 8, 9), + new Token(['source.php', 'meta.function.php', 'entity.name.function.php'], 'a', 9, 10), + new Token(['source.php', 'meta.function.php', 'punctuation.definition.parameters.begin.bracket.round.php'], '(', 10, 11), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php', 'support.other.namespace.php'], 'A', 11, 12), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php', 'support.other.namespace.php', 'punctuation.separator.inheritance.php'], '\\', 12, 13), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php', 'support.class.php'], 'B', 13, 14), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php'], ' ', 14, 15), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php', 'variable.other.php', 'punctuation.definition.variable.php'], '$', 15, 16), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php', 'variable.other.php'], 'b', 16, 17), + new Token(['source.php', 'meta.function.php', 'punctuation.definition.parameters.end.bracket.round.php'], ')', 17, 18), + new Token(['source.php'], ' ', 18, 19), + new Token(['source.php', 'punctuation.definition.begin.bracket.curly.php'], '{', 19, 20), + new Token(['source.php', 'punctuation.definition.end.bracket.curly.php'], '}', 20, 21), + new Token(['source.php'], "\n", 21, 21), + ], + ]); + }); + + it('correctly tokenizes a function statement with a union type parameter', function () { + $tokens = php('function a(int|float $b) {}'); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.php', 'meta.function.php', 'storage.type.function.php'], 'function', 0, 8), + new Token(['source.php', 'meta.function.php'], ' ', 8, 9), + new Token(['source.php', 'meta.function.php', 'entity.name.function.php'], 'a', 9, 10), + new Token(['source.php', 'meta.function.php', 'punctuation.definition.parameters.begin.bracket.round.php'], '(', 10, 11), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php', 'keyword.other.type.php'], 'int', 11, 14), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php', 'punctuation.separator.delimiter.php'], '|', 14, 15), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php', 'keyword.other.type.php'], 'float', 15, 20), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php'], ' ', 20, 21), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php', 'variable.other.php', 'punctuation.definition.variable.php'], '$', 21, 22), + new Token(['source.php', 'meta.function.php', 'meta.function.parameters.php', 'meta.function.parameter.typehinted.php', 'variable.other.php'], 'b', 22, 23), + new Token(['source.php', 'meta.function.php', 'punctuation.definition.parameters.end.bracket.round.php'], ')', 23, 24), + new Token(['source.php'], ' ', 24, 25), + new Token(['source.php', 'punctuation.definition.begin.bracket.curly.php'], '{', 25, 26), + new Token(['source.php', 'punctuation.definition.end.bracket.curly.php'], '}', 26, 27), + new Token(['source.php'], "\n", 27, 27), + ], + ]); + }); +}); + +function php(string $input): array +{ + $tokenizer = new Tokenizer( + Grammar::parse(json_decode(file_get_contents(__DIR__.'/../../languages/php.json'), true)) + ); + + return $tokenizer->tokenize($input); +} diff --git a/tests/Languages/TomlTest.php b/tests/Languages/TomlTest.php new file mode 100644 index 0000000..69f40da --- /dev/null +++ b/tests/Languages/TomlTest.php @@ -0,0 +1,39 @@ +toEqualCanonicalizing([ + [ + new Token(['source.toml', 'meta.group.toml', 'punctuation.definition.section.begin.toml'], '[', 0, 1), + new Token(['source.toml', 'meta.group.toml', 'entity.name.section.toml'], 'group', 1, 6), + new Token(['source.toml', 'meta.group.toml', 'punctuation.definition.section.begin.toml'], ']', 6, 7), + new Token(['source.toml'], "\n", 7, 7), + ], + ]); + }); + + it('correctly tokenizes group headers with dot-notated names', function () { + $tokens = toml('[group.subgroup]'); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.toml', 'meta.group.toml', 'punctuation.definition.section.begin.toml'], '[', 0, 1), + new Token(['source.toml', 'meta.group.toml', 'entity.name.section.toml'], 'group', 1, 6), + new Token(['source.toml', 'meta.group.toml'], '.', 6, 7), + new Token(['source.toml', 'meta.group.toml', 'entity.name.section.toml'], 'subgroup', 7, 15), + new Token(['source.toml', 'meta.group.toml', 'punctuation.definition.section.begin.toml'], ']', 15, 16), + new Token(['source.toml'], "\n", 16, 16), + ], + ]); + }); +}); + +function toml(string $input): array +{ + return Phiki::default()->codeToTokens($input, 'toml'); +} \ No newline at end of file diff --git a/tests/Languages/YamlTest.php b/tests/Languages/YamlTest.php new file mode 100644 index 0000000..77946ca --- /dev/null +++ b/tests/Languages/YamlTest.php @@ -0,0 +1,29 @@ +toEqualCanonicalizing([ + [ + new Token(['source.yaml', 'string.unquoted.plain.out.yaml', 'entity.name.tag.yaml'], 'n', 0, 1), + new Token(['source.yaml', 'string.unquoted.plain.out.yaml', 'entity.name.tag.yaml'], 'ame', 1, 4), + new Token(['source.yaml', 'punctuation.separator.key-value.mapping.yaml'], ':', 4, 5), + new Token(['source.yaml'], ' ', 5, 6), + new Token(['source.yaml', 'string.quoted.double.yaml', 'punctuation.definition.string.begin.yaml'], '"', 6, 7), + new Token(['source.yaml', 'string.quoted.double.yaml'], 'Hello, world', 7, 19), + new Token(['source.yaml', 'string.quoted.double.yaml', 'punctuation.definition.string.end.yaml'], '"', 19, 20), + new Token(['source.yaml'], "\n", 20, 20), + ], + ]); + }); +}); + +function yaml(string $input): array +{ + return Phiki::default()->codeToTokens($input, 'yaml'); +} \ No newline at end of file diff --git a/tests/Pest.php b/tests/Pest.php new file mode 100644 index 0000000..74de6c7 --- /dev/null +++ b/tests/Pest.php @@ -0,0 +1,13 @@ +tokenize($input); +} diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 0000000..cfb05b6 --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,10 @@ + Extension', function () { + it('registers renderers', function () { + $environment = new Environment(); + + $environment + ->addExtension(new CommonMarkCoreExtension) + ->addExtension(new PhikiExtension('github-dark')); + + $markdown = new MarkdownConverter($environment); + $generated = $markdown->convert(<<<'MD' + ```php + class A {} + ``` + MD)->getContent(); + + expect($generated) + ->toContain('phiki') + ->toContain('github-dark') + ->toContain('A'); + }); +}); \ No newline at end of file diff --git a/tests/Unit/GrammarParserTest.php b/tests/Unit/GrammarParserTest.php new file mode 100644 index 0000000..c8f90d3 --- /dev/null +++ b/tests/Unit/GrammarParserTest.php @@ -0,0 +1,35 @@ +toBeInstanceOf(GrammarParser::class); + }); + + it('can parse a grammar file', function () { + $parser = new GrammarParser; + $grammar = $parser->parse(json_decode(file_get_contents(__DIR__.'/../../languages/php.json'), true)); + + expect($grammar->scopeName)->toBe('source.php'); + expect($grammar->patterns)->toBeArray(); + expect($grammar->repository)->toBeArray(); + }); + + it('can parse a grammar file with injections', function () { + $parser = new GrammarParser; + $grammar = $parser->parse(json_decode(file_get_contents(__DIR__.'/../../languages/blade.json'), true)); + + expect($grammar->scopeName)->toBe('text.html.php.blade'); + expect($grammar->getInjections())->toBeArray(); + expect($grammar->hasInjections())->toBeTrue(); + }); + + it('marks injection patterns as injected ones', function () { + $parser = new GrammarParser; + $grammar = $parser->parse(json_decode(file_get_contents(__DIR__ . '/../../languages/blade.json'), true)); + + expect($grammar->scopeName)->toBe('text.html.php.blade'); + expect($grammar->getInjections()[0]->pattern->injection)->toBeTrue(); + }); +}); diff --git a/tests/Unit/GrammarRepositoryTest.php b/tests/Unit/GrammarRepositoryTest.php new file mode 100644 index 0000000..8d2a040 --- /dev/null +++ b/tests/Unit/GrammarRepositoryTest.php @@ -0,0 +1,60 @@ +toBeInstanceOf(GrammarRepository::class); + }); + + it('can check for the existence of a grammar', function () { + $grammarRepository = new GrammarRepository; + + expect($grammarRepository->has('php'))->toBeTrue(); + }); + + it('can get a grammar', function () { + $grammarRepository = new GrammarRepository; + $grammar = $grammarRepository->get('php'); + + expect($grammar) + ->toBeInstanceOf(Grammar::class) + ->toHaveProperty('scopeName', 'source.php'); + }); + + it('can register a custom grammar using a file path', function () { + $grammarRepository = new GrammarRepository; + $grammarRepository->register('example', __DIR__.'/../Fixtures/example.json'); + + $grammar = $grammarRepository->get('example'); + + expect($grammar) + ->toBeInstanceOf(Grammar::class) + ->toHaveProperty('scopeName', 'source.example'); + }); + + it('can register a custom grammar using a grammar object', function () { + $grammarRepository = new GrammarRepository; + $grammarRepository->register('example', Grammar::parse([ + 'scopeName' => 'source.example', + ])); + + $grammar = $grammarRepository->get('example'); + + expect($grammar) + ->toBeInstanceOf(Grammar::class) + ->toHaveProperty('scopeName', 'source.example'); + }); + + it('resolves aliases', function () { + $grammarRepository = new GrammarRepository; + $grammarRepository->alias('bash', 'shellscript'); + + $grammar = $grammarRepository->get('bash'); + + expect($grammar) + ->toBeInstanceOf(Grammar::class) + ->toHaveProperty('scopeName', 'source.shell'); + }); +}); diff --git a/tests/Unit/HighlighterTest.php b/tests/Unit/HighlighterTest.php new file mode 100644 index 0000000..6b2b003 --- /dev/null +++ b/tests/Unit/HighlighterTest.php @@ -0,0 +1,17 @@ + [ + 'editor.background' => '#000', + 'editor.foreground' => '#fff', + ], + ]); + + expect(new Highlighter($styles))->toBeInstanceOf(Highlighter::class); + }); +}); diff --git a/tests/Unit/InjectionMatchingTest.php b/tests/Unit/InjectionMatchingTest.php new file mode 100644 index 0000000..4985a97 --- /dev/null +++ b/tests/Unit/InjectionMatchingTest.php @@ -0,0 +1,67 @@ +matches(['text.html.blade.php']))->toBeTrue(); +}); + +test('a multi scope path correctly matches a single scope', function () { + $path = new Path([ + new Scope(['text', 'html', 'blade', 'php']), + new Scope(['meta', 'tag']), + ]); + + expect($path->matches(['text.html.blade.php']))->toBeFalse(); + expect($path->matches(['text.html.blade.php', 'meta.tag']))->toBeTrue(); +}); + +test('a group correctly matches a set of scopes', function () { + $group = new Group(new Selector([ + new Composite([new Expression(new Path([ + new Scope(['text', 'html', 'blade', 'php']), + ]))]), + ])); + + expect($group->matches(['text.html.blade.php']))->toBeTrue(); +}); + +test('a negated expression correctly matches a set of scopes', function () { + $expression = new Expression(new Path([ + new Scope(['text', 'html', 'blade', 'php']), + ]), negated: true); + + expect($expression->matches(['text.html.blade.php']))->toBeFalse(); +}); + +test('a filter correctly matches a set of scopes', function () { + $filter = new Expression(new Filter(new Path([ + new Scope(['text', 'html', 'blade', 'php']), + ]), Prefix::Left)); + + expect($filter->matches(['text.html.blade.php']))->toBeTrue(); +}); + +test('a scope with wildcards can match another scope', function () { + $scope = new Scope(['text', 'html', '*', 'php']); + + expect($scope->matches(Scope::fromString('text.html.blade.php')))->toBeTrue(); + expect($scope->matches(Scope::fromString('text.html.twig.php')))->toBeTrue(); +}); + +test('a scope with less parts than comparison does not match', function () { + $scope = new Scope(['text', 'html', 'blade', 'php']); + + expect($scope->matches(Scope::fromString('text.html.blade')))->toBeFalse(); +}); diff --git a/tests/Unit/InjectionParserTest.php b/tests/Unit/InjectionParserTest.php new file mode 100644 index 0000000..a2fecd5 --- /dev/null +++ b/tests/Unit/InjectionParserTest.php @@ -0,0 +1,178 @@ +getSelector(); + + expect($selector)->toBeInstanceOf(Selector::class); + expect($selector->composites)->toBeArray(); + expect($selector->composites)->toHaveCount(1); + + $composite = $selector->composites[0]; + + expect($composite->expressions)->toBeArray(); + expect($composite->expressions)->toHaveCount(1); + + $expression = $composite->expressions[0]; + + expect($expression->child)->toBeInstanceOf(Path::class); + expect($expression->child->scopes)->toBeArray(); + expect($expression->child->scopes)->toHaveCount(1); + + $scope = $expression->child->scopes[0]; + + expect($scope->__toString())->toBe('text.html.blade.php'); + }); + + it('can parse a multi-part path', function () { + $injection = injection('text.html.blade.php meta.tag'); + + $scopes = $injection->getSelector()->composites[0]->expressions[0]->child->scopes; + + expect($scopes[0]->__toString())->toBe('text.html.blade.php'); + expect($scopes[1]->__toString())->toBe('meta.tag'); + }); + + it('can parse a left-prefixed path', function () { + $injection = injection('L:text.html.blade.php'); + + $filter = $injection->getSelector()->composites[0]->expressions[0]->child; + + expect($filter)->toBeInstanceOf(Filter::class); + expect($filter->prefix)->toBe(Prefix::Left); + + $path = $filter->child; + + expect($path)->toBeInstanceOf(Path::class); + expect($path->scopes)->toBeArray(); + expect($path->scopes)->toHaveCount(1); + + $scope = $path->scopes[0]; + + expect($scope->__toString())->toBe('text.html.blade.php'); + }); + + it('can parse a right-prefixed path', function () { + $injection = injection('R:text.html.blade.php'); + + $filter = $injection->getSelector()->composites[0]->expressions[0]->child; + + expect($filter)->toBeInstanceOf(Filter::class); + expect($filter->prefix)->toBe(Prefix::Right); + + $path = $filter->child; + + expect($path)->toBeInstanceOf(Path::class); + expect($path->scopes)->toBeArray(); + expect($path->scopes)->toHaveCount(1); + + $scope = $path->scopes[0]; + + expect($scope->__toString())->toBe('text.html.blade.php'); + }); + + it('can parse a grouped path', function () { + $injection = injection('(text.html.blade.php)'); + + $group = $injection->getSelector()->composites[0]->expressions[0]->child; + + expect($group)->toBeInstanceOf(Group::class); + + $path = $group->child; + + expect($path)->toBeInstanceOf(Selector::class); + + $scope = $path->composites[0]->expressions[0]->child->scopes[0]; + + expect($scope->__toString())->toBe('text.html.blade.php'); + }); + + it('can parse a grouped path with a prefix', function () { + $injection = injection('L:(text.html.blade.php)'); + + $filter = $injection->getSelector()->composites[0]->expressions[0]->child; + + expect($filter)->toBeInstanceOf(Filter::class); + expect($filter->prefix)->toBe(Prefix::Left); + + $group = $filter->child; + + expect($group)->toBeInstanceOf(Group::class); + + $path = $group->child; + + expect($path)->toBeInstanceOf(Selector::class); + + $scope = $path->composites[0]->expressions[0]->child->scopes[0]; + + expect($scope->__toString())->toBe('text.html.blade.php'); + }); + + it('can parse comma-separated paths', function () { + $injection = injection('text.html.blade.php, meta.tag'); + + $first = $injection->getSelector()->composites[0]->expressions[0]->child->scopes; + + expect($first[0]->__toString())->toBe('text.html.blade.php'); + + $second = $injection->getSelector()->composites[1]->expressions[0]->child->scopes; + + expect($second[0]->__toString())->toBe('meta.tag'); + }); + + it('can parse a negated path', function () { + $injection = injection('text.html.php.blade - meta.tag'); + + $first = $injection->getSelector()->composites[0]->expressions[0]->child->scopes[0]; + + expect($first->__toString())->toBe('text.html.php.blade'); + + $second = $injection->getSelector()->composites[0]->expressions[1]; + + expect($second->operator)->toBe(Operator::Not); + expect($second->child->scopes[0]->__toString())->toBe('meta.tag'); + }); + + it('can parse a group with or operators', function () { + $injection = injection('(text.html.blade.php | meta.tag)'); + + $group = $injection->getSelector()->composites[0]->expressions[0]->child; + + expect($group)->toBeInstanceOf(Group::class); + + $first = $group->child->composites[0]->expressions[0]->child->scopes[0]; + + expect($first->__toString())->toBe('text.html.blade.php'); + + $second = $group->child->composites[0]->expressions[1]; + + expect($second->operator)->toBe(Operator::Or); + expect($second->child->scopes[0]->__toString())->toBe('meta.tag'); + }); +}); + +function injection(string $selector): Injection +{ + $grammar = Grammar::parse([ + 'scopeName' => 'source.test', + 'injections' => [ + $selector => [ + 'patterns' => [], + ], + ], + 'patterns' => [], + ]); + + return $grammar->getInjections()[0]; +} diff --git a/tests/Unit/PhikiTest.php b/tests/Unit/PhikiTest.php new file mode 100644 index 0000000..c12236a --- /dev/null +++ b/tests/Unit/PhikiTest.php @@ -0,0 +1,17 @@ +toBeInstanceOf(Phiki::class); + }); + + it('can generate html from code', function () { + expect(Phiki::default()->codeToHtml(<<<'PHP' + function add(int|float $a, int|float $b): int|float { + return $a + $b; + } + PHP, 'php', 'github-dark'))->toBeString(); + }); +}); diff --git a/tests/Unit/ThemeRepositoryTest.php b/tests/Unit/ThemeRepositoryTest.php new file mode 100644 index 0000000..71aba0c --- /dev/null +++ b/tests/Unit/ThemeRepositoryTest.php @@ -0,0 +1,48 @@ +toBeInstanceOf(ThemeRepository::class); + }); + + it('can check for the existence of a grammar', function () { + $themeRepository = new ThemeRepository; + + expect($themeRepository->has('github-dark'))->toBeTrue(); + }); + + it('can get a grammar', function () { + $themeRepository = new ThemeRepository; + $grammar = $themeRepository->get('github-dark'); + + expect($grammar) + ->toBeArray(); + }); + + it('can register a custom grammar using a file path', function () { + $themeRepository = new ThemeRepository; + $themeRepository->register('example', __DIR__.'/../Fixtures/theme.json'); + + $grammar = $themeRepository->get('example'); + + expect($grammar) + ->toBeArray(); + }); + + it('can register a custom grammar using a grammar array', function () { + $themeRepository = new ThemeRepository; + $themeRepository->register('example', [ + 'colors' => [ + 'editor.background' => '#000000', + 'editor.foreground' => '#ffffff', + ], + ]); + + $grammar = $themeRepository->get('example'); + + expect($grammar) + ->toBeArray(); + }); +}); diff --git a/tests/Unit/ThemeStylesTest.php b/tests/Unit/ThemeStylesTest.php new file mode 100644 index 0000000..4f73dee --- /dev/null +++ b/tests/Unit/ThemeStylesTest.php @@ -0,0 +1,59 @@ + [ + 'editor.background' => '#000', + 'editor.foreground' => '#fff', + ], + ]); + + expect($styles)->toBeInstanceOf(ThemeStyles::class); + }); + + it('can resolve style settings for the given scope', function () { + $styles = new ThemeStyles([ + 'colors' => [ + 'editor.background' => '#000', + 'editor.foreground' => '#fff', + ], + 'tokenColors' => [ + [ + 'scope' => 'comment', + 'settings' => [ + 'fontStyle' => 'italic', + 'foreground' => '#888', + ], + ], + [ + 'scope' => [ + 'keyword', + ], + 'settings' => [ + 'foreground' => '#f97583', + ], + ], + ], + ]); + + $settings = $styles->resolve('comment'); + + expect($settings)->toEqualCanonicalizing(new TokenSettings( + null, + '#888', + 'italic' + )); + + $settings = $styles->resolve('keyword.function.test'); + + expect($settings)->toEqualCanonicalizing(new TokenSettings( + null, + '#f97583', + null + )); + }); +}); diff --git a/tests/Unit/TokenSettingsTest.php b/tests/Unit/TokenSettingsTest.php new file mode 100644 index 0000000..efe741b --- /dev/null +++ b/tests/Unit/TokenSettingsTest.php @@ -0,0 +1,69 @@ +toBeInstanceOf(TokenSettings::class); + }); + + it('can generate a style string with foreground', function () { + $settings = new TokenSettings(null, '#fff', null); + + expect($settings->toStyleString())->toBe('color: #fff;'); + }); + + it('can generate a style string with background', function () { + $settings = new TokenSettings('#000', null, null); + + expect($settings->toStyleString())->toBe('background-color: #000;'); + }); + + it('can generate a style string with font style italic', function () { + $settings = new TokenSettings(null, null, 'italic'); + + expect($settings->toStyleString())->toBe('font-style: italic;'); + }); + + it('can generate a style string with font style bold', function () { + $settings = new TokenSettings(null, null, 'bold'); + + expect($settings->toStyleString())->toBe('font-weight: bold;'); + }); + + it('can generate a style string with font style underline', function () { + $settings = new TokenSettings(null, null, 'underline'); + + expect($settings->toStyleString())->toBe('text-decoration: underline;'); + }); + + it('can generate a style string with font style strikethrough', function () { + $settings = new TokenSettings(null, null, 'strikethrough'); + + expect($settings->toStyleString())->toBe('text-decoration: line-through;'); + }); + + it('can generate a style string with multiple font styles', function () { + $settings = new TokenSettings(null, null, 'italic underline'); + + expect($settings->toStyleString())->toBe('font-style: italic;text-decoration: underline;'); + }); + + it('can generate a style string with multiple font styles in any order', function () { + $settings = new TokenSettings(null, null, 'underline italic'); + + expect($settings->toStyleString())->toBe('text-decoration: underline;font-style: italic;'); + }); + + it('can generate a style string with multiple font styles and foreground', function () { + $settings = new TokenSettings(null, '#fff', 'underline italic'); + + expect($settings->toStyleString())->toBe('color: #fff;text-decoration: underline;font-style: italic;'); + }); + + it('can generate a style string with multiple font styles and background', function () { + $settings = new TokenSettings('#000', null, 'underline italic'); + + expect($settings->toStyleString())->toBe('background-color: #000;text-decoration: underline;font-style: italic;'); + }); +}); diff --git a/tests/Unit/TokenizerTest.php b/tests/Unit/TokenizerTest.php new file mode 100644 index 0000000..e480750 --- /dev/null +++ b/tests/Unit/TokenizerTest.php @@ -0,0 +1,615 @@ + 'source.test', + 'patterns' => [ + [ + 'name' => 'keyword.control.test', + 'match' => '\\b(if|else|while|end)\\b', + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'keyword.control.test'], 'if', 0, 2), + new Token(['source.test'], ' ', 2, 3), + new Token(['source.test', 'keyword.control.test'], 'else', 3, 7), + new Token(['source.test'], ' ', 7, 8), + new Token(['source.test', 'keyword.control.test'], 'while', 8, 13), + new Token(['source.test'], ' ', 13, 14), + new Token(['source.test', 'keyword.control.test'], 'end', 14, 17), + new Token(['source.test'], "\n", 17, 17), + ], + ]); + }); + + it('can tokenize a simple match with simple named captures', function () { + $tokens = tokenize('function foo() {}', [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'meta.function.test', + 'match' => '(function)\\s*([a-zA-Z_\\x{7f}-\\x{10ffff}][a-zA-Z0-9_\\x{7f}-\\x{10ffff}]*)', + 'captures' => [ + '1' => [ + 'name' => 'storage.type.function.test', + ], + '2' => [ + 'name' => 'entity.name.function.test', + ], + ], + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'meta.function.test', 'storage.type.function.test'], 'function', 0, 8), + new Token(['source.test', 'meta.function.test'], ' ', 8, 9), + new Token(['source.test', 'meta.function.test', 'entity.name.function.test'], 'foo', 9, 12), + new Token(['source.test'], "() {}\n", 12, 17), + ], + ]); + }); + + it('can tokenize a match with captures and subpatterns, where the subpatterns are not found', function () { + $tokens = tokenize('namespace Foo;', [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'meta.namespace.test', + 'match' => '(?i)(?:^|(?<=<\\?php))\\s*(namespace)\\s+([a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)(?=\\s*;)', + 'captures' => [ + '1' => [ + 'name' => 'keyword.other.namespace.test', + ], + '2' => [ + 'name' => 'entity.name.type.namespace.test', + 'patterns' => [ + [ + 'match' => '\\\\', + 'name' => 'punctuation.separator.inheritance.test', + ], + ], + ], + ], + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'meta.namespace.test', 'keyword.other.namespace.test'], 'namespace', 0, 9), + new Token(['source.test', 'meta.namespace.test'], ' ', 9, 10), + new Token(['source.test', 'meta.namespace.test', 'entity.name.type.namespace.test'], 'Foo', 10, 13), + new Token(['source.test'], ";\n", 13, 14), + ], + ]); + }); + + it('can tokenize a match with captures and subpatterns, where the subpatterns are found', function () { + $tokens = tokenize('namespace Foo\\Bar\\Baz;', [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'meta.namespace.test', + 'match' => '(?i)(?:^|(?<=<\\?php))\\s*(namespace)\\s+([a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)(?=\\s*;)', + 'captures' => [ + '1' => [ + 'name' => 'keyword.other.namespace.test', + ], + '2' => [ + 'name' => 'entity.name.type.namespace.test', + 'patterns' => [ + [ + 'match' => '\\\\', + 'name' => 'punctuation.separator.inheritance.test', + ], + ], + ], + ], + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'meta.namespace.test', 'keyword.other.namespace.test'], 'namespace', 0, 9), + new Token(['source.test', 'meta.namespace.test'], ' ', 9, 10), + new Token(['source.test', 'meta.namespace.test', 'entity.name.type.namespace.test'], 'Foo', 10, 13), + new Token(['source.test', 'meta.namespace.test', 'entity.name.type.namespace.test', 'punctuation.separator.inheritance.test'], '\\', 13, 14), + new Token(['source.test', 'meta.namespace.test', 'entity.name.type.namespace.test'], 'Bar', 14, 17), + new Token(['source.test', 'meta.namespace.test', 'entity.name.type.namespace.test', 'punctuation.separator.inheritance.test'], '\\', 17, 18), + new Token(['source.test', 'meta.namespace.test', 'entity.name.type.namespace.test'], 'Baz', 18, 21), + new Token(['source.test'], ";\n", 21, 22), + ], + ]); + }); +}); + +describe('subpattern includes', function () { + it('can tokenize an include with only subpatterns', function () { + $tokens = tokenize('$hello', [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'include' => '#variable-name', + ], + ], + 'repository' => [ + 'variable-name' => [ + 'patterns' => [ + [ + 'captures' => [ + '1' => [ + 'name' => 'variable.other.php', + ], + '10' => [ + 'name' => 'string.unquoted.index.php', + ], + '11' => [ + 'name' => 'punctuation.section.array.end.php', + ], + '2' => [ + 'name' => 'punctuation.definition.variable.php', + ], + '4' => [ + 'name' => 'keyword.operator.class.php', + ], + '5' => [ + 'name' => 'variable.other.property.php', + ], + '6' => [ + 'name' => 'punctuation.section.array.begin.php', + ], + '7' => [ + 'name' => 'constant.numeric.index.php', + ], + '8' => [ + 'name' => 'variable.other.index.php', + ], + '9' => [ + 'name' => 'punctuation.definition.variable.php', + ], + ], + 'match' => '(?i)((\\$)(?[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*))\\s*(?:(\\??->)\\s*(\\g)|(\\[)(?:(\\d+)|((\$)\\g)|([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*))(\\]))?', + ], + [ + 'captures' => [ + '1' => [ + 'name' => 'variable.other.php', + ], + '2' => [ + 'name' => 'punctuation.definition.variable.php', + ], + '4' => [ + 'name' => 'punctuation.definition.variable.php', + ], + ], + 'match' => '(?i)((\\${)(?[a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)(}))', + ], + ], + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'variable.other.php', 'punctuation.definition.variable.php'], '$', 0, 1), + new Token(['source.test', 'variable.other.php'], 'hello', 1, 6), + new Token(['source.test'], "\n", 6, 7), + ], + ]); + }); +}); + +describe('begin/end', function () { + it('can tokenize a simple begin/end pattern without captures and subpatterns', function () { + $tokens = tokenize('begin end', [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'meta.block.test', + 'begin' => '\\b(begin)\\b', + 'end' => '\\b(end)\\b', + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'meta.block.test'], 'begin', 0, 5), + new Token(['source.test', 'meta.block.test'], ' ', 5, 6), + new Token(['source.test', 'meta.block.test'], 'end', 6, 9), + new Token(['source.test'], "\n", 9, 9), + ], + ]); + }); + + it('can tokenize a simple begin/end pattern with beginCaptures and endCaptures', function () { + $tokens = tokenize('begin end', [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'meta.block.test', + 'begin' => '\\b(begin)\\b', + 'beginCaptures' => [ + '1' => [ + 'name' => 'keyword.control.test', + ], + ], + 'end' => '\\b(end)\\b', + 'endCaptures' => [ + '1' => [ + 'name' => 'keyword.control.test', + ], + ], + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'meta.block.test', 'keyword.control.test'], 'begin', 0, 5), + new Token(['source.test', 'meta.block.test'], ' ', 5, 6), + new Token(['source.test', 'meta.block.test', 'keyword.control.test'], 'end', 6, 9), + new Token(['source.test'], "\n", 9, 9), + ], + ]); + }); + + it('can tokenize a simple begin/end patterns with captures', function () { + $tokens = tokenize('begin end', [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'meta.block.test', + 'begin' => '\\b(begin)\\b', + 'end' => '\\b(end)\\b', + 'captures' => [ + '1' => [ + 'name' => 'keyword.control.test', + ], + ], + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'meta.block.test', 'keyword.control.test'], 'begin', 0, 5), + new Token(['source.test', 'meta.block.test'], ' ', 5, 6), + new Token(['source.test', 'meta.block.test', 'keyword.control.test'], 'end', 6, 9), + new Token(['source.test'], "\n", 9, 9), + ], + ]); + }); + + it('can tokenize a simple begin/end pattern with beginCaptures that have subpatterns', function () { + $tokens = tokenize('begin end', [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'meta.block.test', + 'begin' => '\\b(begin)\\b', + 'beginCaptures' => [ + '1' => [ + 'name' => 'keyword.control.test', + 'patterns' => [ + [ + 'match' => 'begin', + 'name' => 'keyword.control.begin.test', + ], + ], + ], + ], + 'end' => '\\b(end)\\b', + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'meta.block.test', 'keyword.control.test', 'keyword.control.begin.test'], 'begin', 0, 5), + new Token(['source.test', 'meta.block.test'], ' ', 5, 6), + new Token(['source.test', 'meta.block.test'], 'end', 6, 9), + new Token(['source.test'], "\n", 9, 9), + ], + ]); + }); + + it('can tokenize a simple begin/end pattern with endCaptures that have subpatterns', function () { + $tokens = tokenize('begin end', [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'meta.block.test', + 'begin' => '\\b(begin)\\b', + 'end' => '\\b(end)\\b', + 'endCaptures' => [ + '1' => [ + 'name' => 'keyword.control.test', + 'patterns' => [ + [ + 'match' => 'end', + 'name' => 'keyword.control.end.test', + ], + ], + ], + ], + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'meta.block.test'], 'begin', 0, 5), + new Token(['source.test', 'meta.block.test'], ' ', 5, 6), + new Token(['source.test', 'meta.block.test', 'keyword.control.test', 'keyword.control.end.test'], 'end', 6, 9), + new Token(['source.test'], "\n", 9, 9), + ], + ]); + }); + + it('can tokenize a simple begin/end pattern that has captures with subpatterns', function () { + $tokens = tokenize('begin end', [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'meta.block.test', + 'begin' => '\\b(begin)\\b', + 'end' => '\\b(end)\\b', + 'captures' => [ + '1' => [ + 'name' => 'keyword.control.test', + 'patterns' => [ + [ + 'match' => 'begin', + 'name' => 'keyword.control.begin.test', + ], + [ + 'match' => 'end', + 'name' => 'keyword.control.end.test', + ], + ], + ], + ], + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'meta.block.test', 'keyword.control.test', 'keyword.control.begin.test'], 'begin', 0, 5), + new Token(['source.test', 'meta.block.test'], ' ', 5, 6), + new Token(['source.test', 'meta.block.test', 'keyword.control.test', 'keyword.control.end.test'], 'end', 6, 9), + new Token(['source.test'], "\n", 9, 9), + ], + ]); + }); + + it('can tokenize a begin/end pattern with subpatterns between begin and end', function () { + $tokens = tokenize('begin foo end', [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'meta.block.test', + 'begin' => '\\b(begin)\\b', + 'end' => '\\b(end)\\b', + 'patterns' => [ + [ + 'name' => 'entity.name.test', + 'match' => '\\b(foo)\\b', + ], + ], + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'meta.block.test'], 'begin', 0, 5), + new Token(['source.test', 'meta.block.test'], ' ', 5, 6), + new Token(['source.test', 'meta.block.test', 'entity.name.test'], 'foo', 6, 9), + new Token(['source.test', 'meta.block.test'], ' ', 9, 10), + new Token(['source.test', 'meta.block.test'], 'end', 10, 13), + new Token(['source.test'], "\n", 13, 13), + ], + ]); + }); + + it('can tokenize a begin/end pattern with subpatterns between begin and end that have captures', function () { + $tokens = tokenize('begin foo end', [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'meta.block.test', + 'begin' => '\\b(begin)\\b', + 'end' => '\\b(end)\\b', + 'patterns' => [ + [ + 'name' => 'entity.name.test', + 'match' => '\\b(foo)\\b', + 'captures' => [ + '1' => [ + 'name' => 'entity.name.foo.test', + ], + ], + ], + ], + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'meta.block.test'], 'begin', 0, 5), + new Token(['source.test', 'meta.block.test'], ' ', 5, 6), + new Token(['source.test', 'meta.block.test', 'entity.name.test', 'entity.name.foo.test'], 'foo', 6, 9), + new Token(['source.test', 'meta.block.test'], ' ', 9, 10), + new Token(['source.test', 'meta.block.test'], 'end', 10, 13), + new Token(['source.test'], "\n", 13, 13), + ], + ]); + }); + + it('can tokenize a begin/end patterns that have subpatterns and span multiple lines', function () { + $tokens = tokenize(<<<'TEST' + begin + foo + end + TEST, [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'meta.block.test', + 'begin' => '\\b(begin)\\b', + 'end' => '\\b(end)\\b', + 'patterns' => [ + [ + 'name' => 'entity.name.test', + 'match' => '\\b(foo)\\b', + ], + ], + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'meta.block.test'], 'begin', 0, 5), + new Token(['source.test', 'meta.block.test'], "\n", 5, 5), + ], + [ + new Token(['source.test', 'meta.block.test'], ' ', 0, 4), + new Token(['source.test', 'meta.block.test', 'entity.name.test'], 'foo', 4, 7), + new Token(['source.test', 'meta.block.test'], "\n", 7, 7), + ], + [ + new Token(['source.test', 'meta.block.test'], 'end', 0, 3), + new Token(['source.test'], "\n", 3, 3), + ], + ]); + }); + + it('can tokenize a begin/end patterns that have captures with subpatterns that have captures', function () { + $tokens = tokenize(<<<'TEST' + begin + foo + end + TEST, [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'meta.block.test', + 'begin' => '\\b(begin)\\b', + 'end' => '\\b(end)\\b', + 'captures' => [ + '1' => [ + 'name' => 'keyword.control.test', + 'patterns' => [ + [ + 'match' => 'begin', + 'name' => 'keyword.control.begin.test', + ], + [ + 'match' => 'end', + 'name' => 'keyword.control.end.test', + ], + ], + ], + ], + 'patterns' => [ + [ + 'name' => 'entity.name.test', + 'match' => '\\b(foo)\\b', + 'captures' => [ + '1' => [ + 'name' => 'entity.name.foo.test', + ], + ], + ], + ], + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'meta.block.test', 'keyword.control.test', 'keyword.control.begin.test'], 'begin', 0, 5), + new Token(['source.test', 'meta.block.test'], "\n", 5, 5), + ], + [ + new Token(['source.test', 'meta.block.test'], ' ', 0, 4), + new Token(['source.test', 'meta.block.test', 'entity.name.test', 'entity.name.foo.test'], 'foo', 4, 7), + new Token(['source.test', 'meta.block.test'], "\n", 7, 7), + ], + [ + new Token(['source.test', 'meta.block.test', 'keyword.control.test', 'keyword.control.end.test'], 'end', 0, 3), + new Token(['source.test'], "\n", 3, 3), + ], + ]); + }); + + it('adds contentName to the scope stack when processing begin/end patterns', function () { + $tokens = tokenize('begin foo end', [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'meta.block.test', + 'begin' => '\\b(begin)\\b', + 'end' => '\\b(end)\\b', + 'contentName' => 'meta.begin.end.block.test', + 'patterns' => [ + [ + 'name' => 'entity.name.test', + 'match' => '\\b(foo)\\b', + ], + ], + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'meta.block.test'], 'begin', 0, 5), + new Token(['source.test', 'meta.block.test', 'meta.begin.end.block.test'], ' ', 5, 6), + new Token(['source.test', 'meta.block.test', 'meta.begin.end.block.test', 'entity.name.test'], 'foo', 6, 9), + new Token(['source.test', 'meta.block.test', 'meta.begin.end.block.test'], ' ', 9, 10), + new Token(['source.test', 'meta.block.test'], 'end', 10, 13), + new Token(['source.test'], "\n", 13, 13), + ], + ]); + }); +}); + +describe('scopes', function () { + it('correctly replaces capture references inside of scope names', function () { + $tokens = tokenize('foo', [ + 'scopeName' => 'source.test', + 'patterns' => [ + [ + 'name' => 'entity.name.test', + 'match' => '\\b(foo)\\b', + 'captures' => [ + '1' => [ + 'name' => 'entity.name.$1.test', + ], + ], + ], + ], + ]); + + expect($tokens)->toEqualCanonicalizing([ + [ + new Token(['source.test', 'entity.name.test', 'entity.name.foo.test'], 'foo', 0, 3), + new Token(['source.test'], "\n", 3, 3), + ], + ]); + }); +}); diff --git a/themes/github-dark.json b/themes/github-dark.json new file mode 100644 index 0000000..eaba2a0 --- /dev/null +++ b/themes/github-dark.json @@ -0,0 +1,544 @@ +{ + "colors": { + "activityBar.activeBorder": "#f9826c", + "activityBar.background": "#24292e", + "activityBar.border": "#1b1f23", + "activityBar.foreground": "#e1e4e8", + "activityBar.inactiveForeground": "#6a737d", + "activityBarBadge.background": "#0366d6", + "activityBarBadge.foreground": "#fff", + "badge.background": "#044289", + "badge.foreground": "#c8e1ff", + "breadcrumb.activeSelectionForeground": "#d1d5da", + "breadcrumb.focusForeground": "#e1e4e8", + "breadcrumb.foreground": "#959da5", + "breadcrumbPicker.background": "#2b3036", + "button.background": "#176f2c", + "button.foreground": "#dcffe4", + "button.hoverBackground": "#22863a", + "button.secondaryBackground": "#444d56", + "button.secondaryForeground": "#fff", + "button.secondaryHoverBackground": "#586069", + "checkbox.background": "#444d56", + "checkbox.border": "#1b1f23", + "debugToolBar.background": "#2b3036", + "descriptionForeground": "#959da5", + "diffEditor.insertedTextBackground": "#28a74530", + "diffEditor.removedTextBackground": "#d73a4930", + "dropdown.background": "#2f363d", + "dropdown.border": "#1b1f23", + "dropdown.foreground": "#e1e4e8", + "dropdown.listBackground": "#24292e", + "editor.background": "#24292e", + "editor.findMatchBackground": "#ffd33d44", + "editor.findMatchHighlightBackground": "#ffd33d22", + "editor.focusedStackFrameHighlightBackground": "#2b6a3033", + "editor.foldBackground": "#58606915", + "editor.foreground": "#e1e4e8", + "editor.inactiveSelectionBackground": "#3392FF22", + "editor.lineHighlightBackground": "#2b3036", + "editor.linkedEditingBackground": "#3392FF22", + "editor.selectionBackground": "#3392FF44", + "editor.selectionHighlightBackground": "#17E5E633", + "editor.selectionHighlightBorder": "#17E5E600", + "editor.stackFrameHighlightBackground": "#C6902625", + "editor.wordHighlightBackground": "#17E5E600", + "editor.wordHighlightBorder": "#17E5E699", + "editor.wordHighlightStrongBackground": "#17E5E600", + "editor.wordHighlightStrongBorder": "#17E5E666", + "editorBracketHighlight.foreground1": "#79b8ff", + "editorBracketHighlight.foreground2": "#ffab70", + "editorBracketHighlight.foreground3": "#b392f0", + "editorBracketHighlight.foreground4": "#79b8ff", + "editorBracketHighlight.foreground5": "#ffab70", + "editorBracketHighlight.foreground6": "#b392f0", + "editorBracketMatch.background": "#17E5E650", + "editorBracketMatch.border": "#17E5E600", + "editorCursor.foreground": "#c8e1ff", + "editorError.foreground": "#f97583", + "editorGroup.border": "#1b1f23", + "editorGroupHeader.tabsBackground": "#1f2428", + "editorGroupHeader.tabsBorder": "#1b1f23", + "editorGutter.addedBackground": "#28a745", + "editorGutter.deletedBackground": "#ea4a5a", + "editorGutter.modifiedBackground": "#2188ff", + "editorIndentGuide.activeBackground": "#444d56", + "editorIndentGuide.background": "#2f363d", + "editorLineNumber.activeForeground": "#e1e4e8", + "editorLineNumber.foreground": "#444d56", + "editorOverviewRuler.border": "#1b1f23", + "editorWarning.foreground": "#ffea7f", + "editorWhitespace.foreground": "#444d56", + "editorWidget.background": "#1f2428", + "errorForeground": "#f97583", + "focusBorder": "#005cc5", + "foreground": "#d1d5da", + "gitDecoration.addedResourceForeground": "#34d058", + "gitDecoration.conflictingResourceForeground": "#ffab70", + "gitDecoration.deletedResourceForeground": "#ea4a5a", + "gitDecoration.ignoredResourceForeground": "#6a737d", + "gitDecoration.modifiedResourceForeground": "#79b8ff", + "gitDecoration.submoduleResourceForeground": "#6a737d", + "gitDecoration.untrackedResourceForeground": "#34d058", + "input.background": "#2f363d", + "input.border": "#1b1f23", + "input.foreground": "#e1e4e8", + "input.placeholderForeground": "#959da5", + "list.activeSelectionBackground": "#39414a", + "list.activeSelectionForeground": "#e1e4e8", + "list.focusBackground": "#044289", + "list.hoverBackground": "#282e34", + "list.hoverForeground": "#e1e4e8", + "list.inactiveFocusBackground": "#1d2d3e", + "list.inactiveSelectionBackground": "#282e34", + "list.inactiveSelectionForeground": "#e1e4e8", + "notificationCenterHeader.background": "#24292e", + "notificationCenterHeader.foreground": "#959da5", + "notifications.background": "#2f363d", + "notifications.border": "#1b1f23", + "notifications.foreground": "#e1e4e8", + "notificationsErrorIcon.foreground": "#ea4a5a", + "notificationsInfoIcon.foreground": "#79b8ff", + "notificationsWarningIcon.foreground": "#ffab70", + "panel.background": "#1f2428", + "panel.border": "#1b1f23", + "panelInput.border": "#2f363d", + "panelTitle.activeBorder": "#f9826c", + "panelTitle.activeForeground": "#e1e4e8", + "panelTitle.inactiveForeground": "#959da5", + "peekViewEditor.background": "#1f242888", + "peekViewEditor.matchHighlightBackground": "#ffd33d33", + "peekViewResult.background": "#1f2428", + "peekViewResult.matchHighlightBackground": "#ffd33d33", + "pickerGroup.border": "#444d56", + "pickerGroup.foreground": "#e1e4e8", + "progressBar.background": "#0366d6", + "quickInput.background": "#24292e", + "quickInput.foreground": "#e1e4e8", + "scrollbar.shadow": "#0008", + "scrollbarSlider.activeBackground": "#6a737d88", + "scrollbarSlider.background": "#6a737d33", + "scrollbarSlider.hoverBackground": "#6a737d44", + "settings.headerForeground": "#e1e4e8", + "settings.modifiedItemIndicator": "#0366d6", + "sideBar.background": "#1f2428", + "sideBar.border": "#1b1f23", + "sideBar.foreground": "#d1d5da", + "sideBarSectionHeader.background": "#1f2428", + "sideBarSectionHeader.border": "#1b1f23", + "sideBarSectionHeader.foreground": "#e1e4e8", + "sideBarTitle.foreground": "#e1e4e8", + "statusBar.background": "#24292e", + "statusBar.border": "#1b1f23", + "statusBar.debuggingBackground": "#931c06", + "statusBar.debuggingForeground": "#fff", + "statusBar.foreground": "#d1d5da", + "statusBar.noFolderBackground": "#24292e", + "statusBarItem.prominentBackground": "#282e34", + "statusBarItem.remoteBackground": "#24292e", + "statusBarItem.remoteForeground": "#d1d5da", + "tab.activeBackground": "#24292e", + "tab.activeBorder": "#24292e", + "tab.activeBorderTop": "#f9826c", + "tab.activeForeground": "#e1e4e8", + "tab.border": "#1b1f23", + "tab.hoverBackground": "#24292e", + "tab.inactiveBackground": "#1f2428", + "tab.inactiveForeground": "#959da5", + "tab.unfocusedActiveBorder": "#24292e", + "tab.unfocusedActiveBorderTop": "#1b1f23", + "tab.unfocusedHoverBackground": "#24292e", + "terminal.ansiBlack": "#586069", + "terminal.ansiBlue": "#2188ff", + "terminal.ansiBrightBlack": "#959da5", + "terminal.ansiBrightBlue": "#79b8ff", + "terminal.ansiBrightCyan": "#56d4dd", + "terminal.ansiBrightGreen": "#85e89d", + "terminal.ansiBrightMagenta": "#b392f0", + "terminal.ansiBrightRed": "#f97583", + "terminal.ansiBrightWhite": "#fafbfc", + "terminal.ansiBrightYellow": "#ffea7f", + "terminal.ansiCyan": "#39c5cf", + "terminal.ansiGreen": "#34d058", + "terminal.ansiMagenta": "#b392f0", + "terminal.ansiRed": "#ea4a5a", + "terminal.ansiWhite": "#d1d5da", + "terminal.ansiYellow": "#ffea7f", + "terminal.foreground": "#d1d5da", + "terminal.tab.activeBorder": "#f9826c", + "terminalCursor.background": "#586069", + "terminalCursor.foreground": "#79b8ff", + "textBlockQuote.background": "#24292e", + "textBlockQuote.border": "#444d56", + "textCodeBlock.background": "#2f363d", + "textLink.activeForeground": "#c8e1ff", + "textLink.foreground": "#79b8ff", + "textPreformat.foreground": "#d1d5da", + "textSeparator.foreground": "#586069", + "titleBar.activeBackground": "#24292e", + "titleBar.activeForeground": "#e1e4e8", + "titleBar.border": "#1b1f23", + "titleBar.inactiveBackground": "#1f2428", + "titleBar.inactiveForeground": "#959da5", + "tree.indentGuidesStroke": "#2f363d", + "welcomePage.buttonBackground": "#2f363d", + "welcomePage.buttonHoverBackground": "#444d56" + }, + "displayName": "GitHub Dark", + "name": "github-dark", + "semanticHighlighting": true, + "tokenColors": [ + { + "scope": [ + "comment", + "punctuation.definition.comment", + "string.comment" + ], + "settings": { + "foreground": "#6a737d" + } + }, + { + "scope": [ + "constant", + "entity.name.constant", + "variable.other.constant", + "variable.other.enummember", + "variable.language" + ], + "settings": { + "foreground": "#79b8ff" + } + }, + { + "scope": [ + "entity", + "entity.name" + ], + "settings": { + "foreground": "#b392f0" + } + }, + { + "scope": "variable.parameter.function", + "settings": { + "foreground": "#e1e4e8" + } + }, + { + "scope": "entity.name.tag", + "settings": { + "foreground": "#85e89d" + } + }, + { + "scope": "keyword", + "settings": { + "foreground": "#f97583" + } + }, + { + "scope": [ + "storage", + "storage.type" + ], + "settings": { + "foreground": "#f97583" + } + }, + { + "scope": [ + "storage.modifier.package", + "storage.modifier.import", + "storage.type.java" + ], + "settings": { + "foreground": "#e1e4e8" + } + }, + { + "scope": [ + "string", + "punctuation.definition.string", + "string punctuation.section.embedded source" + ], + "settings": { + "foreground": "#9ecbff" + } + }, + { + "scope": "support", + "settings": { + "foreground": "#79b8ff" + } + }, + { + "scope": "meta.property-name", + "settings": { + "foreground": "#79b8ff" + } + }, + { + "scope": "variable", + "settings": { + "foreground": "#ffab70" + } + }, + { + "scope": "variable.other", + "settings": { + "foreground": "#e1e4e8" + } + }, + { + "scope": "invalid.broken", + "settings": { + "fontStyle": "italic", + "foreground": "#fdaeb7" + } + }, + { + "scope": "invalid.deprecated", + "settings": { + "fontStyle": "italic", + "foreground": "#fdaeb7" + } + }, + { + "scope": "invalid.illegal", + "settings": { + "fontStyle": "italic", + "foreground": "#fdaeb7" + } + }, + { + "scope": "invalid.unimplemented", + "settings": { + "fontStyle": "italic", + "foreground": "#fdaeb7" + } + }, + { + "scope": "carriage-return", + "settings": { + "background": "#f97583", + "content": "^M", + "fontStyle": "italic underline", + "foreground": "#24292e" + } + }, + { + "scope": "message.error", + "settings": { + "foreground": "#fdaeb7" + } + }, + { + "scope": "string variable", + "settings": { + "foreground": "#79b8ff" + } + }, + { + "scope": [ + "source.regexp", + "string.regexp" + ], + "settings": { + "foreground": "#dbedff" + } + }, + { + "scope": [ + "string.regexp.character-class", + "string.regexp constant.character.escape", + "string.regexp source.ruby.embedded", + "string.regexp string.regexp.arbitrary-repitition" + ], + "settings": { + "foreground": "#dbedff" + } + }, + { + "scope": "string.regexp constant.character.escape", + "settings": { + "fontStyle": "bold", + "foreground": "#85e89d" + } + }, + { + "scope": "support.constant", + "settings": { + "foreground": "#79b8ff" + } + }, + { + "scope": "support.variable", + "settings": { + "foreground": "#79b8ff" + } + }, + { + "scope": "meta.module-reference", + "settings": { + "foreground": "#79b8ff" + } + }, + { + "scope": "punctuation.definition.list.begin.markdown", + "settings": { + "foreground": "#ffab70" + } + }, + { + "scope": [ + "markup.heading", + "markup.heading entity.name" + ], + "settings": { + "fontStyle": "bold", + "foreground": "#79b8ff" + } + }, + { + "scope": "markup.quote", + "settings": { + "foreground": "#85e89d" + } + }, + { + "scope": "markup.italic", + "settings": { + "fontStyle": "italic", + "foreground": "#e1e4e8" + } + }, + { + "scope": "markup.bold", + "settings": { + "fontStyle": "bold", + "foreground": "#e1e4e8" + } + }, + { + "scope": [ + "markup.underline" + ], + "settings": { + "fontStyle": "underline" + } + }, + { + "scope": [ + "markup.strikethrough" + ], + "settings": { + "fontStyle": "strikethrough" + } + }, + { + "scope": "markup.inline.raw", + "settings": { + "foreground": "#79b8ff" + } + }, + { + "scope": [ + "markup.deleted", + "meta.diff.header.from-file", + "punctuation.definition.deleted" + ], + "settings": { + "background": "#86181d", + "foreground": "#fdaeb7" + } + }, + { + "scope": [ + "markup.inserted", + "meta.diff.header.to-file", + "punctuation.definition.inserted" + ], + "settings": { + "background": "#144620", + "foreground": "#85e89d" + } + }, + { + "scope": [ + "markup.changed", + "punctuation.definition.changed" + ], + "settings": { + "background": "#c24e00", + "foreground": "#ffab70" + } + }, + { + "scope": [ + "markup.ignored", + "markup.untracked" + ], + "settings": { + "background": "#79b8ff", + "foreground": "#2f363d" + } + }, + { + "scope": "meta.diff.range", + "settings": { + "fontStyle": "bold", + "foreground": "#b392f0" + } + }, + { + "scope": "meta.diff.header", + "settings": { + "foreground": "#79b8ff" + } + }, + { + "scope": "meta.separator", + "settings": { + "fontStyle": "bold", + "foreground": "#79b8ff" + } + }, + { + "scope": "meta.output", + "settings": { + "foreground": "#79b8ff" + } + }, + { + "scope": [ + "brackethighlighter.tag", + "brackethighlighter.curly", + "brackethighlighter.round", + "brackethighlighter.square", + "brackethighlighter.angle", + "brackethighlighter.quote" + ], + "settings": { + "foreground": "#d1d5da" + } + }, + { + "scope": "brackethighlighter.unmatched", + "settings": { + "foreground": "#fdaeb7" + } + }, + { + "scope": [ + "constant.other.reference.link", + "string.other.link" + ], + "settings": { + "fontStyle": "underline", + "foreground": "#dbedff" + } + } + ], + "type": "dark" +} \ No newline at end of file