diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..870a9a4f --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +exclude = systemold +ignore = E302, E305, E122, N806, W503 diff --git a/.gitattributes b/.gitattributes index 7e2c355b..53ead2fb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,14 +1,84 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + * text eol=lf + +# Archives. +*.7z binary +*.gz binary +*.jar binary +*.rar binary +*.tar binary +*.zip binary + +# Audio. +*.kar binary +*.m4a binary +*.mid binary +*.midi binary +*.mp3 binary +*.ogg binary +*.ra binary + +# Executables. +*.exe binary +*.pyc binary + +# Fonts. +*.eot binary +*.otf binary +*.ttf binary +*.woff binary +*.woff2 binary + +# Graphics. +*.afdesign binary +*.afphoto binary +*.ai binary +*.bmp binary +*.eps binary +*.gif binary +*.ico binary +*.jng binary +*.jp2 binary +*.jpeg binary +*.jpg binary +*.jpx binary +*.jxr binary +*.pdf binary *.png binary +*.psb binary +*.psd binary +*.svgz binary +*.tif binary +*.tiff binary +*.wbmp binary +*.webp binary -preview export-ignore -tests export-ignore - -.gitattributes export-ignore -.gitignore export-ignore -code-generator.xlsm export-ignore -CONTRIBUTING.md export-ignore -naomi.sublime-commands export-ignore -naomi.sublime-project export-ignore -README.md export-ignore -tests.py export-ignore +# Video. +*.3gp binary +*.3gpp binary +*.as binary +*.asf binary +*.asx binary +*.fla binary +*.flv binary +*.m4v binary +*.mng binary +*.mov binary +*.mp4 binary +*.mpeg binary +*.mpg binary +*.ogv binary +*.swc binary +*.swf binary +*.webm binary diff --git a/.gitignore b/.gitignore index 5ab1b2e1..18d3e407 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,15 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +*.log *.sublime-workspace +systemold diff --git a/.travis.yml b/.travis.yml index 8e4e1d38..fa3d80c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,55 +10,52 @@ # License for the specific language governing permissions and limitations under # the License. -before_install: - - curl -OL https://raw.githubusercontent.com/SublimeText/UnitTesting/master/sbin/travis.sh - # https://docs.travis-ci.com/user/gui-and-headless-browsers - - if [ "$TRAVIS_OS_NAME" == "linux" ]; then - export DISPLAY=:99.0; - sh -e /etc/init.d/xvfb start; - fi +# before_install: +# - curl -OL https://raw.githubusercontent.com/SublimeText/UnitTesting/master/sbin/travis.sh +# # https://docs.travis-ci.com/user/gui-and-headless-browsers +# - if ["$TRAVIS_OS_NAME" == "linux"]; then +# export DISPLAY=:99.0; +# sh -e /etc/init.d/xvfb start; +# fi -env: - global: - - PACKAGE="Naomi" - - SUBLIME_TEXT_VERSION="3" - # - UNITTESTING_TAG="master" +# env: +# global: +# - PACKAGE="Naomi" +# - SUBLIME_TEXT_VERSION="3" + +git: + depth: false install: # Upgrade python on OSX. - - if [ "$TRAVIS_OS_NAME" == "osx" ]; then - brew update; - brew upgrade python; - fi - # Install flake8 and coveralls. + # - if [ "$TRAVIS_OS_NAME" == "osx" ]; then + # brew update; + # brew upgrade python; + # fi + # Install flake8. - if [ "$TRAVIS_OS_NAME" == "linux" ]; then pip install flake8; - pip install python-coveralls; elif [ "$TRAVIS_OS_NAME" == "osx" ]; then pip3 install flake8; - pip3 install python-coveralls; fi - # Bootstrap the testing environment. - - sh travis.sh bootstrap - # Install Package Control and dependencies. - - sh travis.sh install_package_control + # # Bootstrap the testing environment. + # - sh travis.sh bootstrap + # # Install Package Control and dependencies. + # - sh travis.sh install_package_control matrix: include: - os: linux language: python - python: 3.3 - # https://docs.travis-ci.com/user/multi-os/#Python-example-(unsupported-languages) - - os: osx - language: generic + python: 3.4 notifications: email: false script: - # Run python tests. - - sh travis.sh run_tests --coverage - # Run syntax tests. - - sh travis.sh run_syntax_tests + # # Run python tests. + # - sh travis.sh run_tests + # # Run syntax tests. + # - sh travis.sh run_syntax_tests # Lint the plugin. - flake8 diff --git a/Candyman.scsscheme b/Candyman.scsscheme index 3a0d561a..107b8cb1 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -15,10 +15,6 @@ @import 'schemes/candyman/util/repeatString'; @import 'schemes/candyman/main'; -// Old scopes. -@import 'schemes/candyman/old'; - -// New scopes. @import 'schemes/candyman/array'; @import 'schemes/candyman/annotation'; @import 'schemes/candyman/comment'; diff --git a/Candyman.tmTheme b/Candyman.tmTheme index 3e0c295a..43c80c45 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -41,870 +41,6 @@ stippled_underline - - scope - .tag.embedded .entity.name.tag - settings - - foreground - #4dd0e1 - - - - scope - .tag.embedded .punctuation.definition.tag - settings - - foreground - #4DD0E1B2 - - - - scope - .tag.form .entity.name.tag - settings - - foreground - #ffecb3 - - - - scope - .tag.form .punctuation.definition.tag - settings - - foreground - #FFECB3B2 - - - - scope - .entity.name.tag - settings - - foreground - #bcaaa4 - - - - scope - .punctuation.definition.tag - settings - - foreground - #BCAAA4B2 - - - - scope - .tag.sectioning .entity.name.tag - settings - - foreground - #f48fb1 - - - - scope - .tag.sectioning .punctuation.definition.tag - settings - - foreground - #F48FB1B2 - - - - scope - .tag.sectioning.root .entity.name.tag - settings - - foreground - #ce93d8 - - - - scope - .tag.sectioning.root .punctuation.definition.tag - settings - - foreground - #CE93D8B2 - - - - scope - .tag.style .entity.name.tag - settings - - foreground - #ff8a65 - - - - scope - .tag.style .punctuation.definition.tag - settings - - foreground - #FF8A65B2 - - - - scope - .flowtype .entity.name.module - settings - - foreground - #aed581 - - - - scope - .flowtype .keyword.operator.other.association, .flowtype .keyword.operator.other.cast, .flowtype .keyword.operator.other.contravariant, .flowtype .keyword.operator.other.covariant, .flowtype .keyword.operator.other.existential, .flowtype .keyword.operator.other.intersection, .flowtype .keyword.operator.other.nullable, .flowtype .keyword.operator.other.optional, .flowtype .keyword.operator.other.rest, .flowtype .keyword.operator.other.union - settings - - foreground - #bcaaa4 - - - - scope - .flowtype .word .keyword.operator.other - settings - - foreground - #ff80ab - - - - scope - .flowtype .keyword.operator.other.utility - settings - - foreground - #ff80ab - - - - scope - .flowtype .comment .keyword.operator.other.association, .flowtype .comment .keyword.operator.other.cast, .flowtype .comment .keyword.operator.other.contravariant, .flowtype .comment .keyword.operator.other.covariant, .flowtype .comment .keyword.operator.other.existential, .flowtype .comment .keyword.operator.other.intersection, .flowtype .comment .keyword.operator.other.nullable, .flowtype .comment .keyword.operator.other.optional, .flowtype .comment .keyword.operator.other.union - settings - - foreground - #BCAAA4B2 - - - - scope - .flowtype .comment .keyword.operator.other.utility - settings - - foreground - #FF80ABB2 - - - - scope - .flowtype .comment .word .keyword.operator.other - settings - - foreground - #FF80ABB2 - - - - scope - .flowtype .punctuation.definition.array, .flowtype .punctuation.definition.array.begin, .flowtype .punctuation.definition.array.end, .flowtype .punctuation.definition.cast.begin, .flowtype .punctuation.definition.cast.end, .flowtype .punctuation.definition.function.parameters.begin, .flowtype .punctuation.definition.function.parameters.end, .flowtype .punctuation.definition.function.parameters, .flowtype .punctuation.definition.function.result, .flowtype .punctuation.definition.module.body.begin, .flowtype .punctuation.definition.module.body.end, .flowtype .punctuation.definition.nullable.begin, .flowtype .punctuation.definition.nullable.end, .flowtype .punctuation.definition.object.begin, .flowtype .punctuation.definition.object.end, .flowtype .punctuation.definition.object, .flowtype .punctuation.definition.template.arguments.begin, .flowtype .punctuation.definition.template.arguments, .flowtype .punctuation.definition.template.parameters.begin, .flowtype .punctuation.definition.template.parameters.end, .flowtype .punctuation.definition.template.parameters, .flowtype .punctuation.definition.template.arguments.end - settings - - foreground - #bcaaa4 - - - - scope - .flowtype .comment.block .punctuation.definition - settings - - foreground - #BCAAA4B2 - - - - scope - .flowtype .comment.block .punctuation.definition.array, .flowtype .comment.block .punctuation.definition.array.begin, .flowtype .comment.block .punctuation.definition.array.end, .flowtype .comment.block .punctuation.definition.cast.begin, .flowtype .comment.block .punctuation.definition.cast.end, .flowtype .comment.block .punctuation.definition.function.parameters.begin, .flowtype .comment.block .punctuation.definition.function.parameters.end, .flowtype .comment.block .punctuation.definition.function.parameters, .flowtype .comment.block .punctuation.definition.function.result, .flowtype .comment.block .punctuation.definition.module.body.begin, .flowtype .comment.block .punctuation.definition.module.body.end, .flowtype .comment.block .punctuation.definition.nullable.begin, .flowtype .comment.block .punctuation.definition.nullable.end, .flowtype .comment.block .punctuation.definition.object.begin, .flowtype .comment.block .punctuation.definition.object.end, .flowtype .comment.block .punctuation.definition.object, .flowtype .comment.block .punctuation.definition.template.arguments.begin, .flowtype .comment.block .punctuation.definition.template.arguments, .flowtype .comment.block .punctuation.definition.template.parameters.begin, .flowtype .comment.block .punctuation.definition.template.parameters.end, .flowtype .comment.block .punctuation.definition.template.parameters, .flowtype .comment.block .punctuation.definition.template.arguments.end - settings - - foreground - #BCAAA4B2 - - - - scope - .entity.name.decorator, .punctuation.definition.decorator - settings - - foreground - #b39ddb - - - - scope - .destructuring .keyword, .destructuring .keyword.operator.other.association, .destructuring .punctuation.definition, .destructuring .punctuation.definition.array, .destructuring .punctuation.definition.object, .destructuring .punctuation.definition.property - settings - - foreground - #ffffff - - - - scope - .destructuring .object.property .entity.name.variable - settings - - foreground - #ffffff - - - - scope - .eslint .keyword.other, .eslint .punctuation.definition - settings - - foreground - #bcaaa4 - - - - scope - .entity.name.eslint-rule - settings - - foreground - #b39ddb - - - - scope - .export .entity.name.aliased, .export .entity.name.ambiguous - settings - - foreground - #bcaaa4 - - - - scope - .punctuation.definition.export - settings - - foreground - #ffffff - - - - scope - .import .entity.name.aliased, .import .entity.name.ambiguous - settings - - foreground - #bcaaa4 - - - - scope - .punctuation.definition.import - settings - - foreground - #ffffff - - - - scope - .keyword.operator.other.generator - settings - - foreground - #b39ddb - - - - scope - .keyword.operator.other.rest, .keyword.operator.other.spread - settings - - foreground - #ffffff - - - - scope - .keyword.operator.other.association.json - settings - - foreground - #ffffff - - - - scope - .level-1 .punctuation.definition.object.json, .level-1 .punctuation.definition.object.begin.json, .level-1 .punctuation.definition.object.end.json - settings - - foreground - #ce93d8 - - - - scope - .level-1 .string - settings - - foreground - #4dd0e1 - - - - scope - .level-1 .punctuation.definition.string - settings - - foreground - #4DD0E180 - - - - scope - .level-2 .punctuation.definition.object.json, .level-2 .punctuation.definition.object.begin.json, .level-2 .punctuation.definition.object.end.json - settings - - foreground - #4dd0e1 - - - - scope - .level-2 .string - settings - - foreground - #9ccc65 - - - - scope - .level-2 .punctuation.definition.string - settings - - foreground - #AED58180 - - - - scope - .level-3 .punctuation.definition.object.json, .level-3 .punctuation.definition.object.begin.json, .level-3 .punctuation.definition.object.end.json - settings - - foreground - #9ccc65 - - - - scope - .level-3 .string - settings - - foreground - #4db6ac - - - - scope - .level-3 .punctuation.definition.string - settings - - foreground - #4DB6ACB2 - - - - scope - .level-4 .punctuation.definition.object.json, .level-4 .punctuation.definition.object.begin.json, .level-4 .punctuation.definition.object.end.json - settings - - foreground - #4db6ac - - - - scope - .level-4 .string - settings - - foreground - #ffab91 - - - - scope - .level-4 .punctuation.definition.string - settings - - foreground - #FFAB9180 - - - - scope - .level-5 .punctuation.definition.object.json, .level-5 .punctuation.definition.object.begin.json, .level-5 .punctuation.definition.object.end.json - settings - - foreground - #ffab91 - - - - scope - .level-5 .string - settings - - foreground - #ffe082 - - - - scope - .level-5 .punctuation.definition.string - settings - - foreground - #FFE08280 - - - - scope - .level-6 .punctuation.definition.object.json, .level-6 .punctuation.definition.object.begin.json, .level-6 .punctuation.definition.object.end.json - settings - - foreground - #ffe082 - - - - scope - .level-6 .string - settings - - foreground - #f48fb1 - - - - scope - .level-6 .punctuation.definition.string - settings - - foreground - #F48FB180 - - - - scope - .level-7 .punctuation.definition.object.json, .level-7 .punctuation.definition.object.begin.json, .level-7 .punctuation.definition.object.end.json - settings - - foreground - #f48fb1 - - - - scope - .level-7 .string - settings - - foreground - #ce93d8 - - - - scope - .level-7 .punctuation.definition.string - settings - - foreground - #CE93D880 - - - - scope - .component.jsx .entity.name.tag - settings - - foreground - #ffe082 - - - - scope - .component.jsx .punctuation.definition.tag - settings - - foreground - #FFE082B2 - - - - scope - .source.jsx .keyword.operator - settings - - foreground - #CE93D8B2 - - - - scope - .entity.name.attribute - settings - - foreground - #9ccc65 - - - - scope - .section.cdata - settings - - foreground - #ff80ab - - - - scope - .section.cdata .entity.name - settings - - foreground - #ff80ab - - - - scope - .section.cdata .punctuation.definition - settings - - foreground - #FF80ABB2 - - - - scope - .entity.name.data-attribute - settings - - foreground - #ffffff - - - - scope - .declaration.doctype - settings - - foreground - #ff80ab - - - - scope - .declaration.doctype .entity.name - settings - - foreground - #ff80ab - - - - scope - .declaration.doctype .punctuation.definition.declaration - settings - - foreground - #FF80ABB2 - - - - scope - .text.html .keyword.operator - settings - - foreground - #CE93D8B2 - - - - scope - .instruction.prolog - settings - - foreground - #ff80ab - - - - scope - .instruction.prolog .entity.name - settings - - foreground - #ff80ab - - - - scope - .instruction.prolog .punctuation.definition.instruction - settings - - foreground - #FF80ABB2 - - - - scope - .punctuation.definition.code-block - settings - - foreground - #ff80ab - - - - scope - .level-1 .entity.name.header, .level-1 .punctuation.definition.header - settings - - foreground - #ce93d8 - - - - scope - .level-2 .entity.name.header, .level-2 .punctuation.definition.header - settings - - foreground - #4dd0e1 - - - - scope - .level-3 .entity.name.header, .level-3 .punctuation.definition.header - settings - - foreground - #9ccc65 - - - - scope - .level-4 .entity.name.header, .level-4 .punctuation.definition.header - settings - - foreground - #4db6ac - - - - scope - .level-5 .entity.name.header, .level-5 .punctuation.definition.header - settings - - foreground - #ffab91 - - - - scope - .level-6 .entity.name.header, .level-6 .punctuation.definition.header - settings - - foreground - #ffe082 - - - - scope - .support .entity.name.property.mql - settings - - foreground - #ff9e80 - - - - scope - .entity.name.selector - settings - - foreground - #ff80ab - - - - scope - .punctuation.definition.selector - settings - - foreground - #FF80AB80 - - - - scope - .extension .entity.name.selector - settings - - foreground - #e0e0e0 - - - - scope - .extension .punctuation.definition.selector - settings - - foreground - #E0E0E0B2 - - - - scope - .entity.name.selector.class - settings - - foreground - #4dd0e1 - - - - scope - .punctuation.definition.selector.class - settings - - foreground - #4DD0E1B2 - - - - scope - .entity.name.selector.id - settings - - foreground - #ec407a - - - - scope - .punctuation.definition.selector.id - settings - - foreground - #EC407AB2 - - - - scope - .entity.name.selector.placeholder - settings - - foreground - #ffcc80 - - - - scope - .punctuation.definition.selector.placeholder - settings - - foreground - #FFCC8080 - - - - scope - .entity.name.selector.tag - settings - - foreground - #bcaaa4 - - - - scope - .source.css .support .entity.name.attribute, .source.scss .support .entity.name.attribute - settings - - foreground - #aed581 - - - - scope - .source.css .extension .entity.name.attribute, .source.scss .extension .entity.name.attribute - settings - - foreground - #e0e0e0 - - - - scope - .entity.name.mixin, .punctuation.definition.mixin - settings - - foreground - #4fc3f7 - - - - scope - .source.scss .keyword.operator.other.comma, .source.scss .keyword.operator.other.association, .source.scss .keyword.other.terminator - settings - - foreground - #ffffff - - - - scope - .source.scss .punctuation.definition.body - settings - - foreground - #ffffff - - - - scope - source.scss .keyword.modifier.unit - settings - - foreground - #ff9e80 - - - - scope - .source.scss .declaration .entity.name.variable - settings - - foreground - #bcaaa4 - - scope .meta.annotation .variable.annotation, .meta.annotation .punctuation.definition @@ -919,6 +55,8 @@ .comment, .comment .punctuation.definition settings + background + #607D8B0D foreground #607d8b @@ -976,6 +114,24 @@ #ff9e80 + + scope + .constant.other.color + settings + + foreground + #e57373 + + + + scope + .constant.other.color .punctuation.definition.constant + settings + + foreground + #E5737380 + + scope .constant.numeric @@ -1050,31 +206,49 @@ scope - .constant.other.color, .punctuation.definition.constant + .support.constant settings + fontStyle + foreground - #b39ddb + #ea80fc scope - .support.constant + .source.css .support.constant settings - fontStyle - foreground - #ea80fc + #ff9e80 scope - .source.css .support.constant + .source.css .entity.name.tag settings foreground - #ff9e80 + #bcaaa4 + + + + scope + .source.css .entity.other.attribute-name.class + settings + + foreground + #aed581 + + + + scope + .source.css .entity.other.attribute-name.class .punctuation + settings + + foreground + #AED581B2 @@ -1083,12 +257,12 @@ settings foreground - #ea80fc + #b39ddb scope - .source.css .meta.attribute.builtin .entity.other.attribute-name + .source.css .entity.other.pseudo-class settings foreground @@ -1205,28 +379,17 @@ .entity.name.function, .variable.function, .storage.type.function.arrow settings - fontStyle - bold foreground #40c4ff scope - .storage.type.function.arrow.flow - settings - - foreground - #bcaaa4 - - - - scope - .variable.function + .entity.name.function settings fontStyle - + bold @@ -1269,58 +432,13 @@ scope - .punctuation.section.generic.begin.flow, .punctuation.section.generic.end.flow - settings - - foreground - #9ccc65 - - - - scope - .punctuation.binding.flow, .punctuation.section.brackets.begin.flow, .punctuation.section.brackets.end.flow - settings - - foreground - #ea80fc - - - - scope - .punctuation.section.block.begin.flow, .punctuation.section.block.end.flow - settings - - foreground - #ffe57f - - - - scope - .punctuation.separator.comma.flow, .punctuation.section.group.begin.flow, .punctuation.section.group.end.flow - settings - - foreground - #bcaaa4 - - - - scope - .string.unquoted.flow + .storage.type.function.arrow.flow settings foreground #bcaaa4 - - scope - .variable.parameter.generic - settings - - foreground - #ff4081 - - scope .punctuation.section.generic @@ -1658,6 +776,24 @@ #ffb74d + + scope + .punctuation.separator.key-value.html + settings + + foreground + #bcaaa4 + + + + scope + .source.jsx .punctuation.definition.template-expression + settings + + foreground + #bcaaa4 + + scope .constant.character.entity @@ -1745,7 +881,7 @@ settings fontStyle - italic + italic bold foreground #cfd8dc @@ -1832,7 +968,7 @@ background #263238 foreground - #81c784 + #bcaaa4 @@ -1891,6 +1027,15 @@ #00e676 + + scope + .punctuation.section.generic + settings + + foreground + #bcaaa4 + + scope .source.yaml .string @@ -1917,7 +1062,7 @@ settings background - #263238 + #26A69A1A foreground #26a69a @@ -1946,12 +1091,12 @@ settings foreground - #FF408180 + #ff4081 scope - .entity.name, .entity.other + .entity.name settings foreground @@ -2027,7 +1172,7 @@ settings foreground - #ff9e80 + #e0e0e0 diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap deleted file mode 100644 index 87e6ab61..00000000 --- a/Default (Linux).sublime-keymap +++ /dev/null @@ -1,55 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -[{ - // Opening single curly quote. - "keys": [ "alt+]" ], - "command": "insert_snippet", - "args": { "contents": "‘" } -},{ - // Closing single curly quote. - "keys": [ "alt+shift+]" ], - "command": "insert_snippet", - "args": { "contents": "’" } -},{ - // Opening double curly quote. - "keys": [ "alt+[" ], - "command": "insert_snippet", - "args": { "contents": "“" } -},{ - // Closing double curly quote. - "keys": [ "alt+shift+[" ], - "command": "insert_snippet", - "args": { "contents": "”" } -},{ - // Toggle JS/JSX comment (single line). - "keys": [ "ctrl+/" ], - "command": "naomi_toggle_jsx_comment", - "args": { "block": false }, - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "source.js, source.jsx", - "match_all": true - }] -},{ - // Toggle JS/JSX comment (block). - "keys": [ "ctrl+shift+/" ], - "command": "naomi_toggle_jsx_comment", - "args": { "block": true }, - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "source.js, source.jsx", - "match_all": true - }] -}] diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap deleted file mode 100644 index f5ea7de7..00000000 --- a/Default (OSX).sublime-keymap +++ /dev/null @@ -1,35 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -[{ - // Toggle JS/JSX comment (single line). - "keys": [ "super+/" ], - "command": "naomi_toggle_jsx_comment", - "args": { "block": false }, - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "source.js, source.jsx", - "match_all": true - }] -},{ - // Toggle JS/JSX comment (block). - "keys": [ "super+alt+/" ], - "command": "naomi_toggle_jsx_comment", - "args": { "block": true }, - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "source.js, source.jsx", - "match_all": true - }] -}] diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap deleted file mode 100644 index 87e6ab61..00000000 --- a/Default (Windows).sublime-keymap +++ /dev/null @@ -1,55 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -[{ - // Opening single curly quote. - "keys": [ "alt+]" ], - "command": "insert_snippet", - "args": { "contents": "‘" } -},{ - // Closing single curly quote. - "keys": [ "alt+shift+]" ], - "command": "insert_snippet", - "args": { "contents": "’" } -},{ - // Opening double curly quote. - "keys": [ "alt+[" ], - "command": "insert_snippet", - "args": { "contents": "“" } -},{ - // Closing double curly quote. - "keys": [ "alt+shift+[" ], - "command": "insert_snippet", - "args": { "contents": "”" } -},{ - // Toggle JS/JSX comment (single line). - "keys": [ "ctrl+/" ], - "command": "naomi_toggle_jsx_comment", - "args": { "block": false }, - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "source.js, source.jsx", - "match_all": true - }] -},{ - // Toggle JS/JSX comment (block). - "keys": [ "ctrl+shift+/" ], - "command": "naomi_toggle_jsx_comment", - "args": { "block": true }, - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "source.js, source.jsx", - "match_all": true - }] -}] diff --git a/Default.sublime-keymap b/Default.sublime-keymap deleted file mode 100644 index b195de7c..00000000 --- a/Default.sublime-keymap +++ /dev/null @@ -1,378 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -[{ - // () have the same behavior as {}. - "keys": [ "enter" ], - "command": "run_macro_file", - "args": { "file": "res://Packages/Default/Add Line in Braces.sublime-macro" }, - "context": [{ - "key": "setting.auto_indent", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "selection_empty", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "preceding_text", - "operator": "regex_contains", - "operand": "\\($", - "match_all": true - },{ - "key": "following_text", - "operator": "regex_contains", - "operand": "^\\)", - "match_all": true - }] -},{ - // [] have the same behavior as {}. - "keys": [ "enter" ], - "command": "run_macro_file", - "args": { "file": "res://Packages/Default/Add Line in Braces.sublime-macro" }, - "context": [{ - "key": "setting.auto_indent", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "selection_empty", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "preceding_text", - "operator": "regex_contains", - "operand": "\\[$", - "match_all": true - },{ - "key": "following_text", - "operator": "regex_contains", - "operand": "^\\]", - "match_all": true - }] -},{ - // '' have the same behavior as {}. - "keys": [ "enter" ], - "command": "run_macro_file", - "args": { "file": "res://Packages/Default/Add Line in Braces.sublime-macro" }, - "context": [{ - "key": "setting.auto_indent", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "selection_empty", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "preceding_text", - "operator": "regex_contains", - "operand": "'$", - "match_all": true - },{ - "key": "following_text", - "operator": "regex_contains", - "operand": "^'", - "match_all": true - }] -},{ - // "" have the same behavior as {}. - "keys": [ "enter" ], - "command": "run_macro_file", - "args": { "file": "res://Packages/Default/Add Line in Braces.sublime-macro" }, - "context": [{ - "key": "setting.auto_indent", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "selection_empty", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "preceding_text", - "operator": "regex_contains", - "operand": "\"$", - "match_all": true - },{ - "key": "following_text", - "operator": "regex_contains", - "operand": "^\"", - "match_all": true - }] -},{ - // `` have the same behavior as {}. - "keys": [ "enter" ], - "command": "run_macro_file", - "args": { "file": "res://Packages/Default/Add Line in Braces.sublime-macro" }, - "context": [{ - "key": "setting.auto_indent", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "selection_empty", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "preceding_text", - "operator": "regex_contains", - "operand": "`$", - "match_all": true - },{ - "key": "following_text", - "operator": "regex_contains", - "operand": "^`", - "match_all": true - }] -},{ - // JS - Pair template. - "keys": [ "`" ], - "command": "insert_snippet", - "args": { "contents": "`$0`" }, - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "source.js - (string, comment)", - "match_all": true - },{ - "key": "selection_empty", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "following_text", - "operator": "regex_contains", - "operand": "^(?>\\s|\\)|]|\\}|>|$)", - "match_all": true - },{ - "key": "setting.auto_match_enabled", - "operator": "equal", - "operand": true - }] -},{ - // JS - Pair template for selected text. - "keys": [ "`" ], - "command": "insert_snippet", - "args": { "contents": "`${0:$SELECTION}`" }, - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "source.js", - "match_all": true - },{ - "key": "selection_empty", - "operator": "equal", - "operand": false, - "match_all": true - },{ - "key": "setting.auto_match_enabled", - "operator": "equal", - "operand": true - }] -},{ - // Delete empty “`”. - "keys": [ "backspace" ], - "command": "run_macro_file", - "args": { - "file": "res://Packages/Default/Delete Left Right.sublime-macro" - }, - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "string.template.js", - "match_all": true - },{ - "key": "selection_empty", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "preceding_text", - "operator": "regex_contains", - "operand": "`$", - "match_all": true - },{ - "key": "following_text", - "operator": "regex_contains", - "operand": "^`", - "match_all": true - },{ - "key": "setting.auto_match_enabled", - "operator": "equal", - "operand": true - }] -},{ - // JS - Pair interpolation - "keys": [ "{" ], - "command": "insert_snippet", - "args": { "contents": "{$0}" }, - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "string.template.js - (comment)", - "match_all": true - },{ - "key": "selection_empty", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "preceding_text", - "operator": "regex_contains", - "operand": "\\$$", - "match_all": true - },{ - "key": "setting.auto_match_enabled", - "operator": "equal", - "operand": true - }] -},{ - // Adds “className=""” when “.” is pressed. - "keys": [ "." ], - "args": { "attribute": "className" }, - "command": "emmet_insert_attribute", - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "source.jsx meta.tag - (comment, string, meta.embedded-js)", - "match_all": true - },{ - "operator": "equal", - "operand": true, - "key": "setting.auto_id_class", - "match_all": true - }] -},{ - // Adds “id=""” when “#” is pressed. - "keys": [ "#" ], - "args": { "attribute": "id" }, - "command": "emmet_insert_attribute", - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "source.jsx meta.tag - (comment, string, meta.embedded-js)", - "match_all": true - },{ - "key": "setting.auto_id_class", - "operator": "equal", - "operand": true, - "match_all": true - }] -},{ - // Auto complete tags using tab and emmet. - "keys": [ "tab" ], - "command": "expand_abbreviation_by_tab", - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "source.jsx - (comment, string)", - "match_all": true - },{ - "key": "selection_empty", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "auto_complete_visible", - "operator": "equal", - "operand": false, - "match_all": true - },{ - "key": "is_abbreviation", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "setting.disable_tab_abbreviations", - "operator": "equal", - "operand": false, - "match_all": true - }] -},{ - // Close HTML, JSX and XML tags. - "keys": [ "/" ], - "command": "close_tag", - "args": { "insert_slash": true }, - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "(text.html, text.xml, source.jsx) - (string, comment)", - "match_all": true - },{ - "key": "preceding_text", - "operator": "regex_match", - "operand": "<\\s*$", - "match_all": true - },{ - "key": "setting.auto_close_tags", - "operator": "equal", - "operand": true - }] -},{ - // Close JSX tag on “>”. - "keys": [ ">" ], - "command": "naomi_close_jsx_tag", - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "source.jsx meta.tag - (string, comment)", - "match_all": true - },{ - "key": "selection_empty", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "preceding_text", - "operator": "not_regex_contains", - "operand": "/\\s*$", - "match_all": true - },{ - "key": "setting.auto_close_tags", - "operator": "equal", - "operand": true, - "match_all": true - }] -},{ - // Close self closing JSX tag on “/”. - "keys": [ "/" ], - "command": "insert_snippet", - "args": { "contents": "/>" }, - "context": [{ - "key": "selector", - "operator": "equal", - "operand": "source.jsx meta.tag - (string, comment)", - "match_all": true - },{ - "key": "selection_empty", - "operator": "equal", - "operand": true, - "match_all": true - },{ - "key": "preceding_text", - "operator": "not_regex_contains", - "operand": "<\\s*$", - "match_all": true - },{ - "key": "setting.auto_close_tags", - "operator": "equal", - "operand": true, - "match_all": true - }] -}] diff --git a/Naomi.sublime-settings b/Naomi.sublime-settings new file mode 100644 index 00000000..f2136a61 --- /dev/null +++ b/Naomi.sublime-settings @@ -0,0 +1,25 @@ +{ + // Define the minimum log level used for logging output on the console. + // Valid values are: "CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG" + "log_level": "DEBUG", + + // Syntaxes to be generated. + "syntaxes": [{ + // Name of the syntax shown in all menus. It’s possible to generate multiple + // syntaxes for the same configuration if you need it to be compatible with + // some other plugin. + "names": ["JavaScript (Naomi)", "JavaScript", "JSX", "React"], + + // File used as the entry point relative to “Naomi/syntaxes/src”. + "entry": "naomi.fjsx15.sublime-syntax", + + // Optional features. + "features": { + "flow": true, + "jest-globals": true, + "jsx": true, + "node-globals": true, + "browser-globals": true + } + }] +} diff --git a/README.md b/README.md index 433c0b70..2127531b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Naomi](art/logo.png)][naomi] +[![Naomi](art/logo.svg)][naomi] [![GitHub watchers](https://img.shields.io/github/watchers/borela/naomi.svg?style=social)][watchers] [![GitHub stars](https://img.shields.io/github/stars/borela/naomi.svg?style=social)][stars] diff --git a/_.sublime-project b/_.sublime-project new file mode 100644 index 00000000..02978c48 --- /dev/null +++ b/_.sublime-project @@ -0,0 +1,11 @@ +{ + "folders": [{ + "path": "." + }], + "settings": { + "default_line_ending": "unix", + "ensure_newline_at_eof_on_save": true, + "translate_tabs_to_spaces": true, + "trim_trailing_white_space_on_save": true + } +} diff --git a/__init__.py b/__init__.py index 16c355f1..bbf9a78a 100644 --- a/__init__.py +++ b/__init__.py @@ -10,12 +10,18 @@ # License for the specific language governing permissions and limitations under # the License. -from Naomi.plugin.commands.CloseJsxTag import NaomiCloseJsxTagCommand -from Naomi.plugin.commands.RunSyntaxTests import NaomiRunSyntaxTestsCommand -from Naomi.plugin.commands.ToggleJsxComment import NaomiToggleJsxCommentCommand +import sys +from os.path import ( + dirname, + join, +) -__all__ = [ - NaomiCloseJsxTagCommand, - NaomiRunSyntaxTestsCommand, - NaomiToggleJsxCommentCommand -] +PARENT_DIR = dirname(__file__) +VENDOR_PATH = join(PARENT_DIR, 'vendor') + +# Add the “Naomi/vendor” dir to the paths to enable easy imports. +if VENDOR_PATH not in sys.path: + sys.path.append(VENDOR_PATH) + +# Import the commands to the Naomi namespace to enable sublime to use them. +from Naomi.system.commands import * # noqa diff --git a/art/logo.afdesign b/art/logo.afdesign new file mode 100644 index 00000000..6b89498b Binary files /dev/null and b/art/logo.afdesign differ diff --git a/art/logo.png b/art/logo.png deleted file mode 100644 index a895ea8b..00000000 Binary files a/art/logo.png and /dev/null differ diff --git a/art/logo.svg b/art/logo.svg index 4e6366fc..abe5cfe6 100644 --- a/art/logo.svg +++ b/art/logo.svg @@ -1,198 +1,47 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - aomi - - - - - - - - - - - - - - - - - - - - + + + + + + + aomi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + diff --git a/art/multiline.gif b/art/multiline.gif deleted file mode 100644 index b6be5a03..00000000 Binary files a/art/multiline.gif and /dev/null differ diff --git a/art/single-line.gif b/art/single-line.gif deleted file mode 100644 index 5003bcaf..00000000 Binary files a/art/single-line.gif and /dev/null differ diff --git a/dependencies.json b/dependencies.json new file mode 100644 index 00000000..4d2bf085 --- /dev/null +++ b/dependencies.json @@ -0,0 +1,10 @@ +{ + "*": { + "*": [ + "lxml", + "ruamel-yaml", + "pathtools", + "watchdog" + ] + } +} diff --git a/integration/README.md b/integration/README.md new file mode 100644 index 00000000..38378df4 --- /dev/null +++ b/integration/README.md @@ -0,0 +1,2 @@ +Files in this directory are used to integrate directly to Sublime’s menus, +commands, shortcuts and preferences which includes indexing. diff --git a/integration/commands/build/build.sublime-commands b/integration/commands/build/build.sublime-commands new file mode 100644 index 00000000..b523adc5 --- /dev/null +++ b/integration/commands/build/build.sublime-commands @@ -0,0 +1,57 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +//////////////////////////////////////////////////////////////////////////////// +// +// This code was auto generated, be aware that changes to this file will be +// lost on the next build. To contribute, edit the files in: +// +// Naomi/integration/commands/src +// +//////////////////////////////////////////////////////////////////////////////// +[ + { + "caption": "Naomi: Build Commands", + "command": "naomi_build", + "args": { + "what": "commands" + } + }, + { + "caption": "Naomi: Build Keymaps", + "command": "naomi_build", + "args": { + "what": "keymaps" + } + }, + { + "caption": "Naomi: Build Preferences", + "command": "naomi_build", + "args": { + "what": "preferences" + } + }, + { + "caption": "Naomi: Build Menus", + "command": "naomi_build", + "args": { + "what": "menus" + } + }, + { + "caption": "Naomi: Build Syntaxes", + "command": "naomi_build", + "args": { + "what": "syntaxes" + } + } +] \ No newline at end of file diff --git a/integration/commands/build/tests.sublime-commands b/integration/commands/build/tests.sublime-commands new file mode 100644 index 00000000..f415807e --- /dev/null +++ b/integration/commands/build/tests.sublime-commands @@ -0,0 +1,36 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +//////////////////////////////////////////////////////////////////////////////// +// +// This code was auto generated, be aware that changes to this file will be +// lost on the next build. To contribute, edit the files in: +// +// Naomi/integration/commands/src +// +//////////////////////////////////////////////////////////////////////////////// +[ + { + "caption": "Naomi: Run Plugin Tests", + "command": "naomi_run_tests", + "args": { + "test_type": "plugin" + } + }, + { + "caption": "Naomi: Run Syntax Tests", + "command": "naomi_run_tests", + "args": { + "test_type": "syntax" + } + } +] \ No newline at end of file diff --git a/integration/commands/build/watch.sublime-commands b/integration/commands/build/watch.sublime-commands new file mode 100644 index 00000000..bd3092a5 --- /dev/null +++ b/integration/commands/build/watch.sublime-commands @@ -0,0 +1,57 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +//////////////////////////////////////////////////////////////////////////////// +// +// This code was auto generated, be aware that changes to this file will be +// lost on the next build. To contribute, edit the files in: +// +// Naomi/integration/commands/src +// +//////////////////////////////////////////////////////////////////////////////// +[ + { + "caption": "Naomi: Watch Commands", + "command": "naomi_watch", + "args": { + "what": "commands" + } + }, + { + "caption": "Naomi: Watch Preferences", + "command": "naomi_watch", + "args": { + "what": "preferences" + } + }, + { + "caption": "Naomi: Watch Keymaps", + "command": "naomi_watch", + "args": { + "what": "keymaps" + } + }, + { + "caption": "Naomi: Watch Menus", + "command": "naomi_watch", + "args": { + "what": "menus" + } + }, + { + "caption": "Naomi: Watch Syntaxes", + "command": "naomi_watch", + "args": { + "what": "syntaxes" + } + } +] \ No newline at end of file diff --git a/integration/commands/src/build.yml b/integration/commands/src/build.yml new file mode 100644 index 00000000..e378cdc8 --- /dev/null +++ b/integration/commands/src/build.yml @@ -0,0 +1,39 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +- caption: 'Naomi: Build Commands' + command: naomi_build + args: + what: commands + +- caption: 'Naomi: Build Keymaps' + command: naomi_build + args: + what: keymaps + +- caption: 'Naomi: Build Preferences' + command: naomi_build + args: + what: preferences + +- caption: 'Naomi: Build Menus' + command: naomi_build + args: + what: menus + +- caption: 'Naomi: Build Syntaxes' + command: naomi_build + args: + what: syntaxes diff --git a/integration/commands/src/tests.yml b/integration/commands/src/tests.yml new file mode 100644 index 00000000..22e90224 --- /dev/null +++ b/integration/commands/src/tests.yml @@ -0,0 +1,24 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +- caption: 'Naomi: Run Plugin Tests' + command: naomi_run_tests + args: + test_type: plugin + +- caption: 'Naomi: Run Syntax Tests' + command: naomi_run_tests + args: + test_type: syntax diff --git a/integration/commands/src/watch.yml b/integration/commands/src/watch.yml new file mode 100644 index 00000000..cb127942 --- /dev/null +++ b/integration/commands/src/watch.yml @@ -0,0 +1,39 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +- caption: 'Naomi: Watch Commands' + command: naomi_watch + args: + what: commands + +- caption: 'Naomi: Watch Preferences' + command: naomi_watch + args: + what: preferences + +- caption: 'Naomi: Watch Keymaps' + command: naomi_watch + args: + what: keymaps + +- caption: 'Naomi: Watch Menus' + command: naomi_watch + args: + what: menus + +- caption: 'Naomi: Watch Syntaxes' + command: naomi_watch + args: + what: syntaxes diff --git a/integration/keymaps/build/Default (Linux).sublime-keymap b/integration/keymaps/build/Default (Linux).sublime-keymap new file mode 100644 index 00000000..b465c546 --- /dev/null +++ b/integration/keymaps/build/Default (Linux).sublime-keymap @@ -0,0 +1,92 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +//////////////////////////////////////////////////////////////////////////////// +// +// This code was auto generated, be aware that changes to this file will be +// lost on the next build. To contribute, edit the files in: +// +// Naomi/integration/keymaps/src +// +//////////////////////////////////////////////////////////////////////////////// +[ + { + "keys": [ + "alt+]" + ], + "command": "insert_snippet", + "args": { + "contents": "\u2018" + } + }, + { + "keys": [ + "alt+shift+]" + ], + "command": "insert_snippet", + "args": { + "contents": "\u2019" + } + }, + { + "keys": [ + "alt+[" + ], + "command": "insert_snippet", + "args": { + "contents": "\u201c" + } + }, + { + "keys": [ + "alt+shift+[" + ], + "command": "insert_snippet", + "args": { + "contents": "\u201d" + } + }, + { + "keys": [ + "ctrl+/" + ], + "command": "naomi_toggle_jsx_comment", + "args": { + "block": false + }, + "context": [ + { + "key": "selector", + "operator": "equal", + "operand": "source.js, source.jsx", + "match_all": true + } + ] + }, + { + "keys": [ + "ctrl+shift+/" + ], + "command": "naomi_toggle_jsx_comment", + "args": { + "block": true + }, + "context": [ + { + "key": "selector", + "operator": "equal", + "operand": "source.js, source.jsx", + "match_all": true + } + ] + } +] \ No newline at end of file diff --git a/integration/keymaps/build/Default (OSX).sublime-keymap b/integration/keymaps/build/Default (OSX).sublime-keymap new file mode 100644 index 00000000..27dca426 --- /dev/null +++ b/integration/keymaps/build/Default (OSX).sublime-keymap @@ -0,0 +1,56 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +//////////////////////////////////////////////////////////////////////////////// +// +// This code was auto generated, be aware that changes to this file will be +// lost on the next build. To contribute, edit the files in: +// +// Naomi/integration/keymaps/src +// +//////////////////////////////////////////////////////////////////////////////// +[ + { + "keys": [ + "super+/" + ], + "command": "naomi_toggle_jsx_comment", + "args": { + "block": false + }, + "context": [ + { + "key": "selector", + "operator": "equal", + "operand": "source.js, source.jsx", + "match_all": true + } + ] + }, + { + "keys": [ + "super+alt+/" + ], + "command": "naomi_toggle_jsx_comment", + "args": { + "block": true + }, + "context": [ + { + "key": "selector", + "operator": "equal", + "operand": "source.js, source.jsx", + "match_all": true + } + ] + } +] \ No newline at end of file diff --git a/integration/keymaps/build/Default (Windows).sublime-keymap b/integration/keymaps/build/Default (Windows).sublime-keymap new file mode 100644 index 00000000..b465c546 --- /dev/null +++ b/integration/keymaps/build/Default (Windows).sublime-keymap @@ -0,0 +1,92 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +//////////////////////////////////////////////////////////////////////////////// +// +// This code was auto generated, be aware that changes to this file will be +// lost on the next build. To contribute, edit the files in: +// +// Naomi/integration/keymaps/src +// +//////////////////////////////////////////////////////////////////////////////// +[ + { + "keys": [ + "alt+]" + ], + "command": "insert_snippet", + "args": { + "contents": "\u2018" + } + }, + { + "keys": [ + "alt+shift+]" + ], + "command": "insert_snippet", + "args": { + "contents": "\u2019" + } + }, + { + "keys": [ + "alt+[" + ], + "command": "insert_snippet", + "args": { + "contents": "\u201c" + } + }, + { + "keys": [ + "alt+shift+[" + ], + "command": "insert_snippet", + "args": { + "contents": "\u201d" + } + }, + { + "keys": [ + "ctrl+/" + ], + "command": "naomi_toggle_jsx_comment", + "args": { + "block": false + }, + "context": [ + { + "key": "selector", + "operator": "equal", + "operand": "source.js, source.jsx", + "match_all": true + } + ] + }, + { + "keys": [ + "ctrl+shift+/" + ], + "command": "naomi_toggle_jsx_comment", + "args": { + "block": true + }, + "context": [ + { + "key": "selector", + "operator": "equal", + "operand": "source.js, source.jsx", + "match_all": true + } + ] + } +] \ No newline at end of file diff --git a/integration/keymaps/build/Default.sublime-keymap b/integration/keymaps/build/Default.sublime-keymap new file mode 100644 index 00000000..63c652e1 --- /dev/null +++ b/integration/keymaps/build/Default.sublime-keymap @@ -0,0 +1,447 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +//////////////////////////////////////////////////////////////////////////////// +// +// This code was auto generated, be aware that changes to this file will be +// lost on the next build. To contribute, edit the files in: +// +// Naomi/integration/keymaps/src +// +//////////////////////////////////////////////////////////////////////////////// +[ + { + "keys": [ + "`" + ], + "command": "insert_snippet", + "args": { + "contents": "`$0`" + }, + "context": [ + { + "key": "setting.auto_match_enabled", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selection_empty", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selector", + "operator": "equal", + "operand": "source.js - (string, comment)", + "match_all": true + } + ] + }, + { + "keys": [ + "`" + ], + "command": "insert_snippet", + "args": { + "contents": "`${0:$SELECTION}`" + }, + "context": [ + { + "key": "setting.auto_match_enabled", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selection_empty", + "operator": "equal", + "operand": false, + "match_all": true + }, + { + "key": "selector", + "operator": "equal", + "operand": "source.js - (string, comment)", + "match_all": true + } + ] + }, + { + "keys": [ + "$" + ], + "command": "insert_snippet", + "args": { + "contents": "\\${${0:$SELECTION}}" + }, + "context": [ + { + "key": "setting.auto_match_enabled", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selection_empty", + "operator": "equal", + "operand": false, + "match_all": true + }, + { + "key": "selector", + "operator": "equal", + "operand": "string.template.js", + "match_all": true + } + ] + }, + { + "keys": [ + ">" + ], + "command": "naomi_close_jsx_tag", + "context": [ + { + "key": "setting.auto_close_tags", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selection_empty", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selector", + "operator": "equal", + "operand": "source.jsx meta.tag - (string, comment)", + "match_all": true + }, + { + "key": "preceding_text", + "operator": "not_regex_contains", + "operand": "/\\s*$", + "match_all": true + } + ] + }, + { + "keys": [ + "/" + ], + "command": "insert_snippet", + "args": { + "contents": "/>" + }, + "context": [ + { + "key": "setting.auto_close_tags", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selection_empty", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selector", + "operator": "equal", + "operand": "source.jsx meta.tag - (string, comment)", + "match_all": true + } + ] + }, + { + "keys": [ + "." + ], + "command": "emmet_insert_attribute", + "args": { + "attribute": "className" + }, + "context": [ + { + "key": "setting.auto_id_class", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selector", + "operator": "equal", + "operand": "source.jsx meta.tag - (comment, string, meta.embedded-js)", + "match_all": true + } + ] + }, + { + "keys": [ + "#" + ], + "command": "emmet_insert_attribute", + "args": { + "attribute": "id" + }, + "context": [ + { + "key": "setting.auto_id_class", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selector", + "operator": "equal", + "operand": "source.jsx meta.tag - (comment, string, meta.embedded-js)", + "match_all": true + } + ] + }, + { + "keys": [ + "tab" + ], + "command": "expand_abbreviation_by_tab", + "context": [ + { + "key": "setting.disable_tab_abbreviations", + "operator": "equal", + "operand": false, + "match_all": true + }, + { + "key": "selection_empty", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "auto_complete_visible", + "operator": "equal", + "operand": false, + "match_all": true + }, + { + "key": "selector", + "operator": "equal", + "operand": "source.jsx - (comment, string)", + "match_all": true + } + ] + }, + { + "keys": [ + "/" + ], + "command": "close_tag", + "context": [ + { + "key": "setting.auto_close_tags", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selector", + "operator": "equal", + "operand": "(text.html, text.xml, source.jsx) - (string, comment)", + "match_all": true + }, + { + "key": "preceding_text", + "operator": "regex_match", + "operand": ".*?<$", + "match_all": true + } + ] + }, + { + "keys": [ + "backspace" + ], + "command": "run_macro_file", + "args": { + "file": "res://Packages/Default/Delete Left Right.sublime-macro" + }, + "context": [ + { + "key": "setting.auto_match_enabled", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selection_empty", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selector", + "operator": "equal", + "operand": "string.template.js", + "match_all": true + }, + { + "key": "preceding_text", + "operator": "regex_contains", + "operand": "`$", + "match_all": true + }, + { + "key": "following_text", + "operator": "regex_contains", + "operand": "^`", + "match_all": true + } + ] + }, + { + "keys": [ + "enter" + ], + "command": "run_macro_file", + "args": { + "file": "res://Packages/Default/Add Line in Braces.sublime-macro" + }, + "context": [ + { + "key": "setting.auto_indent", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selection_empty", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "preceding_text", + "operator": "regex_contains", + "operand": "`$", + "match_all": true + }, + { + "key": "following_text", + "operator": "regex_contains", + "operand": "^`", + "match_all": true + } + ] + }, + { + "keys": [ + "enter" + ], + "command": "naomi_run_commands", + "args": { + "commands": [ + { + "command": "insert", + "args": { + "characters": "\n\n" + } + }, + { + "command": "move", + "args": { + "by": "lines", + "forward": false + } + }, + { + "command": "move_to", + "args": { + "to": "hardeol", + "forward": false + } + }, + { + "command": "reindent", + "args": { + "single_line": true + } + } + ] + }, + "context": [ + { + "key": "setting.auto_indent", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selection_empty", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "preceding_text", + "operator": "regex_contains", + "operand": "\\($", + "match_all": true + }, + { + "key": "following_text", + "operator": "regex_contains", + "operand": "^\\)", + "match_all": true + } + ] + }, + { + "keys": [ + "enter" + ], + "command": "run_macro_file", + "args": { + "file": "res://Packages/Default/Add Line in Braces.sublime-macro" + }, + "context": [ + { + "key": "setting.auto_indent", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "selection_empty", + "operator": "equal", + "operand": true, + "match_all": true + }, + { + "key": "preceding_text", + "operator": "regex_contains", + "operand": "\\[$", + "match_all": true + }, + { + "key": "following_text", + "operator": "regex_contains", + "operand": "^\\]", + "match_all": true + } + ] + } +] \ No newline at end of file diff --git a/integration/keymaps/src/curly-quotes.yml b/integration/keymaps/src/curly-quotes.yml new file mode 100644 index 00000000..76bddaa7 --- /dev/null +++ b/integration/keymaps/src/curly-quotes.yml @@ -0,0 +1,36 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +os: [Linux, Windows] +bindings: + # Opening single curly quote. + - keys: ['alt+]'] + command: insert_snippet + args: {contents: ‘} + + # Closing single curly quote. + - keys: ['alt+shift+]'] + command: insert_snippet + args: {contents: ’} + + # Opening double curly quote. + - keys: ['alt+['] + command: insert_snippet + args: {contents: “} + + # Closing double curly quote. + - keys: ['alt+shift+['] + command: insert_snippet + args: {contents: ”} diff --git a/integration/keymaps/src/js/pair-template.yml b/integration/keymaps/src/js/pair-template.yml new file mode 100644 index 00000000..bf77f94f --- /dev/null +++ b/integration/keymaps/src/js/pair-template.yml @@ -0,0 +1,55 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +bindings: + # No selection. + - keys: ['`'] + command: insert_snippet + args: {contents: '`$0`'} + context: + - key: setting.auto_match_enabled + operator: equal + operand: true + match_all: true + + - key: selection_empty + operator: equal + operand: true + match_all: true + + - key: selector + operator: equal + operand: source.js - (string, comment) + match_all: true + + # Envelop selected text. + - keys: ['`'] + command: insert_snippet + args: {contents: '`${0:$SELECTION}`'} + context: + - key: setting.auto_match_enabled + operator: equal + operand: true + match_all: true + + - key: selection_empty + operator: equal + operand: false + match_all: true + + - key: selector + operator: equal + operand: source.js - (string, comment) + match_all: true diff --git a/integration/keymaps/src/js/template-interpolation.yml b/integration/keymaps/src/js/template-interpolation.yml new file mode 100644 index 00000000..f099ec76 --- /dev/null +++ b/integration/keymaps/src/js/template-interpolation.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +bindings: + # Put selection inside “${...}”. + - keys: ['$'] + command: insert_snippet + args: {contents: '\${${0:$SELECTION}}'} + context: + - key: setting.auto_match_enabled + operator: equal + operand: true + match_all: true + + - key: selection_empty + operator: equal + operand: false + match_all: true + + - key: selector + operator: equal + operand: string.template.js + match_all: true diff --git a/integration/keymaps/src/jsx/close-tag.yml b/integration/keymaps/src/jsx/close-tag.yml new file mode 100644 index 00000000..eba7b24c --- /dev/null +++ b/integration/keymaps/src/jsx/close-tag.yml @@ -0,0 +1,59 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +bindings: + # Close JSX tag on “>”. + - keys: ['>'] + command: naomi_close_jsx_tag + context: + - key: setting.auto_close_tags + operator: equal + operand: true + match_all: true + + - key: selection_empty + operator: equal + operand: true + match_all: true + + - key: selector + operator: equal + operand: source.jsx meta.tag - (string, comment) + match_all: true + + - key: preceding_text + operator: not_regex_contains + operand: /\s*$ + match_all: true + + # Close self closing JSX tag on “/”. + - keys: ['/'] + command: insert_snippet + args: {contents: />} + context: + - key: setting.auto_close_tags + operator: equal + operand: true + match_all: true + + - key: selection_empty + operator: equal + operand: true + match_all: true + + - key: selector + operator: equal + operand: source.jsx meta.tag - (string, comment) + match_all: true diff --git a/integration/keymaps/src/jsx/emmet/className.yml b/integration/keymaps/src/jsx/emmet/className.yml new file mode 100644 index 00000000..00c396e3 --- /dev/null +++ b/integration/keymaps/src/jsx/emmet/className.yml @@ -0,0 +1,30 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +bindings: + # Adds “className=""” when “.” is pressed. + - keys: ['.'] + command: emmet_insert_attribute + args: {attribute: className} + context: + - key: setting.auto_id_class + operator: equal + operand: true + match_all: true + + - key: selector + operator: equal + operand: source.jsx meta.tag - (comment, string, meta.embedded-js) + match_all: true diff --git a/integration/keymaps/src/jsx/emmet/id.yml b/integration/keymaps/src/jsx/emmet/id.yml new file mode 100644 index 00000000..aa033ff1 --- /dev/null +++ b/integration/keymaps/src/jsx/emmet/id.yml @@ -0,0 +1,30 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +bindings: + # Adds “id=""” when “#” is pressed. + - keys: ['#'] + command: emmet_insert_attribute + args: {attribute: id} + context: + - key: setting.auto_id_class + operator: equal + operand: true + match_all: true + + - key: selector + operator: equal + operand: source.jsx meta.tag - (comment, string, meta.embedded-js) + match_all: true diff --git a/integration/keymaps/src/jsx/emmet/tab-completion.yml b/integration/keymaps/src/jsx/emmet/tab-completion.yml new file mode 100644 index 00000000..061f81d2 --- /dev/null +++ b/integration/keymaps/src/jsx/emmet/tab-completion.yml @@ -0,0 +1,38 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +bindings: + - keys: [tab] + command: expand_abbreviation_by_tab + context: + - key: setting.disable_tab_abbreviations + operator: equal + operand: false + match_all: true + + - key: selection_empty + operator: equal + operand: true + match_all: true + + - key: auto_complete_visible + operator: equal + operand: false + match_all: true + + - key: selector + operator: equal + operand: source.jsx - (comment, string) + match_all: true diff --git a/integration/keymaps/src/jsx/toggle-jsx-comment (OSX).yml b/integration/keymaps/src/jsx/toggle-jsx-comment (OSX).yml new file mode 100644 index 00000000..d65779b7 --- /dev/null +++ b/integration/keymaps/src/jsx/toggle-jsx-comment (OSX).yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +os: OSX +bindings: + - keys: ['super+/'] + command: naomi_toggle_jsx_comment + args: {block: false} + context: + - key: selector + operator: equal + operand: source.js, source.jsx + match_all: true + + - keys: ['super+alt+/'] + command: naomi_toggle_jsx_comment + args: {block: true} + context: + - key: selector + operator: equal + operand: source.js, source.jsx + match_all: true diff --git a/integration/keymaps/src/jsx/toggle-jsx-comment.yml b/integration/keymaps/src/jsx/toggle-jsx-comment.yml new file mode 100644 index 00000000..6fdf1233 --- /dev/null +++ b/integration/keymaps/src/jsx/toggle-jsx-comment.yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +os: [Linux, Windows] +bindings: + - keys: ['ctrl+/'] + command: naomi_toggle_jsx_comment + args: {block: false} + context: + - key: selector + operator: equal + operand: source.js, source.jsx + match_all: true + + - keys: ['ctrl+shift+/'] + command: naomi_toggle_jsx_comment + args: {block: true} + context: + - key: selector + operator: equal + operand: source.js, source.jsx + match_all: true diff --git a/integration/keymaps/src/markup/close-tag.yml b/integration/keymaps/src/markup/close-tag.yml new file mode 100644 index 00000000..a75c4bba --- /dev/null +++ b/integration/keymaps/src/markup/close-tag.yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +bindings: + # Close HTML, JSX and XML tags on “/”. + - keys: ['/'] + command: close_tag + context: + - key: setting.auto_close_tags + operator: equal + operand: true + match_all: true + + - key: selector + operator: equal + operand: (text.html, text.xml, source.jsx) - (string, comment) + match_all: true + + - key: preceding_text + operator: regex_match + operand: '.*?<$' + match_all: true diff --git a/integration/keymaps/src/normalize-backspace/js-backtick.yml b/integration/keymaps/src/normalize-backspace/js-backtick.yml new file mode 100644 index 00000000..8d293300 --- /dev/null +++ b/integration/keymaps/src/normalize-backspace/js-backtick.yml @@ -0,0 +1,46 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +bindings: + # Delete empty “``” when the cursor is between them. + - keys: [backspace] + command: run_macro_file + args: + file: res://Packages/Default/Delete Left Right.sublime-macro + context: + - key: setting.auto_match_enabled + operator: equal + operand: true + match_all: true + + - key: selection_empty + operator: equal + operand: true + match_all: true + + - key: selector + operator: equal + operand: string.template.js + match_all: true + + - key: preceding_text + operator: regex_contains + operand: '`$' + match_all: true + + - key: following_text + operator: regex_contains + operand: '^`' + match_all: true diff --git a/integration/keymaps/src/normalize-enter/js-backtick.yml b/integration/keymaps/src/normalize-enter/js-backtick.yml new file mode 100644 index 00000000..28c6cbd9 --- /dev/null +++ b/integration/keymaps/src/normalize-enter/js-backtick.yml @@ -0,0 +1,41 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +bindings: + # Pressing enter between “``” will have the same behavior as “{}”. + - keys: [enter] + command: run_macro_file + args: + file: res://Packages/Default/Add Line in Braces.sublime-macro + context: + - key: setting.auto_indent + operator: equal + operand: true + match_all: true + + - key: selection_empty + operator: equal + operand: true + match_all: true + + - key: preceding_text + operator: regex_contains + operand: '`$' + match_all: true + + - key: following_text + operator: regex_contains + operand: '^`' + match_all: true diff --git a/integration/keymaps/src/normalize-enter/parenthesis.yml b/integration/keymaps/src/normalize-enter/parenthesis.yml new file mode 100644 index 00000000..49179da0 --- /dev/null +++ b/integration/keymaps/src/normalize-enter/parenthesis.yml @@ -0,0 +1,61 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +bindings: + # Pressing enter between “()” will have the same behavior as “{}”. + - keys: [enter] + # This is an example of how to use the multi command runner, the following + # is be same as the “Default/Add Line in Braces.sublime-macro”. You can see + # how the command works and usage instructions in: + # + # Naomi/system/commands/RunCommands.py + # + command: naomi_run_commands + args: + commands: + - command: insert + args: + characters: "\n\n" + - command: move + args: + by: lines + forward: false + - command: move_to + args: + to: hardeol + forward: false + - command: reindent + args: + single_line: true + context: + - key: setting.auto_indent + operator: equal + operand: true + match_all: true + + - key: selection_empty + operator: equal + operand: true + match_all: true + + - key: preceding_text + operator: regex_contains + operand: \($ + match_all: true + + - key: following_text + operator: regex_contains + operand: ^\) + match_all: true diff --git a/integration/keymaps/src/normalize-enter/square-brackets.yml b/integration/keymaps/src/normalize-enter/square-brackets.yml new file mode 100644 index 00000000..eefdbeb7 --- /dev/null +++ b/integration/keymaps/src/normalize-enter/square-brackets.yml @@ -0,0 +1,41 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +bindings: + # Pressing enter between “[]” will have the same behavior as “{}”. + - keys: [enter] + command: run_macro_file + args: + file: res://Packages/Default/Add Line in Braces.sublime-macro + context: + - key: setting.auto_indent + operator: equal + operand: true + match_all: true + + - key: selection_empty + operator: equal + operand: true + match_all: true + + - key: preceding_text + operator: regex_contains + operand: \[$ + match_all: true + + - key: following_text + operator: regex_contains + operand: ^\] + match_all: true diff --git a/integration/menus/build/Main.sublime-menu b/integration/menus/build/Main.sublime-menu new file mode 100644 index 00000000..12527082 --- /dev/null +++ b/integration/menus/build/Main.sublime-menu @@ -0,0 +1,247 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +//////////////////////////////////////////////////////////////////////////////// +// +// This code was auto generated, be aware that changes to this file will be +// lost on the next build. To contribute, edit the files in: +// +// Naomi/integration/menus/src +// +//////////////////////////////////////////////////////////////////////////////// +[ + { + "id": "preferences", + "children": [ + { + "id": "package-settings", + "children": [ + { + "caption": "Naomi", + "children": [ + { + "caption": "Settings", + "command": "edit_settings", + "args": { + "base_file": "${packages}/Naomi/Naomi.sublime-settings", + "default": "{\n\t$0\n}\n" + } + }, + { + "caption": "-" + }, + { + "caption": "Github", + "children": [ + { + "caption": "Fork", + "command": "open_url", + "args": { + "url": "https://github.com/borela/naomi/fork" + } + }, + { + "caption": "-" + }, + { + "caption": "Repository", + "command": "open_url", + "args": { + "url": "https://github.com/borela/naomi" + } + }, + { + "caption": "Issues", + "command": "open_url", + "args": { + "url": "https://github.com/borela/naomi/issues" + } + }, + { + "caption": "Pull Requests", + "command": "open_url", + "args": { + "url": "https://github.com/borela/naomi/pulls" + } + }, + { + "caption": "Stars", + "command": "open_url", + "args": { + "url": "https://github.com/borela/naomi/stargazers" + } + }, + { + "caption": "Watchers", + "command": "open_url", + "args": { + "url": "https://github.com/borela/naomi/watchers" + } + } + ] + } + ] + } + ] + } + ] + }, + { + "caption": "Naomi", + "id": "naomi-main-menu", + "mnemonic": "a", + "children": [ + { + "caption": "Settings", + "command": "edit_settings", + "args": { + "base_file": "${packages}/Naomi/Naomi.sublime-settings", + "default": "{\n\t$0\n}\n" + } + }, + { + "caption": "-" + }, + { + "command": "naomi_build", + "args": { + "what": "commands" + } + }, + { + "command": "naomi_build", + "args": { + "what": "keymaps" + } + }, + { + "command": "naomi_build", + "args": { + "what": "preferences" + } + }, + { + "command": "naomi_build", + "args": { + "what": "menus" + } + }, + { + "command": "naomi_build", + "args": { + "what": "syntaxes" + } + }, + { + "caption": "-" + }, + { + "command": "naomi_watch", + "args": { + "what": "commands" + } + }, + { + "command": "naomi_watch", + "args": { + "what": "preferences" + } + }, + { + "command": "naomi_watch", + "args": { + "what": "keymaps" + } + }, + { + "command": "naomi_watch", + "args": { + "what": "menus" + } + }, + { + "command": "naomi_watch", + "args": { + "what": "syntaxes" + } + }, + { + "caption": "-" + }, + { + "command": "naomi_run_tests", + "args": { + "test_type": "plugin" + } + }, + { + "command": "naomi_run_tests", + "args": { + "test_type": "syntax" + } + }, + { + "caption": "-" + }, + { + "caption": "Github", + "children": [ + { + "caption": "Fork", + "command": "open_url", + "args": { + "url": "https://github.com/borela/naomi/fork" + } + }, + { + "caption": "-" + }, + { + "caption": "Repository", + "command": "open_url", + "args": { + "url": "https://github.com/borela/naomi" + } + }, + { + "caption": "Issues", + "command": "open_url", + "args": { + "url": "https://github.com/borela/naomi/issues" + } + }, + { + "caption": "Pull Requests", + "command": "open_url", + "args": { + "url": "https://github.com/borela/naomi/pulls" + } + }, + { + "caption": "Stars", + "command": "open_url", + "args": { + "url": "https://github.com/borela/naomi/stargazers" + } + }, + { + "caption": "Watchers", + "command": "open_url", + "args": { + "url": "https://github.com/borela/naomi/watchers" + } + } + ] + } + ] + } +] \ No newline at end of file diff --git a/integration/menus/src/naomi.yml b/integration/menus/src/naomi.yml new file mode 100644 index 00000000..a3fa9416 --- /dev/null +++ b/integration/menus/src/naomi.yml @@ -0,0 +1,131 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# Accepted values for location: +# +# Context +# Encoding +# Find in Files +# Indentation +# Line Endings +# Main +# Side Bar Mount Point +# Side Bar +# Syntax +# Tab Context +# Widget Context +# +location: Main +menus: + add: + - caption: Naomi + id: naomi-main-menu + mnemonic: a + children: + - caption: Settings + command: edit_settings + args: + base_file: ${packages}/Naomi/Naomi.sublime-settings + default: "{\n\t$0\n}\n" + + - caption: '-' + + - command: naomi_build + args: + what: commands + + - command: naomi_build + args: + what: keymaps + + - command: naomi_build + args: + what: preferences + + - command: naomi_build + args: + what: menus + + - command: naomi_build + args: + what: syntaxes + + - caption: '-' + + - command: naomi_watch + args: + what: commands + + - command: naomi_watch + args: + what: preferences + + - command: naomi_watch + args: + what: keymaps + + - command: naomi_watch + args: + what: menus + + - command: naomi_watch + args: + what: syntaxes + + - caption: '-' + + - command: naomi_run_tests + args: + test_type: plugin + + - command: naomi_run_tests + args: + test_type: syntax + + - caption: '-' + + - caption: 'Github' + children: + - caption: Fork + command: open_url + args: + url: https://github.com/borela/naomi/fork + + - caption: '-' + + - caption: Repository + command: open_url + args: + url: https://github.com/borela/naomi + + - caption: Issues + command: open_url + args: + url: https://github.com/borela/naomi/issues + + - caption: Pull Requests + command: open_url + args: + url: https://github.com/borela/naomi/pulls + + - caption: Stars + command: open_url + args: + url: https://github.com/borela/naomi/stargazers + + - caption: Watchers + command: open_url + args: + url: https://github.com/borela/naomi/watchers diff --git a/integration/menus/src/preferences/package-settings.yml b/integration/menus/src/preferences/package-settings.yml new file mode 100644 index 00000000..c3798ca2 --- /dev/null +++ b/integration/menus/src/preferences/package-settings.yml @@ -0,0 +1,65 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +location: Main +menus: + extend: + - id: preferences + children: + - id: package-settings + children: + - caption: Naomi + children: + - caption: Settings + command: edit_settings + args: + base_file: ${packages}/Naomi/Naomi.sublime-settings + default: "{\n\t$0\n}\n" + + - caption: '-' + + - caption: 'Github' + children: + - caption: Fork + command: open_url + args: + url: https://github.com/borela/naomi/fork + + - caption: '-' + + - caption: Repository + command: open_url + args: + url: https://github.com/borela/naomi + + - caption: Issues + command: open_url + args: + url: https://github.com/borela/naomi/issues + + - caption: Pull Requests + command: open_url + args: + url: https://github.com/borela/naomi/pulls + + - caption: Stars + command: open_url + args: + url: https://github.com/borela/naomi/stargazers + + - caption: Watchers + command: open_url + args: + url: https://github.com/borela/naomi/watchers diff --git a/integration/preferences/build/indexing/flow/type.tmPreferences b/integration/preferences/build/indexing/flow/type.tmPreferences new file mode 100644 index 00000000..6f89a433 --- /dev/null +++ b/integration/preferences/build/indexing/flow/type.tmPreferences @@ -0,0 +1,36 @@ + + + + + + + scope + entity.name.type + settings + + showInSymbolList + 1 + symbolTransformation + /^\s*/💢 / + + + diff --git a/integration/preferences/build/indexing/js/arrow-function.tmPreferences b/integration/preferences/build/indexing/js/arrow-function.tmPreferences new file mode 100644 index 00000000..854408ce --- /dev/null +++ b/integration/preferences/build/indexing/js/arrow-function.tmPreferences @@ -0,0 +1,36 @@ + + + + + + + scope + source.js meta.declaration.function.arrow + settings + + showInSymbolList + 1 + symbolTransformation + /^\s*/➡ / + + + diff --git a/integration/preferences/build/indexing/js/class.tmPreferences b/integration/preferences/build/indexing/js/class.tmPreferences new file mode 100644 index 00000000..b16e6c35 --- /dev/null +++ b/integration/preferences/build/indexing/js/class.tmPreferences @@ -0,0 +1,36 @@ + + + + + + + scope + source.js meta.declaration.class + settings + + showInSymbolList + 1 + symbolTransformation + /class\s+/🔵 / + + + diff --git a/integration/preferences/build/indexing/js/function.tmPreferences b/integration/preferences/build/indexing/js/function.tmPreferences new file mode 100644 index 00000000..6ddd369f --- /dev/null +++ b/integration/preferences/build/indexing/js/function.tmPreferences @@ -0,0 +1,36 @@ + + + + + + + scope + source.js meta.declaration.function + settings + + showInSymbolList + 1 + symbolTransformation + /^\s*(?:function\s+)?/⚙️ / + + + diff --git a/integration/preferences/build/indexing/js/method.tmPreferences b/integration/preferences/build/indexing/js/method.tmPreferences new file mode 100644 index 00000000..361b7c59 --- /dev/null +++ b/integration/preferences/build/indexing/js/method.tmPreferences @@ -0,0 +1,36 @@ + + + + + + + scope + source.js meta.declaration.function.method + settings + + showInSymbolList + 1 + symbolTransformation + /^\s*/🔹 / + + + diff --git a/integration/preferences/src/indexing/flow/type.yml b/integration/preferences/src/indexing/flow/type.yml new file mode 100644 index 00000000..f487e0b5 --- /dev/null +++ b/integration/preferences/src/indexing/flow/type.yml @@ -0,0 +1,16 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +scope: entity.name.type +settings: + showInSymbolList: 1 + symbolTransformation: /^\s*/💢 / diff --git a/integration/preferences/src/indexing/js/arrow-function.yml b/integration/preferences/src/indexing/js/arrow-function.yml new file mode 100644 index 00000000..ce959a75 --- /dev/null +++ b/integration/preferences/src/indexing/js/arrow-function.yml @@ -0,0 +1,18 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +scope: >- + source.js + meta.declaration.function.arrow +settings: + showInSymbolList: 1 + symbolTransformation: /^\s*/➡ / diff --git a/integration/preferences/src/indexing/js/class.yml b/integration/preferences/src/indexing/js/class.yml new file mode 100644 index 00000000..852526ec --- /dev/null +++ b/integration/preferences/src/indexing/js/class.yml @@ -0,0 +1,18 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +scope: >- + source.js + meta.declaration.class +settings: + showInSymbolList: 1 + symbolTransformation: /class\s+/🔵 / diff --git a/integration/preferences/src/indexing/js/function.yml b/integration/preferences/src/indexing/js/function.yml new file mode 100644 index 00000000..ac978253 --- /dev/null +++ b/integration/preferences/src/indexing/js/function.yml @@ -0,0 +1,18 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +scope: >- + source.js + meta.declaration.function +settings: + showInSymbolList: 1 + symbolTransformation: /^\s*(?:function\s+)?/⚙️ / diff --git a/integration/preferences/src/indexing/js/method.yml b/integration/preferences/src/indexing/js/method.yml new file mode 100644 index 00000000..25b343e6 --- /dev/null +++ b/integration/preferences/src/indexing/js/method.yml @@ -0,0 +1,18 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +scope: >- + source.js + meta.declaration.function.method +settings: + showInSymbolList: 1 + symbolTransformation: /^\s*/🔹 / diff --git a/integration/syntaxes/build/50ef8ea1a3597a53ea29540a5b00469ae8705a1c5c50732cef62d367a2e4a781b3b14ddfaafc246a9c7a63c2606f86b269bb26038dbfc1fdbd67efb7bf454183.yml b/integration/syntaxes/build/50ef8ea1a3597a53ea29540a5b00469ae8705a1c5c50732cef62d367a2e4a781b3b14ddfaafc246a9c7a63c2606f86b269bb26038dbfc1fdbd67efb7bf454183.yml new file mode 100644 index 00000000..8735df69 --- /dev/null +++ b/integration/syntaxes/build/50ef8ea1a3597a53ea29540a5b00469ae8705a1c5c50732cef62d367a2e4a781b3b14ddfaafc246a9c7a63c2606f86b269bb26038dbfc1fdbd67efb7bf454183.yml @@ -0,0 +1,8726 @@ +%YAML 1.2 +--- +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## +# +# This code was auto generated, be aware that changes to this file will be +# lost on the next build. To contribute, edit the entry point and files +# requested by it: +# +# Naomi/integration/syntaxes/src/jest-snapshot.yml +# +# ############################################################################## +# --- +# Statistics: +# contexts: 956 +# contexts_inlined: 0 +# contexts_removed: 22 +# files: 186 +# variables: 203 +# variables_removed: 20 +# --- +name: Jest Snapshot (Naomi) +scope: source.js.jest-snapshot +file_extensions: + - js.snap +variables: + 1_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 15_genericArguments: | + (< + (?> {{15_string}} + | \g<-1> + | [^<>] + )* + >) + 15_parameters: | + (\( + (?> {{15_string}} + | \g<-1> + | [^()] + )* + \)) + 15_flowOperators: | + (?> &(?!\s*&) + | \|(?!\s*\|) + ) + 15_string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + 15_flowObject: | + (\{ + (?> {{15_string}} + | \g<-1> + | [^{}] + )* + }) + 15_simpleFlowType: | + (?> {{15_string}} + | {{15_flowObject}} + | [$_[:alpha:]][$_[:alnum:].]* + ) + (?:\s*{{15_genericArguments}})? + (?:\s*\[\s*\])? + 15_flowFunction: | + ( + {{15_parameters}} + \s*=>\s* + (?> (?:\?\s*){{15_simpleFlowType}} + | \g<-1> + ) + ) + 15_complexType: | + (?:\?\s*)? + ( + (?> {{15_simpleFlowType}} + | {{15_flowFunction}} + | \g<-1> + ) + ) + 15_multipleTypes: | + ( + (?> \s*{{15_flowOperators}} + | \s*{{15_complexType}} + | \g<-1> + )+ + ) + 15_flowComment: /\*\s*:.*?\*/ + 16_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 16_genericArguments: | + (< + (?> {{16_string}} + | \g<-1> + | [^<>] + )* + >) + 16_parameters: | + (\( + (?> {{16_string}} + | \g<-1> + | [^()] + )* + \)) + 16_flowOperators: | + (?> &(?!\s*&) + | \|(?!\s*\|) + ) + 16_string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + 16_flowObject: | + (\{ + (?> {{16_string}} + | \g<-1> + | [^{}] + )* + }) + 16_simpleFlowType: | + (?> {{16_string}} + | {{16_flowObject}} + | [$_[:alpha:]][$_[:alnum:].]* + ) + (?:\s*{{16_genericArguments}})? + (?:\s*\[\s*\])? + 16_flowFunction: | + ( + {{16_parameters}} + \s*=>\s* + (?> (?:\?\s*){{16_simpleFlowType}} + | \g<-1> + ) + ) + 16_complexType: | + (?:\?\s*)? + ( + (?> {{16_simpleFlowType}} + | {{16_flowFunction}} + | \g<-1> + ) + ) + 16_multipleTypes: | + ( + (?> \s*{{16_flowOperators}} + | \s*{{16_complexType}} + | \g<-1> + )+ + ) + 16_flowComment: /\*\s*:.*?\*/ + 18_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 21_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 22_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 23_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 23_hexEscapedChar: | + x[a-f0-9]{2} + 23_unicodeEscapedChar: | + (?> u[a-f0-9]{4} + | u\{[a-f0-9]+\} + ) + 23_escapeSequences: | + \\ + (?> [`\\$bfnrtv] + | {{23_hexEscapedChar}} + | {{23_unicodeEscapedChar}} + ) + 24_hexEscapedChar: | + x[a-f0-9]{2} + 24_unicodeEscapedChar: | + (?> u[a-f0-9]{4} + | u\{[a-f0-9]+} + ) + 24_singleQuotedEscapeSequences: | + \\ + (?> ['\\bfnrtv] + | {{24_hexEscapedChar}} + | {{24_unicodeEscapedChar}} + ) + 25_hexEscapedChar: | + x[a-f0-9]{2} + 25_unicodeEscapedChar: | + (?> u[a-f0-9]{4} + | u\{[a-f0-9]+} + ) + 25_doubleQuotedEscapeSequences: | + \\ + (?> ["\\bfnrtv] + | {{25_hexEscapedChar}} + | {{25_unicodeEscapedChar}} + ) + 26_literalDecimal: | + [0-9][0-9_]* + 26_literalFloat: | + (?> [0-9]*[.]{{26_literalDecimal}} + | {{26_literalDecimal}}[.][0-9]* + ) + 26_scientificNotation: | + ( + (?> {{26_literalFloat}} + | {{26_literalDecimal}} + ) + [e][+-]? + {{26_literalDecimal}} + ) + 28_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 28_constantIdentifier: | + [$_[:upper:]] + [$_[:upper:][:digit:]]* + 29_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 38_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 41_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 41_constantIdentifier: | + [$_[:upper:]] + [$_[:upper:][:digit:]]* + 42_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 42_genericArguments: | + (< + (?> {{42_string}} + | \g<-1> + | [^<>] + )* + >) + 42_parameters: | + (\( + (?> {{42_string}} + | \g<-1> + | [^()] + )* + \)) + 42_flowOperators: | + (?> &(?!\s*&) + | \|(?!\s*\|) + ) + 42_string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + 42_flowObject: | + (\{ + (?> {{42_string}} + | \g<-1> + | [^{}] + )* + }) + 42_simpleFlowType: | + (?> {{42_string}} + | {{42_flowObject}} + | [$_[:alpha:]][$_[:alnum:].]* + ) + (?:\s*{{42_genericArguments}})? + (?:\s*\[\s*\])? + 42_flowFunction: | + ( + {{42_parameters}} + \s*=>\s* + (?> (?:\?\s*){{42_simpleFlowType}} + | \g<-1> + ) + ) + 42_complexType: | + (?:\?\s*)? + ( + (?> {{42_simpleFlowType}} + | {{42_flowFunction}} + | \g<-1> + ) + ) + 42_multipleTypes: | + ( + (?> \s*{{42_flowOperators}} + | \s*{{42_complexType}} + | \g<-1> + )+ + ) + 42_flowComment: /\*\s*:.*?\*/ + 42_type: | + (?> {{42_flowComment}} + | \:\s*{{42_multipleTypes}} + ) + 42_normalArrowFunction: | + (?:async\b\s*)? + (?:{{42_genericArguments}}\s*)? + {{42_parameters}} + (?:\s*{{42_type}})? + \s*=> + 42_singleParameterArrowFunction: | + (?:async\b\s+)? + {{42_commonIdentifier}} + (?:\s*{{42_type}})? + \s*=> + 42_normalArrowFunctionAssignedToVariable: | + {{42_commonIdentifier}} + (?:\s*{{42_type}})? + \s*=\s* + {{42_normalArrowFunction}} + 42_singleParameterArrowFunctionAssignedToVariable: | + {{42_commonIdentifier}} + (?:\s*{{42_type}})? + \s*=\s* + {{42_singleParameterArrowFunction}} + 43_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 44_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 44_genericArguments: | + (< + (?> {{44_string}} + | \g<-1> + | [^<>] + )* + >) + 44_parameters: | + (\( + (?> {{44_string}} + | \g<-1> + | [^()] + )* + \)) + 44_flowOperators: | + (?> &(?!\s*&) + | \|(?!\s*\|) + ) + 44_string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + 44_flowObject: | + (\{ + (?> {{44_string}} + | \g<-1> + | [^{}] + )* + }) + 44_simpleFlowType: | + (?> {{44_string}} + | {{44_flowObject}} + | [$_[:alpha:]][$_[:alnum:].]* + ) + (?:\s*{{44_genericArguments}})? + (?:\s*\[\s*\])? + 44_flowFunction: | + ( + {{44_parameters}} + \s*=>\s* + (?> (?:\?\s*){{44_simpleFlowType}} + | \g<-1> + ) + ) + 44_complexType: | + (?:\?\s*)? + ( + (?> {{44_simpleFlowType}} + | {{44_flowFunction}} + | \g<-1> + ) + ) + 44_multipleTypes: | + ( + (?> \s*{{44_flowOperators}} + | \s*{{44_complexType}} + | \g<-1> + )+ + ) + 44_flowComment: /\*\s*:.*?\*/ + 44_type: | + (?> {{44_flowComment}} + | \:\s*{{44_multipleTypes}} + ) + 55_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 57_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 59_arrayFunctions: | + (?> from + | isArray + )\b + 59_dateFunctions: | + (?> [gs]et + (?> Date + | Day + | FullYear + | Hours + | Milliseconds + | Minutes + | Month + | Seconds + | Time(?>ZoneOffset) + | UTC + (?> Date + | Day + | FullYear + | Hours + | Milliseconds + | minutes + | Month + | Seconds + ) + ) + | now + | parse + | to + (?> DateString + | GMTString + | ISOString + | JSON + | Locale + (?> DateString + | Format + | String + | TimeString + ) + | Source + | String + | TimeString + | UTCString + | valueOf + ) + | UTC + )\b + 59_globalFunctions: | + (?> decodeURI(?:Component)? + | encodeURI(?:Component)? + | eval + | is(?>Finite|NaN) + | parse(?>Float|Int) + )\b + 59_jsonFunctions: | + (?> parse + | stringify + )\b + 59_mathFunctions: | + (?> abs + | acosh? + | asinh? + | atan(?>2|h)? + | cbrt + | ceil + | clz32 + | cosh? + | exp + | exp(?:m1)? + | floor + | fround + | hypot + | imul + | log(?>10|1p|2)? + | max + | min + | pow + | random + | round + | sign + | sinh? + | sqrt + | tanh? + | trunc + )\b + 59_objectFunctions: | + (?> assign + | create + | definePropert(?>ies|y) + | freeze + | getOwnProperty(?>Descriptors?|Names|Symbols) + | getPrototypeOf + | is(?>Extensible|Frozen|Sealed)? + | keys + | preventExtensions + | seal + | setPrototypeOf + )\b + 59_stringFunctions: | + (?> from(?>CharCode|CodePoint) + | char(?>At|CodeAt) + | codePointAt + | concat + | endsWith + | includes + | indexOf + | lastIndexOf + | localeCompare + | match + | normalize + | pad(?>End|start) + | repeat + | replace + | search + | slice + | split + | substr(?:ing)? + | to + (?> Locale(?>Lower|Upper) + | LowerCase + | String + | UpperCase + ) + | trim(?>Left|Right)? + | valueOf + | raw + )\b + 59_symbolFunctions: | + (?> for + | KeyFor + )\b + 61_constantIdentifier: | + [$_[:upper:]] + [$_[:upper:][:digit:]]* + 62_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 62_comment: /\*.*?\*/ + 62_genericArguments: | + (< + (?> {{62_string}} + | \g<-1> + | [^<>] + )* + >) + 62_string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + 67_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 68_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 70_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 71_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 71_indexer: | + (\[ + (?> {{71_string}} + | \g<-1> + | [^\[\]] + )* + \]) + 71_methodIdentifier: | + (?> {{71_string}} + | {{71_indexer}} + | {{71_commonIdentifier}} + ) + 71_genericParameters: | + (< + (?> {{71_string}} + | \g<-1> + | [^<>] + )* + >) + 71_string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + 73_propTypeFunctions: | + (?: + (React) + \s*(\.)\s* + )? + (PropTypes) + \s*(\.)\s* + ((?> arrayOf + | instanceOf + | oneOf(?:Type)? + | shape + ))\b + 73_reactFunctions: | + (React) + \s*(\.)\s* + ((?> createElement + | createFactory + | cloneElement + | isValidElement + ))\b + 73_reactDomFunctions: | + (ReactD[oO][mM]) + \s*(\.)\s* + ((?> findDOMNode + | render(?:ToS(?>taticMarkup|tring))? + | unmountComponentAtNode + ))\b + 74_decoratorIdentifier: | + [$._[:alpha:]] + [$._[:alnum:]]* + 77_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 78_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 79_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 80_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 81_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 81_genericArguments: | + (< + [^<>]* + \g<-1>? + [^<>]* + >) + 82_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 84_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 86_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 86_keyIdentifier: | + (?> {{86_string}} + | [$_[:alnum:]] + [$_[:alnum:]]* + ) + 86_genericArguments: | + (< + (?> {{86_string}} + | \g<-1> + | [^<>] + )* + >) + 86_parameters: | + (\( + (?> {{86_string}} + | \g<-1> + | [^()] + )* + \)) + 86_flowOperators: | + (?> &(?!\s*&) + | \|(?!\s*\|) + ) + 86_string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + 86_flowObject: | + (\{ + (?> {{86_string}} + | \g<-1> + | [^{}] + )* + }) + 86_simpleFlowType: | + (?> {{86_string}} + | {{86_flowObject}} + | [$_[:alpha:]][$_[:alnum:].]* + ) + (?:\s*{{86_genericArguments}})? + (?:\s*\[\s*\])? + 86_flowFunction: | + ( + {{86_parameters}} + \s*=>\s* + (?> (?:\?\s*){{86_simpleFlowType}} + | \g<-1> + ) + ) + 86_complexType: | + (?:\?\s*)? + ( + (?> {{86_simpleFlowType}} + | {{86_flowFunction}} + | \g<-1> + ) + ) + 86_multipleTypes: | + ( + (?> \s*{{86_flowOperators}} + | \s*{{86_complexType}} + | \g<-1> + )+ + ) + 86_flowComment: /\*\s*:.*?\*/ + 86_type: | + (?> {{86_flowComment}} + | \:\s*{{86_multipleTypes}} + ) + 86_normalArrowFunction: | + (?:async\b\s*)? + (?:{{86_genericArguments}}\s*)? + {{86_parameters}} + (?:\s*{{86_type}})? + \s*=> + 86_singleParameterArrowFunction: | + (?:async\b\s+)? + {{86_commonIdentifier}} + (?:\s*{{86_type}})? + \s*=> + 87_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 87_genericArguments: | + (< + (?> {{87_string}} + | \g<-1> + | [^<>] + )* + >) + 87_parameters: | + (\( + (?> {{87_string}} + | \g<-1> + | [^()] + )* + \)) + 87_flowOperators: | + (?> &(?!\s*&) + | \|(?!\s*\|) + ) + 87_string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + 87_flowObject: | + (\{ + (?> {{87_string}} + | \g<-1> + | [^{}] + )* + }) + 87_simpleFlowType: | + (?> {{87_string}} + | {{87_flowObject}} + | [$_[:alpha:]][$_[:alnum:].]* + ) + (?:\s*{{87_genericArguments}})? + (?:\s*\[\s*\])? + 87_flowFunction: | + ( + {{87_parameters}} + \s*=>\s* + (?> (?:\?\s*){{87_simpleFlowType}} + | \g<-1> + ) + ) + 87_complexType: | + (?:\?\s*)? + ( + (?> {{87_simpleFlowType}} + | {{87_flowFunction}} + | \g<-1> + ) + ) + 87_multipleTypes: | + ( + (?> \s*{{87_flowOperators}} + | \s*{{87_complexType}} + | \g<-1> + )+ + ) + 87_flowComment: /\*\s*:.*?\*/ + 87_type: | + (?> {{87_flowComment}} + | \:\s*{{87_multipleTypes}} + ) + 87_normalArrowFunction: | + (?:async\b\s*)? + (?:{{87_genericArguments}}\s*)? + {{87_parameters}} + (?:\s*{{87_type}})? + \s*=> + 87_singleParameterArrowFunction: | + (?:async\b\s+)? + {{87_commonIdentifier}} + (?:\s*{{87_type}})? + \s*=> + 89_globalFunctions: | + (?> (?>clear|set)Immediate + | require + )\b + 89_processFunctions: | + (?> abort + | chdir + | cpuUsage + | cwd + | disconnect + | emitWarning + | exit + # getegid, geteuid, getgid, getuid, getgroups + | get(?>e[gu]id|[gu]id|groups) + | hrtime + | initgroups + | kill + | memoryUsage + | nextTick + | send + # setegid, seteuid, setgid, setuid, setgroups + | set(?>e[gu]id|[gu]id|groups) + # umask, uptime + | u(?>mask|ptime) + )\b + 93_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 94_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 94_classIdentifier: | + [$_[:upper:]] + [$_[:alnum:]]* + 105_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 106_commonIdentifier: | + [$_[:alpha:]] + [$_.:[:alnum:]]* + 107_commonIdentifier: | + [$_[:alpha:]] + [$_.:[:alnum:]]* + 108_elementIdentifier: | + [$_[:alpha:]] + [$_.[:alnum:]\-]* + 108_namespaceIdentifier: '{{108_elementIdentifier}}' + 111_componentIdentifier: | + [[:upper:]] + [$_.:[:alnum:]]* + 111_namespaceIdentifier: | + [$_[:alpha:]] + [$_.[:alnum:]\-]* + 113_attributeIdentifier: | + [_[:alpha:]] + [_.[:alnum:]\-]* + 125_possibleRange: | + (?> \w + | \d + | \\ + (?> c[A-Z] + | x[\da-fA-F]{2} + | u[\da-fA-F]{4} + ) + ) + 129_commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + 132_cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + 132_customProperty: --[_[:alnum:]\-]+ + 137_cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + 137_customProperty: (--)([_[:alnum:]\-]*) + 137_coreProperties: | + (?> additive-symbols + # align-content, align-items, align-self + | align-(?>content|items|self) + | alignment-baseline + | all + | animation + (?:- + # animation-delay + (?> delay + # anmation-direction + | direction + # animation-duration + | duration + # animation-fill-mode + | fill-mode + # aniation-iteration-count + | iteration-count + # aniamtion-name + | name + # animation-play-state + | play-state + # animation-timing-functin + | timing-function + ) + )? + | appearance + | azimuth + | background + (?:- + # background-attachment + (?> attachment + # background-blend-mode + | blend-mode + # background-clip + | clip + # background-color + | color + # background-image, background-image-transform + | image(?:-transform)? + # background-origin + | origin + # background-position + | position + # background-repeat + | repeat + # background-size + | size + ) + )? + | baseline-shift + | block- + # block-size + (?> size + # block-step + | step + # block-step-align, block-step-insert, block-steap-round, + # block-step-size + (?:-(?>align|insert|round|size))? + ) + # bookmark-label, bookmark-level, bookmark-state + | bookmark-(?>label|level|state) + | border + (?:- + # border-block + (?> block + (?:- + # border-block-color + (?> color + # border-block-end, border-block-end-color, + # border-block-end-style, border-block-end-width + | end(?:-(?>color|style|width))? + # border-block-start, border-block-start-color, + # border-block-start-style, border-block-start-width + | start(?:-(?>color|style|width))? + # border-block-style + | style + # border-block-width + | width + ) + )? + # border-bottom + | bottom + (?:- + # border-bottom-color + (?> color + # border-bottom-left-radius + | left-radius + # border-bottom-right-radius + | right-radius + # border-bottom-style + | style + # border-bottom-width + | width + ) + )? + # border-boundary + | boundary + # border-collapse + | collapse + # border-color + | color + # border-image + | image + (?:- + # border-image-outset + (?> outset + # border-image-repeat + | repeat + # border-image-slice + | slice + # border-image-source + | source + # border-image-transform + | transform + # border-image-width + | width + ) + )? + # border-inline + | inline + (?:- + # border-inline-color + (?> color + # border-inline-end, border-inline-end-color, + # border-inline-end-style, border-inline-end-width + | end(?:-(?>color|style|width))? + # border-inline-start, border-inline-start-color, + # border-inline-start-style, border-inline-start-width + | start(?:-(?>color|style|width))? + # border-inline-style + | style + # border-inline-width + | width + ) + )? + # border-left + | left + (?:- + # border-left-color + (?> color + # border-left-style + | style + # border-left-width + | width + ) + )? + # border-right + | right + (?:- + # border-right-color + (?> color + # border-right-style + | style + # border-right-width + | width + ) + )? + # border-radius + | radius + # border-style + | style + # border-spacing + | spacing + # border-top + | top + (?:- + # border-top-color + (?> color + # border-top-left-radius + | left-radius + # border-top-right-radius + | right-radius + # border-top-style + | style + # border-top-width + | width + ) + )? + # border-width + | width + ) + )? + | bottom + # box-decoration-break, box-shadow, box-sizing, box-snap + | box-(?>decoration-break|shadow|sizing|snap) + # break-after, break-before, break-inside + | break(?:-(?>after|before|inside))? + | caption-side + # caret, caret-color, caret-shape + | caret(?:-(?>color|shape))? + | chains + | clear + # clip, clip-path, clip-rule + | clip(?:-(?>path|rule))? + # color, color-adjust, color-interpolation-filters + | color(?:-(?>adjust|interpolation-filters))? + | column + # colums + (?> s + | - + # column-count + (?> count + # column-fill + | fill + # column-gap + | gap + # column-rule, column-rule-color, column-rule-style, + # column-rule-width + | rule(?:-(?>color|style|width))? + # column-span + | span + # column-width + | width + ) + ) + | contain + | content + | continue + # counter-increment, counter-reset, counter-set + | counter(?:-(?>increment|reset|set)) + # cue, cue-after, cue-before + | cue(?:-(?>after|before))? + | cursor + | direction + | display + | dominant-baseline + | elevation + | empty-cells + | fallback + | fill + (?:- + # fill-break + (?> break + # fill-color + | color + # fill-image + | image + # fill-opacity + | opacity + # fill-origin + | origin + # fill-position + | position + # fill-repeat + | repeat + # fill-rule + | rule + # fill-size + | size + ) + )? + | filter + # flex, flex-basis, flex-direction, flex-flow, flex-grow, flex-shrink, + # flex-wrap + | flex(?:-(?>basis|direction|flow|grow|shrink|wrap))? + # float, float-defer, float-offset, float-reference + | float(?:-(?>defer|offset|reference))? + # flood-color, flood-opacity + | flood-(?>color|opacity) + # flow, flow-from, flow-into + | flow(?:-(?>from|into))? + | font + (?:- + # font-family + (?> family + # font-feature-settings + | feature-settings + # font-kerning + | kerning + # font-language-override + | language-override + # font-max-size + | max-size + # font-min-size + | min-size + # font-optical-sizing + | optical-sizing + # font-pallete + | palette + # font-presentation + | presentation + # font-size, font-size-adjust + | size(?:-adjust)? + # font-stretch + | stretch + # font-style + | style + # font-synthesis + | synthesis + # font-variant + | variant + (?:- + # font-variant-alternates + (?> alternates + # font-variant-caps + | caps + # font-variant-asian + | east-asian + # font-variant-ligatures + | ligatures + # font-variant-numeric + | numeric + # font-variant-position + | position + ) + )? + # font-variation-settings + | variation-settings + # font-weight + | weight + ) + )? + # footnote-display, footnote-policy + | footnote-(?>display|policy) + | gap + | glyph-orientation-vertical + | hanging-punctuation + | height + | hyphenate- + # hyphenate-character + (?> character + # hyphenate-limit-chars, hyphenate-limit-last, hyphenate-limit-lines, + # hyphenate-limit-zone + | limit-(?>chars|last|lines|zone) + ) + | hyphens + # image-orientation, image-resolution + | image(?:-(?>orientation|resolution)) + # initial-letter, initial-align, initial-wrap + | initial-letter(?:-(?>align|wrap))? + | inline-size + | inset + (?:- + # inset-block-end, inset-block-start + (?> block(?:-(?>end|start))? + # inset-inline-end, inset-inline-start + | inline(?:-(?>end|start))? + ) + )? + | isolation + # justify-content, justify-items, justify-self + | justify-(?>content|items|self) + | left + | letter-spacing + | lighting-color + # line-break, line-grid, line-height, line-height-step, line-snap + | line-(?>break|grid|height(?:-step)?|snap) + | list-style + (?:- + # list-style-image + (?> image + # list-style-position + | position + # list-style-type + | type + ) + )? + | margin + (?:- + # margin-block-end, margin-block-start + (?> block(?:-(?>end|start))? + # margin-bottom + | bottom + # margin-inline-end, margin-inline-start + | inline(?:-(?>end|start))? + # margin-left + | left + # margin-right + | right + # margin-top + | top + ) + )? + | marker + (?:- + # marker-end + (?> end + # marker-knockout-left, marker-knockout-right + | knockout-(?>left|right) + # marker-mid + | mid + # marker-pattern + | pattern + # marker-segment + | segment + # marker-side + | side + # marker-start + | start + ) + )? + # marquee-direction, marquee-loop, marquee-speed, marquee-style + | marquee-(?>direction|loop|speed|style) + | mask + (?:- + # mask-border + (?> border + (?:- + # mask-border-mode + (?> mode + # mask-border-outset + | outset + # mask-border-repeat + | repeat + # mask-border-slice + | slice + # mask-border-source + | source + # mask-border-width + | width + ) + )? + # mask-clip + | clip + # mask-composite + | composite + # mask-image + | image + # mask-mode + | mode + # mask-origin + | origin + # mask-position + | position + # mask-repeat + | repeat + # mask-size + | size + # mask-type + | type + ) + )? + # max-block-size, max-height, max-inline-size, max-lines, max-width, max-zoom + | max-(?>block-size|height|inline-size|lines|width|zoom) + # min-block-size, min-height, min-inline-size, min-width, min-zoom + | min-(?>block-size|height|inline-size|width|zoom) + | mix-blend-mode + # nav-down, nav-left, nav-right, nav-up + | nav-(?>down|left|right|up) + | negative + # object-fit, object-position + | object-(?>fit|position) + | offset + (?:- + # offset-after + (?> after + # offset-anchor + | anchor + # offset-before + | before + # offset-distance + | distance + # offset-end + | end + # offset-path + | path + # offset-position + | position + # offset-rotate + | rotate + # offset-start + | start + ) + )? + | opacity + | order + | orphans + | orientation + | overflow + (?:- + # overflow-style + (?> style + # overflow-wrap + | wrap + # overflow-x + | x + # overflow-y + | y + ) + )? + | outline + (?:- + # outline-color + (?> color + # outline-offset + | offset + # outline-style + | style + # outline-width + | width + ) + )? + | pad + (?:ding + (?:- + # padding-block, padding-block-end, padding-block-start + (?> block(?:-(?>end|start))? + # padding-bottom + | bottom + # padding-inline, padding-inline-end, padding-inline-start + | inline(?:-(?>end|start))? + # padding-left + | left + # padding-right + | right + # padding-top + | top + ) + )? + )? + # page, page-break-after, page-break-before, page-break-inside + | page(?:-break-(?>after|before|inside))? + # pause, pause-after, pause-before + | pause(?:-(?>after|before))? + # pitch, pitch-range + | pitch(?:-range)? + # place-content, place-items, place-self + | place-(?>content|items|self) + | play-during + | position + | pointer-events + | prefix + | presentation-level + | quotes + | range + | region-fragment + | resize + # rest, rest-after, rest-before + | rest(?:-(?>after|before))? + | richness + | right + # rotation, rotation-point + | rotation(?:-point)? + | row-gap + # ruby-align, ruby-merge, ruby-position + | ruby-(?>align|merge|position) + | running + | scroll- + (?> behavior + | margin + (?:- + # scroll-margin-block, scroll-margin-block-end, + # scroll-margin-block-start + (?> block(?:-(?>end|start))? + # scroll-margin-bottom + | bottom + # scroll-margin-inline, scroll-margin-inline-end, + # scroll-margin-inline-start + | inline(?:-(?>end|start))? + # scroll-margin-left + | left + # scroll-margin-right + | right + # scroll-margin-top + | top + ) + )? + ) + | scroll-padding + (?:- + # scroll-padding-block, scroll-padding-block-end, + # scroll-padding-block-start + (?> block(?:-(?>end|start))? + # scroll-padding-bottom + | bottom + # scroll-padding-inline, scroll-padding-inline-end, + # scroll-padding-inline-start + | inline(?:-(?>end|start))? + # scroll-padding-left + | left + # scroll-padding-right + | right + # scroll-padding-top + | top + ) + )? + # scroll-snap-align, scroll-snap-stop, scroll-snap-type + | scroll-snap-(?>align|stop|type) + | scrollbar-gutter + # shape-inside, shape-image-threshold, shape-margin, shape-outside + | shape-(?>inside|image-threshold|margin|outside) + | size + | speak + (?:- + # speak-as + (?> as + # speak-header + | header + # speak-numeral + | numeral + # speak-punctuation + | punctuation + ) + )? + | speech-rate + | src + | stress + | string-set + | stroke + (?:- + # stroke-align, stroke-alignment + (?> align(?:ment)? + # stroke-break + | break + # stroke-color + | color + | dash + # stroke-dash-corner, stroke-dash-justify + (?> -(?>corner|justify) + # stroke-dashadjust + | adjust + # stroke-array + | array + # stroke-corner + | corner + # stroke-offset + | offset + ) + # stroke-image + | image + # stroke-linecap, stroke-linejoin + | line(?>cap|join) + # stroke-miterlimit + | miterlimit + # stroke-opacity + | opacity + # stroke-origin + | origin + # stroke-position + | position + # stroke-repeat + | repeat + # stroke-size + | size + # stroke-width + | width + ) + )? + # symbols, system, suffix + | s(?>ymbols|ystem|uffix) + | tab-size + | table-layout + | text- + # text-align, text-align-all, text-align-last + (?> align(?:-(?>all|last))? + # text-combine-upright + | combine-upright + # text-decoration + | decoration + # text-decoration-color, text-decoration-line, text-decoration-skip + # text-decoration-style + (?:-(?>color|line|skip|style))? + # text-emphasis + | emphasis + # text-emphasis-color, text-emphasis-position, text-emphasis-style + (?:-(?>color|position|style))? + # text-indent + | indent + # text-justify + | justify + # text-orientation + | orientation + # text-overflow + | overflow + # text-shadow + | shadow + # text-space-collapse, text-space-trim + | space-(?>collapse|trim) + # text-spacing + | spacing + # text-transform + | transform + # text-underline-position + | underline-position + # text-wrap + | wrap + ) + | top + # transform, transform-box, transform-origin + | transform(?:-(?>box|origin))? + # transition, transition-delay, transition-duration, transition-property, + # transition-timing-function + | transition(?:-(?>delay|duration|property|timing-function))? + | unicode-bidi + | user-select + | vertical-align + | visibility + | voice- + # voice-balance + (?> balance + # voice-duration + | duration + # voice-family + | family + # voice-pitch + | pitch + # voice-range + | range + # voice-rate + | rate + # voice-stress + | stress + # voice-volume + | volume + ) + | volume + | white-space + | widows + | width + | will-change + # word-break, word-spacing, word-wrap + | word-(?>break|spacing|wrap) + | wrap- + # wrap-after + (?> after + # wrap-before + | before + # wrap-flow + | flow + # wrap-inside + | inside + # wrap-through + | through + ) + | writing-mode + # z-index, zoom + | z(?>-index|oom) + ) + 142_cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + 146_literalDecimal: '[0-9]+' + 146_literalFloat: | + [+-]? + (?> [0-9]*[.]{{146_literalDecimal}} + | {{146_literalDecimal}}[.][0-9]+ + ) + 146_scientificNotation: | + (?> {{146_literalFloat}} + | [+-]?{{146_literalDecimal}} + ) + [e][+-]? + {{146_literalDecimal}} + 146_angleUnits: (?>deg|grad|rad|turn) + 146_frequencyUnits: (?>k?Hz) + 146_relativeLengthUnits: | + # cap, ch + (?> c(?>ap|h) + # em, ex + | e[mx] + | fr + | ic + | lh + # rem, rlh + | r(?>em|lh) + # vb, vh, vi, vmax, vmin, vw + | v(?>[bhiw]|m(?>ax|in)) + | x + ) + 146_absoluteLengthUnits: | + (?> cm + | in + | mm + # pc, pt, px + | p[ctx] + | q + ) + 146_resolutionUnits: dp(?>i|cm|px) + 146_timeUnits: (?>s|ms) + 146_unit: | + (?> % + | {{146_absoluteLengthUnits}}\b + | {{146_relativeLengthUnits}}\b + | {{146_angleUnits}}\b + | {{146_resolutionUnits}}\b + | {{146_timeUnits}}\b + | {{146_frequencyUnits}}\b + ) + 148_hex: '[0-9a-f]' + 151_cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + 152_customSelector: (:--)([_[:alnum:]\-]*) + 153_cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + 153_corePseudoClasses: | + (?> active + # any, any-link + | any(?:-link)? + | checked + | default + | disabled + | empty + | enabled + # first, first-child, first-of-type + | first(?:-(?>child|of-type))? + | fullscreen + | focus + | hover + | indeterminate + | in-range + | invalid + | last-(?>child|of-type) + | left + | link + # only-child, only-of-type + | only-(?>child|of-type) + | optional + | out-of-range + # read-only, read-write + | read-(?>only|write) + | required + | right + | root + | scope + | target + | valid + | visited + ) + 157_cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + 163_cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + 163_tags: | + (?> a + # abbr + (?> bbr + # address + | ddress + # area + | rea + # article + | rticle + # aside + | side + # audio + | udio + )? + | b + # base + (?> ase + # bdi, bdo + | d[io] + # blockquote + | lockquote + # body + | ody + # br + | r + # button + | utton + )? + # canvas, caption + | ca(?>nvas|ption) + | cite + | code + # col, colgroup + | col(?:group)? + # data, datalist + | data(?:list)? + | dd + | del + | details + | dfn + | dialog + | div + # dl, dt + | d[lt] + # em, embed + | em(?:bed)? + | fieldset + | figcaption + | figure + | footer + | form + | h[1-6] + # head, header + | head(?:er)? + | hgroup + | hr + | html + | i + # iframe + (?> frame + # img + | mg + # input + | nput + # ins + | ns + )? + | kbd + | label + | legend + # li, link + | li(?:nk)? + # main, map, mark + | ma(?>in|p|rk) + # meta, meter + | met(?>a|er) + | nav + | nextid + | noscript + | object + | ol + # optgroup, option + | opt(?>group|ion) + | output + | p + # param + (?> aram + # picture + | icture + # pre + | re + # progress + | rogress + )? + | q + # rp, rt, rtc + | r(?>p|tc?) + | ruby + | s + # sup + (?> amp + # script + | cript + # section + | ection + # select + | elect + # slot + | lot + # small + | mall + # source + | ource + # span + | pan + # strong + | trong + # style + | tyle + # sub + | ub + # summary + | ummary + # sup + | up + )? + | table + | tbody + | td + | template + | textarea + | tfoot + # th, thead + | th(?:ead)? + # time, title + | ti(?>me|tle) + # tr, track + | tr(?:ack)? + # u, ul + | ul? + | var + | video + | wbr + ) + 164_cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + 165_cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + 167_cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + 171_cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + 177_customMedia: (--)([_[:alnum:]\-]*) + 183_documentFunctions: | + (?> adoptNode + | close + | create + # createAttribute + (?> Attribute + # createCDATASection + | CDATASection + # createComment + | Comment + # createDocumentFragment + | DocumentFragment + # ccreateElement, reateElementNS + | Element(?:NS)? + # createExpression + | Event + # createExpression + | Expression + # createNodeIterator + | NodeIterator + # createNSResolver + | NSResolver + # createProcessingInstruction + | ProcessingInstruction + # createRange + | Range + # createTextNode + | TextNode + # createTreeWalker + | TreeWalker + ) + | elementFromPoint + | enableStyleSheetsForSet + | evaluate + | execCommand + | exitFullscreen + | getElement + # getElementById + (?> ById + | sBy + # getElementsByClassName + (?> ClassName + # getElementsByName + | Name + # getElementsByTagName, getElementsByTagNameNS + | TagName(?:NS)? + ) + ) + | getSelection + | hasFocus + | importNode + | open + | query + # queryCommand, queryCommandEnabled, queryCommandSupported + (?> Command(?>Enabled|Supported) + # querySelector, querySelectorAll + | Selector(?:All)? + ) + | releaseCapture + # write, writeln + | write(?:ln)? + )\b + 183_windowFunctions: | + (?> addEventListener + | alert + | atob + | blur + | btoa + # cancelAnimationFrame, cancelIddleCallback + | cancel(?>AnimationFrame|IdleCallback) + # clearInterval, clearTimeout + | clear(?>Interval|Timeout) + | close + | confirm + | convertPointFromNodeToPage + | createImageBitmap + | event + | fetch + | focus + | forward + | get + # getAttention + (?> Attention + # getComputedStyle + | ComputedStyle + # getDefaultComputedStyle + | DefaultComputedStyle + # getSelection + | Selection + ) + | home + | matchMedia + | minimize + # moveBy, moveTo + | move(?>By|To) + | open + | postMessage + | print + | prompt + # requestAnimationFrame, requestIdleCallback + | request(?>AnimationFrame|IdleCallback) + | removeEventListener + # resizeBy, resizeTo + | resize(?>By|To) + | restore + | routeEvent + | scroll + # scrollBy, scrollByPages + (?> By(?:Pages)? + # ScrollTo + | To + )? + # setInterval, setTimeout + | set(?>Interval|Timeout) + | sizeToContent + | stop + | updateCommands + )\b +contexts: + 1_array: + - match: \[ + scope: punctuation.section.brackets.begin.js.jest-snapshot + set: + - 1_array-close + 1_array-close: + - match: \] + scope: punctuation.section.brackets.end.js.jest-snapshot + pop: 'False' + - include: 1_comma-no-pop + - match: (?=\S) + push: + - 1_snapshot-content + 1_assignment: + - match: \= + scope: keyword.operator.other.assignment.js.jest-snapshot + 1_close-object: + - meta_scope: meta.object-literal.js.jest-snapshot + - match: \} + scope: punctuation.section.block.end.js.jest-snapshot + pop: 'False' + - include: 1_comma-no-pop + - match: (?=\S) + push: + - 1_key-value + - 1_key-bind + - 1_key + 1_close-snapshot: + - match: \` + scope: punctuation.definition.snapshot.end.js.jest-snapshot + pop: 'True' + - match: (?=\S) + push: + - 1_snapshot-content + 1_comma-no-pop: + - match: \, + scope: punctuation.separator.comma.js.jest-snapshot + 1_entry: + - match: | + (?xi) + //\s+Jest\s+Snapshot.* + scope: keyword.declaration.snapshot-version.js.jest-snapshot + - match: exports\b + scope: support.type.object.js.jest-snapshot + push: + - 1_value + - 1_assignment + - 1_property-access + - match: ; + scope: punctuation.terminator.js.jest-snapshot + 1_key: + - meta_scope: meta.object-literal.key.jest-snapshot + 1_key-bind: + - match: ':' + scope: punctuation.separator.key-value.js.jest-snapshot + pop: 'True' + 1_key-value: + - include: 59_constants + - include: 1_snapshot-content + 1_js-literals: + - include: Naomi/integration/syntaxes/src/js/literal/index.yml + 1_jsx: + - include: Naomi/integration/syntaxes/src/js/index.yml + 1_naomi: + - meta_scope: naomi + - match: '' + pop: 'True' + 1_meta-jsx: + - clear_scopes: true + - meta_content_scope: source.jsx naomi + - include: 1_pop-now + 1_object: + - match: \{ + scope: punctuation.section.block.begin.js.jest-snapshot + set: + - 1_close-object + 1_pop-now: + - match: '' + pop: 'True' + 1_property-access: + - include: Naomi/integration/syntaxes/src/js/property-access.yml + 1_snapshot-content: + - match: (?xi)(?={{1_commonIdentifier}}\s*{) + set: + - 1_object + - 1_type + - match: (?xi)(?={{1_commonIdentifier}}\s*\[) + set: + - 1_type-array + - match: (?xi)(?=<{{1_commonIdentifier}}) + set: + - 1_meta-jsx + - 1_jsx + - include: 1_js-literals + 1_type: + - match: | + (?x) + (?> Array + | Object + | Promise + ) + scope: support.type.js.jest-snapshot + pop: 'True' + - match: (?xi){{1_commonIdentifier}} + scope: variable.other.type.js.jest-snapshot + pop: 'True' + 1_type-array: + - match: '' + set: + - 1_array + - 1_type + 1_value: + - match: (`) + captures: + 0: source.js.jest-snapshot + 1: keyword.operator.assignment.js.fjsx15 + 2: punctuation.definition.snapshot.begin.js.fjsx15 + set: + - 1_close-snapshot + - include: 1_js-literals + Naomi/integration/syntaxes/src/js/property-access.yml: + - match: \[ + scope: punctuation.section.brackets.begin.js.fjsx15 + set: + - 2_index + 2_index: + - meta_scope: meta.brackets.js.fjsx15 + - match: \] + scope: punctuation.section.brackets.end.js.fjsx15a + pop: 'True' + - match: '' + push: + - 2_optional-expression + 2_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/optional-expression.yml: + - include: 3_expression-escape + - include: Naomi/integration/syntaxes/src/js/expression.yml + 3_expression-escape: + - match: (?=[,;:)\]}]) + pop: 'True' + Naomi/integration/syntaxes/src/js/expression.yml: + - include: 4_comment-no-pop + - include: 4_shared-main + - match: (?=\S) + set: + - 4_optional-tail + - 4_head + 4_close-group: + - match: \) + scope: punctuation.section.group.end.js.fjsx15 + pop: 'True' + 4_comma: + - include: Naomi/integration/syntaxes/src/js/operator/comma.yml + 4_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 4_do-expression: + - match: do\b + scope: keyword.control.do-expression.js.fjsx15 + set: + - 4_meta-do-expression + - 4_do-expression-body-begin + 4_do-expression-body-begin: + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: + - 4_do-expression-body-end + 4_do-expression-body-end: + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + pop: 'True' + - match: (?=\S) + push: + - 4_statement-or-expression + 4_function-call: + - include: 4_comment-no-pop + - include: Naomi/integration/syntaxes/src/js/expression.yml + 4_function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - match: '' + pop: 'True' + 4_globals: + - include: Naomi/integration/syntaxes/src/js/node-js.yml + - include: Naomi/integration/syntaxes/src/js/react-js.yml + - include: Naomi/integration/syntaxes/src/js/jest.yml + - include: Naomi/integration/syntaxes/src/js/web.yml + - include: Naomi/integration/syntaxes/src/js/core.yml + 4_head: + - include: 4_comment-no-pop + - include: 4_do-expression + - include: 4_globals + - include: Naomi/integration/syntaxes/src/js/jsx1.yml + - include: Naomi/integration/syntaxes/src/js/literal/index.yml + - include: Naomi/integration/syntaxes/src/js/class/index.yml + - include: Naomi/integration/syntaxes/src/js/function-expression.yml + - include: Naomi/integration/syntaxes/src/js/function-call/index.yml + - include: 42_function-assigned-to-variable + - include: Naomi/integration/syntaxes/src/js/constant.yml + - include: Naomi/integration/syntaxes/src/js/variable.yml + - match: \( + scope: punctuation.section.group.begin.js.fjsx15 + set: + - 4_open-group + 4_meta-do-expression: + - meta_scope: meta.do-expression.js.fjsx15 + - match: '' + pop: 'True' + 4_open-group: + - meta_scope: meta.group.js.fjsx15 + - include: 4_comment-no-pop + - include: 4_close-group + - match: (?=:) + set: + - 4_close-group + - 4_type-cast + - match: (?=\S) + push: + - - include: 4_shared-main + - match: '' + set: + - 4_optional-tail + - 4_head + 4_optional-tail: + - include: 4_comment-no-pop + - match: (?=\() + push: + - 4_function-call-meta-scope + - 4_function-call + - match: (?=\[) + push: + - 4_property-access + - include: Naomi/integration/syntaxes/src/js/operator/index.yml + - match: (?=\S) + pop: 'True' + 4_property-access: + - include: 4_comment-no-pop + - include: Naomi/integration/syntaxes/src/js/property-access.yml + 4_regex-literal: + - include: Naomi/integration/syntaxes/src/js/literal/string/regex/index.yml + 4_shared-main: + - include: 4_comma + - match: (?=/) + set: + - 4_optional-tail + - 4_regex-literal + - include: Naomi/integration/syntaxes/src/js/arrow-function/index.yml + - include: Naomi/integration/syntaxes/src/js/jsx1-early.yml + - match: (?=\.\d) + set: + - - include: Naomi/integration/syntaxes/src/js/literal/number.yml + - include: Naomi/integration/syntaxes/src/js/operator/index.yml + 4_statement-or-expression: + - include: 4_comment-no-pop + - include: Naomi/integration/syntaxes/src/js/statement.yml + - include: Naomi/integration/syntaxes/src/js/expression.yml + 4_type-cast: + - include: Naomi/integration/syntaxes/src/facebook-flow/cast.yml + Naomi/integration/syntaxes/src/facebook-flow/cast.yml: + - match: ':' + scope: keyword.operator.other.cast.flow + set: + - 5_optional-type-expression + 5_optional-type-expression: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-type-expression.yml + Naomi/integration/syntaxes/src/facebook-flow/optional-type-expression.yml: + - match: (?=[>,;:)\]}]) + pop: 'True' + - include: Naomi/integration/syntaxes/src/facebook-flow/type-expression.yml + Naomi/integration/syntaxes/src/facebook-flow/type-expression.yml: + - include: 7_comment-no-pop + - include: Naomi/integration/syntaxes/src/facebook-flow/function/index.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/operator/index.yml + - match: \( + scope: punctuation.section.group.begin.flow + set: + - 7_open-group + - match: (?=\S) + set: + - 7_optional-tail + - 7_head + 7_close-group: + - match: \) + scope: punctuation.section.group.end.flow + set: + - 7_optional-tail + 7_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 7_else-pop: + - match: (?=\S) + pop: 'True' + 7_head: + - include: 7_comment-no-pop + - include: Naomi/integration/syntaxes/src/facebook-flow/object.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/tuple.yml + - include: Naomi/integration/syntaxes/src/js/literal/number.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/double-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/single-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/template.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/simple.yml + 7_open-group: + - include: 7_comment-no-pop + - include: Naomi/integration/syntaxes/src/facebook-flow/function.no-pop.yml + - match: \( + scope: punctuation.section.group.begin.flow + push: + - 7_open-group + - include: 7_close-group + - match: (?=\S) + push: + - 7_optional-type-expression + 7_optional-tail: + - include: 7_comment-no-pop + - match: (?=[\[<]) + set: + - 7_optional-tail + - 7_tail + - include: Naomi/integration/syntaxes/src/facebook-flow/operator/index.yml + - include: 7_else-pop + 7_optional-type-expression: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-type-expression.yml + 7_tail: + - include: 7_comment-no-pop + - include: Naomi/integration/syntaxes/src/facebook-flow/operator/array-shorthand.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.yml + Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.yml: + - match: \< + scope: punctuation.section.generic.begin.flow + set: + - 8_delimiters + - 8_optional-type-expression + 8_delimiters: + - meta_scope: meta.generic.flow + - match: \, + scope: punctuation.separator.comma.flow + push: + - 8_optional-type-expression + - match: \> + scope: punctuation.section.generic.end.flow + pop: 'True' + 8_optional-type-expression: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-type-expression.yml + Naomi/integration/syntaxes/src/facebook-flow/operator/array-shorthand.yml: + - match: ((\[)\s*(])) + captures: + 1: meta.sequence.flow + 2: punctuation.section.brackets.begin.flow + 3: punctuation.section.brackets.end.flow + pop: 'True' + Naomi/integration/syntaxes/src/facebook-flow/operator/index.yml: + - include: Naomi/integration/syntaxes/src/facebook-flow/operator/typeof.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/operator/intersection.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/operator/nullable.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/operator/union.yml + Naomi/integration/syntaxes/src/facebook-flow/operator/union.yml: + - match: \|(?!}) + scope: keyword.operator.other.union.flow + set: + - 11_optional-type-expression + 11_optional-type-expression: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-type-expression.yml + Naomi/integration/syntaxes/src/facebook-flow/operator/nullable.yml: + - match: \? + scope: storage.modifier.nullable.flow + set: + - 12_optional-type-expression + 12_optional-type-expression: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-type-expression.yml + Naomi/integration/syntaxes/src/facebook-flow/operator/intersection.yml: + - match: \& + scope: keyword.operator.other.intersection.flow + set: + - 13_optional-type-expression + 13_optional-type-expression: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-type-expression.yml + Naomi/integration/syntaxes/src/facebook-flow/operator/typeof.yml: + - match: (?i)typeof\b + scope: keyword.operator.word.typeof.flow + set: + - 14_type + 14_type: + - include: Naomi/integration/syntaxes/src/facebook-flow/type-expression.yml + Naomi/integration/syntaxes/src/facebook-flow/function.no-pop.yml: + - match: | + (?xi) + (?= + {{15_genericArguments}}? + {{15_flowFunction}} + ) + push: + - 15_declaration + - match: | + (?xi) + (?= + {{15_complexType}} + \s*=> + (?!\s*{) + ) + push: + - 15_return + - 15_meta-parameters + - 15_optional-tail + - 15_head + 15_declaration: + - include: 16_declaration + 15_head: + - include: 16_head + 15_meta-parameters: + - include: 16_meta-parameters + 15_optional-tail: + - include: 16_optional-tail + 15_return: + - include: 16_return + Naomi/integration/syntaxes/src/facebook-flow/function/index.yml: + - match: | + (?xi) + (?= + {{16_genericArguments}}? + {{16_flowFunction}} + ) + set: + - 16_declaration + - match: | + (?xi) + (?= + {{16_commonIdentifier}} + {{16_genericArguments}} + \s*=> + (?!\s*\{) + ) + set: + - 16_return + - 16_meta-parameters + - 16_optional-tail + - 16_head + 16_declaration: + - match: (?=<) + push: + - 16_generic-arguments + - match: (?=\() + set: + - 16_return + - 16_parameters + 16_generic-arguments: + - include: Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.yml + 16_head: + - include: 7_head + 16_meta-parameters: + - meta_scope: meta.function.parameters.flow + - include: 16_pop-now + 16_optional-tail: + - include: 7_optional-tail + 16_optional-type-expression: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-type-expression.yml + 16_parameters: + - include: Naomi/integration/syntaxes/src/facebook-flow/function/parameters/index.yml + 16_pop-now: + - match: '' + pop: 'True' + 16_return: + - match: => + scope: storage.type.function.arrow.flow + set: + - 16_optional-type-expression + Naomi/integration/syntaxes/src/facebook-flow/function/parameters/index.yml: + - match: \( + scope: punctuation.section.group.begin.flow + set: + - 17_delimiters + - 17_optional-parameter + 17_delimiters: + - match: \, + scope: punctuation.separator.comma.flow + push: + - 17_optional-parameter + - match: \) + scope: punctuation.section.group.end.flow + pop: 'True' + 17_optional-parameter: + - meta_scope: meta.function.parameters.flow + - match: \.{3} + scope: keyword.operator.other.rest.flow + - include: Naomi/integration/syntaxes/src/facebook-flow/function/parameters/simple.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-type-expression.yml + Naomi/integration/syntaxes/src/facebook-flow/function/parameters/simple.yml: + - match: | + (?xi) + ({{18_commonIdentifier}})(\?)? + (?=\s*:) + captures: + 1: variable.parameter.function.js.fjsx15 + 2: storage.modifier.flow + set: + - 18_optional-associated-type + 18_optional-associated-type: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-associated-type.yml + Naomi/integration/syntaxes/src/facebook-flow/optional-associated-type.yml: + - match: (?=:) + set: + - 19_associated-type + - match: (?=\S) + pop: 'True' + 19_associated-type: + - include: Naomi/integration/syntaxes/src/facebook-flow/associated-type.yml + Naomi/integration/syntaxes/src/facebook-flow/associated-type.yml: + - match: ':' + scope: punctuation.binding.flow + set: + - 20_optional-type-expression + 20_optional-type-expression: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-type-expression.yml + Naomi/integration/syntaxes/src/facebook-flow/simple.yml: + - include: Naomi/integration/syntaxes/src/facebook-flow/namespace-path.no-pop.yml + - match: \* + scope: support.type.existential.flow + pop: 'True' + - match: | + (?x) + (?> any + | Array + | [Bb]oolean + | false + | Function + | Generator + | mixed + | [Nn]umber + | null + | Object + | [Ss]tring + | true + | undefined + | void + )\b + scope: support.type.primitive.flow + pop: 'True' + - match: (?xi){{21_commonIdentifier}} + scope: variable.other.type.flow + pop: 'True' + Naomi/integration/syntaxes/src/facebook-flow/namespace-path.no-pop.yml: + - match: | + (?xi) + ({{22_commonIdentifier}})\s* + (?> (\?\.) + | (\.) + ) + captures: + 1: variable.other.namespace.flow + 2: punctuation.accessor.optional-chain.flow + 3: punctuation.accessor.flow + Naomi/integration/syntaxes/src/js/literal/string/template.yml: + - match: (?xi){{23_commonIdentifier}}(?=\s*\`) + scope: entity.name.function.tag.js.fjsx15 + set: + - Naomi/integration/syntaxes/src/js/literal/string/template.yml + - match: \` + scope: punctuation.definition.string.begin.js.fjsx15 + set: + - - meta_scope: string.template.js.fjsx15 + - match: \` + scope: punctuation.definition.string.end.js.fjsx15 + pop: 'True' + - match: (?xi){{23_escapeSequences}} + scope: constant.character.escape.js.fjsx15 + 23_close-embedded-expression: + - clear_scopes: true + - meta_scope: source.js meta.template-expression.js.fjsx15 + - match: \} + scope: punctuation.definition.template-expression.end.js.fjsx15 + pop: 'True' + 23_embedded-content: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + 23_embedded-expression-no-pop: + - match: \$\{ + scope: punctuation.definition.template-expression.begin.js.fjsx15 + push: + - 23_close-embedded-expression + - 23_embedded-content + Naomi/integration/syntaxes/src/js/literal/string/single-quoted.yml: + - match: \' + scope: punctuation.definition.string.begin.js.fjsx15 + set: + - 24_string + 24_trap: + - meta_content_scope: context.trap + 24_string: + - meta_scope: string.quoted.single.js.fjsx15 + - match: (? \$\B + | [_[:upper:]]\b + ) + ) + (?:\s*(\?\B))? + captures: + 1: meta.object-literal.key.flow string.unquoted.flow + 2: storage.modifier.optional.flow + set: + - 28_associated-type + 28_delimiters: + - match: (?:(,)|(;)) + captures: + 1: punctuation.separator.comma.flow + 2: punctuation.terminator.flow + push: + - 28_optional-property-or-method + - match: (\|)\s*(}) + captures: + 1: punctuation.section.block.end.flow + 2: punctuation.section.block.end.flow + pop: 'True' + - match: \} + scope: punctuation.section.block.end.flow + pop: 'True' + 28_else-pop: + - match: (?=\S) + pop: 'True' + 28_meta-scope: + - meta_scope: meta.object-literal.flow meta.block.flow + - include: 28_pop-now + 28_meta-exact: + - meta_scope: meta.object-literal.exact.flow meta.block.flow + - include: 28_pop-now + 28_optional-property-or-method: + - include: 28_comment-no-pop + - match: (?=[|}]) + pop: 'True' + - include: 28_co-contra-variant-no-pop + - match: \.{3} + scope: keyword.operator.spread.flow + set: + - 28_type-expression + - include: Naomi/integration/syntaxes/src/js/class/modifier.yml + - include: Naomi/integration/syntaxes/src/js/class/method.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/indexer.yml + - include: 28_constant + - include: 28_variable + - match: (?=(?>'|"|`)) + set: + - 28_associated-type + - 28_string + - include: 28_else-pop + 28_pop-now: + - match: '' + pop: 'True' + 28_string: + - include: Naomi/integration/syntaxes/src/js/literal/string/double-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/single-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/template.yml + 28_type-expression: + - include: Naomi/integration/syntaxes/src/facebook-flow/type-expression.yml + 28_variable: + - match: | + (?xi) + ((?> \$\B + | [_[:alpha:]]\b + )) + (?:\s*(\?))? + captures: + 1: meta.object-literal.key.flow string.unquoted.flow + 2: storage.modifier.optional.flow + set: + - 28_associated-type + - match: | + (?xi) + ( + {{28_commonIdentifier}} + (?> \$\B + | [_[:alnum:]]\b + ) + ) + (?:\s*(\?))? + captures: + 1: meta.object-literal.key.flow string.unquoted.flow + 2: storage.modifier.optional.flow + set: + - 28_associated-type + Naomi/integration/syntaxes/src/facebook-flow/indexer.yml: + - match: \[ + scope: punctuation.section.brackets.begin.flow + set: + - 29_optional-associated-type + - 29_indexer-end + - 29_optional-name + 29_associated-type: + - include: Naomi/integration/syntaxes/src/facebook-flow/associated-type.yml + 29_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 29_indexer-end: + - match: \] + scope: punctuation.section.brackets.end.flow + pop: 'True' + 29_optional-associated-type: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-associated-type.yml + 29_optional-name: + - include: 29_comment-no-pop + - match: | + (?xi) + ({{29_commonIdentifier}})(\?)? + (?=\s*:) + captures: + 1: variable.parameter.function.js.fjsx15 + 2: storage.modifier.optional.flow + set: + - 29_associated-type + - match: (?=(?>'|"|`)) + set: + - 29_associated-type + - 29_string + - match: (?=\S) + set: + - 29_type-expression + 29_string: + - include: Naomi/integration/syntaxes/src/js/literal/string/double-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/single-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/template.yml + 29_type-expression: + - include: Naomi/integration/syntaxes/src/facebook-flow/type-expression.yml + Naomi/integration/syntaxes/src/js/comment.no-pop.yml: + - match: (?=/(?>/|\*)) + push: + - - include: Naomi/integration/syntaxes/src/js/comment/index.yml + Naomi/integration/syntaxes/src/js/comment/index.yml: + - include: Naomi/integration/syntaxes/src/facebook-flow/prolog.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/comment.yml + - include: Naomi/integration/syntaxes/src/js/comment/docblock.yml + - include: Naomi/integration/syntaxes/src/js/comment/block.yml + - include: Naomi/integration/syntaxes/src/js/comment/line.yml + Naomi/integration/syntaxes/src/js/comment/line.yml: + - match: // + scope: punctuation.definition.comment.begin.js.fjsx15 + set: + - 32_line + 32_no-pop: + - match: // + scope: punctuation.definition.comment.begin.js.fjsx15 + push: + - 32_line + 32_line: + - meta_scope: comment.line.js.fjsx15 + - include: 32_email-no-pop + - include: 32_link-no-pop + - match: \n|$ + pop: 'True' + 32_email-no-pop: + - include: Naomi/integration/syntaxes/src/shared/email.no-pop.yml + 32_link-no-pop: + - include: Naomi/integration/syntaxes/src/shared/link.no-pop.yml + Naomi/integration/syntaxes/src/shared/link.no-pop.yml: + - match: (?i)([[:alnum:]]+://\S+)\s + captures: + 1: entity.link + Naomi/integration/syntaxes/src/shared/email.no-pop.yml: + - match: | + (?xi) + (?> ([.[:alnum:]]+@[.[:alnum:]]+)\s + | (<[.[:alnum:]]+@[.[:alnum:]]+>) + ) + captures: + 1: entity.email + 2: entity.email + Naomi/integration/syntaxes/src/js/comment/block.yml: + - match: /\* + scope: punctuation.definition.comment.begin.js.fjsx15 + set: + - 35_block + 35_block: + - meta_scope: comment.block.js.fjsx15 + - include: 35_email-no-pop + - include: 35_link-no-pop + - match: \*/ + scope: punctuation.definition.comment.end.js.fjsx15 + pop: 'True' + 35_email-no-pop: + - include: Naomi/integration/syntaxes/src/shared/email.no-pop.yml + 35_link-no-pop: + - include: Naomi/integration/syntaxes/src/shared/link.no-pop.yml + Naomi/integration/syntaxes/src/js/comment/docblock.yml: + - match: /\*\*(?!/) + scope: punctuation.definition.comment.begin.js.fjsx15 + set: + - 36_block + 36_block: + - meta_scope: comment.block.documentation.js.fjsx15 + - include: 36_email-no-pop + - include: 36_link-no-pop + - match: \*/ + scope: punctuation.definition.comment.end.js.fjsx15 + pop: 'True' + 36_email-no-pop: + - include: Naomi/integration/syntaxes/src/shared/email.no-pop.yml + 36_link-no-pop: + - include: Naomi/integration/syntaxes/src/shared/link.no-pop.yml + Naomi/integration/syntaxes/src/facebook-flow/comment.yml: + - match: /\*\s*(?>::|flow-include) + scope: punctuation.definition.comment.begin.flow + set: + - 37_block-end + - match: /\*(?=\s*:) + scope: punctuation.definition.comment.begin.flow + set: + - 37_block-end + 37_block-end: + - meta_scope: comment.block.flow + - match: \*/ + scope: punctuation.definition.comment.end.js.fjsx15 + pop: 'True' + - match: (;) + captures: + 1: punctuation.terminator.flow + - match: (?=\S) + 37_statement-without-label: + - include: Naomi/integration/syntaxes/src/facebook-flow/declare.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/interface.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/type-aliasing.yml + - include: Naomi/integration/syntaxes/src/js/decorator.yml + - include: Naomi/integration/syntaxes/src/js/import.yml + - include: Naomi/integration/syntaxes/src/js/export.yml + - include: Naomi/integration/syntaxes/src/js/class/index.yml + - include: Naomi/integration/syntaxes/src/js/function/index.yml + - include: Naomi/integration/syntaxes/src/js/variable-declaration.yml + - include: 38_block + - include: 38_break-continue + - include: 38_debugger + - include: 38_do-while + - include: 38_empty + - include: 38_for + - include: 38_if-else + - include: 38_return + - include: 38_switch-case + - include: 38_throw + - include: 38_try-catch-finally + Naomi/integration/syntaxes/src/js/statement.yml: + - include: Naomi/integration/syntaxes/src/facebook-flow/declare.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/interface.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/type-aliasing.yml + - include: Naomi/integration/syntaxes/src/js/decorator.yml + - include: Naomi/integration/syntaxes/src/js/import.yml + - include: Naomi/integration/syntaxes/src/js/export.yml + - include: Naomi/integration/syntaxes/src/js/class/index.yml + - include: Naomi/integration/syntaxes/src/js/function/index.yml + - include: Naomi/integration/syntaxes/src/js/variable-declaration.yml + - include: 38_block + - include: 38_break-continue + - include: 38_debugger + - include: 38_do-while + - include: 38_empty + - include: 38_for + - include: 38_if-else + - include: 38_label + - include: 38_return + - include: 38_switch-case + - include: 38_throw + - include: 38_try-catch-finally + 38_asi-checked-optional-expression: + - match: (?=\s*\n) + pop: 'True' + - include: 38_optional-expression + 38_block: + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: + - 38_block-end + 38_block-end: + - meta_scope: meta.block.js.fjsx15 + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + pop: 'True' + - match: '' + push: + - 38_optional-statement-or-expression + 38_break-continue: + - match: | + (?xi) + (?>(break)|(continue))\b + (?:\s+({{38_commonIdentifier}}))? + captures: + 1: keyword.control.flow.break.js.fjsx15 + 2: keyword.control.flow.break.continue.js.fjsx15 + 3: entity.name.label.js.fjsx15 + pop: 'True' + 38_colon: + - match: ':' + scope: punctuation.separator.js.fjsx15 + pop: 'True' + 38_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 38_debugger: + - match: debugger\b + scope: keyword.other.js.fjsx15 + pop: 'True' + 38_do-while: + - match: do\b + scope: keyword.control.loop.js.fjsx15 + set: + - 38_meta-loop-do + - 38_optional-while + - 38_optional-statement-or-expression + - match: while\b + scope: keyword.control.loop.js.fjsx15 + set: + - 38_meta-loop-while + - 38_optional-statement-or-expression + - 38_optional-expression + 38_else-pop: + - match: (?=\S) + pop: 'True' + 38_empty: + - match: \; + scope: punctuation.terminator.js.fjsx15 + pop: 'True' + 38_expression: + - include: Naomi/integration/syntaxes/src/js/expression.yml + 38_for: + - match: for\b + scope: keyword.control.loop.js.fjsx15 + set: + - 38_meta-loop-for + - 38_optional-statement-or-expression + - 38_for-header + - 38_optional-await + 38_for-header: + - match: \( + scope: punctuation.section.group.begin.js.fjsx15 + set: + - 38_meta-group + - 38_for-header-end + 38_for-header-end: + - match: \) + scope: punctuation.section.group.end.js.fjsx15 + pop: 'True' + - match: (?=(?>const|let|var)) + push: + - 38_statement-or-expression + - match: (?=\S) + push: + - - include: 38_empty + - include: 38_expression + 38_if-else: + - match: if\b + scope: keyword.control.conditional.js.fjsx15 + set: + - 38_meta-conditional + - 38_optional-statement-or-expression + - 38_optional-expression + - match: else\b + scope: keyword.control.conditional.js.fjsx15 + set: + - 38_meta-conditional + - 38_optional-else-if + 38_label: + - match: | + (?xi) + (?!default) + ({{38_commonIdentifier}}) + \s*(:) + captures: + 1: entity.name.label.js.fjsx15 + 2: punctuation.separator.js.fjsx15 + set: + - 38_optional-statement-or-expression + 38_meta-group: + - meta_scope: meta.group.js.fjsx15 + - include: 38_pop-now + 38_meta-conditional: + - meta_scope: meta.conditional.js.fjsx15 + - include: 38_pop-now + 38_meta-loop-do: + - meta_scope: meta.loop.do.js.fjsx15 + - include: 38_pop-now + 38_meta-loop-for: + - meta_scope: meta.loop.for.js.fjsx15 + - include: 38_pop-now + 38_meta-loop-while: + - meta_scope: meta.loop.while.js.fjsx15 + - include: 38_pop-now + 38_meta-switch: + - meta_scope: meta.switch.js.fjsx15 + - include: 38_pop-now + 38_no-meta-if: + - match: if\b + scope: keyword.control.conditional.js.fjsx15 + set: + - 38_optional-statement-or-expression + - 38_optional-expression + 38_optional-await: + - include: 40_just-pop + - include: 38_else-pop + 38_optional-else-if: + - include: 38_no-meta-if + - include: 38_optional-statement-or-expression + 38_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + 38_optional-statement-or-expression: + - include: Naomi/integration/syntaxes/src/js/optional-statement-or-expression.yml + 38_optional-while: + - include: 38_comment-no-pop + - match: while\b + scope: keyword.control.loop.js.fjsx15 + set: + - 38_optional-expression + 38_pop-now: + - match: '' + pop: 'True' + 38_return: + - match: return\b + scope: keyword.control.flow.return.js.fjsx15 + set: + - 38_asi-checked-optional-expression + 38_statement-or-expression: + - include: Naomi/integration/syntaxes/src/js/comment/index.yml + - include: Naomi/integration/syntaxes/src/js/statement.yml + - include: Naomi/integration/syntaxes/src/js/expression.yml + - include: 38_else-pop + 38_statement-or-expression-header-end: + - match: \) + scope: punctuation.section.group.end.js.fjsx15 + pop: 'True' + - match: (?=\S) + push: + - 38_statement-or-expression + 38_switch-case: + - match: switch\b + scope: keyword.control.switch.js.fjsx15 + set: + - 38_meta-switch + - 38_optional-expression + - match: case\b + scope: keyword.control.switch.js.fjsx15 + set: + - 38_colon + - 38_optional-expression + - match: default\b + scope: keyword.control.switch.js.fjsx15 + set: + - 38_colon + - 38_optional-expression + 38_throw: + - match: throw\b + scope: keyword.control.flow.break.throw.js.fjsx15 + set: + - 38_asi-checked-optional-expression + 38_try-catch-finally: + - match: try\b + scope: keyword.control.trycatch.js.fjsx15 + pop: 'True' + - match: catch\b + scope: keyword.control.trycatch.js.fjsx15 + set: + - 38_optional-expression + - match: finally\b + scope: keyword.control.trycatch.js.fjsx15 + pop: 'True' + Naomi/integration/syntaxes/src/js/optional-statement-or-expression.yml: + - match: (?=[)\]}]) + pop: 'True' + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/statement.yml + - include: Naomi/integration/syntaxes/src/js/expression.yml + Naomi/integration/syntaxes/src/js/operator/await.yml: + - match: await\b + scope: keyword.control.flow.await.js.fjsx15 + set: + - 40_optional-expression + 40_just-pop: + - match: \s*(await)\b + captures: + 1: keyword.control.flow.await.js.fjsx15 + pop: 'True' + 40_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/variable-declaration.yml: + - match: (?=(?>const|let|var)\b) + set: + - 41_optional-type-and-initial-value + - 41_variable-or-constant + - 41_keyword + 41_associated-type: + - include: Naomi/integration/syntaxes/src/facebook-flow/associated-type.yml + 41_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 41_else-pop: + - match: (?=\S) + pop: 'True' + 41_keyword: + - match: (?>const|let|var)\b + scope: storage.type.js.fjsx15 + pop: 'True' + 41_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + 41_optional-type-and-initial-value: + - meta_scope: meta.declaration.variable.js.fjsx15 + - match: (?=:) + push: + - 41_associated-type + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: + - 41_variable-or-constant + - match: (?==) + push: + - 41_optional-expression + - include: 41_else-pop + 41_constant: + - match: | + (?x) + (\#)? + ([_[:upper:]])\b + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.constant.js.fjsx15 + pop: 'True' + - match: | + (?x) + (\#)? + ( + {{41_constantIdentifier}} + (?> \$\B + | [_[:upper:][:digit:]]\b + ) + ) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.constant.js.fjsx15 + pop: 'True' + 41_variable: + - match: | + (?xi) + (\#)? + ((?> \$\B + | [_[:alpha:]]\b + )) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.readwrite.js.fjsx15 + pop: 'True' + - match: | + (?xi) + (\#)? + ( + {{41_commonIdentifier}} + (?> \$\B + | [_[:alnum:]]\b + ) + ) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.readwrite.js.fjsx15 + pop: 'True' + 41_variable-or-constant: + - include: 41_comment-no-pop + - include: Naomi/integration/syntaxes/src/js/destructuring/array.yml + - include: Naomi/integration/syntaxes/src/js/destructuring/object/index.yml + - include: 42_function-assigned-to-variable + - include: 41_constant + - include: 41_variable + Naomi/integration/syntaxes/src/js/variable.yml: + - include: 42_object + - include: 42_simple + 42_arrow-body: + - include: Naomi/integration/syntaxes/src/js/arrow-function/body.yml + 42_assignment: + - match: '=' + scope: keyword.operator.assignment.js.fjsx15 + pop: 'True' + 42_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 42_function-assigned-to-variable: + - match: | + (?x) + (?={{42_normalArrowFunctionAssignedToVariable}}) + set: + - 42_normal-arrow-function + - 42_assignment + - 42_optional-type + - 42_function-identifier + - match: | + (?x) + (?={{42_singleParameterArrowFunctionAssignedToVariable}}) + set: + - 42_single-parameter-arrow-function + - 42_assignment + - 42_optional-type + - 42_function-identifier + - match: | + (?x) + (?= + {{42_commonIdentifier}} + (?:\s*{{42_type}})? + \s*=\s* + (?:async\b\s+)? + function\s + ) + set: + - 42_function + - 42_assignment + - 42_optional-type + - 42_function-identifier + 42_function: + - meta_scope: meta.declaration.function.js.fjsx15 meta.function.js.fjsx15 + - include: Naomi/integration/syntaxes/src/js/function/index.yml + 42_function-identifier: + - match: (?xi){{42_commonIdentifier}} + scope: entity.name.function.js.fjsx15 + pop: 'True' + 42_normal-arrow-function: + - meta_scope: meta.declaration.function.arrow.js.fjsx15 + - include: Naomi/integration/syntaxes/src/js/async.no-pop.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/function/parameters.no-pop.yml + - match: (?==>) + set: + - 42_arrow-body + 42_single-parameter-arrow-function: + - meta_scope: meta.declaration.function.arrow.js.fjsx15 + - include: Naomi/integration/syntaxes/src/js/async.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/function/parameter/simple.no-pop.yml + - match: (?==>) + set: + - 42_arrow-body + 42_optional-type: + - include: 42_comment-no-pop + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-associated-type.yml + 42_object: + - match: | + (?xi) + (\#)? + ({{42_commonIdentifier}}) + (?=\s*\??\.) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.object.js.fjsx15 + pop: 'True' + 42_simple: + - match: | + (?xi) + (\#)? + ((?> \$\B + | [_[:alpha:]]\b + )) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.readwrite.js.fjsx15 + pop: 'True' + - match: | + (?xi) + (\#)? + ( + {{42_commonIdentifier}} + (?> \$\B + | [_[:alnum:]]\b + ) + ) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.readwrite.js.fjsx15 + pop: 'True' + Naomi/integration/syntaxes/src/js/function/parameter/simple.no-pop.yml: + - match: | + (?xi) + (?= + (?:\.{3})? + {{43_commonIdentifier}} + ) + push: + - 43_parameter + 43_parameter: + - include: Naomi/integration/syntaxes/src/js/function/parameter/simple.yml + Naomi/integration/syntaxes/src/js/function/parameter/simple.yml: + - match: | + (?xi) + {{44_commonIdentifier}} + (?= + \s*\?? + \s*{{44_type}}? + (?:\s*/\*.*?\*/)? + \s*=(?!\s*>) + ) + scope: variable.parameter.function.js.fjsx15 + set: + - 44_optional-default-value + - 44_optional-modifier-and-type + - match: (?xi){{44_commonIdentifier}} + scope: variable.parameter.function.js.fjsx15 + set: + - 44_optional-modifier-and-type + 44_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 44_expression: + - include: Naomi/integration/syntaxes/src/js/expression.yml + 44_optional-default-value: + - meta_scope: meta.function.parameter.optional.js.fjsx15 + - include: 44_comment-no-pop + - match: (?=(?>[,;:)\]}]|=>)) + pop: 'True' + - match: (?==) + push: + - 44_expression + 44_optional-modifier-and-type: + - include: 44_comment-no-pop + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-modifier.no-pop.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-associated-type.yml + Naomi/integration/syntaxes/src/facebook-flow/optional-modifier.no-pop.yml: + - match: (?=\?) + push: + - 45_optional-modifier + 45_optional-modifier: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-modifier.yml + Naomi/integration/syntaxes/src/facebook-flow/optional-modifier.yml: + - match: \? + scope: storage.modifier.optional.flow + pop: 'True' + Naomi/integration/syntaxes/src/js/async.no-pop.yml: + - match: async\b + scope: storage.modifier.async.js.fjsx15 + Naomi/integration/syntaxes/src/js/function/parameters.no-pop.yml: + - match: (?=\() + push: + - 48_parameters + 48_parameters: + - include: Naomi/integration/syntaxes/src/js/function/parameters.yml + Naomi/integration/syntaxes/src/js/function/parameters.yml: + - match: \( + scope: punctuation.section.group.begin.js.fjsx15 + set: + - 49_delimiters + 49_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 49_delimiters: + - meta_scope: meta.function.parameters.js.fjsx15 meta.group.js.fjsx15 + - include: 49_comment-no-pop + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + - match: \) + scope: punctuation.section.group.end.js.fjsx15 + set: + - 49_optional-return-type + - include: Naomi/integration/syntaxes/src/js/operator/rest.no-pop.yml + - match: (?=\S) + push: + - 49_parameter + 49_optional-return-type: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-associated-type.yml + 49_parameter: + - include: 49_comment-no-pop + - include: Naomi/integration/syntaxes/src/js/function/parameter/destructuring/array.yml + - include: Naomi/integration/syntaxes/src/js/function/parameter/destructuring/object/index.yml + - include: Naomi/integration/syntaxes/src/js/function/parameter/simple.yml + Naomi/integration/syntaxes/src/js/function/parameter/destructuring/object/index.yml: + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: + - 50_meta + - 50_delimiters + - 50_optional-parameter + 50_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 50_delimiters: + - include: 50_comment-no-pop + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: + - 50_optional-parameter + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + set: + - 50_optional-type-and-default-value + 50_meta: + - meta_scope: meta.binding.destructuring.mapping.js.fjsx15 meta.block.js.fjsx15 + - match: '' + pop: 'True' + 50_optional-parameter: + - include: 50_comment-no-pop + - match: (?=[,)\]}]) + pop: 'True' + - include: Naomi/integration/syntaxes/src/js/operator/rest.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/function/parameter/destructuring/object/property.yml + - include: Naomi/integration/syntaxes/src/js/function/parameter/destructuring/array.yml + - include: Naomi/integration/syntaxes/src/js/function/parameter/destructuring/object/index.yml + - include: Naomi/integration/syntaxes/src/js/function/parameter/simple.yml + 50_optional-type-and-default-value: + - match: (?=,) + pop: 'True' + - include: Naomi/integration/syntaxes/src/facebook-flow/associated-type.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/facebook-flow/associated-type.no-pop.yml: + - match: (?=:) + push: + - 51_associated-type + 51_associated-type: + - include: Naomi/integration/syntaxes/src/facebook-flow/associated-type.yml + Naomi/integration/syntaxes/src/js/function/parameter/destructuring/array.yml: + - match: \[ + scope: punctuation.section.brackets.begin.js.fjsx15 + set: + - 52_meta + - 52_delimiters + - 52_optional-parameter + 52_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 52_delimiters: + - include: 52_comment-no-pop + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: + - 52_optional-parameter + - match: \] + scope: punctuation.section.brackets.end.js.fjsx15 + set: + - 52_optional-type-and-default-value + 52_meta: + - meta_scope: meta.binding.destructuring.sequence.js.fjsx15 meta.block.js.fjsx15 + - match: '' + pop: 'True' + 52_optional-parameter: + - include: 52_comment-no-pop + - match: (?=[,)\]}]) + pop: 'True' + - include: Naomi/integration/syntaxes/src/js/operator/rest.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/function/parameter/destructuring/array.yml + - include: Naomi/integration/syntaxes/src/js/function/parameter/destructuring/object/index.yml + - include: Naomi/integration/syntaxes/src/js/function/parameter/simple.yml + 52_optional-type-and-default-value: + - match: (?=,) + pop: 'True' + - include: Naomi/integration/syntaxes/src/facebook-flow/associated-type.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/operator/rest.no-pop.yml: + - match: (?=\.{3}) + push: + - 53_rest-operator + 53_rest-operator: + - include: Naomi/integration/syntaxes/src/js/operator/rest.yml + Naomi/integration/syntaxes/src/js/operator/rest.yml: + - match: \.{3} + scope: keyword.operator.rest.js.fjsx15 + pop: 'True' + Naomi/integration/syntaxes/src/js/function/parameter/destructuring/object/property.yml: + - match: (?=(?>'|"|`)) + set: + - 55_optional-alias + - 55_string + - match: \[ + scope: punctuation.definition.object.computed-property.begin.js.fjsx15 + set: + - 55_optional-alias + - 55_computed-property-end + - 55_optional-expression + - match: (?xi){{55_commonIdentifier}}(?=\s*:) + scope: meta.binding.destructuring.mapping.key.js.fjsx15 + set: + - 55_optional-alias + 55_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 55_computed-property-end: + - match: \] + scope: punctuation.definition.object.computed-property.end.js.fjsx15 + pop: 'True' + 55_optional-alias: + - match: ':' + scope: punctuation.binding.js.fjsx15 + set: + - 55_optional-parameter + - match: (?=\S) + pop: 'True' + 55_optional-parameter: + - include: 55_comment-no-pop + - match: (?=\)) + pop: 'True' + - include: Naomi/integration/syntaxes/src/js/function/parameter/destructuring/array.yml + - include: Naomi/integration/syntaxes/src/js/function/parameter/destructuring/object/index.yml + - include: Naomi/integration/syntaxes/src/js/function/parameter/simple.yml + 55_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + 55_string: + - include: Naomi/integration/syntaxes/src/js/literal/string/double-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/single-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/template.yml + Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.no-pop.yml: + - match: (?=<) + push: + - 56_arguments + 56_arguments: + - include: Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.yml + Naomi/integration/syntaxes/src/js/function/index.yml: + - include: 59_function-properties + - match: | + (?x) + (?= + (?:async\s+)? + function\b + ) + set: + - 57_declaration + - 57_keyword + 57_body: + - include: Naomi/integration/syntaxes/src/js/function/body.yml + 57_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 57_declaration: + - meta_scope: meta.declaration.function.js.fjsx15 meta.function.js.fjsx15 + - include: 57_comment-no-pop + - match: (?=\{) + set: + - 57_body + - match: (?=<) + push: + - 57_generic-arguments + - match: (?=\() + set: + - 57_optional-body + - 57_meta-declaration-scope + - 57_parameters + - match: | + (?xi) + (?:(\*)\s*)? + (?:({{57_commonIdentifier}}))? + captures: + 1: storage.modifier.js.fjsx15 + 2: entity.name.function.js.fjsx15 + - include: 57_else-pop + 57_else-pop: + - match: (?=\S) + pop: 'True' + 57_generic-arguments: + - include: Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.yml + 57_keyword: + - include: Naomi/integration/syntaxes/src/js/async.no-pop.yml + - match: function\b + scope: storage.type.function.js.fjsx15 + pop: 'True' + 57_meta-declaration-scope: + - meta_scope: meta.declaration.function.js.fjsx15 + - match: '' + pop: 'True' + 57_optional-body: + - match: (?=\{) + set: + - 57_body + - include: 57_else-pop + 57_parameters: + - include: Naomi/integration/syntaxes/src/js/function/parameters.yml + Naomi/integration/syntaxes/src/js/function/body.yml: + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: + - 58_close-body + - 58_optional-statement-or-expression + 58_close-body: + - meta_scope: meta.function.js.fjsx15 meta.block.js.fjsx15 + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + pop: 'True' + - match: '' + push: + - 58_optional-statement-or-expression + 58_optional-statement-or-expression: + - include: Naomi/integration/syntaxes/src/js/optional-statement-or-expression.yml + Naomi/integration/syntaxes/src/js/core.yml: + - include: 59_console + - include: 59_constants + - include: 59_variables + - include: 59_functions + - include: 59_function-properties + - include: 59_import-properties + - include: 59_fundamental-objects + - include: 59_numbers-and-dates + - include: 59_text-processing + - include: 59_indexed-collections + - include: 59_keyed-collections + - include: 59_structured-data + - include: 59_control-abstraction-objects + - include: 59_reflection + - include: 59_internationalization + - include: 59_web-assembly + 59_array-property-or-function: + - match: (?x){{59_arrayFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: + - 59_function-call-meta-scope + - 59_arguments + - match: (?x){{59_arrayFunctions}} + scope: support.function.js.fjsx15 + pop: 'True' + - include: 59_other-property-or-function + 59_arguments: + - include: Naomi/integration/syntaxes/src/js/function-call/arguments.yml + 59_console: + - match: (console)\s*(\.) + captures: + 1: support.type.object.console.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: + - 59_console-property-or-function + 59_console-property-or-function: + - match: error(?=\s*\() + scope: support.function.console.error.js.fjsx15 + set: + - 59_console-error-meta-scope + - 59_arguments + - match: error\b + scope: support.function.console.error.js.fjsx15 + pop: 'True' + - match: info(?=\s*\() + scope: support.function.console.info.js.fjsx15 + set: + - 59_console-info-meta-scope + - 59_arguments + - match: info\b + scope: support.function.console.info.js.fjsx15 + pop: 'True' + - match: log(?=\s*\() + scope: support.function.console.log.js.fjsx15 + set: + - 59_console-log-meta-scope + - 59_arguments + - match: log\b + scope: support.function.console.log.js.fjsx15 + pop: 'True' + - match: warn(?=\s*\() + scope: support.function.console.warn.js.fjsx15 + set: + - 59_console-warn-meta-scope + - 59_arguments + - match: warn\b + scope: support.function.console.warn.js.fjsx15 + pop: 'True' + - include: 59_other-property-or-function + 59_console-error-meta-scope: + - meta_scope: meta.function-call.console.error.js.fjsx15 + - include: 59_pop-now + 59_console-info-meta-scope: + - meta_scope: meta.function-call.console.info.js.fjsx15 + - include: 59_pop-now + 59_console-log-meta-scope: + - meta_scope: meta.function-call.console.log.js.fjsx15 + - include: 59_pop-now + 59_console-warn-meta-scope: + - meta_scope: meta.function-call.console.warn.js.fjsx15 + - include: 59_pop-now + 59_constants: + - match: | + (?x) + (?> (false) + | (Infinity) + | (NaN) + | (null) + | (true) + | (undefined) + )\b + captures: + 1: constant.language.boolean.false.js.fjsx15 + 2: constant.language.infinity.js.fjsx15 + 3: constant.language.nan.js.fjsx15 + 4: constant.language.null.js.fjsx15 + 5: constant.language.boolean.true.js.fjsx15 + 6: constant.language.undefined.js.fjsx15 + pop: 'True' + 59_control-abstraction-objects: + - match: | + (?x) + (?> Generator(?:Function)? + | Promise + )\b + scope: support.type.object.js.fjsx15 + pop: 'True' + 59_date-property-or-function: + - match: (?x){{59_dateFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: + - 59_function-call-meta-scope + - 59_arguments + - match: (?x){{59_dateFunctions}} + scope: support.function.js.fjsx15 + pop: 'True' + - include: 59_other-property-or-function + 59_function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - include: 59_pop-now + 59_functions: + - match: (?x){{59_globalFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: + - 59_function-call-meta-scope + - 59_arguments + - match: (?x){{59_globalFunctions}} + scope: support.function.js.fjsx15 + pop: 'True' + 59_fundamental-objects: + - match: (Object)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: + - 59_object-property-or-function + - match: (Symbol)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: + - 59_symbol-property-or-function + - match: | + (?x) + (?> Boolean + | Error + | EvalError + | Function + | InternalError + | Object + | RangeError + | ReferenceError + | Symbol + | SyntaxError + | TypeError + | URIError + )\b + scope: support.type.object.js.fjsx15 + pop: 'True' + 59_function-properties: + - match: | + (?x) + (function) + \s*(\.) + \s*(sent) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.variable.js.fsjx15 + pop: 'True' + 59_import-properties: + - match: | + (?x) + (import) + \s*(\.) + \s*(meta) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.variable.js.fsjx15 + pop: 'True' + 59_indexed-collections: + - match: (Array)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: + - 59_array-property-or-function + - match: | + (?x) + (?> Array + | Float(?>32|64)Array + | Int(?>8|16|32)Array + | Uint(?>8|16|32)Array + | Uint8ClampedArray + )\b + scope: support.type.object.js.fjsx15 + pop: 'True' + 59_internationalization: + - match: | + (?x) + (Intl)\b + (?: + \s*(\.)\s* + ((?> Collator + | DateTimeFormat + | NumberFormat + ))\b + )? + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.type.js.fsjx15 + pop: 'True' + 59_json-property-or-function: + - match: (?x){{59_jsonFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: + - 59_function-call-meta-scope + - 59_arguments + - match: (?x){{59_jsonFunctions}} + scope: support.function.js.fjsx15 + pop: 'True' + - include: 59_other-property-or-function + 59_keyed-collections: + - match: | + (?x) + (?> Map + | Set + | Weak(?>Map|Set) + )\b + scope: support.type.object.js.fjsx15 + pop: 'True' + 59_math-property-or-function: + - match: (?x){{59_mathFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: + - 59_function-call-meta-scope + - 59_arguments + - match: (?x){{59_mathFunctions}} + scope: support.function.js.fjsx15 + pop: 'True' + - match: | + (?x) + (?> E + | LN(?>10|2) + | LOG(?>10E|2E) + | PI + | SQRT(?>1_2|2) + )\b + scope: support.constant.js.fjsx15 + pop: 'True' + - include: 59_other-property-or-function + 59_numbers-and-dates: + - match: (Date)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: + - 59_date-property-or-function + - match: (Math)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: + - 59_math-property-or-function + - match: | + (?x) + (?> Date + | Math + | Number + )\b + scope: support.type.object.js.fjsx15 + pop: 'True' + 59_object-property-or-function: + - match: (?x){{59_objectFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: + - 59_function-call-meta-scope + - 59_arguments + - match: (?x){{59_objectFunctions}} + scope: support.function.js.fjsx15 + pop: 'True' + - include: 59_other-property-or-function + 59_other-property-or-function: + - include: 60_other-property-or-function + 59_reflection: + - match: | + (?x) + (?> Proxy + | Reflect + )\b + scope: support.type.object.js.fjsx15 + pop: 'True' + 59_string-property-or-function: + - match: (?x){{59_stringFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: + - 59_function-call-meta-scope + - 59_arguments + - match: (?x){{59_stringFunctions}} + scope: support.function.js.fjsx15 + pop: 'True' + - include: 59_other-property-or-function + 59_structured-data: + - match: (JSON)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: + - 59_json-property-or-function + - match: | + (?x) + (?> ArrayBuffer + | DataView + | JSON + )\b + scope: support.type.object.js.fjsx15 + pop: 'True' + 59_symbol-property-or-function: + - match: (?x){{59_symbolFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: + - 59_function-call-meta-scope + - 59_arguments + - match: (?x){{59_symbolFunctions}} + scope: support.function.js.fjsx15 + pop: 'True' + - include: 59_other-property-or-function + 59_text-processing: + - match: (String)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: + - 59_string-property-or-function + - match: | + (?x) + (?> RegExp + | String + )\b + scope: support.type.object.js.fjsx15 + pop: 'True' + 59_pop-now: + - match: '' + pop: 'True' + 59_variables: + - match: super(?=\s*\() + scope: variable.language.super.js.fjsx15 + set: + - 59_function-call-meta-scope + - 59_arguments + - match: prototype\b + scope: variable.language.prototype.js.fjsx15 + pop: 'True' + - match: super\b + scope: variable.language.super.js.fjsx15 + pop: 'True' + - match: this\b + scope: variable.language.this.js.fjsx15 + pop: 'True' + 59_web-assembly: + - match: | + (?x) + (WebAssembly)\b + (?: + \s*(\.)\s* + ((?> CompileError + | Instance + | LinkError + | Memory + | Module + | RuntimeError + | Table + ))\b + )? + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.type.js.fsjx15 + pop: 'True' + Naomi/integration/syntaxes/src/js/operator/other.yml: + - match: yield\b + scope: keyword.control.flow.js.fjsx15 + set: + - 60_optional-tail + - 60_yield-head + - match: \:{2} + scope: keyword.operator.bind.js.fjsx15 + set: + - 60_optional-expression + - match: \?\? + scope: keyword.operator.nullish-coalescing.js.fjsx15 + set: + - 60_optional-expression + - match: \?\. + scope: punctuation.accessor.optional-chain.js.fjsx15 + set: + - 60_optional-tail + - 60_accessor-head + - match: \.(?!\.) + scope: punctuation.accessor.js.fjsx15 + set: + - 60_optional-tail + - 60_accessor-head + - match: \? + scope: keyword.operator.ternary.js.fjsx15 + set: + - 60_ternary-else + - 60_optional-expression + 60_accessor-head: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/function-call/index.yml + - include: 42_function-assigned-to-variable + - include: Naomi/integration/syntaxes/src/js/constant.yml + - include: Naomi/integration/syntaxes/src/js/variable.yml + 60_other-property-or-function: + - match: (?=\S) + set: + - 60_optional-tail + - 60_accessor-head + 60_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + 60_optional-tail: + - include: 4_optional-tail + 60_ternary-else: + - match: ':' + scope: keyword.operator.ternary.js.fjsx15 + set: + - 60_optional-expression + 60_yield-head: + - include: 4_head + Naomi/integration/syntaxes/src/js/constant.yml: + - include: 61_object + - include: 61_normal + 61_object: + - match: | + (?x) + (\#)? + ({{61_constantIdentifier}}) + (?=\s*\??\.) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.object.constant.js.fjsx15 + pop: 'True' + 61_normal: + - match: | + (?x) + (\#)? + ([_[:upper:]])\b + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.constant.js.fjsx15 + pop: 'True' + - match: | + (?x) + (\#)? + ( + {{61_constantIdentifier}} + (?> \$\B + | [_[:upper:][:digit:]]\b + ) + ) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.constant.js.fjsx15 + pop: 'True' + Naomi/integration/syntaxes/src/js/function-call/index.yml: + - match: | + (?xi) + (?= + (?:\#\s*)? + {{62_commonIdentifier}} + \s*{{62_genericArguments}} + \s*(\?\.)? + \s*\( + ) + set: + - 62_meta + - 62_arguments + - 62_generic-arguments + - 62_identifier + - 62_optional-modifier + - match: | + (?xi) + (?= + (?:\#\s*)? + {{62_commonIdentifier}} + (?:\s*{{62_comment}})? + \s*(\?\.)? + \s*\( + ) + set: + - 62_meta + - 62_arguments + - 62_identifier + - 62_optional-modifier + 62_arguments: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/function-call/arguments.yml + 62_else-pop: + - match: (?=\S) + pop: 'True' + 62_identifier: + - match: (?xi){{62_commonIdentifier}} + scope: variable.function.js.fjsx15 + pop: 'True' + 62_generic-arguments: + - include: Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.yml + 62_meta: + - meta_scope: meta.function-call.js.fjsx15 + - match: '' + pop: 'True' + 62_optional-modifier: + - match: \# + scope: storage.modifier.js.fjsx15 + - include: 62_else-pop + Naomi/integration/syntaxes/src/js/function-call/arguments.yml: + - match: \( + scope: punctuation.section.group.begin.js.fjsx15 + set: + - 63_delimiter + 63_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 63_delimiter: + - meta_scope: meta.group.js.fjsx15 + - include: 63_comment-no-pop + - match: \) + scope: punctuation.section.group.end.js.fjsx15 + pop: 'True' + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + - match: (?=\S) + push: + - 63_expression + 63_expression: + - include: Naomi/integration/syntaxes/src/js/expression.yml + Naomi/integration/syntaxes/src/js/arrow-function/body.yml: + - match: => + scope: storage.type.function.arrow.js.fjsx15 + set: + - 64_possible-multi-statement-body + 64_close-body: + - meta_scope: meta.function.js.fjsx15 meta.block.js.fjsx15 + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + set: + - 64_optional-expression-tail + - match: '' + push: + - 64_optional-statement-or-expression + 64_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 64_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + 64_optional-expression-tail: + - include: 4_optional-tail + 64_optional-statement-or-expression: + - include: Naomi/integration/syntaxes/src/js/optional-statement-or-expression.yml + 64_possible-multi-statement-body: + - include: 64_comment-no-pop + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: + - 64_close-body + - include: 64_optional-expression + Naomi/integration/syntaxes/src/js/destructuring/object/index.yml: + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: + - 65_delimiters + 65_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 65_default-value: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + 65_delimiters: + - meta_scope: meta.binding.destructuring.mapping.js.fjsx15 + - include: 65_comment-no-pop + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + pop: 'True' + - include: Naomi/integration/syntaxes/src/js/operator/rest.no-pop.yml + - match: (?==) + push: + - 65_default-value + - match: (?=\S) + set: + - 65_property-or-variable + 65_property-or-variable: + - include: 65_comment-no-pop + - match: (?=[,)\]}]) + pop: 'True' + - include: Naomi/integration/syntaxes/src/js/destructuring/object/property.yml + - include: Naomi/integration/syntaxes/src/js/destructuring/array.yml + - include: Naomi/integration/syntaxes/src/js/destructuring/object/index.yml + Naomi/integration/syntaxes/src/js/destructuring/array.yml: + - match: \[ + scope: punctuation.section.brackets.begin.js.fjsx15 + set: + - 66_delimiters + - 66_optional-expression + - 66_optional-type + - 66_optional-variable + 66_delimiters: + - meta_scope: meta.binding.destructuring.sequence.js.fjsx15 + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: + - 66_optional-expression + - 66_optional-type + - 66_optional-variable + - match: \] + scope: punctuation.section.brackets.end.js.fjsx15 + pop: 'True' + 66_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + 66_optional-type: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-associated-type.yml + 66_optional-variable: + - match: (?=[,)\]}]) + pop: 'True' + - include: Naomi/integration/syntaxes/src/js/operator/rest.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/destructuring/array.yml + - include: Naomi/integration/syntaxes/src/js/destructuring/object/index.yml + - include: 41_variable-or-constant + Naomi/integration/syntaxes/src/js/destructuring/object/property.yml: + - match: (?=(?>'|"|`)) + set: + - 67_optional-bind + - 67_meta-key + - 67_string + - match: \[ + scope: punctuation.section.brackets.begin.js.fjsx15 + set: + - 67_optional-bind + - 67_meta-computed-key + - 67_computed-property-end + - 67_optional-expression + - match: (?xi)({{67_commonIdentifier}})(?=\s*:) + scope: string.unquoted.js.fjsx15 + set: + - 67_optional-bind + - 67_meta-key + - match: '' + set: + - 67_object-destructuring-delimiters + - 67_variable-or-constant + 67_bind: + - meta_scope: meta.binding.destructuring.mapping.js.fjsx15 + - include: 67_comment-no-pop + - match: (?=\)) + pop: 'True' + - include: Naomi/integration/syntaxes/src/js/destructuring/array.yml + - include: Naomi/integration/syntaxes/src/js/destructuring/object/index.yml + - include: 41_variable-or-constant + 67_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 67_computed-property-end: + - match: \] + scope: punctuation.section.brackets.end.js.fjsx15 + pop: 'True' + 67_meta-computed-key: + - meta_scope: meta.binding.destructuring.mapping.key.computed.js.fjsx15 + - include: 67_pop-now + 67_meta-key: + - meta_scope: meta.binding.destructuring.mapping.key.js.fjsx15 meta.object-literal.key.js.fjsx15 + - include: 67_pop-now + 67_object-destructuring-delimiters: + - meta_scope: meta.binding.destructuring.mapping.js.fjsx15 + - include: 65_delimiters + 67_optional-bind: + - match: ':' + scope: punctuation.binding.js.fjsx15 + push: + - 67_bind + - match: (?=\S) + set: + - 67_object-destructuring-delimiters + 67_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + 67_pop-now: + - match: '' + pop: 'True' + 67_string: + - include: Naomi/integration/syntaxes/src/js/literal/string/double-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/single-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/template.yml + 67_variable-or-constant: + - include: 41_variable-or-constant + Naomi/integration/syntaxes/src/js/class/index.yml: + - match: class\b + scope: storage.type.class.js.fjsx15 + set: + - 68_declaration + 68_body: + - include: Naomi/integration/syntaxes/src/js/class/body.yml + 68_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 68_declaration: + - meta_scope: meta.declaration.class.js.fjsx15 + - include: 68_comment-no-pop + - match: (?=\{) + set: + - 68_body + - match: (?=<) + push: + - 68_generic-arguments + - match: implements\b + scope: storage.modifier.js.fjsx15 + push: + - 68_optional-target-class-or-namespace + - 68_optional-generic-arguments + - 68_target-class-or-namespace + - match: extends\b + scope: storage.modifier.extends.js.fjsx15 + push: + - 68_optional-generic-arguments + - 68_target-class-or-namespace + - match: (?xi){{68_commonIdentifier}} + scope: entity.name.class.js.fjsx15 + 68_generic-arguments: + - include: Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.yml + 68_optional-generic-arguments: + - include: Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.yml + - match: '' + pop: 'True' + 68_optional-target-class-or-namespace: + - match: \, + scope: punctuation.definition.implement-list.separator.js.fjsx15 + set: + - 68_optional-target-class-or-namespace + - 68_optional-generic-arguments + - 68_target-class-or-namespace + - match: (?=\{) + pop: 'True' + 68_target-class-or-namespace: + - include: 68_comment-no-pop + - include: Naomi/integration/syntaxes/src/facebook-flow/namespace-path.no-pop.yml + - match: (?xi){{68_commonIdentifier}} + scope: entity.other.inherited-class.js.fjsx15 + pop: 'True' + Naomi/integration/syntaxes/src/js/class/body.yml: + - include: 69_comment-no-pop + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: + - 69_body-end + - 69_statement-or-expression + 69_body-end: + - meta_scope: meta.class.js.fjsx15 meta.block.js.fjsx15 + - include: 69_comment-no-pop + - match: (?>(,)|(;)) + captures: + 1: punctuation.separator.comma.js.fjsx15 + 2: punctuation.terminator.js.fjsx15 + push: + - 69_statement-or-expression + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + pop: 'True' + - match: (?=\S) + push: + - 69_statement-or-expression + 69_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 69_statement-or-expression: + - include: 69_comment-no-pop + - include: Naomi/integration/syntaxes/src/facebook-flow/operator/covariant.no-pop.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/operator/contravariant.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/decorator.yml + - include: Naomi/integration/syntaxes/src/js/react-js.yml + - include: Naomi/integration/syntaxes/src/js/class/modifier.yml + - include: Naomi/integration/syntaxes/src/js/class/method.yml + - include: Naomi/integration/syntaxes/src/js/class/property.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/indexer.yml + - match: (?=\S) + pop: 'True' + Naomi/integration/syntaxes/src/js/class/property.yml: + - include: 42_function-assigned-to-variable + - match: (?xi)(?={{70_commonIdentifier}}) + set: + - 70_optional-type-and-value + - 70_identifier + 70_associated-type: + - include: Naomi/integration/syntaxes/src/facebook-flow/associated-type.yml + 70_identifier: + - include: Naomi/integration/syntaxes/src/js/constant.yml + - include: Naomi/integration/syntaxes/src/js/variable.yml + 70_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + 70_optional-type-and-value: + - match: \? + scope: keyword.operator.other.optional.flow + - match: (?=:) + push: + - 70_associated-type + - match: (?==) + set: + - 70_optional-expression + - match: (?=\S) + pop: 'True' + Naomi/integration/syntaxes/src/js/class/method.yml: + - match: (?=\() + set: + - 71_declaration + - match: | + (?xi) + (?= + {{71_methodIdentifier}} + \s*{{71_genericParameters}}? + \s*\( + ) + set: + - 71_declaration + 71_body: + - include: Naomi/integration/syntaxes/src/js/function/body.yml + 71_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 71_computed-identifier-end: + - match: \] + scope: punctuation.definition.function.identifier.end.js.fjsx15 + pop: 'True' + 71_declaration: + - meta_scope: meta.declaration.function.method.js.fjsx15 meta.function.js.fjsx15 + - include: 71_comment-no-pop + - match: (?=\{) + set: + - 71_body + - match: (?=<) + push: + - 71_generic-arguments + - match: (?=\() + push: + - 71_parameters + - match: constructor\b + scope: entity.name.function.constructor.js.fjsx15 + set: + - 71_optional-support-body + - 71_support-parameters + - match: (?xi){{71_commonIdentifier}} + scope: entity.name.function.js.fjsx15 + - match: \[ + scope: punctuation.definition.function.identifier.begin.js.fjsx15 + push: + - 71_computed-identifier-end + - 71_optional-expression + - match: (?=['"`]) + push: + - - include: Naomi/integration/syntaxes/src/js/literal/string/double-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/single-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/template.yml + - include: 71_else-pop + 71_else-pop: + - match: (?=\S) + pop: 'True' + 71_generic-arguments: + - include: Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.yml + 71_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + 71_optional-support-body: + - include: 71_body + - include: 71_else-pop + 71_parameters: + - include: Naomi/integration/syntaxes/src/js/function/parameters.yml + 71_support-parameters: + - include: Naomi/integration/syntaxes/src/js/function/parameters.yml + Naomi/integration/syntaxes/src/js/class/modifier.yml: + - match: static\b(?!\s*(?>[:,=(]|$)) + scope: storage.modifier.js.fjsx15 + set: + - 72_modifier-trap + - match: \#(?!\s*(?>[:,=(]|$)) + scope: storage.modifier.js.fjsx15 + set: + - 72_modifier-trap + - match: async\b(?!\s*(?>[:,=(]|$)) + scope: storage.modifier.js.fjsx15 + set: + - 72_modifier-trap + - match: (?>get|set)\b(?!\s*(?>[:,=(]|$)) + scope: storage.modifier.js.fjsx15 + set: + - 72_modifier-trap + - match: \*(?!\s*(?>[:,=(]|$)) + scope: storage.modifier.js.fjsx15 + set: + - 72_modifier-trap + 72_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 72_modifier-trap: + - include: Naomi/integration/syntaxes/src/js/class/modifier.yml + - match: (?=\S) + set: + - 72_property-or-method + 72_property-or-method: + - include: 72_comment-no-pop + - include: Naomi/integration/syntaxes/src/js/class/method.yml + - include: Naomi/integration/syntaxes/src/js/class/property.yml + Naomi/integration/syntaxes/src/js/react-js.yml: + - include: 73_proptype-functions + - include: 73_proptypes + - include: 73_component-functions + - include: 73_react-functions + - include: 73_react-dom-functions + 73_arguments: + - include: Naomi/integration/syntaxes/src/js/expression.yml + 73_component-functions: + - match: (?x){{73_reactFunctions}}(?=\s*\() + captures: + 1: variable.language.this.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 + set: + - 73_function-call-meta-scope + - 73_arguments + - match: (?x){{73_reactFunctions}} + captures: + 1: variable.language.this.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 + pop: 'True' + 73_function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - include: 73_pop-now + 73_pop-now: + - match: '' + pop: 'True' + 73_proptypes: + - match: | + (?x) + (?: + (React) + \s*(\.)\s* + )? + (PropTypes) + \s*(\.)\s* + ((?> any + | array + | bool + | element + | func + | node + | number + | object + | symbol + | string + ))\b + (?: + \s*(\.)\s* + (isRequired\b) + )? + captures: + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.type.object.fjsx15 + 4: punctuation.accessor.js.fjsx15 + 5: support.type.object.fjsx15 + 6: punctuation.accessor.js.fjsx15 + 7: support.type.object.fjsx15 + pop: 'True' + - match: | + (?x) + (?<=\)) + \s*(\.)\s* + (isRequired\b) + captures: + 1: punctuation.accessor.js.fjsx15 + 2: support.type.object.fjsx15 + pop: 'True' + 73_proptype-functions: + - match: (?x){{73_propTypeFunctions}}(?=\s*\() + captures: + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.type.object.fjsx15 + 4: punctuation.accessor.js.fjsx15 + 5: support.function.fjsx15 + set: + - 73_function-call-meta-scope + - 73_arguments + - match: (?x){{73_propTypeFunctions}} + captures: + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.type.object.fjsx15 + 4: punctuation.accessor.js.fjsx15 + 5: support.function.fjsx15 + pop: 'True' + 73_react-dom-functions: + - match: (?x){{73_reactDomFunctions}}(?=\s*\() + captures: + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 + set: + - 73_function-call-meta-scope + - 73_arguments + - match: (?x){{73_reactDomFunctions}} + captures: + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 + pop: 'True' + 73_react-functions: + - match: (?x){{73_reactFunctions}}(?=\s*\() + captures: + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 + set: + - 73_function-call-meta-scope + - 73_arguments + - match: (?x){{73_reactFunctions}} + captures: + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 + pop: 'True' + Naomi/integration/syntaxes/src/js/decorator.yml: + - match: (?xi)(@)(?={{74_decoratorIdentifier}}) + scope: punctuation.definition.annotation.js.fjsx15 + set: + - 74_meta + - 74_decorator-identifier + 74_arguments: + - include: Naomi/integration/syntaxes/src/js/expression.yml + 74_decorator-identifier: + - match: (?xi){{74_decoratorIdentifier}}(?=\s*\() + scope: variable.annotation.js.fjsx15 + set: + - 74_possible-chain + - 74_arguments + - match: (?xi){{74_decoratorIdentifier}} + scope: variable.annotation.js.fjsx15 + set: + - 74_possible-chain + 74_meta: + - meta_scope: meta.annotation.js.fjsx15 + - match: '' + pop: 'True' + 74_possible-chain: + - match: \. + scope: punctuation.definition.decorator.chain.js.fjsx15 + set: + - 74_decorator-identifier + - match: (?=\S) + pop: 'True' + Naomi/integration/syntaxes/src/facebook-flow/operator/contravariant.no-pop.yml: + - match: \- + scope: storage.modifier.contravariant.flow + Naomi/integration/syntaxes/src/facebook-flow/operator/covariant.no-pop.yml: + - match: \+ + scope: storage.modifier.covariant.flow + Naomi/integration/syntaxes/src/js/export.yml: + - match: export\b + scope: keyword.control.import-export.export.js.fjsx15 + set: + - 77_possible-statement-or-expression + 77_alias: + - match: as\b + scope: keyword.control.import-export.as.js.fjsx15 + set: + - 77_alias-name + 77_alias-name: + - match: (?xi){{77_commonIdentifier}} + scope: variable.other.readwrite.js.fjsx15 + pop: 'True' + 77_close-block: + - include: 78_close-block + 77_delimiter: + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: + - 77_optional-target + - include: 77_origin + - include: 77_else-pop + 77_else-pop: + - match: (?=\S) + pop: 'True' + 77_expression: + - include: Naomi/integration/syntaxes/src/js/expression.yml + 77_optional-alias: + - match: (?=as\b) + set: + - 77_alias + - include: 77_else-pop + 77_optional-target: + - match: (?=(?>[,}]|from)) + pop: 'True' + - include: Naomi/integration/syntaxes/src/facebook-flow/type-export.yml + - match: \*(?=\s*as\b) + scope: keyword.control.import-export.star.js.fjsx15 + set: + - 77_alias + - match: \* + scope: keyword.control.import-export.star.js.fjsx15 + pop: 'True' + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: + - 77_close-block + - 77_delimiter + - 77_optional-target + - match: default\b + scope: keyword.control.import-export.default.js.fjsx15 + set: + - 77_optional-alias + - match: (?xi){{77_commonIdentifier}}(?=\s+as\b) + scope: variable.other.readwrite.js.fjsx15 + set: + - 77_alias + - match: (?xi){{77_commonIdentifier}} + scope: variable.other.readwrite.js.fjsx15 + pop: 'True' + 77_origin: + - include: 78_origin + 77_possible-statement-or-expression: + - match: (?=(?>[*{]|type(?:of)?)) + set: + - 77_delimiter + - 77_optional-target + - match: default\b(?=\s+from\b) + scope: keyword.control.import-export.default.js.fjsx15 + set: + - 77_origin + - match: default\b + scope: keyword.control.import-export.default.js.fjsx15 + set: + - 77_expression + - include: Naomi/integration/syntaxes/src/js/statement.yml + - match: (?xi){{77_commonIdentifier}} + scope: variable.other.readwrite.js.fjsx15 + set: + - 77_origin + Naomi/integration/syntaxes/src/js/import.yml: + - include: 59_import-properties + - match: import\b(?=\s*\() + scope: support.function.import.js.fjsx15 + set: + - 78_function-call-meta-scope + - 78_arguments + - match: (?x)import\b(?=\s*(?>"|'|`)) + scope: keyword.control.import-export.import.js.fjsx15 + set: + - 78_origin-path + - match: (?x)import\b + scope: keyword.control.import-export.import.js.fjsx15 + set: + - 78_delimiter + - 78_optional-target + 78_alias: + - match: as\b + scope: keyword.control.import-export.as.js.fjsx15 + set: + - 78_alias-name + 78_alias-name: + - match: (?xi){{78_commonIdentifier}} + scope: variable.other.readwrite.js.fjsx15 + pop: 'True' + 78_arguments: + - include: Naomi/integration/syntaxes/src/js/expression.yml + 78_block-optional-target: + - include: 78_comment-no-pop + - match: (?=(?>[,}])) + pop: 'True' + - include: 78_shared-optional-target + 78_close-block: + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + pop: 'True' + 78_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 78_delimiter: + - include: 78_comment-no-pop + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: + - 78_optional-target + - include: 78_origin + - include: 78_else-pop + 78_else-pop: + - match: (?=\S) + pop: 'True' + 78_function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - match: '' + pop: 'True' + 78_origin: + - include: 78_comment-no-pop + - match: from\b + scope: keyword.control.import-export.origin.js.fjsx15 + set: + - 78_origin-path + 78_origin-path: + - include: 78_comment-no-pop + - include: Naomi/integration/syntaxes/src/js/literal/string/double-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/single-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/template.yml + 78_optional-target: + - include: 78_comment-no-pop + - match: (?=(?>[,}]|from)) + pop: 'True' + - include: 78_shared-optional-target + 78_shared-optional-target: + - include: Naomi/integration/syntaxes/src/facebook-flow/type-import.yml + - match: \*(?=\s*as) + scope: keyword.control.import-export.star.js.fjsx15 + set: + - 78_alias + - match: \* + scope: keyword.control.import-export.star.js.fjsx15 + pop: 'True' + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: + - 78_close-block + - 78_delimiter + - 78_block-optional-target + - match: (?xi){{78_commonIdentifier}}(?=\s+as) + scope: variable.other.readwrite.js.fjsx15 + set: + - 78_alias + - match: (?xi){{78_commonIdentifier}} + scope: variable.other.readwrite.js.fjsx15 + pop: 'True' + Naomi/integration/syntaxes/src/facebook-flow/type-import.yml: + - match: typeof\b + scope: keyword.operator.word.typeof.flow + set: + - 79_optional-target + - match: type\b + scope: storage.type.flow + set: + - 79_optional-target + 79_alias: + - match: as\b + scope: keyword.control.import-export.as.js.fjsx15 + set: + - 79_alias-name + 79_alias-name: + - match: (?xi){{79_commonIdentifier}} + scope: entity.name.type.js.fjsx15 + pop: 'True' + 79_close-block: + - include: 78_close-block + 79_delimiter: + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: + - 79_optional-target + - include: 79_origin + - include: 79_else-pop + 79_else-pop: + - match: (?=\S) + pop: 'True' + 79_optional-target: + - match: (?=(?>[,}]|from)) + pop: 'True' + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: + - 79_close-block + - 79_delimiter + - 79_optional-target + - match: (?xi){{79_commonIdentifier}}(?=\s+as) + scope: variable.other.type.js.fjsx15 + set: + - 79_alias + - match: (?xi){{79_commonIdentifier}} + scope: entity.name.type.js.fjsx15 + pop: 'True' + 79_origin: + - include: 78_origin + Naomi/integration/syntaxes/src/facebook-flow/type-export.yml: + - match: typeof\b + scope: keyword.operator.word.typeof.flow + set: + - 80_optional-target + - match: | + (?xi) + (?= + type + \s+{{80_commonIdentifier}} + ) + set: + - 80_type-aliasing + - match: type\b + scope: storage.type.flow + set: + - 80_optional-target + 80_alias: + - match: as\b + scope: keyword.control.import-export.as.js.fjsx15 + set: + - 80_alias-name + 80_alias-name: + - match: (?xi){{80_commonIdentifier}} + scope: variable.other.type.js.fjsx15 + pop: 'True' + 80_close-block: + - include: 78_close-block + 80_delimiter: + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: + - 80_optional-target + - include: 80_origin + - include: 80_else-pop + 80_else-pop: + - match: (?=\S) + pop: 'True' + 80_optional-target: + - match: (?=(?>[,}]|from)) + pop: 'True' + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: + - 80_close-block + - 80_delimiter + - 80_optional-target + - match: (?xi){{80_commonIdentifier}}(?=\s+as) + scope: variable.other.type.js.fjsx15 + set: + - 80_alias + - match: (?xi){{80_commonIdentifier}} + scope: variable.other.type.js.fjsx15 + pop: 'True' + 80_origin: + - include: 78_origin + 80_type-aliasing: + - include: Naomi/integration/syntaxes/src/facebook-flow/type-aliasing.yml + Naomi/integration/syntaxes/src/facebook-flow/type-aliasing.yml: + - match: | + (?xi) + (?:(opaque)\s+)? + (type)\b + (?=\s+ + {{81_commonIdentifier}} + {{81_genericArguments}}? + ) + captures: + 1: storage.modifier.opaque.flow + 2: storage.type.flow + set: + - 81_punctuation + - 81_identifier + 81_identifier: + - match: (?xi){{81_commonIdentifier}} + scope: entity.name.type.flow + pop: 'True' + 81_meta-scope: + - meta_scope: meta.declaration.type.flow + - match: '' + pop: 'True' + 81_optional-type-expression: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-type-expression.yml + 81_punctuation: + - meta_scope: meta.declaration.type.flow + - include: Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.no-pop.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/associated-type.no-pop.yml + - match: '=' + scope: keyword.operator.other.assignment.flow + set: + - 81_meta-scope + - 81_optional-type-expression + Naomi/integration/syntaxes/src/facebook-flow/interface.yml: + - match: interface\b + scope: storage.type.interface.flow + set: + - 82_declaration + 82_body: + - include: 82_comment-no-pop + - match: \{ + scope: punctuation.section.block.begin.flow + set: + - 82_body-end + 82_body-end: + - include: 82_comment-no-pop + - match: (?>(,)|(;)) + captures: + 1: punctuation.separator.comma.flow + 2: punctuation.terminator.flow + - match: \} + scope: punctuation.section.block.end.flow + pop: 'True' + - match: (?=\S) + push: + - 82_statement-or-expression + 82_comment: + - include: Naomi/integration/syntaxes/src/js/comment/index.yml + 82_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 82_co-contra-variant-no-pop: + - include: Naomi/integration/syntaxes/src/facebook-flow/operator/covariant.no-pop.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/operator/contravariant.no-pop.yml + 82_declaration: + - include: 82_comment-no-pop + - match: extends\b + scope: storage.modifier.extends.flow + push: + - 82_optional-type-expression + - match: (?=<) + push: + - 82_generic-arguments + - match: (?=\{) + set: + - 82_body + - match: (?xi){{82_commonIdentifier}} + scope: entity.name.interface.flow + 82_generic-arguments: + - include: Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.yml + 82_optional-type-expression: + - include: Naomi/integration/syntaxes/src/facebook-flow/optional-type-expression.yml + 82_statement-or-expression: + - include: 82_comment + - include: 82_co-contra-variant-no-pop + - include: Naomi/integration/syntaxes/src/facebook-flow/indexer.yml + - include: Naomi/integration/syntaxes/src/js/class/method.yml + - include: Naomi/integration/syntaxes/src/js/class/property.yml + Naomi/integration/syntaxes/src/facebook-flow/declare.yml: + - match: declare\b + scope: keyword.declaration.flow + set: + - 83_possible-module + 83_possible-module: + - include: Naomi/integration/syntaxes/src/facebook-flow/module.yml + - match: (?=\S) + pop: 'True' + Naomi/integration/syntaxes/src/facebook-flow/module.yml: + - match: (?=module\s*.\s*exports) + set: + - 84_object-literal + - 84_association + - 84_common-js-module + - match: module\b + scope: storage.type.module.flow + set: + - 84_identifier + 84_association: + - match: ':' + scope: keyword.operator.other.flow + pop: 'True' + 84_common-js-module: + - include: Naomi/integration/syntaxes/src/js/node-js.yml + 84_identifier: + - include: Naomi/integration/syntaxes/src/js/literal/string/double-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/single-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/template.yml + - match: (?xi){{84_commonIdentifier}} + scope: entity.name.module.flow + pop: 'True' + 84_object-literal: + - include: Naomi/integration/syntaxes/src/js/literal/object/index.yml + Naomi/integration/syntaxes/src/js/literal/object/index.yml: + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: + - 85_delimiters + 85_anything-else: + - include: 85_comment-no-pop + - match: (?=[,}]) + pop: 'True' + - include: Naomi/integration/syntaxes/src/js/operator/spread.yml + - include: Naomi/integration/syntaxes/src/js/class/modifier.yml + - include: Naomi/integration/syntaxes/src/js/class/method.yml + - include: Naomi/integration/syntaxes/src/js/literal/object/property.yml + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + 85_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 85_delimiters: + - meta_scope: meta.object-literal.js.fjsx15 meta.block.js.fjsx15 + - include: 85_comment-no-pop + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + pop: 'True' + - match: (?=\S) + push: + - 85_anything-else + Naomi/integration/syntaxes/src/js/literal/object/property.yml: + - match: | + (?xi) + (?= + {{86_keyIdentifier}} + \s*:\s* + (?:async\b\s+)? + function + (?> \s+{{86_commonIdentifier}} + | \( + ) + ) + set: + - 86_function-declaration + - 86_meta-declaration-function + - 86_function-keyword + - 86_meta-key + - 86_method-identifier + - match: | + (?xi) + (?= + {{86_keyIdentifier}} + \s*:\s* + {{86_singleParameterArrowFunction}} + ) + set: + - 86_arrow-function + - 86_meta-key + - 86_method-identifier + - match: | + (?xi) + (?= + {{86_keyIdentifier}} + \s*:\s* + {{86_normalArrowFunction}} + ) + set: + - 86_arrow-function + - 86_meta-key + - 86_method-identifier + - match: \[ + scope: punctuation.section.brackets.begin.js.fjsx15 + set: + - 86_associated-value + - 86_meta-computed-key + - 86_computed-property-end + - 86_optional-expression + - match: | + (?xi) + (?= + {{86_keyIdentifier}} + \s*: + ) + set: + - 86_associated-value + - 86_meta-key + - 86_any-key + 86_any-key: + - include: 86_string + - include: 86_number + - match: '[^:]*' + scope: string.unquoted.js.fjsx15 + pop: 'True' + 86_arrow-function: + - include: Naomi/integration/syntaxes/src/js/arrow-function/index.yml + 86_associated-value: + - match: ':' + scope: punctuation.separator.key-value.js.fjsx15 + set: + - 86_optional-expression + 86_computed-property-end: + - match: \] + scope: punctuation.section.brackets.end.js.fjsx15 + pop: 'True' + 86_function-declaration: + - include: 57_declaration + 86_function-keyword: + - include: 57_keyword + 86_meta-computed-key: + - meta_scope: meta.object-literal.key.computed.js.fjsx15 + - include: 86_pop-now + 86_meta-declaration-function: + - meta_scope: meta.declaration.function.js.fjsx15 + - include: 86_pop-now + 86_meta-key: + - meta_scope: meta.object-literal.key.js.fjsx15 + - include: 86_pop-now + 86_method-identifier: + - match: | + (?xi) + ({{86_keyIdentifier}}) + \s*(:) + captures: + 1: entity.name.function.js.fjsx15 + 2: punctuation.separator.key-value.js.fjsx15 + pop: 'True' + 86_number: + - include: Naomi/integration/syntaxes/src/js/literal/number.yml + 86_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + 86_pop-now: + - match: '' + pop: 'True' + 86_string: + - include: Naomi/integration/syntaxes/src/js/literal/string/double-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/single-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/template.yml + Naomi/integration/syntaxes/src/js/arrow-function/index.yml: + - match: | + (?xi) + (?={{87_normalArrowFunction}}) + set: + - 87_normal-arrow-function + - match: | + (?xi) + (?={{87_singleParameterArrowFunction}}) + set: + - 87_single-parameter-arrow-function + 87_normal-arrow-function: + - meta_scope: meta.function.js.fjsx15 + - include: Naomi/integration/syntaxes/src/js/async.no-pop.yml + - include: Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/function/parameters.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/arrow-function/body.yml + 87_single-parameter-arrow-function: + - meta_scope: meta.function.js.fjsx15 + - include: Naomi/integration/syntaxes/src/js/async.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/function/parameter/simple.no-pop.yml + - include: Naomi/integration/syntaxes/src/js/arrow-function/body.yml + Naomi/integration/syntaxes/src/js/operator/spread.yml: + - match: \.{3} + scope: keyword.operator.spread.js.fjsx15 + set: + - 88_optional-expression + 88_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/node-js.yml: + - include: 89_global-constant + - include: 89_global-function + - match: (module)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: + - 89_module-property-or-function + - match: (process)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: + - 89_process-property-or-function + - match: (?>module|process)\b + scope: support.type.object.js.fjsx15 + pop: 'True' + 89_arguments: + - include: Naomi/integration/syntaxes/src/js/function-call/arguments.yml + 89_function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - include: 89_pop-now + 89_global-constant: + - match: __(?>dirname|filename)\b + scope: support.constant.js.fjsx15 + pop: 'True' + 89_global-function: + - match: (?x){{89_globalFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: + - 89_function-call-meta-scope + - 89_arguments + - match: (?x){{89_globalFunctions}} + scope: support.function.js.fjsx15 + pop: 'True' + 89_module-property-or-function: + - match: (?>default|exports|parent)\b + scope: support.variable.js.fjsx15 + pop: 'True' + - include: 89_other-property-or-function + 89_other-property-or-function: + - include: 60_other-property-or-function + 89_pop-now: + - match: '' + pop: 'True' + 89_process-property-or-function: + - match: (?x){{89_processFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: + - 89_function-call-meta-scope + - 89_arguments + - match: (?x){{89_processFunctions}} + scope: support.function.js.fjsx15 + pop: 'True' + - match: | + (?x) + # arch, argv, argv0 + (?> ar(?>ch|gv0?) + | channel + | config + | connected + | env + # execArgv, execPath + | exec(?>Argv|Path) + | exitCode + | mainModule + | pid + | platform + | release + # stderr, stdin, stdout + | std(?>err|in|out) + | title + # version, versions + | versions? + )\b + scope: support.variable.js.fjsx15 + pop: 'True' + - include: 89_other-property-or-function + Naomi/integration/syntaxes/src/facebook-flow/prolog.yml: + - match: | + (?x) + (?> //\s*@flow + | /\*\s*@flow\s\*/ + ) + scope: keyword.other.prolog.flow + pop: 'True' + Naomi/integration/syntaxes/src/js/operator/index.yml: + - include: Naomi/integration/syntaxes/src/js/arrow-function/body.yml + - include: Naomi/integration/syntaxes/src/js/operator/pipe.yml + - include: Naomi/integration/syntaxes/src/js/operator/comparison.yml + - include: Naomi/integration/syntaxes/src/js/operator/assignment.yml + - include: Naomi/integration/syntaxes/src/js/operator/arithmetic.yml + - include: Naomi/integration/syntaxes/src/js/operator/await.yml + - include: Naomi/integration/syntaxes/src/js/operator/bitwise.yml + - include: Naomi/integration/syntaxes/src/js/operator/delete.yml + - include: Naomi/integration/syntaxes/src/js/operator/in.yml + - include: Naomi/integration/syntaxes/src/js/operator/logical.yml + - include: Naomi/integration/syntaxes/src/js/operator/new.yml + - include: Naomi/integration/syntaxes/src/js/operator/of.yml + - include: Naomi/integration/syntaxes/src/js/operator/other.yml + - include: Naomi/integration/syntaxes/src/js/operator/relational.yml + - include: Naomi/integration/syntaxes/src/js/operator/shebang.yml + - include: Naomi/integration/syntaxes/src/js/operator/spread.yml + - include: Naomi/integration/syntaxes/src/js/operator/typeof.yml + - include: Naomi/integration/syntaxes/src/js/operator/void.yml + Naomi/integration/syntaxes/src/js/operator/void.yml: + - match: void\b + scope: keyword.operator.word.void.js.fjsx15 + set: + - 92_optional-expression + 92_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/operator/typeof.yml: + - match: (?xi)(typeof)(?=\s+{{93_commonIdentifier}}) + scope: keyword.operator.word.typeof.js.fjsx15 + set: + - 93_optional-tail + - 93_type + - match: (?i)typeof\b + scope: keyword.operator.word.typeof.js.fjsx15 + set: + - 93_optional-tail + 93_optional-tail: + - include: 4_optional-tail + 93_type: + - include: 94_type + Naomi/integration/syntaxes/src/js/operator/new.yml: + - match: (new)\s*(\.)\s*(target) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.constant.js.fjsx15 + pop: 'True' + - match: (?xi)new(?=\s+{{94_commonIdentifier}}) + scope: keyword.operator.word.new.js.fjsx15 + set: + - 94_optional-tail + - 94_meta-instance-call-constructor-scope + - 94_optional-arguments + - 94_type + - match: (?i)new\b + scope: keyword.operator.word.new.js.fjsx15 + set: + - 94_optional-tail + - 94_meta-instance-scope + - 94_optional-expression + 94_arguments: + - include: 62_arguments + 94_else-pop: + - match: (?=\S) + pop: 'True' + 94_meta-instance-call-constructor-scope: + - meta_scope: meta.instance.constructor.js.fjsx15 + - meta_content_scope: meta.function-call.constructor.js.fjsx15 + - include: 94_pop-now + 94_meta-instance-scope: + - meta_scope: meta.instance.js.fjsx15 + - include: 94_pop-now + 94_optional-arguments: + - match: (?=\() + set: + - 94_arguments + - include: 94_else-pop + 94_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + 94_optional-tail: + - include: 4_optional-tail + 94_pop-now: + - match: '' + pop: 'True' + 94_type: + - include: Naomi/integration/syntaxes/src/js/core.yml + - match: (?xi)({{94_commonIdentifier}})\s*(\.) + captures: + 1: variable.other.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + - match: (?x){{94_classIdentifier}} + scope: variable.other.type.js.fjsx15 + pop: 'True' + - include: Naomi/integration/syntaxes/src/js/expression.yml + Naomi/integration/syntaxes/src/js/operator/shebang.yml: + - match: ^#!.+$ + scope: keyword.operator.other.shebang.js.fjsx15 + Naomi/integration/syntaxes/src/js/operator/relational.yml: + - match: instanceof\b + scope: keyword.operator.word.instanceof.js.fjsx15 + set: + - 96_optional-expression + - match: in\b + scope: keyword.operator.word.in.js.fjsx15 + set: + - 96_optional-expression + 96_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/operator/of.yml: + - match: of\b + scope: keyword.operator.word.of.js.fjsx15 + set: + - 97_optional-expression + 97_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/operator/logical.yml: + - match: | + (?x) + (?> && + | \|\| + | !!? + ) + scope: keyword.operator.logical.js.fjsx15 + set: + - 98_optional-expression + 98_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/operator/in.yml: + - match: in\b + scope: keyword.operator.word.in.js.fjsx15 + set: + - 99_optional-expression + 99_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/operator/delete.yml: + - match: delete\b + scope: keyword.operator.word.delete.js.fjsx15 + set: + - 100_optional-expression + 100_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/operator/bitwise.yml: + - match: | + (?x) + (?> ~=? + | &(?!&)=? + | \|(?!\|)=? + | \^=? + | <<=? + | >>>=? + | >>=? + ) + scope: keyword.operator.bitwise.js.fjsx15 + set: + - 101_optional-expression + 101_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/operator/arithmetic.yml: + - match: | + (?x) + (?> -- + | \+\+ + ) + scope: keyword.operator.arithmetic.js.fjsx15 + pop: 'True' + - match: | + (?x) + (?> -=? + | \+=? + | \*\*?=? + | /=? + | %=? + ) + scope: keyword.operator.arithmetic.js.fjsx15 + set: + - 102_optional-expression + 102_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/operator/assignment.yml: + - match: \= + scope: keyword.operator.other.assignment.js.fjsx15 + set: + - 103_optional-expression + 103_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/operator/comparison.yml: + - match: | + (?x) + (?> ===? + | !==? + | >= + | <= + | >(?!>) + | <(?!<) + ) + scope: keyword.operator.comparison.js.fjsx15 + set: + - 104_optional-expression + 104_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/operator/pipe.yml: + - match: \|> + scope: keyword.operator.pipe.js.fjsx15 + set: + - 105_target + 105_else-pop: + - match: (?=\S) + pop: 'True' + 105_target: + - include: Naomi/integration/syntaxes/src/js/arrow-function/index.yml + - match: await\b + scope: keyword.control.flow.js.fjsx15 + set: + - 105_function-identifier + - match: | + (?xi) + (?= + {{105_commonIdentifier}}\s* + (?>\|>|$) + ) + set: + - 105_function-identifier + - include: 105_else-pop + 105_function-identifier: + - match: (?xi){{105_commonIdentifier}} + scope: meta.function-call.js.fjsx15 variable.function.js.fjsx15 + pop: 'True' + - include: 105_else-pop + Naomi/integration/syntaxes/src/js/jsx1-early.yml: + - match: (?xi)(?=<(?>\s*>|{{106_commonIdentifier}})) + set: + - 106_meta + - 106_jsx + 106_jsx: + - include: 107_jsx + 106_meta: + - clear_scopes: true + - meta_scope: source.jsx naomi + - match: '' + pop: 'True' + Naomi/integration/syntaxes/src/js/jsx1.yml: + - match: (?xi)(?=<(?>\s*>|{{107_commonIdentifier}})) + set: + - 107_meta + - 107_jsx + 107_jsx: + - include: 112_with-js-fence + - include: 111_with-js-fence + - include: 108_with-js-fence + 107_meta: + - clear_scopes: true + - meta_scope: source.jsx naomi + - match: '' + pop: 'True' + Naomi/integration/syntaxes/src/facebook-jsx/element.yml: + - match: | + (?xi) + (<) + (?: + \s*({{108_namespaceIdentifier}}) + \s*(:) + )? + \s*({{108_elementIdentifier}}) + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.namespace.html.jsx.jsx1 + 3: punctuation.separator.namespace.html.jsx.jsx1 + 4: entity.name.tag.html.jsx.jsx1 + set: + - 108_meta + - 108_namespaced-closing-tag + - 108_close-open-tag + 108_close-open-tag: + - include: 109_close-open-tag + 108_meta: + - meta_scope: meta.tag.other.html.jsx.jsx1 + - include: 108_pop-now + 108_namespaced-closing-tag: + - include: 109_namespaced-closing-tag + 108_pop-now: + - match: '' + pop: 'True' + 108_with-js-fence: + - match: | + (?xi) + (<) + (?: + \s*({{108_namespaceIdentifier}}) + \s*(:) + )? + \s*({{108_elementIdentifier}}) + captures: + 1: meta.jsx-fence.jsx.jsx1 punctuation.definition.tag.begin.jsx.jsx1 + 2: entity.name.tag.namespace.html.jsx.jsx1 + 3: punctuation.separator.namespace.html.jsx.jsx1 + 4: entity.name.tag.html.jsx.jsx1 + set: + - 108_meta + - 108_namespaced-closing-tag + - 108_close-open-tag + 109_attribute: + - include: Naomi/integration/syntaxes/src/facebook-jsx/attribute.yml + 109_close-open-tag: + - match: (?=/>) + pop: 'True' + - match: \> + scope: punctuation.definition.tag.end.html.jsx.jsx1 + pop: 'True' + - match: (?=\S) + push: + - 109_attribute + 109_component-closing-tag: + - include: 109_self-closing-tag + - match: | + (?x) + ( + ( (\2)(:)(\4) + | (\4) + ) + (>) + ) + captures: + 1: meta.tag.close.html.jsx.jsx1 + 2: punctuation.definition.tag.begin.html.jsx.jsx1 + 3: entity.name.tag.namespace.html.jsx.jsx1 + 4: punctuation.separator.namespace.html.jsx.jsx1 + 5: entity.name.tag.component.jsx.jsx1 + 6: entity.name.tag.component.jsx.jsx1 + 7: punctuation.definition.tag.end.html.jsx.jsx1 + pop: 'True' + - match: (?=.|\n) + push: + - 109_meta-content + - 109_content + 109_content: + - include: Naomi/integration/syntaxes/src/facebook-jsx/fragment.yml + - include: Naomi/integration/syntaxes/src/facebook-jsx/component.yml + - include: Naomi/integration/syntaxes/src/facebook-jsx/element.yml + - include: Naomi/integration/syntaxes/src/facebook-jsx/embedded-js.yml + - match: .|\n + pop: 'True' + 109_meta-content: + - clear_scopes: true + - meta_scope: source.jsx naomi + - include: 109_pop-now + 109_namespaced-closing-tag: + - include: 109_self-closing-tag + - match: | + (?x) + ( + ( (\2)(:)(\4) + | (\4) + ) + (>) + ) + captures: + 1: meta.tag.close.html.jsx.jsx1 + 2: punctuation.definition.tag.begin.html.jsx.jsx1 + 3: entity.name.tag.namespace.html.jsx.jsx1 + 4: punctuation.separator.namespace.html.jsx.jsx1 + 5: entity.name.tag.jsx.jsx1 + 6: entity.name.tag.jsx.jsx1 + 7: punctuation.definition.tag.end.html.jsx.jsx1 + pop: 'True' + - match: (?=.|\n) + push: + - 109_meta-content + - 109_content + 109_pop-now: + - match: '' + pop: 'True' + 109_self-closing-tag: + - match: /> + scope: punctuation.definition.tag.end.html.jsx.jsx1 + pop: 'True' + 109_simple-closing-tag: + - include: 109_self-closing-tag + - match: (()) + captures: + 1: meta.tag.close.html.jsx.jsx1 + 2: punctuation.definition.tag.begin.html.jsx.jsx1 + 3: entity.name.tag.html.jsx.jsx1 + 4: punctuation.definition.tag.end.html.jsx.jsx1 + pop: 'True' + - match: (?=.|\n) + push: + - 109_meta-content + - 109_content + 109_trap: + - match: . + scope: trap.jsx1 + Naomi/integration/syntaxes/src/facebook-jsx/embedded-js.yml: + - match: \{ + scope: punctuation.definition.template-expression.begin.html.jsx.jsx1 + set: + - 110_meta + - 110_close + - 110_content + 110_close: + - match: \} + scope: punctuation.definition.template-expression.end.html.jsx.jsx1 + pop: 'True' + 110_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 110_content: + - clear_scopes: true + - meta_content_scope: source.js naomi + - match: (?=}) + pop: 'True' + - include: 110_comment-no-pop + - match: (?=\S) + push: + - 110_expression + 110_expression: + - include: Naomi/integration/syntaxes/src/js/expression.yml + 110_meta: + - meta_scope: meta.embedded-js.jsx.jsx1 + - match: '' + pop: 'True' + Naomi/integration/syntaxes/src/facebook-jsx/component.yml: + - match: | + (?x) + (<) + (?: + \s*({{111_namespaceIdentifier}}) + \s*(:) + )? + \s*({{111_componentIdentifier}}) + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.namespace.html.jsx.jsx1 + 3: punctuation.separator.namespace.html.jsx.jsx1 + 4: entity.name.tag.component.jsx.jsx1 + set: + - 111_meta + - 111_namespaced-closing-tag + - 111_close-open-tag + 111_close-open-tag: + - include: 109_close-open-tag + 111_meta: + - meta_scope: meta.tag.other.component.html.jsx.jsx1 + - match: '' + pop: 'True' + 111_namespaced-closing-tag: + - include: 109_component-closing-tag + 111_with-js-fence: + - match: | + (?x) + (<) + (?: + \s*({{111_namespaceIdentifier}}) + \s*(:) + )? + \s*({{111_componentIdentifier}}) + captures: + 1: meta.jsx-fence.jsx.jsx1 punctuation.definition.tag.begin.jsx.jsx1 + 2: entity.name.tag.namespace.html.jsx.jsx1 + 3: punctuation.separator.namespace.html.jsx.jsx1 + 4: entity.name.tag.component.jsx.jsx1 + set: + - 111_meta + - 111_namespaced-closing-tag + - 111_close-open-tag + Naomi/integration/syntaxes/src/facebook-jsx/fragment.yml: + - match: (<)\s*(>) + captures: + 1: punctuation.definition.tag.begin.jsx.jsx1 + 2: punctuation.definition.tag.end.jsx.jsx1 + set: + - 112_meta + - 112_closing-tag + 112_closing-tag: + - match: (()) + captures: + 1: meta.tag.close.jsx.jsx1 + 2: punctuation.definition.tag.begin.jsx.jsx1 + 3: punctuation.definition.tag.end.jsx.jsx1 + pop: 'True' + - match: (?=.|\n) + push: + - 112_meta-content + - 112_content + 112_content: + - include: 109_content + 112_meta: + - meta_scope: meta.tag.other.fragment.jsx.jsx1 + - include: 112_pop-now + 112_meta-content: + - clear_scopes: true + - meta_scope: source.jsx naomi + - include: 112_pop-now + 112_pop-now: + - match: '' + pop: 'True' + 112_with-js-fence: + - match: (<)\s*(>) + captures: + 1: meta.jsx-fence.jsx.jsx1 punctuation.definition.tag.begin.jsx.jsx1 + 2: punctuation.definition.tag.end.jsx.jsx1 + set: + - 112_meta + - 112_closing-tag + Naomi/integration/syntaxes/src/facebook-jsx/attribute.yml: + - include: Naomi/integration/syntaxes/src/facebook-flow/prolog.yml + - include: Naomi/integration/syntaxes/src/js/comment/eslint.yml + - include: Naomi/integration/syntaxes/src/js/comment/docblock.yml + - include: Naomi/integration/syntaxes/src/js/comment/block.yml + - include: Naomi/integration/syntaxes/src/js/comment/line.yml + - include: Naomi/integration/syntaxes/src/facebook-jsx/embedded-js.yml + - include: 113_dangerous + - include: 113_key + - include: 113_ref + - include: 113_fallback + 113_dangerous: + - match: dangerouslySetInnerHTML\b(?=\s*=) + scope: meta.attribute.builtin.html.jsx.jsx1 entity.other.attribute-name.dangerous.html.jsx.jsx1 + set: + - 113_meta + - 113_optional-value + - match: dangerouslySetInnerHTML\b + scope: meta.attribute.builtin.html.jsx.jsx1 entity.other.attribute-name.dangerous.html.jsx.jsx1 + pop: 'True' + 113_else-pop: + - match: (?=\S) + pop: 'True' + 113_key: + - match: key(?=\s*=) + scope: meta.attribute.builtin.html.jsx.jsx1 entity.other.attribute-name.key.html.jsx.jsx1 + set: + - 113_meta + - 113_optional-value + - match: key\b + scope: meta.attribute.builtin.html.jsx.jsx1 entity.other.attribute-name.key.html.jsx.jsx1 + pop: 'True' + 113_optional-value: + - match: '=' + scope: punctuation.separator.key-value.html.jsx.jsx1 + set: + - 113_value + - include: 113_else-pop + 113_fallback: + - match: (?xi){{113_attributeIdentifier}}(?=\s*=) + scope: entity.other.attribute-name.html.jsx.jsx1 + set: + - 113_meta + - 113_optional-value + - match: (?xi){{113_attributeIdentifier}} + scope: entity.other.attribute-name.html.jsx.jsx1 + pop: 'True' + 113_meta: + - meta_scope: meta.attribute-with-value.html.html5 + - include: 113_pop-now + 113_pop-now: + - match: '' + pop: 'True' + 113_ref: + - match: ref(?=\s*=) + scope: meta.attribute.builtin.html.jsx.jsx1 entity.other.attribute-name.ref.html.jsx.jsx1 + set: + - 113_meta + - 113_optional-value + - match: ref\b + scope: meta.attribute.builtin.html.jsx.jsx1 entity.other.attribute-name.ref.html.jsx.jsx1 + pop: 'True' + 113_value: + - include: Naomi/integration/syntaxes/src/facebook-jsx/component.yml + - include: Naomi/integration/syntaxes/src/facebook-jsx/element.yml + - include: Naomi/integration/syntaxes/src/facebook-jsx/fragment.yml + - include: Naomi/integration/syntaxes/src/facebook-jsx/literal/string/double-quoted.yml + - include: Naomi/integration/syntaxes/src/facebook-jsx/literal/string/single-quoted.yml + - include: 113_else-pop + Naomi/integration/syntaxes/src/facebook-jsx/literal/string/single-quoted.yml: + - match: \' + scope: punctuation.definition.string.begin.html.jsx.jsx1 + set: + - 114_string + 114_string: + - meta_scope: string.quoted.single.html.jsx.jsx1 + - match: \' + scope: punctuation.definition.string.end.html.jsx.jsx1 + pop: 'True' + Naomi/integration/syntaxes/src/facebook-jsx/literal/string/double-quoted.yml: + - match: \" + scope: punctuation.definition.string.begin.html.html.jsx.jsx1 + set: + - 115_string + 115_string: + - meta_scope: string.quoted.double.html.html.jsx.jsx1 + - match: \" + scope: punctuation.definition.string.end.html.html.jsx.jsx1 + pop: 'True' + Naomi/integration/syntaxes/src/js/comment/eslint.yml: + - match: \/\/(?=\s*eslint) + scope: punctuation.definition.comment.begin.js.fjsx15 + set: + - 116_line + - match: \/\*(?=\s*eslint) + scope: punctuation.definition.comment.begin.js.fjsx15 + set: + - 116_block + 116_line: + - include: 116_enable-disable + - match: \s*$ + pop: 'True' + 116_block: + - include: 116_enable-disable + - match: \*/ + scope: punctuation.definition.comment.end.js.fjsx15 + pop: 'True' + 116_enable-disable: + - match: (?i)eslint-(?>enable|disable)(?:-line)? + scope: keyword.other.js.fjsx15 + push: + - 116_rules-loop + 116_rules-loop: + - match: (?=(?>$|\*\/)) + pop: 'True' + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + - match: | + (?xi) + ( + [$_[:alpha:]] + [$_\-/[:alnum:]]* + ) + scope: variable.other.eslint.rule.js.fjsx15 + Naomi/integration/syntaxes/src/js/literal/string/regex/index.yml: + - match: / + scope: punctuation.definition.string.begin.js.fjsx15 + set: + - 117_regex-meta + - 117_close-regex + - 117_regex-content + 117_close-regex: + - match: (/)([a-z]*) + captures: + 1: punctuation.definition.string.end.js.fjsx15 + 2: keyword.other.flag.js.fjsx15 + pop: 'True' + - match: (?=\S) + push: + - 117_regex-content + 117_pop-now: + - match: '' + pop: 'True' + 117_regex-content: + - include: Naomi/integration/syntaxes/src/js/literal/string/regex/anchor.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/regex/backref.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/regex/backslash.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/regex/capturing-group.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/regex/character-class/index.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/regex/lookahead.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/regex/negative-lookahead.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/regex/non-capturing-group.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/regex/operator.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/regex/quantifier.yml + - include: 117_pop-now + 117_regex-meta: + - meta_scope: string.regexp.js.fjsx15 + - include: 117_pop-now + Naomi/integration/syntaxes/src/js/literal/string/regex/quantifier.yml: + - match: '[*+]?\??' + scope: keyword.operator.quantifier.regexp.js.fjsx15 + pop: 'True' + - match: | + (?x) + \{ + (?> \d+,\d+ + | \d+, + | \d+ + ) + } + scope: keyword.operator.quantifier.regexp + pop: 'True' + Naomi/integration/syntaxes/src/js/literal/string/regex/operator.yml: + - match: \| + scope: keyword.operator.or.regexp.js.fjsx15 + pop: 'True' + Naomi/integration/syntaxes/src/js/literal/string/regex/non-capturing-group.yml: + - match: '\(\?:' + scope: punctuation.definition.group.no-capture.begin.regexp.js.fjsx15 + set: + - 120_meta + - 120_close + - 120_regex-content + 120_close: + - match: \) + scope: punctuation.definition.group.no-capture.end.regexp.js.fjsx15 + pop: 'True' + - match: (?=\S) + push: + - 120_regex-content + 120_meta: + - meta_scope: meta.group.regexp.js.fjsx15 + - match: '' + pop: 'True' + 120_regex-content: + - include: 117_regex-content + Naomi/integration/syntaxes/src/js/literal/string/regex/negative-lookahead.yml: + - match: \(\?! + scope: punctuation.definition.group.assertion.begin.regexp.js.fjsx15 + set: + - 121_meta + - 121_close + - 121_regex-content + 121_close: + - match: \) + scope: punctuation.definition.group.assertion.end.regexp.js.fjsx15 + pop: 'True' + - match: (?=\S) + push: + - 121_regex-content + 121_meta: + - meta_scope: meta.group.assertion.look-ahead.negative.regexp.js.fjsx15 + - match: '' + pop: 'True' + 121_regex-content: + - include: 117_regex-content + Naomi/integration/syntaxes/src/js/literal/string/regex/lookahead.yml: + - match: \(\?= + scope: punctuation.definition.group.assertion.begin.regexp.js.fjsx15 + set: + - 122_meta + - 122_close + - 122_regex-content + 122_close: + - match: \) + scope: punctuation.definition.group.assertion.end.regexp.js.fjsx15 + pop: 'True' + - match: (?=\S) + push: + - 122_regex-content + 122_meta: + - meta_scope: meta.group.assertion.look-ahead.regexp.js.fjsx15 + - match: '' + pop: 'True' + 122_regex-content: + - include: 117_regex-content + Naomi/integration/syntaxes/src/js/literal/string/regex/character-class/index.yml: + - match: \. + scope: constant.other.character-class.regexp.js.fjsx15 + pop: 'True' + - match: ((\[)(\^)?) + captures: + 1: constant.other.character-class.regexp.js.fjsx15 + 2: punctuation.definition.character-class.begin.regexp.js.fjsx15 + 3: keyword.operator.negation.regexp.js.fjsx15 + set: + - 123_close + 123_close: + - match: \] + scope: constant.other.character-class.regexp.js.fjsx15 punctuation.definition.character-class.end.regexp.js.fjsx15 + pop: 'True' + - match: (?=\S) + push: + - 123_content + 123_content: + - include: Naomi/integration/syntaxes/src/js/literal/string/regex/character-class/range.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/regex/backslash.yml + - match: . + scope: constant.other.character-class.regexp.js.fjsx15 + pop: 'True' + Naomi/integration/syntaxes/src/js/literal/string/regex/backslash.yml: + - match: (?i)\\[wsd]| + scope: constant.other.character-class.escape.backslash.regexp + pop: 'True' + - match: | + (?x) + \\ + (?> c[A-Z] + | x[\da-fA-F]{2} + | u[\da-fA-F]{4} + | . + ) + scope: constant.character.escape.backslash.regexp.js.fjsx15 + pop: 'True' + Naomi/integration/syntaxes/src/js/literal/string/regex/character-class/range.yml: + - match: (?xi){{125_possibleRange}}-{{125_possibleRange}} + scope: constant.other.character-class.range.regexp.js.fjsx15 + pop: 'True' + Naomi/integration/syntaxes/src/js/literal/string/regex/capturing-group.yml: + - match: \((?!\?) + scope: punctuation.definition.group.begin.regexp.js.fjsx15 + set: + - 126_meta + - 126_close + - 126_regex-content + 126_close: + - match: \) + scope: punctuation.definition.group.end.regexp.js.fjsx15 + pop: 'True' + - match: (?=\S) + push: + - 126_regex-content + 126_meta: + - meta_scope: meta.group.regexp.js.fjsx15 + - match: '' + pop: 'True' + 126_regex-content: + - include: 117_regex-content + Naomi/integration/syntaxes/src/js/literal/string/regex/backref.yml: + - match: \\[1-9][0-9]* + scope: keyword.other.back-reference.regexp.js.fjsx15 + pop: 'True' + Naomi/integration/syntaxes/src/js/literal/string/regex/anchor.yml: + - match: (?>\\b|\^|\$) + scope: keyword.control.anchor.regexp.js.fjsx15 + pop: 'True' + Naomi/integration/syntaxes/src/js/function-expression.yml: + - include: 59_function-properties + - match: | + (?x) + (?= + (?:async\s+)? + function\b + ) + set: + - 129_declaration + - 129_keyword + 129_body: + - include: Naomi/integration/syntaxes/src/js/function/body.yml + 129_comment-no-pop: + - include: Naomi/integration/syntaxes/src/js/comment.no-pop.yml + 129_declaration: + - meta_scope: meta.function.js.fjsx15 + - include: 129_comment-no-pop + - match: (?=\{) + set: + - 129_body + - match: (?=<) + push: + - 129_generic-arguments + - match: (?=\() + push: + - 129_parameters + - match: | + (?xi) + (?:(\*)\s*)? + (?:({{129_commonIdentifier}}))? + captures: + 1: storage.modifier.js.fjsx15 + 2: entity.name.function.js.fjsx15 + - include: 129_else-pop + 129_else-pop: + - match: (?=\S) + pop: 'True' + 129_keyword: + - include: Naomi/integration/syntaxes/src/js/async.no-pop.yml + - match: function\b + scope: storage.type.function.js.fjsx15 + pop: 'True' + 129_generic-arguments: + - include: Naomi/integration/syntaxes/src/facebook-flow/generic/arguments.yml + 129_parameters: + - include: Naomi/integration/syntaxes/src/js/function/parameters.yml + Naomi/integration/syntaxes/src/js/literal/index.yml: + - include: Naomi/integration/syntaxes/src/js/literal/number.yml + - include: Naomi/integration/syntaxes/src/js/literal/array.yml + - include: Naomi/integration/syntaxes/src/js/literal/object/index.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/double-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/single-quoted.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/styled-component.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/template.yml + - include: Naomi/integration/syntaxes/src/js/literal/string/regex/index.yml + Naomi/integration/syntaxes/src/js/literal/string/styled-component.yml: + - match: | + (?x) + (styled) + (?: + (.)(\w+) + (.)(attrs) + )? + (?=\s*\() + captures: + 1: support.function.styled-component.js.fjsx15 + 2: punctuation.accessor.js.fjsxa15 + 3: variable.other.component.js.fjsx15 + 4: punctuation.accessor.js.fjsx15 + 5: support.function.styled-component.js.fjsx15 + set: + - 131_meta-styled-component + - 131_styled-component-begin + - 131_meta-function-call + - 131_arguments + - match: | + (?x) + ( + [[:upper:]] + [[:alnum:]]* + ) + (.) + (extend) + (?=\s*`) + captures: + 1: variable.other.component.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.styled-component.js.fjsx15 + set: + - 131_meta-styled-component + - 131_styled-component-begin + - match: | + (?x) + (styled)(.) + (\w+) + (?=\s*`) + captures: + 1: support.function.styled-component.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: variable.other.component.js.fjsx15 + set: + - 131_meta-styled-component + - 131_styled-component-begin + - match: | + (?x) + ((?> createGlobalStyle + | css + | injectGlobal + )) + (?=\s*`) + captures: + 1: support.function.styled-component.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: variable.other.component.js.fjsx15 + set: + - 131_meta-styled-component + - 131_styled-component-begin + - match: keyframes(?=\s*`) + scope: support.function.styled-component.js.fjsx15 + set: + - 131_meta-styled-component + - 131_styled-component-begin-keyframes + - match: | + (?x) + ( + [[:upper:]] + [[:alnum:]]* + ) + (.) + (withComponent) + (?=\s*\() + captures: + 1: variable.other.component.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.styled-component.js.fjsx15 + set: + - 131_meta-styled-component + - 131_optional-extend + - 131_meta-function-call + - 131_arguments + 131_arguments: + - include: Naomi/integration/syntaxes/src/js/function-call/arguments.yml + 131_close: + - match: \` + scope: punctuation.definition.styled-component.end.js.fjsx15 + pop: 'True' + 131_comment-no-pop: + - include: Naomi/integration/syntaxes/src/css/comment.no-pop.yml + - include: 32_no-pop + 131_keyframe-block-identifier: + - include: 178_block-identifier + 131_meta-function-call: + - meta_scope: meta.function-call.js.fjsx15 + - include: 131_pop-now + 131_meta-styled-component: + - meta_scope: meta.styled-component.js.fjsx15 + - include: 131_pop-now + 131_optional-extend: + - match: (\.)(extend)(?=`) + captures: + 1: punctuation.accessor.js.fjsx15 + 2: support.function.styled-component.js.fjsx15 + set: + - 131_styled-component-begin + 131_pop-now: + - match: '' + pop: 'True' + 131_ruleset-block: + - include: Naomi/integration/syntaxes/src/css/ruleset/block.yml + 131_ruleset-block-content: + - include: Naomi/integration/syntaxes/src/css/ruleset/block-content.yml + 131_shared-content: + - match: (?=`) + set: + - 131_close + - match: ; + scope: punctuation.terminator.css.css3 + 131_styled-component-begin: + - match: (?=\() + set: + - 131_arguments + - match: \` + scope: punctuation.definition.styled-component.begin.js.fjsx15 + set: + - 131_styled-component-content + 131_styled-component-begin-keyframes: + - match: \` + scope: punctuation.definition.styled-component.begin.js.fjsx15 + set: + - 131_styled-component-content-keyframes + 131_styled-component-content: + - clear_scopes: true + - meta_content_scope: source.css + - include: 131_comment-no-pop + - include: 131_shared-content + - match: (?=\{) + push: + - 131_ruleset-block + - match: (?=\S) + push: + - 131_ruleset-block-content + 131_styled-component-content-keyframes: + - clear_scopes: true + - meta_content_scope: source.css + - include: 131_comment-no-pop + - include: 131_shared-content + - match: (?=\S) + push: + - 131_ruleset-block + - 131_keyframe-block-identifier + Naomi/integration/syntaxes/src/css/ruleset/block-content.yml: + - include: 132_comment-no-pop + - match: (?=\}) + pop: 'True' + - match: | + (?xi) + (?= + {{132_customProperty}} + \s*: + ) + set: + - 132_possible-set + - 132_property + - match: | + (?x) + # grid-template, grid-template-areas, grid-template-columns, + # grid-template-rows + grid-template(?:-(?>areas|columns|rows))? + (?=\s*:) + scope: support.type.property-name.css.css3 + set: + - 132_meta-value + - 132_optional-grid-template-value + - 132_delimiter + - match: | + (?x) + grid + (?:- + # grid-area + (?> area + # grid-auto-coolums, grid-auto-flow, grid-auto-rows + | auto(?:-(?>columns|flow|rows)) + # grid-column, grid-column-end, grid-column-start + | column(?:-(?>end|start))? + # grid-gap + | gap + # grid-row, grid-row-end, grid-row-start + | row(?:-(?>end|start))? + ) + )? + (?=\s*:) + scope: support.type.property-name.css.css3 + set: + - 132_meta-value + - 132_optional-grid-value + - 132_delimiter + - match: | + (?xi) + (?= + {{132_cssIdentifier}} + \s*: + ) + set: + - 132_meta-value + - 132_optional-value + - 132_delimiter + - 132_property + - match: (?=\S) + set: + - - include: Naomi/integration/syntaxes/src/css/statement.yml + - include: Naomi/integration/syntaxes/src/css/ruleset/index.yml + 132_comment-no-pop: + - include: Naomi/integration/syntaxes/src/css/comment.no-pop.yml + 132_delimiter: + - include: 132_comment-no-pop + - match: ':' + scope: punctuation.separator.key-value.css.css3 + pop: 'True' + 132_grid-line-name: + - match: | + (?xi) + {{132_cssIdentifier}} + scope: variable.other.grid-line.css.css3 + pop: 'True' + 132_meta-value: + - meta_scope: meta.property-value.css.css3 + - include: 132_pop-now + 132_named-grid-line-declaration: + - meta_scope: meta.named-grid-line.css.css3 + - include: 132_comment-no-pop + - match: \] + scope: punctuation.definition.bracket.end.css.css3 + pop: 'True' + - match: (?=\S) + push: + - 132_grid-line-name + 132_optional-grid-value: + - include: 132_comment-no-pop + - match: (?=[`;()\]{}]) + pop: 'True' + - match: (?=\S) + push: + - - include: 132_start-end-ratio + - include: 132_value-separator + - match: span\b(?!-) + scope: keyword.operator.word.css.css3 + pop: 'True' + - include: 132_grid-line-name + - include: Naomi/integration/syntaxes/src/css/value.yml + 132_optional-grid-template-value: + - include: 132_comment-no-pop + - match: (?=[`;()\]{}]) + pop: 'True' + - match: \[ + scope: punctuation.definition.bracket.begin.css.css3 + push: + - 132_named-grid-line-declaration + - match: (?=\S) + push: + - - include: 132_start-end-ratio + - include: 132_value-separator + - include: Naomi/integration/syntaxes/src/css/value.yml + 132_optional-value: + - include: 132_comment-no-pop + - match: (?=[`;()\[\]{}]) + pop: 'True' + - match: (?=\S) + push: + - - include: 132_value-separator + - include: Naomi/integration/syntaxes/src/css/value.yml + 132_possible-set: + - include: 132_comment-no-pop + - match: ':' + scope: punctuation.separator.key-value.css.css3 + set: + - 132_meta-value + - 132_set-or-optional-value + 132_pop-now: + - match: '' + pop: 'True' + 132_property: + - include: 132_comment-no-pop + - include: Naomi/integration/syntaxes/src/css/property.yml + 132_ruleset-block: + - include: Naomi/integration/syntaxes/src/css/ruleset/block.yml + 132_start-end-ratio: + - match: / + scope: keyword.operator.arithmetic.ratio.css.css3 + pop: 'True' + 132_set-or-optional-value: + - include: 132_comment-no-pop + - match: (?=\{) + set: + - 132_ruleset-block + - include: 132_optional-value + 132_value-separator: + - match: \, + scope: punctuation.separator.sequence.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/ruleset/block.yml: + - match: \{ + scope: punctuation.section.property-list.begin.css.css3 + set: + - 133_delimiter + 133_comment-no-pop: + - include: Naomi/integration/syntaxes/src/css/comment.no-pop.yml + 133_delimiter: + - meta_scope: meta.property-list.css.css3 + - include: 133_comment-no-pop + - match: \} + scope: punctuation.section.property-list.end.css.css3 + pop: 'True' + - match: ; + scope: punctuation.terminator.css.css3 + - match: '' + push: + - - include: Naomi/integration/syntaxes/src/css/ruleset/block-content.yml + - match: '' + pop: 'True' + Naomi/integration/syntaxes/src/css/comment.no-pop.yml: + - match: (?=/\*) + push: + - - include: Naomi/integration/syntaxes/src/css/comment/index.yml + Naomi/integration/syntaxes/src/css/comment/index.yml: + - include: Naomi/integration/syntaxes/src/css/comment/block.yml + Naomi/integration/syntaxes/src/css/comment/block.yml: + - match: /\* + scope: punctuation.definition.comment.begin.css.css3 + set: + - 136_block + 136_block: + - meta_scope: comment.block.css.css3 + - include: 136_email-no-pop + - include: 136_link-no-pop + - match: \*/ + scope: punctuation.definition.comment.end.css.css3 + pop: 'True' + 136_email-no-pop: + - include: Naomi/integration/syntaxes/src/shared/email.no-pop.yml + 136_link-no-pop: + - include: Naomi/integration/syntaxes/src/shared/link.no-pop.yml + Naomi/integration/syntaxes/src/css/property.yml: + - include: 137_core + - include: 137_custom + - include: 137_prefixed + - include: 137_other + 137_core: + - match: (?xi){{137_coreProperties}} + scope: support.type.property-name.css.css3 + pop: 'True' + 137_custom: + - match: (?i){{137_customProperty}} + captures: + 0: support.type.custom-property.css.css3 + 1: punctuation.definition.custom-property.css.css3 + 2: support.type.custom-property.name.css.css3 + pop: 'True' + 137_prefixed: + - match: | + (?xi) + (-(?>moz|ms|o|webkit)-) + ({{137_coreProperties}}) + captures: + 1: support.type.vendor-prefix.css.css3 + 2: support.type.property-name.css.css3 + pop: 'True' + 137_other: + - match: (?i){{137_cssIdentifier}} + scope: variable.other.type.property-name.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/value.yml: + - include: Naomi/integration/syntaxes/src/css/value-no-unquoted-string.yml + - include: Naomi/integration/syntaxes/src/css/literal/string/unquoted.yml + Naomi/integration/syntaxes/src/css/literal/string/unquoted.yml: + - match: (?!--)[_[:alnum:]\-]+ + scope: string.unquoted.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/value-no-unquoted-string.yml: + - match: '!important\b' + scope: keyword.other.important.css.css3 + pop: 'True' + - include: Naomi/integration/syntaxes/src/css/literal/color.yml + - include: Naomi/integration/syntaxes/src/css/literal/ratio.yml + - include: Naomi/integration/syntaxes/src/css/literal/number.yml + - include: Naomi/integration/syntaxes/src/css/literal/string/double-quoted.yml + - include: Naomi/integration/syntaxes/src/css/literal/string/single-quoted.yml + - include: Naomi/integration/syntaxes/src/css/function-call/index.yml + - include: Naomi/integration/syntaxes/src/css/constant.yml + Naomi/integration/syntaxes/src/css/constant.yml: + - include: 141_color + - include: 141_other + 141_color: + - match: | + (?xi) + (?> aliceblue + | antiquewhite + | aqua + | aquamarine + | azure + | beige + | bisque + | black + | blanchedalmond + | blue + | blueviolet + | brown + | burlywood + | cadetblue + | chartreuse + | chocolate + | coral + | cornflowerblue + | cornsilk + | crimson + | cyan + | dark + (?> blue + | cyan + | goldenrod + | gray + | grey + | green + | khaki + | magenta + | olivegreen + | orange + | orchid + | red + | salmon + | seagreen + | slateblue + | slategray + | slategrey + | turquoise + | violet + ) + | deeppink + | deepskyblue + | dimgray + | dimgrey + | dodgerblue + | firebrick + | floralwhite + | forestgreen + | fuchsia + | gainsboro + | ghostwhite + | gold(?:enrod)? + | gr[ae]y + | green(?:yellow)? + | honeydew + | hotpink + | indianred + | indigo + | ivory + | khaki + | lavender(?:blush)? + | lawngreen + | lemonchiffon + | light + (?> blue + | coral + | cyan + | goldenrodyellow + | gray + | grey + | green + | pink + | salmon + | seagreen + | skyblue + | slategray + | slategrey + | steelblue + | yellow + ) + | lime(?:green)? + | linen + | magenta + | maroon + | medium + (?> aquamarine + | blue + | orchid + | purple + | seagreen + | slateblue + | springgreen + | turquoise + | violetred + ) + | midnightblue + | mintcream + | mistyrose + | moccasin + | navajowhite + | navy + | oldlace + | olive(?:drab)? + | orange(?:red)? + | orchid + | palegoldenrod + | palegreen + | paleturquoise + | palevioletred + | papayawhip + | peachpuff + | peru + | pink + | plum + | powderblue + | purple + | rebeccapurple + | red + | rosybrown + | royalblue + | saddlebrown + | salmon + | sandybrown + | seagreen + | seashell + | sienna + | silver + | skyblue + | slateblue + | slategr[ae]y + | snow + | springgreen + | steelblue + | tan + | teal + | thistle + | tomato + | turquoise + | violet + | wheat + | white(?:smoke)? + | yellow(?:green)? + )\b + (?!-) + scope: support.constant.color.css.css3 + pop: 'True' + 141_other: + - match: | + (?x) + (?> a4 + | absolute + | alternate + | all + | at + | auto-fill + | auto-fit + | auto + | baseline + | block + | bold + | border-box + | bottom + | button + | center + | checkbox + | content-box + | collapse + | column(?:-reverse)? + | contain + | cover + | dashed + | disabled + | dotted + | ease + (?:-(?>in|out))? + | ellipsis + | ellipse + | false + | fixed + | flex-start + | flex-end + | flex + | forwards + | hidden + | grid + | infinite + | inline-block + | inline-flex + | inline-grid + | inline-table + | inline + | inherit + | initial + | italic + | landscape + | left + | lining-nums + | list-item + | middle + | no-repeat + | none + | normal + | nowrap + | number + | only + | pointer + | print + | projection + | radio + | relative + | repeat + | reset + | right + | row(?:-reverse)? + | run-in + | screen + | search + | small-caps + | solid + | space-arround + | space-between + | speech + | sub + | submit + | system-ui + | super + | table-caption + | table-cell + | table-column(?:-group)? + | table-footer-group + | table-header-group + | table-row(?:-group)? + | table + | text-bottom + | text-top + | top + | transparent + | true + | tv + | visible + | uppercase + )\b + (?!-) + scope: support.constant.property-value.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/function-call/index.yml: + - include: 142_calc + - include: 142_domain + - include: 142_regexp + - include: 142_url-and-url-prefix + - include: 142_var + - include: 142_other + - include: 142_fallback + 142_arg-begin: + - match: \( + scope: punctuation.section.group.begin.css.css3 + pop: 'True' + 142_arg-close: + - match: \) + scope: punctuation.section.group.close.css.css3 + pop: 'True' + 142_arguments: + - include: Naomi/integration/syntaxes/src/css/function-call/arguments.yml + 142_calc: + - match: calc(?=\s*\() + scope: support.function.css.css3 + set: + - 142_meta + - 142_calc-arg-close + - 142_arg-begin + 142_calc-arg-close: + - include: 142_comma-no-pop + - include: 142_arg-close + - match: (?=\S) + push: + - 142_calc-optional-tail + - 142_calc-optional-head + 142_calc-close-group: + - match: \) + scope: punctuation.section.group.end.css.css3 + pop: 'True' + 142_calc-optional-head: + - match: \( + scope: punctuation.section.group.begin.css.css3 + push: + - 142_meta-group + - 142_calc-close-group + - 142_calc-optional-tail + - 142_calc-optional-head + - include: Naomi/integration/syntaxes/src/css/value.yml + - include: 142_else-pop + 142_calc-optional-tail: + - match: '[+\-*/]' + scope: keyword.operator.arithmetic.css.css3 + set: + - 142_calc-optional-head + - include: 142_else-pop + 142_comma-no-pop: + - match: \, + scope: punctuation.separator.comma.css.css3 + 142_domain: + - match: domain(?=\s*\() + scope: support.function.domain.css.css3 + set: + - 142_meta + - 142_arg-close + - 142_url-argument + - 142_arg-begin + 142_else-pop: + - match: (?=\S) + pop: 'True' + 142_fallback: + - match: | + (?xi) + (?= + {{142_cssIdentifier}} + \s*\( + ) + set: + - 142_meta + - 142_arguments + - 142_identifier + 142_identifier: + - match: (?xi){{142_cssIdentifier}} + scope: variable.function.css.css3 + pop: 'True' + 142_meta: + - meta_scope: meta.function-call.css.css3 meta.group.css.css3 + - include: 142_pop-now + 142_meta-group: + - meta_scope: meta.group.css.css3 + - include: 142_pop-now + 142_optional-var-value: + - include: 137_custom + - include: Naomi/integration/syntaxes/src/css/value.yml + - include: 142_else-pop + 142_other: + - match: | + (?x) + (?> attr + | blur + | cubic-bezier + | format + | gray + | hsla? + | hwb + | image-set + | linear-gradient + | polygon + | radial-gradient + | repeating-(?>linear|radial)-gradient + | repeat + | rotate + | rgba? + ) + (?=\s*\() + scope: support.function.css.css3 + set: + - 142_meta + - 142_arguments + 142_pop-now: + - match: '' + pop: 'True' + 142_quoted-string: + - include: Naomi/integration/syntaxes/src/css/literal/string/double-quoted.yml + - include: Naomi/integration/syntaxes/src/css/literal/string/single-quoted.yml + 142_regexp: + - match: regexp(?=\s*\() + scope: support.function.regexp.css.css3 + set: + - 142_meta + - 142_arg-close + - 142_quoted-string + - 142_arg-begin + 142_url-and-url-prefix: + - match: url-prefix(?=\s*\() + scope: support.function.url-prefix.css.css3 + set: + - 142_meta + - 142_arg-close + - 142_url-argument + - 142_arg-begin + - match: url(?=\s*\() + scope: support.function.url.css.css3 + set: + - 142_meta + - 142_arg-close + - 142_url-argument + - 142_arg-begin + 142_url-argument: + - match: (?=\)) + pop: 'True' + - include: 142_quoted-string + - match: | + (?x) + (?> \\["'()\s] + | [^"'()\s] + ) + scope: string.unquoted.css.css3 + 142_var: + - match: var(?=\s*\() + scope: support.function.regexp.css.css3 + set: + - 142_meta + - 142_var-arg-close + - 142_arg-begin + 142_var-arg-close: + - include: 142_comma-no-pop + - include: 142_arg-close + - match: (?=\S) + push: + - 142_optional-var-value + Naomi/integration/syntaxes/src/css/literal/string/single-quoted.yml: + - match: \' + scope: punctuation.definition.string.begin.css.css3 + set: + - 143_string + 143_string: + - meta_scope: string.quoted.single.css.css3 + - match: \' + scope: punctuation.definition.string.end.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/literal/string/double-quoted.yml: + - match: \" + scope: punctuation.definition.string.begin.css.css3 + set: + - 144_string + 144_string: + - meta_scope: string.quoted.double.css.css3 + - match: \" + scope: punctuation.definition.string.end.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/function-call/arguments.yml: + - match: \( + scope: punctuation.section.group.begin.css.css3 + set: + - 145_delimiter + 145_delimiter: + - meta_scope: meta.group.css.css3 + - match: \) + scope: punctuation.section.group.end.css.css3 + pop: 'True' + - match: \, + scope: punctuation.separtor.comma.css.css3 + - match: (?=\S) + push: + - 145_value + 145_value: + - include: Naomi/integration/syntaxes/src/css/value.yml + Naomi/integration/syntaxes/src/css/literal/number.yml: + - include: 146_float + - include: 146_integer + 146_float: + - match: (?xi){{146_scientificNotation}}({{146_unit}})? + captures: + 0: constant.numeric.float.scientific.css.css3 + 1: keyword.other.unit.css.css3 + pop: 'True' + - match: (?xi){{146_literalFloat}}({{146_unit}})? + captures: + 0: constant.numeric.float.css.css3 + 1: keyword.other.unit.css.css3 + pop: 'True' + 146_integer: + - match: (?xi)-?0b[01]+({{146_unit}})? + captures: + 0: constant.numeric.binary.css.css3 + 1: keyword.other.unit.css.css3 + pop: 'True' + - match: (?xi)-?0[0-7]+({{146_unit}})? + captures: + 0: constant.numeric.octal.css.css3 + 1: keyword.other.unit.css.css3 + pop: 'True' + - match: (?xi)-?0[x][0-9a-f]+({{146_unit}})? + captures: + 0: constant.numeric.hex.css.css3 + 1: keyword.other.unit.css.css3 + pop: 'True' + - match: (?xi)(?:-?[1-9][0-9]*|0)({{146_unit}})? + captures: + 0: constant.numeric.decimal.css.css3 + 1: keyword.other.unit.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/literal/ratio.yml: + - match: ([0-9]+)\s*(/)\s*([0-9]) + captures: + 0: constant.numeric.ratio.css.css3 + 1: constant.numeric.decimal.css.css3 + 2: keyword.operator.arithmetic.ratio.css.css3 + 3: constant.numeric.decimal.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/literal/color.yml: + - match: (?i)(\#)({{148_hex}}{3}|{{148_hex}}{6})\b + captures: + 0: constant.other.color.rgb-value.css + 1: punctuation.definition.constant.css + pop: 'True' + - match: (?i)(\#)({{148_hex}}{4}|{{148_hex}}{8})\b + captures: + 0: constant.other.color.rgba-value.css + 1: punctuation.definition.constant.css + pop: 'True' + Naomi/integration/syntaxes/src/css/ruleset/index.yml: + - match: '' + set: + - 149_meta + - 149_block + - 149_selector-list + 149_block: + - include: Naomi/integration/syntaxes/src/css/ruleset/block.yml + 149_meta: + - meta_scope: meta.rule-set.css.css3 + - match: '' + pop: 'True' + 149_selector-list: + - include: Naomi/integration/syntaxes/src/css/ruleset/selector-list.yml + Naomi/integration/syntaxes/src/css/ruleset/selector-list.yml: + - match: '' + set: + - 150_meta-selector-list + - 150_delimiter + - 150_meta-selector + - 150_selector-expression + 150_delimiter: + - match: (?=[;{]) + pop: 'True' + - match: \, + scope: punctuation.separator.comma.css.css3 + push: + - 150_meta-selector + - 150_selector-expression + 150_meta-selector: + - meta_content_scope: meta.selector.css.css3 + - match: '' + pop: 'True' + 150_meta-selector-list: + - meta_content_scope: meta.selector-list.css.css3 + - match: '' + pop: 'True' + 150_selector-expression: + - include: Naomi/integration/syntaxes/src/css/selector-expression.yml + Naomi/integration/syntaxes/src/css/selector-expression.yml: + - match: '' + set: + - 151_optional-tail + - 151_head + 151_head: + - match: | + (?xi) + (?> ({{151_cssIdentifier}}) + | (\*) + ) + \s*(\|) + captures: + 0: meta.namespace-prefix.css.css3 + 1: variable.other.namespace-prefix.css.css3 + 2: keyword.other.namespace-wildcard.css.css3 + 3: punctuation.separator.key-value.css.css3 + - include: Naomi/integration/syntaxes/src/css/selector/pseudo-element.yml + - include: Naomi/integration/syntaxes/src/css/selector/pseudo-class.yml + - include: Naomi/integration/syntaxes/src/css/selector/ampersand.yml + - include: Naomi/integration/syntaxes/src/css/selector/attribute.yml + - include: Naomi/integration/syntaxes/src/css/selector/custom.yml + - include: Naomi/integration/syntaxes/src/css/selector/id.yml + - include: Naomi/integration/syntaxes/src/css/selector/class.yml + - include: Naomi/integration/syntaxes/src/css/selector/type.yml + - include: Naomi/integration/syntaxes/src/css/selector/universal.yml + 151_optional-tail: + - include: Naomi/integration/syntaxes/src/css/comment.no-pop.yml + - match: (?=[,;(){}]) + pop: 'True' + - include: Naomi/integration/syntaxes/src/css/combinator.yml + - match: (?=\[) + push: + - - include: Naomi/integration/syntaxes/src/css/selector/attribute.yml + - match: (?=:) + push: + - - include: Naomi/integration/syntaxes/src/css/selector/pseudo-element.yml + - include: Naomi/integration/syntaxes/src/css/selector/pseudo-class.yml + - include: Naomi/integration/syntaxes/src/css/selector/custom.yml + - match: (?=\S) + push: + - 151_head + Naomi/integration/syntaxes/src/css/selector/custom.yml: + - match: (?i){{152_customSelector}} + captures: + 0: support.type.custom-selector.css.css3 + 1: punctuation.definition.custom-selector.css.css3 + 2: support.type.custom-selector.name.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/selector/pseudo-class.yml: + - include: 153_expected-pseudo-classes + - include: 153_matches + - include: 153_not + - include: 153_nth-child + - include: 153_nth-of-type + - include: 153_fallback + 153_expected-pseudo-classes: + - match: (?xi)(:){{153_corePseudoClasses}} + captures: + 0: entity.other.pseudo-class.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: 'True' + 153_fallback: + - match: (?xi)(:){{153_cssIdentifier}} + captures: + 0: variable.other.pseudo-class.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: 'True' + 153_matches: + - match: (\:)matches(?=\s*\() + captures: + 0: entity.other.pseudo-class.css.cs3 + 1: punctuation.definition.entity.css.css3 + set: + - 153_selector-expression-as-arguments + 153_not: + - match: (\:)not(?=\s*\() + captures: + 0: entity.other.pseudo-class.css.cs3 + 1: punctuation.definition.entity.css.css3 + set: + - 153_selector-expression-as-arguments + - match: (\:)not\b + captures: + 0: entity.other.pseudo-class.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: 'True' + 153_nth-arguments: + - include: Naomi/integration/syntaxes/src/css/selector/nth/arguments.yml + 153_nth-child: + - match: (\:)nth(?:-last)?-child\b + captures: + 0: entity.other.pseudo-class.css.cs3 + 1: punctuation.definition.entity.css.css3 + set: + - 153_nth-arguments + 153_nth-of-type: + - match: (\:)nth(?:-last)?-of-type\b + captures: + 0: entity.other.pseudo-class.css.cs3 + 1: punctuation.definition.entity.css.css3 + set: + - 153_nth-arguments + 153_selector-expression-as-arguments: + - include: Naomi/integration/syntaxes/src/css/selector-expression-as-arguments.yml + Naomi/integration/syntaxes/src/css/selector-expression-as-arguments.yml: + - match: \( + scope: punctuation.section.group.begin.css.css3 + set: + - 154_close + 154_close: + - meta_scope: meta.group.css.css3 + - match: \) + scope: punctuation.section.group.end.css.css3 + pop: 'True' + - match: (?=\S) + push: + - 154_expression + 154_expression: + - include: Naomi/integration/syntaxes/src/css/selector-expression.yml + Naomi/integration/syntaxes/src/css/selector/nth/arguments.yml: + - match: \( + scope: punctuation.section.group.begin.css.css3 + set: + - 155_close + 155_close: + - meta_scope: meta.group.css.css3 + - match: \) + scope: punctuation.section.group.end.css.css3 + pop: 'True' + - match: (?=\S) + push: + - 155_expression + 155_expression: + - include: Naomi/integration/syntaxes/src/css/selector/nth/expression.yml + Naomi/integration/syntaxes/src/css/selector/nth/expression.yml: + - include: 156_operator + - match: (?=\S) + set: + - 156_optional-tail + - 156_head + 156_head: + - match: (?>even|odd)\b + scope: keyword.other.pseudo-class.css.css3 + pop: 'True' + - match: -?[1-9][0-9]*|0 + scope: constant.numeric.decimal.css.css3 + pop: 'True' + - match: n\b + scope: keyword.other.unit.css.css3 + pop: 'True' + 156_operator: + - match: '[+-]' + scope: keyword.operator.arithmetic.css.css3 + set: + - Naomi/integration/syntaxes/src/css/selector/nth/expression.yml + - match: of\b + scope: keyword.operator.word.of.css.css3 + set: + - 156_selector-expression + 156_optional-tail: + - include: 156_operator + - match: (?=\S) + pop: 'True' + 156_selector-expression: + - include: Naomi/integration/syntaxes/src/css/selector-expression.yml + Naomi/integration/syntaxes/src/css/selector/pseudo-element.yml: + - include: 157_css2 + - include: 157_other + - include: 157_fallback + 157_css2: + - match: (?xi)(::?)(?>after|before|first-(?>letter|line))\b + captures: + 0: entity.other.pseudo-element.class.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: 'True' + 157_fallback: + - match: (?xi)(::){{157_cssIdentifier}} + captures: + 0: variable.other.pseudo-element.class.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: 'True' + 157_other: + - match: (::)cue(?=\s*\() + captures: + 0: entity.other.pseudo-element.class.css.cs3 + 1: punctuation.definition.entity.css.css3 + set: + - 157_selector-expression-as-arguments + - match: (?xi)(::)(?>backdrop|cue|selection)\b + captures: + 0: entity.other.pseudo-element.class.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: 'True' + 157_selector-expression-as-arguments: + - include: Naomi/integration/syntaxes/src/css/selector-expression-as-arguments.yml + Naomi/integration/syntaxes/src/css/selector/attribute.yml: + - match: \[ + scope: punctuation.section.brackets.begin.css.css3 + set: + - 158_meta + - 158_close + - 158_optional-operator + - 158_attribute + 158_attribute: + - include: Naomi/integration/syntaxes/src/html/attribute/builtin.yml + - include: Naomi/integration/syntaxes/src/html/attribute/data.yml + - match: | + (?xi) + (?> [_[:alpha:]\-] + | \\\S + )+ + scope: entity.other.attribute-name.css.css3 + pop: 'True' + 158_close: + - match: \] + scope: punctuation.section.brackets.end.css.css3 + pop: 'True' + - match: (?=\S) + push: + - 158_value + 158_meta: + - meta_scope: meta.attribute-selector.css.css3 + - match: '' + pop: 'True' + 158_optional-operator: + - match: '[~|^$*]?=' + scope: keyword.operator.attribute-selector.css.css3 + set: + - 158_value + - match: (?=\S) + pop: 'True' + 158_value: + - include: Naomi/integration/syntaxes/src/css/value.yml + Naomi/integration/syntaxes/src/html/attribute/data.yml: + - match: (?i)data-[_:[:alnum:]\-.]* + scope: meta.attribute.data.html.html5 entity.other.attribute-name.html.html5 + pop: 'True' + Naomi/integration/syntaxes/src/html/attribute/builtin.yml: + - match: id\b + scope: meta.attribute.builtin.html.html5 entity.other.attribute-name.id.html.html5 + pop: 'True' + - match: | + (?xi) + (?> a + # accept, accept-charset, accessKey + (?> cce(?>pt(?:-charset)?|sskey) + # action + | ction + # align, alt + | l(?>ign|t) + # async + | sync + # autocomplete, autofocus, autoplay, autosave + | uto(?>complete|focus|play|save) + ) + | buffered + | c + # challenge, charset + (?> ha(?>llenge|rset) + # checked + | hecked + # cite + | ite + # class + | lass + | o + # code, codebase + (?> de(?:base)? + # cols, colspan + | ls(?:pan)? + # content. contenteditable, contextmenu, controls + | nt(?>e(?>nt(?:editable)?|xtmenu)|rols) + # cords + | ords + ) + ) + | d + # data, datetime + (?> at(?>a|etime) + # default, defer + | ef(?>ault|er) + # dir, dirname + | ir(?:name)? + # disabled + | isabled + # download + | ownload + # draggable, dropzone + | r(?>aggable|opzone) + ) + | enctype + # form, formaction + | for(?:m(?:action)?)? + | h + # headers + (?> eaders + # height + | eight + # hidden + | idden + # high + | igh + # href + | ref(?:lang)? + # http-equiv + | ttp-equiv + ) + | i + # icon + (?> con + # ismap + | smap + # itemprop + | temprop + ) + # keytype, kind + | k(?>eytype|ind) + | l + # label + (?> abel + # lang, language + | ang(?:uage)? + # list + | ist + # loop + | oop + # low + | ow + ) + | m + # manifest + (?> anifest + # max + | ax(?:length)? + # media + | edia + # method + | ethod + # min + | in + # multiple + | ultiple + # muted + | uted + ) + # name, novalidate + | n(?>ame|ovalidate) + # open, optimum + | op(?>en|timum) + | p + # pattern + (?> attern + # ping + | ing + # placeholder + | laceholder + # poster + | oster + # preload + | reload + ) + | r + # radiogroup + (?> adiogroup + # readonly, rel, required, reversed + | e(?>adonly|l|quired|versed) + # rows, rowspan + | ows(?:pan)? + ) + | s + # sandbox + (?> andbox + # scope, scoped + | coped? + # seamless + | eamless + # selected + | elected + # shape + | hape + # size, sizes + | izes? + # span + | pan + # spellcheck + | pellcheck + # src, srcdoc, srclang, srcset + | rc(?>doc|lang|set)? + # start, step, style, summary + | t(?>art|ep|yle) + # summary + | ummary + ) + | t + # tabindex, target + (?> a(?>bindex|rget) + # title + | itle + # type + | ype + ) + | usemap + | value + # width, wrap + | w(?>idth|rap) + )\b(?!-) + scope: meta.attribute.builtin.html.html5 entity.other.attribute-name.html.html5 + pop: 'True' + Naomi/integration/syntaxes/src/css/combinator.yml: + - match: \+ + scope: punctuation.separator.combinator.sibling.direct.css.css3 + set: + - 161_optional-selector-expression + - match: None + scope: punctuation.separator.combinator.sibling.css.css3 + set: + - 161_optional-selector-expression + - match: \> + scope: punctuation.separator.combinator.child.css.css3 + set: + - 161_optional-selector-expression + 161_optional-selector-expression: + - match: (?=[,{]) + pop: 'True' + - match: (?=\S) + set: + - 161_selector-expression + 161_selector-expression: + - include: Naomi/integration/syntaxes/src/css/selector-expression.yml + Naomi/integration/syntaxes/src/css/selector/universal.yml: + - match: \* + scope: entity.name.tag.wildcard.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/selector/type.yml: + - match: (?xi){{163_tags}}\b + scope: entity.name.tag.css.cs3 + pop: 'True' + - match: (?xi){{163_cssIdentifier}}\b + scope: variable.other.tag.css.cs3 + pop: 'True' + Naomi/integration/syntaxes/src/css/selector/class.yml: + - match: (?xi)(\.)({{164_cssIdentifier}}) + captures: + 0: entity.other.attribute-name.class.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/selector/id.yml: + - match: (?xi)(\#)({{165_cssIdentifier}}) + captures: + 0: entity.other.attribute-name.id.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/selector/ampersand.yml: + - match: \& + scope: entity.name.tag.wildcard.parent.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/statement.yml: + - include: 167_apply + - include: 167_empty-statement + - include: 167_charset + - include: 167_conditional-group-rules + - include: 167_counter-style + - include: 167_custom-media + - include: 167_custom-selector + - include: 167_font-face + - include: 167_keyframes + - include: 167_namespace + - include: 167_nest + - include: 167_import + - include: 167_page + - include: 167_viewport + 167_apply: + - match: (@)apply\b + captures: + 0: keyword.control.at-rule.apply.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-apply + - 167_custom-property + 167_charset: + - match: (@)charset\b + captures: + 0: keyword.control.at-rule.charset.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-charset + - 167_double-quoted-string + 167_conditional-group-body: + - include: Naomi/integration/syntaxes/src/css/ruleset/block.yml + 167_conditional-group-rules: + - match: (@)document\b + captures: + 0: keyword.control.at-rule.document.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-document + - 167_conditional-group-body + - 167_url-list + - match: (@)media\b + captures: + 0: keyword.control.at-rule.media.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-media + - 167_conditional-group-body + - 167_optional-media-query-list + - match: (@)supports\b + captures: + 0: keyword.control.at-rule.supports.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-supports + - 167_conditional-group-body + - 167_feature-query-list + 167_counter-style: + - match: (@)counter-style\b + captures: + 0: keyword.control.at-rule.counter-style.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-counter-style + - 167_ruleset-block + - 167_counter-style-name + 167_counter-style-name: + - match: | + (?xi) + {{167_cssIdentifier}} + scope: entity.other.counter-style.css.css3 + pop: 'True' + 167_custom-media: + - match: (@)custom-media\b + captures: + 0: keyword.control.at-rule.media.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-custom-media + - 167_optional-media-query-list + - 167_custom-media-identifier + 167_custom-media-identifier: + - include: Naomi/integration/syntaxes/src/css/custom-media-identifier.yml + 167_custom-selector: + - match: (@)custom-selector\b + captures: + 0: keyword.control.at-rule.media.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-custom-selector + - 167_selector-list + - 167_custom-selector-identifier + 167_custom-selector-identifier: + - include: Naomi/integration/syntaxes/src/css/selector/custom.yml + 167_custom-property: + - include: 137_custom + 167_double-quoted-string: + - include: Naomi/integration/syntaxes/src/css/literal/string/double-quoted.yml + 167_empty-statement: + - match: ; + scope: punctuation.terminator.css.css3 + pop: 'True' + 167_feature-query-list: + - include: Naomi/integration/syntaxes/src/css/feature-query-list.yml + 167_font-face: + - match: (@)font-face\b + captures: + 0: keyword.control.at-rule.font-face.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-font-face + - 167_ruleset-block + 167_import: + - match: (@)import-normalize\b + captures: + 0: keyword.control.at-rule.import.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-import + - match: (@)import\b + captures: + 0: keyword.control.at-rule.import.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-import + - 167_optional-media-query-list + - 167_string-or-url + 167_keyframe-block-list: + - include: Naomi/integration/syntaxes/src/css/keyframe-block-list.yml + 167_keyframe-name: + - match: | + (?xi) + {{167_cssIdentifier}} + scope: entity.other.animation-name.css.css3 + pop: 'True' + 167_keyframes: + - match: | + (?x) + (@) + (?:- + (?> moz + | ms + | o + | webkit + ) + -)?keyframes\b + captures: + 0: keyword.control.at-rule.keyframes.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-keyframes + - 167_keyframe-block-list + - 167_keyframe-name + 167_meta-apply: + - meta_scope: meta.at-rule.apply.css.css3 + - include: 167_pop-now + 167_meta-charset: + - meta_scope: meta.at-rule.charset.css.css3 + - include: 167_pop-now + 167_meta-counter-style: + - meta_scope: meta.at-rule.counter-style.css.css3 + - include: 167_pop-now + 167_meta-custom-media: + - meta_scope: meta.at-rule.custom-media.css.css3 + - include: 167_pop-now + 167_meta-custom-selector: + - meta_scope: meta.at-rule.custom-selector.css.css3 + - include: 167_pop-now + 167_meta-document: + - meta_scope: meta.at-rule.document.css.css3 + - include: 167_pop-now + 167_meta-font-face: + - meta_scope: meta.at-rule.font-face.css.css3 + - include: 167_pop-now + 167_meta-import: + - meta_scope: meta.at-rule.import.css.css3 + - include: 167_pop-now + 167_meta-keyframes: + - meta_scope: meta.at-rule.keyframes.css.css3 + - include: 167_pop-now + 167_meta-media: + - meta_scope: meta.at-rule.media.css.css3 + - include: 167_pop-now + 167_meta-namespace: + - meta_scope: meta.at-rule.namespace.css.css3 + - include: 167_pop-now + 167_meta-nest: + - meta_scope: meta.at-rule.nest.css.css3 + - include: 167_pop-now + 167_meta-page: + - meta_scope: meta.at-rule.page.css.css3 + - include: 167_pop-now + 167_meta-supports: + - meta_scope: meta.at-rule.supports.css.css3 + - include: 167_pop-now + 167_meta-viewport: + - meta_scope: meta.at-rule.viewport.css.css3 + - include: 167_pop-now + 167_namespace: + - match: (@)namespace\b + captures: + 0: keyword.control.at-rule.namespace.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-namespace + - 167_string-or-url + - 167_optional-namespace-prefix + 167_nest: + - match: (@)nest\b + captures: + 0: keyword.control.at-rule.nest.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-nest + - 167_ruleset-block + - 167_selector-list + 167_optional-media-query-list: + - include: Naomi/integration/syntaxes/src/css/optional-media-query-list.yml + 167_optional-namespace-prefix: + - match: | + (?xi) + {{167_cssIdentifier}}\b + (?!\s*\() + scope: entity.name.namespace.css.css3 + pop: 'True' + - match: (?=\S) + pop: 'True' + 167_optional-page-selector: + - include: Naomi/integration/syntaxes/src/css/optional-page-selector-list.yml + 167_page: + - match: (@)page\b + captures: + 0: keyword.control.at-rule.page.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-page + - 167_page-block + - 167_optional-page-selector + 167_page-block: + - include: Naomi/integration/syntaxes/src/css/page/block.yml + 167_pop-now: + - match: '' + pop: 'True' + 167_ruleset-block: + - include: Naomi/integration/syntaxes/src/css/ruleset/block.yml + 167_selector-list: + - include: Naomi/integration/syntaxes/src/css/ruleset/selector-list.yml + 167_string-or-url: + - include: Naomi/integration/syntaxes/src/css/literal/string/double-quoted.yml + - include: Naomi/integration/syntaxes/src/css/literal/string/single-quoted.yml + - include: Naomi/integration/syntaxes/src/css/function-call/index.yml + 167_viewport: + - match: (@)viewport\b + captures: + 0: keyword.control.at-rule.viewport.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: + - 167_meta-viewport + - 167_ruleset-block + 167_url-list: + - include: Naomi/integration/syntaxes/src/css/url-list.yml + Naomi/integration/syntaxes/src/css/url-list.yml: + - match: '' + set: + - 168_meta-url-list + - 168_delimiter + - 168_url + 168_comment-no-pop: + - include: Naomi/integration/syntaxes/src/css/comment.no-pop.yml + 168_delimiter: + - include: 168_comment-no-pop + - match: (?=\{) + pop: 'True' + - match: \, + scope: punctuation.separator.comma.css.css3 + push: + - 168_optional-url + 168_meta-url-list: + - meta_content_scope: meta.document.url-list.css.css3 + - match: '' + pop: 'True' + 168_optional-url: + - include: 168_comment-no-pop + - match: (?=[,;()\[\]{}]) + pop: 'True' + - include: 168_url + 168_url: + - include: Naomi/integration/syntaxes/src/css/function-call/index.yml + Naomi/integration/syntaxes/src/css/page/block.yml: + - match: \{ + scope: punctuation.section.property-list.begin.css.css3 + set: + - 169_delimiter + 169_comment-no-pop: + - include: Naomi/integration/syntaxes/src/css/comment.no-pop.yml + 169_delimiter: + - meta_scope: meta.at-rule.page.body.css.css3 meta.property-list.css.css3 + - include: 169_comment-no-pop + - match: \} + scope: punctuation.section.property-list.end.css.css3 + pop: 'True' + - match: ; + scope: punctuation.terminator.css.css3 + - match: '' + push: + - - include: Naomi/integration/syntaxes/src/css/ruleset/block-content.yml + - match: '' + pop: 'True' + Naomi/integration/syntaxes/src/css/optional-page-selector-list.yml: + - include: 170_expression-escape + - match: (?=\S) + set: + - - include: Naomi/integration/syntaxes/src/css/page-selector-list.yml + 170_expression-escape: + - match: (?=[,;)\[\]{}]) + pop: 'True' + Naomi/integration/syntaxes/src/css/page-selector-list.yml: + - match: '' + set: + - 171_meta-selector-list + - 171_delimiter + - 171_meta-selector + - 171_selector + 171_delimiter: + - match: \, + scope: punctuation.separator.comma.css.css3 + push: + - 171_meta-selector + - 171_optional-selector + - include: 171_else-pop + 171_else-pop: + - match: (?=\S) + pop: 'True' + 171_meta-selector: + - meta_content_scope: meta.page-selector.css.css3 + - include: 171_pop-now + 171_meta-selector-list: + - meta_content_scope: meta.page-selector-list.css.css3 + - include: 171_pop-now + 171_optional-selector: + - match: (?=[,;()\[\]{}]) + pop: 'True' + - include: 171_selector + 171_pop-now: + - match: '' + pop: 'True' + 171_selector: + - match: | + (?xi) + {{171_cssIdentifier}}\b + scope: entity.name.page.css.css3 + - match: (:)((?>blank|first|left|recto|right|verso)) + captures: + 1: punctuation.definition.entity.css.css3 + 2: entity.other.pseudo-class.css.css3 + pop: 'True' + - include: 171_else-pop + Naomi/integration/syntaxes/src/css/optional-media-query-list.yml: + - include: 172_expression-escape + - match: (?=\S) + set: + - - include: Naomi/integration/syntaxes/src/css/media-query-list.yml + 172_expression-escape: + - match: (?=[,;:)\[\]{}]) + pop: 'True' + Naomi/integration/syntaxes/src/css/media-query-list.yml: + - match: '' + set: + - 173_meta-query-list + - 173_delimiter + - 173_meta-query + - 173_query + 173_delimiter: + - match: (?=[;{]) + pop: 'True' + - match: \, + scope: punctuation.separator.comma.css.css3 + push: + - 173_meta-query + - 173_optional-query + 173_meta-query: + - meta_content_scope: meta.media-query.css.css3 + - include: 173_pop-now + 173_meta-query-list: + - meta_content_scope: meta.media-query-list.css.css3 + - include: 173_pop-now + 173_optional-query: + - include: Naomi/integration/syntaxes/src/css/optional-media-query.yml + 173_pop-now: + - match: '' + pop: 'True' + 173_query: + - include: Naomi/integration/syntaxes/src/css/media-query.yml + Naomi/integration/syntaxes/src/css/media-query.yml: + - include: 174_comment-no-pop + - include: 174_logical-operator + - match: '' + set: + - 174_optional-tail + - 174_head + 174_close-group: + - meta_scope: meta.group.css.css3 + - match: \) + scope: punctuation.section.group.end.js.fjsx15 + pop: 'True' + - match: (?=\S) + push: + - - include: 174_logical-operator + - include: 174_feature-expression + 174_comment-no-pop: + - include: Naomi/integration/syntaxes/src/css/comment.no-pop.yml + 174_else-pop: + - match: (?=\S) + pop: 'True' + 174_feature-expression: + - include: Naomi/integration/syntaxes/src/css/media-query-feature-expression.yml + 174_head: + - include: 174_comment-no-pop + - include: 174_type + - include: 174_open-group + 174_logical-operator: + - match: (?>and|not|or|only)\b + scope: keyword.operator.word.logical.media-query.css.css3 + set: + - 174_optional-media-query + 174_open-group: + - match: \( + scope: punctuation.section.group.begin.css.css3 + set: + - 174_close-group + 174_optional-media-query: + - include: Naomi/integration/syntaxes/src/css/optional-media-query.yml + 174_optional-tail: + - include: 174_comment-no-pop + - include: 174_logical-operator + - include: 174_else-pop + 174_type: + - match: | + (?x) + (?> all + | aural + | braille + | embossed + | handheld + | print + | projection + | screen + | speech + | tty + | tv + )\b + scope: support.constant.media.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/optional-media-query.yml: + - include: 175_expression-escape + - match: (?=\S) + set: + - - include: Naomi/integration/syntaxes/src/css/media-query.yml + 175_expression-escape: + - match: (?=[,;:)\]{}]) + pop: 'True' + Naomi/integration/syntaxes/src/css/media-query-feature-expression.yml: + - include: 176_comment-no-pop + - match: '' + set: + - 176_optional-tail + - 176_head + 176_comment-no-pop: + - include: Naomi/integration/syntaxes/src/css/comment.no-pop.yml + 176_custom-property: + - include: Naomi/integration/syntaxes/src/css/custom-media-identifier.yml + 176_else-pop: + - match: (?=\S) + pop: 'True' + 176_head: + - include: 176_comment-no-pop + - include: 176_custom-property + - match: | + (?x) + ((?> any-(?>pointer|hover) + | aspect-ratio + | color(?:-(?>gamut|index))? + | device-(?>aspect-ratio|height|width) + | display-mode + | grid + | height + | hover + | inverted-colors + | light-level + | max-(?>height|width) + | min-(?>height|width) + | orientation + | overflow-(?>block|inline) + | pointer + | resolution + | scan + | scripting + | update + | width + )) + (?:\s*(:))? + captures: + 1: support.type.media-feature.css.css3 + 2: punctuation.separator.key-value.css.css3 + pop: 'True' + - include: 176_value + 176_optional-tail: + - include: 176_comment-no-pop + - match: | + (?x) + (?> <> + | <=? + | >=? + ) + scope: keyword.operator.comparison.css.css3 + set: + - 176_head + - include: 176_else-pop + 176_value: + - include: Naomi/integration/syntaxes/src/css/value.yml + Naomi/integration/syntaxes/src/css/custom-media-identifier.yml: + - match: (?i){{177_customMedia}} + captures: + 0: support.type.custom-media.css.css3 + 1: punctuation.definition.custom-media.css.css3 + 2: support.type.custom-media.name.css.css3 + pop: 'True' + Naomi/integration/syntaxes/src/css/keyframe-block-list.yml: + - match: \{ + scope: punctuation.section.block.begin.css.css3 + set: + - 178_meta-block-list + - 178_block-list-end + 178_block-identifier: + - match: (?>from|to) + scope: keyword.keyframe-selector.css.css3 + pop: 'True' + - include: Naomi/integration/syntaxes/src/css/literal/number.yml + 178_block-list-end: + - match: \} + scope: punctuation.section.block.end.css.css3 + pop: 'True' + - match: (?=\S) + push: + - 178_ruleset-block + - 178_block-identifier + 178_meta-block-list: + - meta_scope: meta.block-list.css.css3 + - include: 178_pop-now + 178_pop-now: + - match: '' + pop: 'True' + 178_ruleset-block: + - include: Naomi/integration/syntaxes/src/css/ruleset/block.yml + Naomi/integration/syntaxes/src/css/feature-query-list.yml: + - match: '' + set: + - 179_meta-query-list + - 179_delimiter + - 179_meta-query + - 179_query + 179_delimiter: + - match: \, + scope: punctuation.separator.comma.css.css3 + push: + - 179_meta-query + - 179_optional-query + - include: 179_else-pop + 179_else-pop: + - match: (?=\S) + pop: 'True' + 179_meta-query: + - meta_content_scope: meta.feature-query.css.css3 + - include: 179_pop-now + 179_meta-query-list: + - meta_content_scope: meta.feature-query-list.css.css3 + - include: 179_pop-now + 179_optional-query: + - match: (?=[,;()\[\]{}]) + pop: 'True' + - include: 179_query + 179_pop-now: + - match: '' + pop: 'True' + 179_query: + - include: Naomi/integration/syntaxes/src/css/optional-feature-query.yml + Naomi/integration/syntaxes/src/css/optional-feature-query.yml: + - include: 180_expression-escape + - match: (?=\S) + set: + - - include: Naomi/integration/syntaxes/src/css/feature-query.yml + 180_expression-escape: + - match: (?=[,;:)\]}]) + pop: 'True' + Naomi/integration/syntaxes/src/css/feature-query.yml: + - include: 181_comment-no-pop + - include: 181_logical-operator + - match: '' + set: + - 181_optional-tail + - 181_head + 181_close-group: + - meta_scope: meta.group.css.css3 + - match: \) + scope: punctuation.section.group.end.j.fjsx15 + pop: 'True' + - match: (?=\S) + push: + - - include: 181_logical-operator + - match: '' + set: + - 181_meta-value + - 181_optional-value + - 181_delimiter + - 181_property + 181_comment-no-pop: + - include: Naomi/integration/syntaxes/src/css/comment.no-pop.yml + 181_delimiter: + - include: 132_delimiter + 181_else-pop: + - match: (?=\S) + pop: 'True' + 181_head: + - include: 181_comment-no-pop + - include: 181_open-group + 181_logical-operator: + - match: (?>and|not|or|only)\b + scope: keyword.operator.word.logical.feature-query.css.css3 + set: + - 181_optional-feature-query + 181_meta-value: + - include: 132_meta-value + 181_open-group: + - match: \( + scope: punctuation.section.group.begin.css.css3 + set: + - 181_close-group + 181_optional-feature-query: + - include: Naomi/integration/syntaxes/src/css/optional-feature-query.yml + 181_optional-tail: + - include: 181_logical-operator + - include: 181_else-pop + 181_optional-value: + - include: 132_optional-value + 181_property: + - include: 132_property + Naomi/integration/syntaxes/src/js/literal/array.yml: + - match: \[ + scope: punctuation.section.brackets.begin.js.fjsx15 + set: + - 182_delimiters + - 182_optional-expression + 182_delimiters: + - meta_scope: meta.sequence.js.fjsx15 + - match: \] + scope: punctuation.section.brackets.end.js.fjsx15 + pop: 'True' + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: + - 182_optional-expression + 182_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/web.yml: + - match: (document)\s*(\.) + captures: + 1: support.type.object.dom.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: + - 183_document-property-or-function + - match: (window)\s*(\.) + captures: + 1: support.type.object.dom.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: + - 183_window-property-or-function + - match: (?>document|window)\b + scope: support.type.object.dom.js.fjsx15 + pop: 'True' + 183_arguments: + - include: Naomi/integration/syntaxes/src/js/function-call/arguments.yml + 183_document-property-or-function: + - match: (?x){{183_documentFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: + - 183_function-call-meta-scope + - 183_arguments + - match: (?x){{183_documentFunctions}} + scope: support.function.js.fjsx15 + pop: 'True' + - match: | + (?x) + (?> activeElement + | body + | characterSet + | childElementCount + | children + | compatMode + | currentScript + | defaultView + | designMode + | dir + | doctype + | documentElement + | documentURI + | documentURIObject + | domain + | embeds + | firstElementChild + | forms + | fullscreenElement + | fullscreenEnabled + | head + | hidden + | images + | implementation + | last + (?> ElementChild + | Modified + | StyleSheetSet + ) + | links + | location + | on + (?> abort + | animationcancel + | animationend + | blur + | change + | click + | close + | contextmenu + | dblclick + | error + | focus + | fullscreenchange + | fullscreenerror + | gotpointercapture + | input + | keydown + | keypress + | keyup + | load + | loadend + | loadstart + | lostpointercapture + | mousedown + | mousemove + | mouseout + | mouseover + | mouseup + | offline + | online + | pointercancel + | pointerdown + | pointerenter + | pointerleave + | pointermove + | pointerout + | pointerover + | pointerup + | reset + | resize + | scroll + | select + | submit + | transitioncancel + | transitionend + | visibilitychange + | wheel + ) + | plugins + | pointerLockElement + | popupNode + | preferredStyleSheetSet + | readyState + | referrer + | scripts + | scrollingElement + | selectedStyleSheetSet + | styleSheets + | styleSheetSets + | title + | tooltipNode + | URL + | visibilityState + )\b + scope: support.variable.js.fjsx15 + pop: 'True' + - include: 183_other-property-or-function + 183_function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - include: 183_pop-now + 183_other-property-or-function: + - include: 60_other-property-or-function + 183_pop-now: + - match: '' + pop: 'True' + 183_window-property-or-function: + - match: (?x){{183_windowFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: + - 183_function-call-meta-scope + - 183_arguments + - match: (?x){{183_windowFunctions}} + scope: support.function.js.fjsx15 + pop: 'True' + - match: | + (?x) + (?> applicationCache + | caches + | closed + | console + | controllers + | crypto + | devicePixelRatio + | document + | frameElement + | frames + | fullScreen + | history + | indexedDB + # innerHeight, innerWidth + | inner(?>Height|Width) + | isSecureContext + | length + | localStorage + # location, locationbar + | location(?:bar)? + | menubar + | messageManager + | name + | navigator + | onabort + | onafterprint + | onanimation + # onanimationcancel + (?> cancel + # onanimationend + | end + # onanimationiteration + | iteration + ) + | onappinstalled + | onauxclick + | onbefore + # onbeforeinstallprompt + (?> installprompt + # onbeforeprint + | print + # onbeforeunload + | unload + ) + | onblur + | onchange + | onclick + | onclose + | oncontextmenu + | ondblclick + | ondevice + # ondevicelight + (?> light + # ondevicemotion + | motion + # ondeviceorientation + | orientation + # ondeviceorientationabsolute + | orientationabsolute + # ondevice$roximity + | proximity + ) + | onerror + | onfocus + # ongamepadconnected, ongamepaddisconnected + | ongamepad(?>connected|disconnected) + | ongotpointercapture + | onhashchange + | oninput + # onkeydown, onkeypress, onkeyup + | onkey(?>down|press|up) + | onlanguagechange + # onload, onloadend, onloadstart + | onload(?>end|start)? + | onlostpointercapture + | onmessage + | onmessageerror + # onmousedown, onmousemove, onmouseout, onmouseover, onmouseup + | onmouse(?>down|move|out|over|up) + | onpointer + # onpointercancel + (?> cancel + # onpointerenter + | enter + # onpointerleave + | leave + # onpointermove + | move + # onpointerout + | out + # onpointerover + | over + # onpointerup + | up + ) + | onpopstate + | onrejectionhandled + | onreset + | onresize + | onscroll + | onselect + | onselectionchange + | onselectstart + | onstorage + | onsubmit + # ontouchcancel, ontouchmove, ontouchstart + | ontouch(?>cancel|move|start) + # ontransitioncancel, ontransitionend + | ontransition(?>cancel|end) + | onunhandledrejection + | onunload + | onuserproximity + | onvrdisplay + # onvrdisplayactivate + (?> activate + # onvrdisplayblur + | blur + # onvrdisplayconnect + | connect + # onvrdisplaydeactivate + | deactivate + # onvrdisplaydisconnect + | disconnect + # onvrdisplayfocus + | focus + # onvrdisplaypresentchange + | presentchange + ) + | onwheel + | opener + | origin + # outerHeight, outerWidth + | outer(?>Height|Width) + | pageYOffset + | parent + | performance + | personalbar + # screen, screenX, screenY + | screen[XY]? + | scroll + # scrollbars + (?> bars + # scrollX, scrollY + | [XY] + ) + | self + | sessionStorage + | speechSynthesis + # status, statusbar + | status(?:bar)? + | toolbar + | top + | URL + | visualViewport + | window + )\b + scope: support.variable.js.fjsx15 + pop: 'True' + - include: 183_other-property-or-function + Naomi/integration/syntaxes/src/js/jest.yml: + - match: (jest)\s*(\.) + captures: + 1: support.type.object.jest.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: + - 184_jest-property-or-function + - match: | + (?x) + (?> after(?>All|Each) + | before(?>All|Each) + | describe + | it + | test + )\b + (?= + (?> \.(?>each|only|skip) + | \s*\( + ) + ) + scope: support.function.jest.fn.js.fjsx15 + set: + - 184_meta-scope + - 184_arguments + - 184_optional-each-skip-only + - match: expect\b + scope: support.function.jest.js.fjsx15 + set: + - 184_expect-chain + 184_accessor-no-pop: + - match: \. + scope: punctuation.accessor.js.fjsx15 + 184_arguments: + - include: Naomi/integration/syntaxes/src/js/function-call/arguments.yml + 184_else-pop: + - match: (?=\S) + pop: 'True' + 184_expect-chain: + - include: 184_accessor-no-pop + - match: (?=\s*\() + push: + - 184_meta-scope + - 184_arguments + - match: (?>not|resolves|rejects)\b + scope: support.type.object.jest.matcher.other.js.fjsx15 + - match: | + (?x) + to + (?> Be + (?> Called + | CloseTo + | Defined + | Falsy + | GreaterThan(?:OrEqual)? + | InstanceOf + | LessThan(?:OrEqual)? + | Null + | Truthy + | Undefined + )? + | Contain(?:Equal)? + | Equal + | Have + (?> Been + (?> Called(?>Times|With)? + | LastCalledWith + | NthCalledWith + ) + | LastReturnedWith + | NthReturnedWith + | Returned(?>Times|With)? + ) + | Have(?>Length|Property) + | Match(?:Object|(?:Inline)?Snapshot)? + | StrictEqual + | Throw(?:Error(?:Matching(?:Inline)?Snapshot)?)? + )\b + (?=\s*\() + scope: support.function.jest.matcher.fjsx15 + set: + - 184_matcher-meta-scope + - 184_arguments + - match: | + (?x) + (?> addSnapshotSerializer + | any(?:thing)? + | array(?:Containing)? + | assertions + | extend + | hasAssertions + | objectContaining + | string(?>Containing|Matching) + )\b + (?=\s*\() + scope: support.function.jest.matcher.fjsx15 + set: + - 184_meta-scope + - 184_arguments + - include: 184_else-pop + 184_jest-property-or-function: + - match: \b(?>advanceTimersByTime|clearAll(?>Mocks|Timers)|d(?>isableAutomock|o(?>Mock|ntMock))|enableAutomock|fn|genMockFromModule|isMockFunction|mock|r(?>es(?>et(?>AllMocks|Modules)|toreAllMocks)|un(?>AllTi(?>cks|mers)|OnlyPendingTimers))|s(?>et(?>Mock|Timeout)|pyOn)|u(?>nmock|se(?>FakeTimers|RealTimers)))\b(?=\s*\() + scope: support.function.jest.js.fjsx15 + set: + - 184_meta-scope + - 184_arguments + - include: 184_else-pop + 184_matcher-meta-scope: + - meta_scope: meta.function-call.jest.matcher.js.fjsx15 + - include: 184_pop-now + 184_meta-scope: + - meta_scope: meta.function-call.jest.js.fjsx15 + - include: 184_pop-now + 184_optional-each-skip-only: + - include: 184_accessor-no-pop + - match: each\b + scope: support.function.jest.each.js.fjsx15 + pop: 'True' + - match: only\b + scope: support.function.jest.only.js.fjsx15 + pop: 'True' + - match: skip\b + scope: support.function.jest.skip.js.fjsx15 + pop: 'True' + - include: 184_else-pop + 184_pop-now: + - match: '' + pop: 'True' + Naomi/integration/syntaxes/src/js/operator/comma.yml: + - match: \, + scope: keyword.operator.comma.js.fjsx15 + set: + - 185_optional-expression + 185_optional-expression: + - include: Naomi/integration/syntaxes/src/js/optional-expression.yml + Naomi/integration/syntaxes/src/js/index.yml: + - match: '' + push: + - 186_naomi + - 186_entry + 186_entry: + - include: Naomi/integration/syntaxes/src/js/comment/index.yml + - include: Naomi/integration/syntaxes/src/js/statement.yml + - include: Naomi/integration/syntaxes/src/js/expression.yml + 186_naomi: + - meta_scope: naomi + - match: '' + pop: 'True' diff --git a/integration/syntaxes/src/css/combinator.yml b/integration/syntaxes/src/css/combinator.yml new file mode 100644 index 00000000..389065c9 --- /dev/null +++ b/integration/syntaxes/src/css/combinator.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \+ + scope: punctuation.separator.combinator.sibling.direct.css.css3 + set: optional-selector-expression + - match: ~ + scope: punctuation.separator.combinator.sibling.css.css3 + set: optional-selector-expression + - match: \> + scope: punctuation.separator.combinator.child.css.css3 + set: optional-selector-expression + + optional-selector-expression: + - match: (?=[,{]) + pop: true + - match: (?=\S) + set: selector-expression + + selector-expression: + - include: ~/css/selector-expression diff --git a/integration/syntaxes/src/css/comment.no-pop.yml b/integration/syntaxes/src/css/comment.no-pop.yml new file mode 100644 index 00000000..10f88550 --- /dev/null +++ b/integration/syntaxes/src/css/comment.no-pop.yml @@ -0,0 +1,20 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?=/\*) + push: + - include: ~/css/comment diff --git a/integration/syntaxes/src/css/comment/block.yml b/integration/syntaxes/src/css/comment/block.yml new file mode 100644 index 00000000..be5fe2aa --- /dev/null +++ b/integration/syntaxes/src/css/comment/block.yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: /\* + scope: punctuation.definition.comment.begin.css.css3 + set: block + + block: + - meta_scope: comment.block.css.css3 + - include: email-no-pop + - include: link-no-pop + - match: \*/ + scope: punctuation.definition.comment.end.css.css3 + pop: true + + email-no-pop: + - include: ~/shared/email.no-pop + + link-no-pop: + - include: ~/shared/link.no-pop diff --git a/integration/syntaxes/src/css/comment/index.yml b/integration/syntaxes/src/css/comment/index.yml new file mode 100644 index 00000000..14fd756a --- /dev/null +++ b/integration/syntaxes/src/css/comment/index.yml @@ -0,0 +1,18 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/css/comment/block diff --git a/integration/syntaxes/src/css/constant.yml b/integration/syntaxes/src/css/constant.yml new file mode 100644 index 00000000..1201d829 --- /dev/null +++ b/integration/syntaxes/src/css/constant.yml @@ -0,0 +1,271 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: color + - include: other + + color: + - match: | + (?xi) + (?> aliceblue + | antiquewhite + | aqua + | aquamarine + | azure + | beige + | bisque + | black + | blanchedalmond + | blue + | blueviolet + | brown + | burlywood + | cadetblue + | chartreuse + | chocolate + | coral + | cornflowerblue + | cornsilk + | crimson + | cyan + | dark + (?> blue + | cyan + | goldenrod + | gray + | grey + | green + | khaki + | magenta + | olivegreen + | orange + | orchid + | red + | salmon + | seagreen + | slateblue + | slategray + | slategrey + | turquoise + | violet + ) + | deeppink + | deepskyblue + | dimgray + | dimgrey + | dodgerblue + | firebrick + | floralwhite + | forestgreen + | fuchsia + | gainsboro + | ghostwhite + | gold(?:enrod)? + | gr[ae]y + | green(?:yellow)? + | honeydew + | hotpink + | indianred + | indigo + | ivory + | khaki + | lavender(?:blush)? + | lawngreen + | lemonchiffon + | light + (?> blue + | coral + | cyan + | goldenrodyellow + | gray + | grey + | green + | pink + | salmon + | seagreen + | skyblue + | slategray + | slategrey + | steelblue + | yellow + ) + | lime(?:green)? + | linen + | magenta + | maroon + | medium + (?> aquamarine + | blue + | orchid + | purple + | seagreen + | slateblue + | springgreen + | turquoise + | violetred + ) + | midnightblue + | mintcream + | mistyrose + | moccasin + | navajowhite + | navy + | oldlace + | olive(?:drab)? + | orange(?:red)? + | orchid + | palegoldenrod + | palegreen + | paleturquoise + | palevioletred + | papayawhip + | peachpuff + | peru + | pink + | plum + | powderblue + | purple + | rebeccapurple + | red + | rosybrown + | royalblue + | saddlebrown + | salmon + | sandybrown + | seagreen + | seashell + | sienna + | silver + | skyblue + | slateblue + | slategr[ae]y + | snow + | springgreen + | steelblue + | tan + | teal + | thistle + | tomato + | turquoise + | violet + | wheat + | white(?:smoke)? + | yellow(?:green)? + )\b + (?!-) + scope: support.constant.color.css.css3 + pop: true + + other: + - match: | + (?x) + (?> a4 + | absolute + | alternate + | all + | at + | auto-fill + | auto-fit + | auto + | baseline + | block + | bold + | border-box + | bottom + | button + | center + | checkbox + | content-box + | collapse + | column(?:-reverse)? + | contain + | cover + | dashed + | disabled + | dotted + | ease + (?:-(?>in|out))? + | ellipsis + | ellipse + | false + | fixed + | flex-start + | flex-end + | flex + | forwards + | hidden + | grid + | infinite + | inline-block + | inline-flex + | inline-grid + | inline-table + | inline + | inherit + | initial + | italic + | landscape + | left + | lining-nums + | list-item + | middle + | no-repeat + | none + | normal + | nowrap + | number + | only + | pointer + | print + | projection + | radio + | relative + | repeat + | reset + | right + | row(?:-reverse)? + | run-in + | screen + | search + | small-caps + | solid + | space-arround + | space-between + | speech + | sub + | submit + | system-ui + | super + | table-caption + | table-cell + | table-column(?:-group)? + | table-footer-group + | table-header-group + | table-row(?:-group)? + | table + | text-bottom + | text-top + | top + | transparent + | true + | tv + | visible + | uppercase + )\b + (?!-) + scope: support.constant.property-value.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/custom-media-identifier.yml b/integration/syntaxes/src/css/custom-media-identifier.yml new file mode 100644 index 00000000..4bfbc441 --- /dev/null +++ b/integration/syntaxes/src/css/custom-media-identifier.yml @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + customMedia: (--)([_[:alnum:]\-]*) + +contexts: + main: + - match: (?i){{customMedia}} + captures: + 0: support.type.custom-media.css.css3 + 1: punctuation.definition.custom-media.css.css3 + 2: support.type.custom-media.name.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/feature-query-list.yml b/integration/syntaxes/src/css/feature-query-list.yml new file mode 100644 index 00000000..172c96f5 --- /dev/null +++ b/integration/syntaxes/src/css/feature-query-list.yml @@ -0,0 +1,54 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: "" + set: [ + meta-query-list, + delimiter, + meta-query, + query + ] + + delimiter: + - match: \, + scope: punctuation.separator.comma.css.css3 + push: [ meta-query, optional-query ] + - include: else-pop + + else-pop: + - match: (?=\S) + pop: true + + meta-query: + - meta_content_scope: meta.feature-query.css.css3 + - include: pop-now + + meta-query-list: + - meta_content_scope: meta.feature-query-list.css.css3 + - include: pop-now + + optional-query: + - match: (?=[,;()\[\]{}]) + pop: true + - include: query + + pop-now: + - match: "" + pop: true + + query: + - include: ~/css/optional-feature-query diff --git a/integration/syntaxes/src/css/feature-query.yml b/integration/syntaxes/src/css/feature-query.yml new file mode 100644 index 00000000..f31d2313 --- /dev/null +++ b/integration/syntaxes/src/css/feature-query.yml @@ -0,0 +1,72 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: comment-no-pop + - include: logical-operator + - match: "" + set: [ optional-tail, head ] + + close-group: + - meta_scope: meta.group.css.css3 + - match: \) + scope: punctuation.section.group.end.j.fjsx15 + pop: true + - match: (?=\S) + push: + - include: logical-operator + - match: "" + set: [ meta-value, optional-value, delimiter, property ] + + comment-no-pop: + - include: ~/css/comment.no-pop + + delimiter: + - include: ~/css/ruleset/block-content#delimiter + + else-pop: + - match: (?=\S) + pop: true + + head: + - include: comment-no-pop + - include: open-group + + logical-operator: + - match: (?>and|not|or|only)\b + scope: keyword.operator.word.logical.feature-query.css.css3 + set: optional-feature-query + + meta-value: + - include: ~/css/ruleset/block-content#meta-value + + open-group: + - match: \( + scope: punctuation.section.group.begin.css.css3 + set: close-group + + optional-feature-query: + - include: ~/css/optional-feature-query + + optional-tail: + - include: logical-operator + - include: else-pop + + optional-value: + - include: ~/css/ruleset/block-content#optional-value + + property: + - include: ~/css/ruleset/block-content#property diff --git a/integration/syntaxes/src/css/function-call/arguments.yml b/integration/syntaxes/src/css/function-call/arguments.yml new file mode 100644 index 00000000..bdea53dc --- /dev/null +++ b/integration/syntaxes/src/css/function-call/arguments.yml @@ -0,0 +1,33 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \( + scope: punctuation.section.group.begin.css.css3 + set: delimiter + + delimiter: + - meta_scope: meta.group.css.css3 + - match: \) + scope: punctuation.section.group.end.css.css3 + pop: true + - match: \, + scope: punctuation.separtor.comma.css.css3 + - match: (?=\S) + push: value + + value: + - include: ~/css/value diff --git a/integration/syntaxes/src/css/function-call/index.yml b/integration/syntaxes/src/css/function-call/index.yml new file mode 100644 index 00000000..e7c535f7 --- /dev/null +++ b/integration/syntaxes/src/css/function-call/index.yml @@ -0,0 +1,184 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + +contexts: + main: + - include: calc + - include: domain + - include: regexp + - include: url-and-url-prefix + - include: var + - include: other + - include: fallback + + arg-begin: + - match: \( + scope: punctuation.section.group.begin.css.css3 + pop: true + + arg-close: + - match: \) + scope: punctuation.section.group.close.css.css3 + pop: true + + arguments: + - include: ~/css/function-call/arguments + + calc: + - match: calc(?=\s*\() + scope: support.function.css.css3 + set: [ meta, calc-arg-close, arg-begin ] + + calc-arg-close: + - include: comma-no-pop + - include: arg-close + - match: (?=\S) + push: [ calc-optional-tail, calc-optional-head ] + + calc-close-group: + - match: \) + scope: punctuation.section.group.end.css.css3 + pop: true + + calc-optional-head: + # Group begin. + - match: \( + scope: punctuation.section.group.begin.css.css3 + push: [ + meta-group, + calc-close-group, + calc-optional-tail, + calc-optional-head + ] + # Value. + - include: ~/css/value + - include: else-pop + + calc-optional-tail: + - match: "[+\\-*/]" + scope: keyword.operator.arithmetic.css.css3 + set: calc-optional-head + - include: else-pop + + comma-no-pop: + - match: \, + scope: punctuation.separator.comma.css.css3 + + domain: + - match: domain(?=\s*\() + scope: support.function.domain.css.css3 + set: [ meta, arg-close, url-argument, arg-begin ] + + else-pop: + - match: (?=\S) + pop: true + + fallback: + - match: | + (?xi) + (?= + {{cssIdentifier}} + \s*\( + ) + set: [ meta, arguments, identifier ] + + identifier: + - match: (?xi){{cssIdentifier}} + scope: variable.function.css.css3 + pop: true + + meta: + - meta_scope: >- + meta.function-call.css.css3 + meta.group.css.css3 + - include: pop-now + + meta-group: + - meta_scope: meta.group.css.css3 + - include: pop-now + + optional-var-value: + - include: ~/css/property#custom + - include: ~/css/value + - include: else-pop + + other: + - match: | + (?x) + (?> attr + | blur + | cubic-bezier + | format + | gray + | hsla? + | hwb + | image-set + | linear-gradient + | polygon + | radial-gradient + | repeating-(?>linear|radial)-gradient + | repeat + | rotate + | rgba? + ) + (?=\s*\() + scope: support.function.css.css3 + set: [ meta, arguments ] + + pop-now: + - match: "" + pop: true + + quoted-string: + - include: ~/css/literal/string/double-quoted + - include: ~/css/literal/string/single-quoted + + regexp: + - match: regexp(?=\s*\() + scope: support.function.regexp.css.css3 + set: [ meta, arg-close, quoted-string, arg-begin ] + + url-and-url-prefix: + - match: url-prefix(?=\s*\() + scope: support.function.url-prefix.css.css3 + set: [ meta, arg-close, url-argument, arg-begin ] + - match: url(?=\s*\() + scope: support.function.url.css.css3 + set: [ meta, arg-close, url-argument, arg-begin ] + + url-argument: + - match: (?=\)) + pop: true + - include: quoted-string + - match: | + (?x) + (?> \\["'()\s] + | [^"'()\s] + ) + scope: string.unquoted.css.css3 + + var: + - match: var(?=\s*\() + scope: support.function.regexp.css.css3 + set: [ meta, var-arg-close, arg-begin ] + + var-arg-close: + - include: comma-no-pop + - include: arg-close + - match: (?=\S) + push: optional-var-value diff --git a/integration/syntaxes/src/css/index.yml b/integration/syntaxes/src/css/index.yml new file mode 100644 index 00000000..c9a31a3b --- /dev/null +++ b/integration/syntaxes/src/css/index.yml @@ -0,0 +1,44 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +name: CSS (Naomi) +scope: source.css + +file_extensions: + - css + - css3 + +contexts: + main: + - match: "" + push: [naomi, entry] + + entry: + - include: ~/css/comment + - include: ~/css/statement + - match: (?=\S) + push: + - include: ~/css/ruleset + + naomi: + - meta_scope: naomi + - match: "" + pop: true + + # Used by the core syntax to highlight inline CSS. + rule-list-body: + - match: "" + push: + - include: ~/css/ruleset/block#delimiter diff --git a/integration/syntaxes/src/css/keyframe-block-list.yml b/integration/syntaxes/src/css/keyframe-block-list.yml new file mode 100644 index 00000000..128a9351 --- /dev/null +++ b/integration/syntaxes/src/css/keyframe-block-list.yml @@ -0,0 +1,44 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \{ + scope: punctuation.section.block.begin.css.css3 + set: [ meta-block-list, block-list-end ] + + block-identifier: + - match: (?>from|to) + scope: keyword.keyframe-selector.css.css3 + pop: true + - include: ~/css/literal/number + + block-list-end: + - match: \} + scope: punctuation.section.block.end.css.css3 + pop: true + - match: (?=\S) + push: [ ruleset-block, block-identifier ] + + meta-block-list: + - meta_scope: meta.block-list.css.css3 + - include: pop-now + + pop-now: + - match: "" + pop: true + + ruleset-block: + - include: ~/css/ruleset/block diff --git a/integration/syntaxes/src/css/literal/color.yml b/integration/syntaxes/src/css/literal/color.yml new file mode 100644 index 00000000..189e9224 --- /dev/null +++ b/integration/syntaxes/src/css/literal/color.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + hex: "[0-9a-f]" + +contexts: + main: + # RGB + - match: (?i)(\#)({{hex}}{3}|{{hex}}{6})\b + captures: + 0: constant.other.color.rgb-value.css + 1: punctuation.definition.constant.css + pop: true + # RGBA. + - match: (?i)(\#)({{hex}}{4}|{{hex}}{8})\b + captures: + 0: constant.other.color.rgba-value.css + 1: punctuation.definition.constant.css + pop: true diff --git a/integration/syntaxes/src/css/literal/number.yml b/integration/syntaxes/src/css/literal/number.yml new file mode 100644 index 00000000..d55b21bb --- /dev/null +++ b/integration/syntaxes/src/css/literal/number.yml @@ -0,0 +1,112 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + literalDecimal: "[0-9]+" + + literalFloat: | + [+-]? + (?> [0-9]*[.]{{literalDecimal}} + | {{literalDecimal}}[.][0-9]+ + ) + + scientificNotation: | + (?> {{literalFloat}} + | [+-]?{{literalDecimal}} + ) + [e][+-]? + {{literalDecimal}} + + angleUnits: (?>deg|grad|rad|turn) + + # Hz, kHz + frequencyUnits: (?>k?Hz) + + relativeLengthUnits: | + # cap, ch + (?> c(?>ap|h) + # em, ex + | e[mx] + | fr + | ic + | lh + # rem, rlh + | r(?>em|lh) + # vb, vh, vi, vmax, vmin, vw + | v(?>[bhiw]|m(?>ax|in)) + | x + ) + + absoluteLengthUnits: | + (?> cm + | in + | mm + # pc, pt, px + | p[ctx] + | q + ) + + resolutionUnits: dp(?>i|cm|px) + + timeUnits: (?>s|ms) + + unit: | + (?> % + | {{absoluteLengthUnits}}\b + | {{relativeLengthUnits}}\b + | {{angleUnits}}\b + | {{resolutionUnits}}\b + | {{timeUnits}}\b + | {{frequencyUnits}}\b + ) + +contexts: + main: + - include: float + - include: integer + + float: + - match: (?xi){{scientificNotation}}({{unit}})? + captures: + 0: constant.numeric.float.scientific.css.css3 + 1: keyword.other.unit.css.css3 + pop: true + - match: (?xi){{literalFloat}}({{unit}})? + captures: + 0: constant.numeric.float.css.css3 + 1: keyword.other.unit.css.css3 + pop: true + + integer: + - match: (?xi)-?0b[01]+({{unit}})? + captures: + 0: constant.numeric.binary.css.css3 + 1: keyword.other.unit.css.css3 + pop: true + - match: (?xi)-?0[0-7]+({{unit}})? + captures: + 0: constant.numeric.octal.css.css3 + 1: keyword.other.unit.css.css3 + pop: true + - match: (?xi)-?0[x][0-9a-f]+({{unit}})? + captures: + 0: constant.numeric.hex.css.css3 + 1: keyword.other.unit.css.css3 + pop: true + - match: (?xi)(?:-?[1-9][0-9]*|0)({{unit}})? + captures: + 0: constant.numeric.decimal.css.css3 + 1: keyword.other.unit.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/literal/ratio.yml b/integration/syntaxes/src/css/literal/ratio.yml new file mode 100644 index 00000000..1926ce03 --- /dev/null +++ b/integration/syntaxes/src/css/literal/ratio.yml @@ -0,0 +1,24 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: ([0-9]+)\s*(/)\s*([0-9]) + captures: + 0: constant.numeric.ratio.css.css3 + 1: constant.numeric.decimal.css.css3 + 2: keyword.operator.arithmetic.ratio.css.css3 + 3: constant.numeric.decimal.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/literal/string/double-quoted.yml b/integration/syntaxes/src/css/literal/string/double-quoted.yml new file mode 100644 index 00000000..8501ebf6 --- /dev/null +++ b/integration/syntaxes/src/css/literal/string/double-quoted.yml @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \" + scope: punctuation.definition.string.begin.css.css3 + set: string + + string: + - meta_scope: string.quoted.double.css.css3 + - match: \" + scope: punctuation.definition.string.end.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/literal/string/single-quoted.yml b/integration/syntaxes/src/css/literal/string/single-quoted.yml new file mode 100644 index 00000000..389852ca --- /dev/null +++ b/integration/syntaxes/src/css/literal/string/single-quoted.yml @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \' + scope: punctuation.definition.string.begin.css.css3 + set: string + + string: + - meta_scope: string.quoted.single.css.css3 + - match: \' + scope: punctuation.definition.string.end.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/literal/string/unquoted.yml b/integration/syntaxes/src/css/literal/string/unquoted.yml new file mode 100644 index 00000000..64b3f0fd --- /dev/null +++ b/integration/syntaxes/src/css/literal/string/unquoted.yml @@ -0,0 +1,20 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?!--)[_[:alnum:]\-]+ + scope: string.unquoted.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/media-query-feature-expression.yml b/integration/syntaxes/src/css/media-query-feature-expression.yml new file mode 100644 index 00000000..d89bbe9d --- /dev/null +++ b/integration/syntaxes/src/css/media-query-feature-expression.yml @@ -0,0 +1,78 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: comment-no-pop + - match: "" + set: [ optional-tail, head ] + + comment-no-pop: + - include: ~/css/comment.no-pop + + custom-property: + - include: ~/css/custom-media-identifier + + else-pop: + - match: (?=\S) + pop: true + + head: + - include: comment-no-pop + - include: custom-property + - match: | + (?x) + ((?> any-(?>pointer|hover) + | aspect-ratio + | color(?:-(?>gamut|index))? + | device-(?>aspect-ratio|height|width) + | display-mode + | grid + | height + | hover + | inverted-colors + | light-level + | max-(?>height|width) + | min-(?>height|width) + | orientation + | overflow-(?>block|inline) + | pointer + | resolution + | scan + | scripting + | update + | width + )) + (?:\s*(:))? + captures: + 1: support.type.media-feature.css.css3 + 2: punctuation.separator.key-value.css.css3 + pop: true + - include: value + + optional-tail: + - include: comment-no-pop + - match: | + (?x) + (?> <> + | <=? + | >=? + ) + scope: keyword.operator.comparison.css.css3 + set: head + - include: else-pop + + value: + - include: ~/css/value diff --git a/integration/syntaxes/src/css/media-query-list.yml b/integration/syntaxes/src/css/media-query-list.yml new file mode 100644 index 00000000..7c82c7a1 --- /dev/null +++ b/integration/syntaxes/src/css/media-query-list.yml @@ -0,0 +1,51 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: "" + set: [ + meta-query-list, + delimiter, + meta-query, + query + ] + + delimiter: + # Escape. + - match: (?=[;{]) + pop: true + # Delimiter. + - match: \, + scope: punctuation.separator.comma.css.css3 + push: [ meta-query, optional-query ] + + meta-query: + - meta_content_scope: meta.media-query.css.css3 + - include: pop-now + + meta-query-list: + - meta_content_scope: meta.media-query-list.css.css3 + - include: pop-now + + optional-query: + - include: ~/css/optional-media-query + + pop-now: + - match: "" + pop: true + + query: + - include: ~/css/media-query diff --git a/integration/syntaxes/src/css/media-query.yml b/integration/syntaxes/src/css/media-query.yml new file mode 100644 index 00000000..1d106ebc --- /dev/null +++ b/integration/syntaxes/src/css/media-query.yml @@ -0,0 +1,83 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: comment-no-pop + - include: logical-operator + - match: "" + set: [ optional-tail, head ] + + close-group: + - meta_scope: meta.group.css.css3 + - match: \) + scope: punctuation.section.group.end.js.fjsx15 + pop: true + - match: (?=\S) + push: + - include: logical-operator + - include: feature-expression + + comment-no-pop: + - include: ~/css/comment.no-pop + + else-pop: + - match: (?=\S) + pop: true + + feature-expression: + - include: ~/css/media-query-feature-expression + + head: + - include: comment-no-pop + - include: type + - include: open-group + + logical-operator: + - match: (?>and|not|or|only)\b + scope: keyword.operator.word.logical.media-query.css.css3 + set: optional-media-query + + open-group: + - match: \( + scope: punctuation.section.group.begin.css.css3 + set: close-group + + optional-media-query: + - include: ~/css/optional-media-query + + optional-tail: + - include: comment-no-pop + - include: logical-operator + - include: else-pop + + type: + # Media type. + - match: | + (?x) + (?> all + | aural + | braille + | embossed + | handheld + | print + | projection + | screen + | speech + | tty + | tv + )\b + scope: support.constant.media.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/optional-feature-query.yml b/integration/syntaxes/src/css/optional-feature-query.yml new file mode 100644 index 00000000..8a7e0447 --- /dev/null +++ b/integration/syntaxes/src/css/optional-feature-query.yml @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: expression-escape + - match: (?=\S) + set: + - include: ~/css/feature-query + + expression-escape: + - match: (?=[,;:)\]}]) + pop: true + diff --git a/integration/syntaxes/src/css/optional-media-query-list.yml b/integration/syntaxes/src/css/optional-media-query-list.yml new file mode 100644 index 00000000..88df662a --- /dev/null +++ b/integration/syntaxes/src/css/optional-media-query-list.yml @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: expression-escape + - match: (?=\S) + set: + - include: ~/css/media-query-list + + expression-escape: + - match: (?=[,;:)\[\]{}]) + pop: true diff --git a/integration/syntaxes/src/css/optional-media-query.yml b/integration/syntaxes/src/css/optional-media-query.yml new file mode 100644 index 00000000..d0bc91a1 --- /dev/null +++ b/integration/syntaxes/src/css/optional-media-query.yml @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: expression-escape + - match: (?=\S) + set: + - include: ~/css/media-query + + expression-escape: + - match: (?=[,;:)\]{}]) + pop: true diff --git a/integration/syntaxes/src/css/optional-page-selector-list.yml b/integration/syntaxes/src/css/optional-page-selector-list.yml new file mode 100644 index 00000000..3b9c90e7 --- /dev/null +++ b/integration/syntaxes/src/css/optional-page-selector-list.yml @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: expression-escape + - match: (?=\S) + set: + - include: ~/css/page-selector-list + + expression-escape: + - match: (?=[,;)\[\]{}]) + pop: true diff --git a/integration/syntaxes/src/css/optional-value.yml b/integration/syntaxes/src/css/optional-value.yml new file mode 100644 index 00000000..308bbbb9 --- /dev/null +++ b/integration/syntaxes/src/css/optional-value.yml @@ -0,0 +1,22 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?=[,;()\[\]{}]) + pop: true + - match: (?=\S) + set: + - include: ~/css/value diff --git a/integration/syntaxes/src/css/page-selector-list.yml b/integration/syntaxes/src/css/page-selector-list.yml new file mode 100644 index 00000000..b38bd425 --- /dev/null +++ b/integration/syntaxes/src/css/page-selector-list.yml @@ -0,0 +1,68 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + +contexts: + main: + - match: "" + set: [ + meta-selector-list, + delimiter, + meta-selector, + selector + ] + + delimiter: + - match: \, + scope: punctuation.separator.comma.css.css3 + push: [ meta-selector, optional-selector ] + - include: else-pop + + else-pop: + - match: (?=\S) + pop: true + + meta-selector: + - meta_content_scope: meta.page-selector.css.css3 + - include: pop-now + + meta-selector-list: + - meta_content_scope: meta.page-selector-list.css.css3 + - include: pop-now + + optional-selector: + - match: (?=[,;()\[\]{}]) + pop: true + - include: selector + + pop-now: + - match: "" + pop: true + + selector: + # Named page. + - match: | + (?xi) + {{cssIdentifier}}\b + scope: entity.name.page.css.css3 + # Pseudo class. + - match: (:)((?>blank|first|left|recto|right|verso)) + captures: + 1: punctuation.definition.entity.css.css3 + 2: entity.other.pseudo-class.css.css3 + pop: true + - include: else-pop diff --git a/integration/syntaxes/src/css/page/block-content.yml b/integration/syntaxes/src/css/page/block-content.yml new file mode 100644 index 00000000..e394e715 --- /dev/null +++ b/integration/syntaxes/src/css/page/block-content.yml @@ -0,0 +1,88 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + +contexts: + main: + - match: | + (?x) + (@) + ((?> bottom + (?:- + (?> center + | left(?:-corner)? + | right(?:-corner)? + ) + )? + | left + (?:-(?>bottom|corner|middle|top))? + | right + (?:-(?>bottom|corner|middle|top))? + | top + (?:- + (?> center + | left(?:-corner)? + | right(?:-corner)? + ) + )? + )) + captures: + 1: punctuation.definition.keyword.css.css3 + 2: keyword.control.at-rule.css.css3 + set: [ meta-margin-box, margin-box-content ] + # Properties. + - match: | + (?xi) + (?={{cssIdentifier}}) + set: [ delimiter, property ] + + comment-no-pop: + - include: ~/css/comment.no-pop + + delimiter: + - include: comment-no-pop + - match: ":" + scope: punctuation.separator.key-value.css.css3 + set: [ meta-property-value, optional-value-no-pop ] + + margin-box-content: + - include: ~/css/ruleset/block + + meta-margin-box: + - meta_scope: meta.margin-box.css.css3 + - include: pop-now + + meta-property-value: + - meta_scope: meta.property-value.css.css3 + - include: pop-now + + optional-value-no-pop: + - match: (?=[;()\[\]{}]) + pop: true + - match: \, + scope: punctuation.separator.sequence.css.css3 + - match: (?=\S) + push: + - include: ~/css/value + + pop-now: + - match: "" + pop: true + + property: + - include: comment-no-pop + - include: ~/css/property diff --git a/integration/syntaxes/src/css/page/block.yml b/integration/syntaxes/src/css/page/block.yml new file mode 100644 index 00000000..bc328a7d --- /dev/null +++ b/integration/syntaxes/src/css/page/block.yml @@ -0,0 +1,42 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \{ + scope: punctuation.section.property-list.begin.css.css3 + set: delimiter + + comment-no-pop: + - include: ~/css/comment.no-pop + + delimiter: + - meta_scope: >- + meta.at-rule.page.body.css.css3 + meta.property-list.css.css3 + - include: comment-no-pop + # Close. + - match: \} + scope: punctuation.section.property-list.end.css.css3 + pop: true + # Delimiter. + - match: ; + scope: punctuation.terminator.css.css3 + # Actual rules. + - match: "" + push: + - include: ~/css/ruleset/block-content + - match: "" + pop: true diff --git a/integration/syntaxes/src/css/property.yml b/integration/syntaxes/src/css/property.yml new file mode 100644 index 00000000..443791c1 --- /dev/null +++ b/integration/syntaxes/src/css/property.yml @@ -0,0 +1,784 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + + customProperty: (--)([_[:alnum:]\-]*) + + coreProperties: | + (?> additive-symbols + # align-content, align-items, align-self + | align-(?>content|items|self) + | alignment-baseline + | all + | animation + (?:- + # animation-delay + (?> delay + # anmation-direction + | direction + # animation-duration + | duration + # animation-fill-mode + | fill-mode + # aniation-iteration-count + | iteration-count + # aniamtion-name + | name + # animation-play-state + | play-state + # animation-timing-functin + | timing-function + ) + )? + | appearance + | azimuth + | background + (?:- + # background-attachment + (?> attachment + # background-blend-mode + | blend-mode + # background-clip + | clip + # background-color + | color + # background-image, background-image-transform + | image(?:-transform)? + # background-origin + | origin + # background-position + | position + # background-repeat + | repeat + # background-size + | size + ) + )? + | baseline-shift + | block- + # block-size + (?> size + # block-step + | step + # block-step-align, block-step-insert, block-steap-round, + # block-step-size + (?:-(?>align|insert|round|size))? + ) + # bookmark-label, bookmark-level, bookmark-state + | bookmark-(?>label|level|state) + | border + (?:- + # border-block + (?> block + (?:- + # border-block-color + (?> color + # border-block-end, border-block-end-color, + # border-block-end-style, border-block-end-width + | end(?:-(?>color|style|width))? + # border-block-start, border-block-start-color, + # border-block-start-style, border-block-start-width + | start(?:-(?>color|style|width))? + # border-block-style + | style + # border-block-width + | width + ) + )? + # border-bottom + | bottom + (?:- + # border-bottom-color + (?> color + # border-bottom-left-radius + | left-radius + # border-bottom-right-radius + | right-radius + # border-bottom-style + | style + # border-bottom-width + | width + ) + )? + # border-boundary + | boundary + # border-collapse + | collapse + # border-color + | color + # border-image + | image + (?:- + # border-image-outset + (?> outset + # border-image-repeat + | repeat + # border-image-slice + | slice + # border-image-source + | source + # border-image-transform + | transform + # border-image-width + | width + ) + )? + # border-inline + | inline + (?:- + # border-inline-color + (?> color + # border-inline-end, border-inline-end-color, + # border-inline-end-style, border-inline-end-width + | end(?:-(?>color|style|width))? + # border-inline-start, border-inline-start-color, + # border-inline-start-style, border-inline-start-width + | start(?:-(?>color|style|width))? + # border-inline-style + | style + # border-inline-width + | width + ) + )? + # border-left + | left + (?:- + # border-left-color + (?> color + # border-left-style + | style + # border-left-width + | width + ) + )? + # border-right + | right + (?:- + # border-right-color + (?> color + # border-right-style + | style + # border-right-width + | width + ) + )? + # border-radius + | radius + # border-style + | style + # border-spacing + | spacing + # border-top + | top + (?:- + # border-top-color + (?> color + # border-top-left-radius + | left-radius + # border-top-right-radius + | right-radius + # border-top-style + | style + # border-top-width + | width + ) + )? + # border-width + | width + ) + )? + | bottom + # box-decoration-break, box-shadow, box-sizing, box-snap + | box-(?>decoration-break|shadow|sizing|snap) + # break-after, break-before, break-inside + | break(?:-(?>after|before|inside))? + | caption-side + # caret, caret-color, caret-shape + | caret(?:-(?>color|shape))? + | chains + | clear + # clip, clip-path, clip-rule + | clip(?:-(?>path|rule))? + # color, color-adjust, color-interpolation-filters + | color(?:-(?>adjust|interpolation-filters))? + | column + # colums + (?> s + | - + # column-count + (?> count + # column-fill + | fill + # column-gap + | gap + # column-rule, column-rule-color, column-rule-style, + # column-rule-width + | rule(?:-(?>color|style|width))? + # column-span + | span + # column-width + | width + ) + ) + | contain + | content + | continue + # counter-increment, counter-reset, counter-set + | counter(?:-(?>increment|reset|set)) + # cue, cue-after, cue-before + | cue(?:-(?>after|before))? + | cursor + | direction + | display + | dominant-baseline + | elevation + | empty-cells + | fallback + | fill + (?:- + # fill-break + (?> break + # fill-color + | color + # fill-image + | image + # fill-opacity + | opacity + # fill-origin + | origin + # fill-position + | position + # fill-repeat + | repeat + # fill-rule + | rule + # fill-size + | size + ) + )? + | filter + # flex, flex-basis, flex-direction, flex-flow, flex-grow, flex-shrink, + # flex-wrap + | flex(?:-(?>basis|direction|flow|grow|shrink|wrap))? + # float, float-defer, float-offset, float-reference + | float(?:-(?>defer|offset|reference))? + # flood-color, flood-opacity + | flood-(?>color|opacity) + # flow, flow-from, flow-into + | flow(?:-(?>from|into))? + | font + (?:- + # font-family + (?> family + # font-feature-settings + | feature-settings + # font-kerning + | kerning + # font-language-override + | language-override + # font-max-size + | max-size + # font-min-size + | min-size + # font-optical-sizing + | optical-sizing + # font-pallete + | palette + # font-presentation + | presentation + # font-size, font-size-adjust + | size(?:-adjust)? + # font-stretch + | stretch + # font-style + | style + # font-synthesis + | synthesis + # font-variant + | variant + (?:- + # font-variant-alternates + (?> alternates + # font-variant-caps + | caps + # font-variant-asian + | east-asian + # font-variant-ligatures + | ligatures + # font-variant-numeric + | numeric + # font-variant-position + | position + ) + )? + # font-variation-settings + | variation-settings + # font-weight + | weight + ) + )? + # footnote-display, footnote-policy + | footnote-(?>display|policy) + | gap + | glyph-orientation-vertical + | hanging-punctuation + | height + | hyphenate- + # hyphenate-character + (?> character + # hyphenate-limit-chars, hyphenate-limit-last, hyphenate-limit-lines, + # hyphenate-limit-zone + | limit-(?>chars|last|lines|zone) + ) + | hyphens + # image-orientation, image-resolution + | image(?:-(?>orientation|resolution)) + # initial-letter, initial-align, initial-wrap + | initial-letter(?:-(?>align|wrap))? + | inline-size + | inset + (?:- + # inset-block-end, inset-block-start + (?> block(?:-(?>end|start))? + # inset-inline-end, inset-inline-start + | inline(?:-(?>end|start))? + ) + )? + | isolation + # justify-content, justify-items, justify-self + | justify-(?>content|items|self) + | left + | letter-spacing + | lighting-color + # line-break, line-grid, line-height, line-height-step, line-snap + | line-(?>break|grid|height(?:-step)?|snap) + | list-style + (?:- + # list-style-image + (?> image + # list-style-position + | position + # list-style-type + | type + ) + )? + | margin + (?:- + # margin-block-end, margin-block-start + (?> block(?:-(?>end|start))? + # margin-bottom + | bottom + # margin-inline-end, margin-inline-start + | inline(?:-(?>end|start))? + # margin-left + | left + # margin-right + | right + # margin-top + | top + ) + )? + | marker + (?:- + # marker-end + (?> end + # marker-knockout-left, marker-knockout-right + | knockout-(?>left|right) + # marker-mid + | mid + # marker-pattern + | pattern + # marker-segment + | segment + # marker-side + | side + # marker-start + | start + ) + )? + # marquee-direction, marquee-loop, marquee-speed, marquee-style + | marquee-(?>direction|loop|speed|style) + | mask + (?:- + # mask-border + (?> border + (?:- + # mask-border-mode + (?> mode + # mask-border-outset + | outset + # mask-border-repeat + | repeat + # mask-border-slice + | slice + # mask-border-source + | source + # mask-border-width + | width + ) + )? + # mask-clip + | clip + # mask-composite + | composite + # mask-image + | image + # mask-mode + | mode + # mask-origin + | origin + # mask-position + | position + # mask-repeat + | repeat + # mask-size + | size + # mask-type + | type + ) + )? + # max-block-size, max-height, max-inline-size, max-lines, max-width, max-zoom + | max-(?>block-size|height|inline-size|lines|width|zoom) + # min-block-size, min-height, min-inline-size, min-width, min-zoom + | min-(?>block-size|height|inline-size|width|zoom) + | mix-blend-mode + # nav-down, nav-left, nav-right, nav-up + | nav-(?>down|left|right|up) + | negative + # object-fit, object-position + | object-(?>fit|position) + | offset + (?:- + # offset-after + (?> after + # offset-anchor + | anchor + # offset-before + | before + # offset-distance + | distance + # offset-end + | end + # offset-path + | path + # offset-position + | position + # offset-rotate + | rotate + # offset-start + | start + ) + )? + | opacity + | order + | orphans + | orientation + | overflow + (?:- + # overflow-style + (?> style + # overflow-wrap + | wrap + # overflow-x + | x + # overflow-y + | y + ) + )? + | outline + (?:- + # outline-color + (?> color + # outline-offset + | offset + # outline-style + | style + # outline-width + | width + ) + )? + | pad + (?:ding + (?:- + # padding-block, padding-block-end, padding-block-start + (?> block(?:-(?>end|start))? + # padding-bottom + | bottom + # padding-inline, padding-inline-end, padding-inline-start + | inline(?:-(?>end|start))? + # padding-left + | left + # padding-right + | right + # padding-top + | top + ) + )? + )? + # page, page-break-after, page-break-before, page-break-inside + | page(?:-break-(?>after|before|inside))? + # pause, pause-after, pause-before + | pause(?:-(?>after|before))? + # pitch, pitch-range + | pitch(?:-range)? + # place-content, place-items, place-self + | place-(?>content|items|self) + | play-during + | position + | pointer-events + | prefix + | presentation-level + | quotes + | range + | region-fragment + | resize + # rest, rest-after, rest-before + | rest(?:-(?>after|before))? + | richness + | right + # rotation, rotation-point + | rotation(?:-point)? + | row-gap + # ruby-align, ruby-merge, ruby-position + | ruby-(?>align|merge|position) + | running + | scroll- + (?> behavior + | margin + (?:- + # scroll-margin-block, scroll-margin-block-end, + # scroll-margin-block-start + (?> block(?:-(?>end|start))? + # scroll-margin-bottom + | bottom + # scroll-margin-inline, scroll-margin-inline-end, + # scroll-margin-inline-start + | inline(?:-(?>end|start))? + # scroll-margin-left + | left + # scroll-margin-right + | right + # scroll-margin-top + | top + ) + )? + ) + | scroll-padding + (?:- + # scroll-padding-block, scroll-padding-block-end, + # scroll-padding-block-start + (?> block(?:-(?>end|start))? + # scroll-padding-bottom + | bottom + # scroll-padding-inline, scroll-padding-inline-end, + # scroll-padding-inline-start + | inline(?:-(?>end|start))? + # scroll-padding-left + | left + # scroll-padding-right + | right + # scroll-padding-top + | top + ) + )? + # scroll-snap-align, scroll-snap-stop, scroll-snap-type + | scroll-snap-(?>align|stop|type) + | scrollbar-gutter + # shape-inside, shape-image-threshold, shape-margin, shape-outside + | shape-(?>inside|image-threshold|margin|outside) + | size + | speak + (?:- + # speak-as + (?> as + # speak-header + | header + # speak-numeral + | numeral + # speak-punctuation + | punctuation + ) + )? + | speech-rate + | src + | stress + | string-set + | stroke + (?:- + # stroke-align, stroke-alignment + (?> align(?:ment)? + # stroke-break + | break + # stroke-color + | color + | dash + # stroke-dash-corner, stroke-dash-justify + (?> -(?>corner|justify) + # stroke-dashadjust + | adjust + # stroke-array + | array + # stroke-corner + | corner + # stroke-offset + | offset + ) + # stroke-image + | image + # stroke-linecap, stroke-linejoin + | line(?>cap|join) + # stroke-miterlimit + | miterlimit + # stroke-opacity + | opacity + # stroke-origin + | origin + # stroke-position + | position + # stroke-repeat + | repeat + # stroke-size + | size + # stroke-width + | width + ) + )? + # symbols, system, suffix + | s(?>ymbols|ystem|uffix) + | tab-size + | table-layout + | text- + # text-align, text-align-all, text-align-last + (?> align(?:-(?>all|last))? + # text-combine-upright + | combine-upright + # text-decoration + | decoration + # text-decoration-color, text-decoration-line, text-decoration-skip + # text-decoration-style + (?:-(?>color|line|skip|style))? + # text-emphasis + | emphasis + # text-emphasis-color, text-emphasis-position, text-emphasis-style + (?:-(?>color|position|style))? + # text-indent + | indent + # text-justify + | justify + # text-orientation + | orientation + # text-overflow + | overflow + # text-shadow + | shadow + # text-space-collapse, text-space-trim + | space-(?>collapse|trim) + # text-spacing + | spacing + # text-transform + | transform + # text-underline-position + | underline-position + # text-wrap + | wrap + ) + | top + # transform, transform-box, transform-origin + | transform(?:-(?>box|origin))? + # transition, transition-delay, transition-duration, transition-property, + # transition-timing-function + | transition(?:-(?>delay|duration|property|timing-function))? + | unicode-bidi + | user-select + | vertical-align + | visibility + | voice- + # voice-balance + (?> balance + # voice-duration + | duration + # voice-family + | family + # voice-pitch + | pitch + # voice-range + | range + # voice-rate + | rate + # voice-stress + | stress + # voice-volume + | volume + ) + | volume + | white-space + | widows + | width + | will-change + # word-break, word-spacing, word-wrap + | word-(?>break|spacing|wrap) + | wrap- + # wrap-after + (?> after + # wrap-before + | before + # wrap-flow + | flow + # wrap-inside + | inside + # wrap-through + | through + ) + | writing-mode + # z-index, zoom + | z(?>-index|oom) + ) + +contexts: + main: + - include: core + - include: custom + - include: prefixed + - include: other + + core: + - match: (?xi){{coreProperties}} + scope: support.type.property-name.css.css3 + pop: true + + custom: + - match: (?i){{customProperty}} + captures: + 0: support.type.custom-property.css.css3 + 1: punctuation.definition.custom-property.css.css3 + 2: support.type.custom-property.name.css.css3 + pop: true + + prefixed: + - match: | + (?xi) + (-(?>moz|ms|o|webkit)-) + ({{coreProperties}}) + captures: + 1: support.type.vendor-prefix.css.css3 + 2: support.type.property-name.css.css3 + pop: true + + other: + - match: (?i){{cssIdentifier}} + scope: variable.other.type.property-name.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/ruleset/block-content.yml b/integration/syntaxes/src/css/ruleset/block-content.yml new file mode 100644 index 00000000..9bdfe9ad --- /dev/null +++ b/integration/syntaxes/src/css/ruleset/block-content.yml @@ -0,0 +1,175 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + + customProperty: --[_[:alnum:]\-]+ + +contexts: + main: + - include: comment-no-pop + - match: (?=\}) + pop: true + # Custom property. + - match: | + (?xi) + (?= + {{customProperty}} + \s*: + ) + set: [ possible-set, property ] + # Grid-template. + - match: | + (?x) + # grid-template, grid-template-areas, grid-template-columns, + # grid-template-rows + grid-template(?:-(?>areas|columns|rows))? + (?=\s*:) + scope: support.type.property-name.css.css3 + set: [ meta-value, optional-grid-template-value, delimiter ] + # Grid. + - match: | + (?x) + grid + (?:- + # grid-area + (?> area + # grid-auto-coolums, grid-auto-flow, grid-auto-rows + | auto(?:-(?>columns|flow|rows)) + # grid-column, grid-column-end, grid-column-start + | column(?:-(?>end|start))? + # grid-gap + | gap + # grid-row, grid-row-end, grid-row-start + | row(?:-(?>end|start))? + ) + )? + (?=\s*:) + scope: support.type.property-name.css.css3 + set: [ meta-value, optional-grid-value, delimiter ] + # property: value. + - match: | + (?xi) + (?= + {{cssIdentifier}} + \s*: + ) + set: [ meta-value, optional-value, delimiter, property ] + # Nesting. + - match: (?=\S) + set: + - include: ~/css/statement + - include: ~/css/ruleset + + comment-no-pop: + - include: ~/css/comment.no-pop + + delimiter: + - include: comment-no-pop + - match: ":" + scope: punctuation.separator.key-value.css.css3 + pop: true + + grid-line-name: + - match: | + (?xi) + {{cssIdentifier}} + scope: variable.other.grid-line.css.css3 + pop: true + + meta-value: + - meta_scope: meta.property-value.css.css3 + - include: pop-now + + named-grid-line-declaration: + - meta_scope: meta.named-grid-line.css.css3 + - include: comment-no-pop + - match: \] + scope: punctuation.definition.bracket.end.css.css3 + pop: true + - match: (?=\S) + push: grid-line-name + + optional-grid-value: + - include: comment-no-pop + - match: (?=[`;()\]{}]) + pop: true + - match: (?=\S) + push: + - include: start-end-ratio + - include: value-separator + - match: span\b(?!-) + scope: keyword.operator.word.css.css3 + pop: true + - include: grid-line-name + - include: ~/css/value + + optional-grid-template-value: + - include: comment-no-pop + - match: (?=[`;()\]{}]) + pop: true + # Named lines + - match: \[ + scope: punctuation.definition.bracket.begin.css.css3 + push: named-grid-line-declaration + # Other values. + - match: (?=\S) + push: + - include: start-end-ratio + - include: value-separator + - include: ~/css/value + + optional-value: + - include: comment-no-pop + - match: (?=[`;()\[\]{}]) + pop: true + - match: (?=\S) + push: + - include: value-separator + - include: ~/css/value + + possible-set: + - include: comment-no-pop + - match: ":" + scope: punctuation.separator.key-value.css.css3 + set: [ meta-value, set-or-optional-value ] + + pop-now: + - match: "" + pop: true + + property: + - include: comment-no-pop + - include: ~/css/property + + ruleset-block: + - include: ~/css/ruleset/block + + start-end-ratio: + - match: / + scope: keyword.operator.arithmetic.ratio.css.css3 + pop: true + + set-or-optional-value: + - include: comment-no-pop + - match: (?=\{) + set: ruleset-block + - include: optional-value + + value-separator: + - match: \, + scope: punctuation.separator.sequence.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/ruleset/block.yml b/integration/syntaxes/src/css/ruleset/block.yml new file mode 100644 index 00000000..c6f32df0 --- /dev/null +++ b/integration/syntaxes/src/css/ruleset/block.yml @@ -0,0 +1,40 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \{ + scope: punctuation.section.property-list.begin.css.css3 + set: delimiter + + comment-no-pop: + - include: ~/css/comment.no-pop + + delimiter: + - meta_scope: meta.property-list.css.css3 + - include: comment-no-pop + # Close. + - match: \} + scope: punctuation.section.property-list.end.css.css3 + pop: true + # Delimiter. + - match: ; + scope: punctuation.terminator.css.css3 + # Actual rules. + - match: "" + push: + - include: ~/css/ruleset/block-content + - match: "" + pop: true diff --git a/integration/syntaxes/src/css/ruleset/index.yml b/integration/syntaxes/src/css/ruleset/index.yml new file mode 100644 index 00000000..04a119d3 --- /dev/null +++ b/integration/syntaxes/src/css/ruleset/index.yml @@ -0,0 +1,30 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: "" + set: [ meta, block, selector-list ] + + block: + - include: ~/css/ruleset/block + + meta: + - meta_scope: meta.rule-set.css.css3 + - match: "" + pop: true + + selector-list: + - include: ~/css/ruleset/selector-list diff --git a/integration/syntaxes/src/css/ruleset/selector-list.yml b/integration/syntaxes/src/css/ruleset/selector-list.yml new file mode 100644 index 00000000..a13f8764 --- /dev/null +++ b/integration/syntaxes/src/css/ruleset/selector-list.yml @@ -0,0 +1,46 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: "" + set: [ + meta-selector-list, + delimiter, + meta-selector, + selector-expression + ] + + delimiter: + # Escape. + - match: (?=[;{]) + pop: true + # Delimiter. + - match: \, + scope: punctuation.separator.comma.css.css3 + push: [ meta-selector, selector-expression ] + + meta-selector: + - meta_content_scope: meta.selector.css.css3 + - match: "" + pop: true + + meta-selector-list: + - meta_content_scope: meta.selector-list.css.css3 + - match: "" + pop: true + + selector-expression: + - include: ~/css/selector-expression diff --git a/integration/syntaxes/src/css/selector-expression-as-arguments.yml b/integration/syntaxes/src/css/selector-expression-as-arguments.yml new file mode 100644 index 00000000..02953dbd --- /dev/null +++ b/integration/syntaxes/src/css/selector-expression-as-arguments.yml @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \( + scope: punctuation.section.group.begin.css.css3 + set: close + + close: + - meta_scope: meta.group.css.css3 + - match: \) + scope: punctuation.section.group.end.css.css3 + pop: true + - match: (?=\S) + push: expression + + expression: + - include: ~/css/selector-expression diff --git a/integration/syntaxes/src/css/selector-expression.yml b/integration/syntaxes/src/css/selector-expression.yml new file mode 100644 index 00000000..0e01432f --- /dev/null +++ b/integration/syntaxes/src/css/selector-expression.yml @@ -0,0 +1,68 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + +contexts: + main: + - match: "" + set: [ optional-tail, head ] + + head: + # Namespace prefix. + - match: | + (?xi) + (?> ({{cssIdentifier}}) + | (\*) + ) + \s*(\|) + captures: + 0: meta.namespace-prefix.css.css3 + 1: variable.other.namespace-prefix.css.css3 + 2: keyword.other.namespace-wildcard.css.css3 + 3: punctuation.separator.key-value.css.css3 + # Some pseudo elements still allow the CSS2 syntax and could be confused with + # a pseudo class, to prevent that, we try to match the pseudo element first. + - include: ~/css/selector/pseudo-element + - include: ~/css/selector/pseudo-class + - include: ~/css/selector/ampersand + - include: ~/css/selector/attribute + - include: ~/css/selector/custom + - include: ~/css/selector/id + - include: ~/css/selector/class + - include: ~/css/selector/type + - include: ~/css/selector/universal + + optional-tail: + - include: ~/css/comment.no-pop + # Escape. + - match: (?=[,;(){}]) + pop: true + # Operators. + - include: ~/css/combinator + # Attribute. + - match: (?=\[) + push: + - include: ~/css/selector/attribute + # Pseudo element, class and custom selector. + - match: (?=:) + push: + - include: ~/css/selector/pseudo-element + - include: ~/css/selector/pseudo-class + - include: ~/css/selector/custom + # Loop. + - match: (?=\S) + push: head diff --git a/integration/syntaxes/src/css/selector/ampersand.yml b/integration/syntaxes/src/css/selector/ampersand.yml new file mode 100644 index 00000000..e0f2c11c --- /dev/null +++ b/integration/syntaxes/src/css/selector/ampersand.yml @@ -0,0 +1,20 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \& + scope: entity.name.tag.wildcard.parent.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/selector/attribute.yml b/integration/syntaxes/src/css/selector/attribute.yml new file mode 100644 index 00000000..19f16e22 --- /dev/null +++ b/integration/syntaxes/src/css/selector/attribute.yml @@ -0,0 +1,54 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \[ + scope: punctuation.section.brackets.begin.css.css3 + set: [ meta, close, optional-operator, attribute ] + + attribute: + - include: ~/html/attribute/builtin + - include: ~/html/attribute/data + # Other attributes with escaping. + - match: | + (?xi) + (?> [_[:alpha:]\-] + | \\\S + )+ + scope: entity.other.attribute-name.css.css3 + pop: true + + close: + - match: \] + scope: punctuation.section.brackets.end.css.css3 + pop: true + - match: (?=\S) + push: value + + meta: + - meta_scope: meta.attribute-selector.css.css3 + - match: "" + pop: true + + optional-operator: + - match: "[~|^$*]?=" + scope: keyword.operator.attribute-selector.css.css3 + set: value + - match: (?=\S) + pop: true + + value: + - include: ~/css/value diff --git a/integration/syntaxes/src/css/selector/class.yml b/integration/syntaxes/src/css/selector/class.yml new file mode 100644 index 00000000..6ffeec01 --- /dev/null +++ b/integration/syntaxes/src/css/selector/class.yml @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + +contexts: + main: + - match: (?xi)(\.)({{cssIdentifier}}) + captures: + 0: entity.other.attribute-name.class.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/selector/custom.yml b/integration/syntaxes/src/css/selector/custom.yml new file mode 100644 index 00000000..9a1b02c5 --- /dev/null +++ b/integration/syntaxes/src/css/selector/custom.yml @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + customSelector: (:--)([_[:alnum:]\-]*) + +contexts: + main: + - match: (?i){{customSelector}} + captures: + 0: support.type.custom-selector.css.css3 + 1: punctuation.definition.custom-selector.css.css3 + 2: support.type.custom-selector.name.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/selector/id.yml b/integration/syntaxes/src/css/selector/id.yml new file mode 100644 index 00000000..3a813933 --- /dev/null +++ b/integration/syntaxes/src/css/selector/id.yml @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + +contexts: + main: + - match: (?xi)(\#)({{cssIdentifier}}) + captures: + 0: entity.other.attribute-name.id.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/selector/nth/arguments.yml b/integration/syntaxes/src/css/selector/nth/arguments.yml new file mode 100644 index 00000000..486badc9 --- /dev/null +++ b/integration/syntaxes/src/css/selector/nth/arguments.yml @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \( + scope: punctuation.section.group.begin.css.css3 + set: close + + close: + - meta_scope: meta.group.css.css3 + - match: \) + scope: punctuation.section.group.end.css.css3 + pop: true + - match: (?=\S) + push: expression + + expression: + - include: ~/css/selector/nth/expression diff --git a/integration/syntaxes/src/css/selector/nth/expression.yml b/integration/syntaxes/src/css/selector/nth/expression.yml new file mode 100644 index 00000000..6176bb74 --- /dev/null +++ b/integration/syntaxes/src/css/selector/nth/expression.yml @@ -0,0 +1,51 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # It is possible to have an operator in the beginning of the expression. + - include: operator + # Complex expression. + - match: (?=\S) + set: [ optional-tail, head ] + + head: + - match: (?>even|odd)\b + scope: keyword.other.pseudo-class.css.css3 + pop: true + # Numbers. + - match: -?[1-9][0-9]*|0 + scope: constant.numeric.decimal.css.css3 + pop: true + - match: n\b + scope: keyword.other.unit.css.css3 + pop: true + + operator: + - match: "[+-]" + scope: keyword.operator.arithmetic.css.css3 + set: main + # “of [selector]” clause. + - match: of\b + scope: keyword.operator.word.of.css.css3 + set: selector-expression + + optional-tail: + - include: operator + - match: (?=\S) + pop: true + + selector-expression: + - include: ~/css/selector-expression diff --git a/integration/syntaxes/src/css/selector/pseudo-class.yml b/integration/syntaxes/src/css/selector/pseudo-class.yml new file mode 100644 index 00000000..1000c043 --- /dev/null +++ b/integration/syntaxes/src/css/selector/pseudo-class.yml @@ -0,0 +1,116 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + + corePseudoClasses: | + (?> active + # any, any-link + | any(?:-link)? + | checked + | default + | disabled + | empty + | enabled + # first, first-child, first-of-type + | first(?:-(?>child|of-type))? + | fullscreen + | focus + | hover + | indeterminate + | in-range + | invalid + | last-(?>child|of-type) + | left + | link + # only-child, only-of-type + | only-(?>child|of-type) + | optional + | out-of-range + # read-only, read-write + | read-(?>only|write) + | required + | right + | root + | scope + | target + | valid + | visited + ) + +contexts: + main: + - include: expected-pseudo-classes + - include: matches + - include: not + - include: nth-child + - include: nth-of-type + - include: fallback + + expected-pseudo-classes: + - match: (?xi)(:){{corePseudoClasses}} + captures: + 0: entity.other.pseudo-class.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: true + + fallback: + - match: (?xi)(:){{cssIdentifier}} + captures: + 0: variable.other.pseudo-class.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: true + + matches: + - match: (\:)matches(?=\s*\() + captures: + 0: entity.other.pseudo-class.css.cs3 + 1: punctuation.definition.entity.css.css3 + set: selector-expression-as-arguments + + not: + - match: (\:)not(?=\s*\() + captures: + 0: entity.other.pseudo-class.css.cs3 + 1: punctuation.definition.entity.css.css3 + set: selector-expression-as-arguments + - match: (\:)not\b + captures: + 0: entity.other.pseudo-class.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: true + + nth-arguments: + - include: ~/css/selector/nth/arguments + + nth-child: + # nth-child, nth-last-child + - match: (\:)nth(?:-last)?-child\b + captures: + 0: entity.other.pseudo-class.css.cs3 + 1: punctuation.definition.entity.css.css3 + set: nth-arguments + + nth-of-type: + # nth-of-type, nth-last-of-type + - match: (\:)nth(?:-last)?-of-type\b + captures: + 0: entity.other.pseudo-class.css.cs3 + 1: punctuation.definition.entity.css.css3 + set: nth-arguments + + selector-expression-as-arguments: + - include: ~/css/selector-expression-as-arguments diff --git a/integration/syntaxes/src/css/selector/pseudo-element.yml b/integration/syntaxes/src/css/selector/pseudo-element.yml new file mode 100644 index 00000000..4b9f1e63 --- /dev/null +++ b/integration/syntaxes/src/css/selector/pseudo-element.yml @@ -0,0 +1,58 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + +contexts: + main: + - include: css2 + - include: other + - include: fallback + + css2: + # after, before, first-letter, first-line, + - match: (?xi)(::?)(?>after|before|first-(?>letter|line))\b + captures: + 0: entity.other.pseudo-element.class.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: true + + cue-arguments: + - match: \( + scope: punctuation + - match: (?=\S) + + fallback: + - match: (?xi)(::){{cssIdentifier}} + captures: + 0: variable.other.pseudo-element.class.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: true + + other: + - match: (::)cue(?=\s*\() + captures: + 0: entity.other.pseudo-element.class.css.cs3 + 1: punctuation.definition.entity.css.css3 + set: selector-expression-as-arguments + - match: (?xi)(::)(?>backdrop|cue|selection)\b + captures: + 0: entity.other.pseudo-element.class.css.cs3 + 1: punctuation.definition.entity.css.css3 + pop: true + + selector-expression-as-arguments: + - include: ~/css/selector-expression-as-arguments diff --git a/integration/syntaxes/src/css/selector/type.yml b/integration/syntaxes/src/css/selector/type.yml new file mode 100644 index 00000000..48768195 --- /dev/null +++ b/integration/syntaxes/src/css/selector/type.yml @@ -0,0 +1,174 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + + tags: | + (?> a + # abbr + (?> bbr + # address + | ddress + # area + | rea + # article + | rticle + # aside + | side + # audio + | udio + )? + | b + # base + (?> ase + # bdi, bdo + | d[io] + # blockquote + | lockquote + # body + | ody + # br + | r + # button + | utton + )? + # canvas, caption + | ca(?>nvas|ption) + | cite + | code + # col, colgroup + | col(?:group)? + # data, datalist + | data(?:list)? + | dd + | del + | details + | dfn + | dialog + | div + # dl, dt + | d[lt] + # em, embed + | em(?:bed)? + | fieldset + | figcaption + | figure + | footer + | form + | h[1-6] + # head, header + | head(?:er)? + | hgroup + | hr + | html + | i + # iframe + (?> frame + # img + | mg + # input + | nput + # ins + | ns + )? + | kbd + | label + | legend + # li, link + | li(?:nk)? + # main, map, mark + | ma(?>in|p|rk) + # meta, meter + | met(?>a|er) + | nav + | nextid + | noscript + | object + | ol + # optgroup, option + | opt(?>group|ion) + | output + | p + # param + (?> aram + # picture + | icture + # pre + | re + # progress + | rogress + )? + | q + # rp, rt, rtc + | r(?>p|tc?) + | ruby + | s + # sup + (?> amp + # script + | cript + # section + | ection + # select + | elect + # slot + | lot + # small + | mall + # source + | ource + # span + | pan + # strong + | trong + # style + | tyle + # sub + | ub + # summary + | ummary + # sup + | up + )? + | table + | tbody + | td + | template + | textarea + | tfoot + # th, thead + | th(?:ead)? + # time, title + | ti(?>me|tle) + # tr, track + | tr(?:ack)? + # u, ul + | ul? + | var + | video + | wbr + ) + +contexts: + main: + # HTML5 tags. + - match: (?xi){{tags}}\b + scope: entity.name.tag.css.cs3 + pop: true + # Other tags. + - match: (?xi){{cssIdentifier}}\b + scope: variable.other.tag.css.cs3 + pop: true diff --git a/integration/syntaxes/src/css/selector/universal.yml b/integration/syntaxes/src/css/selector/universal.yml new file mode 100644 index 00000000..8ee89325 --- /dev/null +++ b/integration/syntaxes/src/css/selector/universal.yml @@ -0,0 +1,20 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \* + scope: entity.name.tag.wildcard.css.css3 + pop: true diff --git a/integration/syntaxes/src/css/statement.yml b/integration/syntaxes/src/css/statement.yml new file mode 100644 index 00000000..188ac7fc --- /dev/null +++ b/integration/syntaxes/src/css/statement.yml @@ -0,0 +1,294 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* + +contexts: + main: + - include: apply + - include: empty-statement + - include: charset + - include: conditional-group-rules + - include: counter-style + - include: custom-media + - include: custom-selector + - include: font-face + - include: keyframes + - include: namespace + - include: nest + - include: import + - include: page + - include: viewport + + apply: + - match: (@)apply\b + captures: + 0: keyword.control.at-rule.apply.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ meta-apply, custom-property ] + + charset: + - match: (@)charset\b + captures: + 0: keyword.control.at-rule.charset.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ meta-charset, double-quoted-string ] + + conditional-group-body: + - include: ~/css/ruleset/block + + conditional-group-rules: + - match: (@)document\b + captures: + 0: keyword.control.at-rule.document.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ meta-document, conditional-group-body, url-list ] + - match: (@)media\b + captures: + 0: keyword.control.at-rule.media.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ meta-media, conditional-group-body, optional-media-query-list ] + - match: (@)supports\b + captures: + 0: keyword.control.at-rule.supports.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ meta-supports, conditional-group-body, feature-query-list ] + + counter-style: + - match: (@)counter-style\b + captures: + 0: keyword.control.at-rule.counter-style.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ meta-counter-style, ruleset-block, counter-style-name ] + + counter-style-name: + - match: | + (?xi) + {{cssIdentifier}} + scope: entity.other.counter-style.css.css3 + pop: true + + custom-media: + - match: (@)custom-media\b + captures: + 0: keyword.control.at-rule.media.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ + meta-custom-media, + optional-media-query-list, + custom-media-identifier + ] + + custom-media-identifier: + - include: ~/css/custom-media-identifier + + custom-selector: + - match: (@)custom-selector\b + captures: + 0: keyword.control.at-rule.media.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ + meta-custom-selector, + selector-list, + custom-selector-identifier + ] + + custom-selector-identifier: + - include: ~/css/selector/custom + + custom-property: + - include: ~/css/property#custom + + double-quoted-string: + - include: ~/css/literal/string/double-quoted + + empty-statement: + - match: ; + scope: punctuation.terminator.css.css3 + pop: true + + feature-query-list: + - include: ~/css/feature-query-list + + font-face: + - match: (@)font-face\b + captures: + 0: keyword.control.at-rule.font-face.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ meta-font-face, ruleset-block ] + + import: + - match: (@)import-normalize\b + captures: + 0: keyword.control.at-rule.import.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: meta-import + - match: (@)import\b + captures: + 0: keyword.control.at-rule.import.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ meta-import, optional-media-query-list, string-or-url ] + + keyframe-block-list: + - include: ~/css/keyframe-block-list + + keyframe-name: + - match: | + (?xi) + {{cssIdentifier}} + scope: entity.other.animation-name.css.css3 + pop: true + + keyframes: + - match: | + (?x) + (@) + (?:- + (?> moz + | ms + | o + | webkit + ) + -)?keyframes\b + captures: + 0: keyword.control.at-rule.keyframes.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ meta-keyframes, keyframe-block-list, keyframe-name ] + + meta-apply: + - meta_scope: meta.at-rule.apply.css.css3 + - include: pop-now + + meta-charset: + - meta_scope: meta.at-rule.charset.css.css3 + - include: pop-now + + meta-counter-style: + - meta_scope: meta.at-rule.counter-style.css.css3 + - include: pop-now + + meta-custom-media: + - meta_scope: meta.at-rule.custom-media.css.css3 + - include: pop-now + + meta-custom-selector: + - meta_scope: meta.at-rule.custom-selector.css.css3 + - include: pop-now + + meta-document: + - meta_scope: meta.at-rule.document.css.css3 + - include: pop-now + + meta-font-face: + - meta_scope: meta.at-rule.font-face.css.css3 + - include: pop-now + + meta-import: + - meta_scope: meta.at-rule.import.css.css3 + - include: pop-now + + meta-keyframes: + - meta_scope: meta.at-rule.keyframes.css.css3 + - include: pop-now + + meta-media: + - meta_scope: meta.at-rule.media.css.css3 + - include: pop-now + + meta-namespace: + - meta_scope: meta.at-rule.namespace.css.css3 + - include: pop-now + + meta-nest: + - meta_scope: meta.at-rule.nest.css.css3 + - include: pop-now + + meta-page: + - meta_scope: meta.at-rule.page.css.css3 + - include: pop-now + + meta-supports: + - meta_scope: meta.at-rule.supports.css.css3 + - include: pop-now + + meta-viewport: + - meta_scope: meta.at-rule.viewport.css.css3 + - include: pop-now + + namespace: + - match: (@)namespace\b + captures: + 0: keyword.control.at-rule.namespace.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ meta-namespace, string-or-url, optional-namespace-prefix ] + + nest: + - match: (@)nest\b + captures: + 0: keyword.control.at-rule.nest.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ meta-nest, ruleset-block, selector-list ] + + optional-media-query-list: + - include: ~/css/optional-media-query-list + + optional-namespace-prefix: + - match: | + (?xi) + {{cssIdentifier}}\b + (?!\s*\() + scope: entity.name.namespace.css.css3 + pop: true + - match: (?=\S) + pop: true + + optional-page-selector: + - include: ~/css/optional-page-selector-list + + page: + - match: (@)page\b + captures: + 0: keyword.control.at-rule.page.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ meta-page, page-block, optional-page-selector ] + + page-block: + - include: ~/css/page/block + + pop-now: + - match: "" + pop: true + + ruleset-block: + - include: ~/css/ruleset/block + + selector-list: + - include: ~/css/ruleset/selector-list + + string-or-url: + - include: ~/css/literal/string/double-quoted + - include: ~/css/literal/string/single-quoted + - include: ~/css/function-call + + viewport: + - match: (@)viewport\b + captures: + 0: keyword.control.at-rule.viewport.css.css3 + 1: punctuation.definition.keyword.css.css3 + set: [ meta-viewport, ruleset-block ] + + url-list: + - include: ~/css/url-list diff --git a/integration/syntaxes/src/css/url-list.yml b/integration/syntaxes/src/css/url-list.yml new file mode 100644 index 00000000..3de1aa35 --- /dev/null +++ b/integration/syntaxes/src/css/url-list.yml @@ -0,0 +1,50 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: "" + set: [ + meta-url-list, + delimiter, + url + ] + + comment-no-pop: + - include: ~/css/comment.no-pop + + delimiter: + - include: comment-no-pop + # Escape. + - match: (?=\{) + pop: true + # Delimiter. + - match: \, + scope: punctuation.separator.comma.css.css3 + push: [ optional-url ] + + meta-url-list: + - meta_content_scope: meta.document.url-list.css.css3 + - match: "" + pop: true + + optional-url: + - include: comment-no-pop + - match: (?=[,;()\[\]{}]) + pop: true + - include: url + + url: + - include: ~/css/function-call diff --git a/integration/syntaxes/src/css/value-no-unquoted-string.yml b/integration/syntaxes/src/css/value-no-unquoted-string.yml new file mode 100644 index 00000000..ed551849 --- /dev/null +++ b/integration/syntaxes/src/css/value-no-unquoted-string.yml @@ -0,0 +1,27 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: "!important\\b" + scope: keyword.other.important.css.css3 + pop: true + - include: ~/css/literal/color + - include: ~/css/literal/ratio + - include: ~/css/literal/number + - include: ~/css/literal/string/double-quoted + - include: ~/css/literal/string/single-quoted + - include: ~/css/function-call + - include: ~/css/constant diff --git a/integration/syntaxes/src/css/value.yml b/integration/syntaxes/src/css/value.yml new file mode 100644 index 00000000..f5a4faec --- /dev/null +++ b/integration/syntaxes/src/css/value.yml @@ -0,0 +1,19 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/css/value-no-unquoted-string + - include: ~/css/literal/string/unquoted diff --git a/integration/syntaxes/src/facebook-flow/associated-type.no-pop.yml b/integration/syntaxes/src/facebook-flow/associated-type.no-pop.yml new file mode 100644 index 00000000..8b691100 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/associated-type.no-pop.yml @@ -0,0 +1,22 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?=:) + push: associated-type + + associated-type: + - include: ~/facebook-flow/associated-type diff --git a/integration/syntaxes/src/facebook-flow/associated-type.yml b/integration/syntaxes/src/facebook-flow/associated-type.yml new file mode 100644 index 00000000..e7063728 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/associated-type.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: ":" + scope: punctuation.binding.flow + set: optional-type-expression + + optional-type-expression: + - include: ~/facebook-flow/optional-type-expression diff --git a/integration/syntaxes/src/facebook-flow/cast.yml b/integration/syntaxes/src/facebook-flow/cast.yml new file mode 100644 index 00000000..4bd3483e --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/cast.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: ":" + scope: keyword.operator.other.cast.flow + set: optional-type-expression + + optional-type-expression: + - include: ~/facebook-flow/optional-type-expression diff --git a/integration/syntaxes/src/facebook-flow/comment.yml b/integration/syntaxes/src/facebook-flow/comment.yml new file mode 100644 index 00000000..c631d881 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/comment.yml @@ -0,0 +1,66 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: "/\\*\\s*(?>::|flow-include)" + scope: punctuation.definition.comment.begin.flow + set: block-end + - match: /\*(?=\s*:) + scope: punctuation.definition.comment.begin.flow + set: block-end + + block-end: + - meta_scope: comment.block.flow + - match: \*/ + scope: punctuation.definition.comment.end.js.fjsx15 + pop: true + - match: (;) + captures: + 1: punctuation.terminator.flow + - match: (?=\S) + embed: statement-or-expression + escape: (?=\*/|;) + + statement-or-expression: + - match: \? + scope: storage.modifier.flow + - include: ~/facebook-flow/associated-type + - include: ~/facebook-flow/generic/arguments + - include: statement-without-label + - include: ~/js/class/property + - include: ~/js/expression + + statement-without-label: + - include: ~/facebook-flow/declare + - include: ~/facebook-flow/interface + - include: ~/facebook-flow/type-aliasing + - include: ~/js/decorator + - include: ~/js/import + - include: ~/js/export + - include: ~/js/class + - include: ~/js/function + - include: ~/js/variable-declaration + - include: ~/js/statement#block + - include: ~/js/statement#break-continue + - include: ~/js/statement#debugger + - include: ~/js/statement#do-while + - include: ~/js/statement#empty + - include: ~/js/statement#for + - include: ~/js/statement#if-else + - include: ~/js/statement#return + - include: ~/js/statement#switch-case + - include: ~/js/statement#throw + - include: ~/js/statement#try-catch-finally diff --git a/integration/syntaxes/src/facebook-flow/declare.yml b/integration/syntaxes/src/facebook-flow/declare.yml new file mode 100644 index 00000000..18aaf3db --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/declare.yml @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: declare\b + scope: keyword.declaration.flow + set: possible-module + + possible-module: + - include: ~/facebook-flow/module + - match: (?=\S) + pop: true diff --git a/integration/syntaxes/src/facebook-flow/function.no-pop.yml b/integration/syntaxes/src/facebook-flow/function.no-pop.yml new file mode 100644 index 00000000..6da699dc --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/function.no-pop.yml @@ -0,0 +1,135 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + genericArguments: | + (< + (?> {{string}} + | \g<-1> + | [^<>] + )* + >) + + parameters: | + (\( + (?> {{string}} + | \g<-1> + | [^()] + )* + \)) + + flowOperators: | + (?> &(?!\s*&) + | \|(?!\s*\|) + ) + + string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + + flowObject: | + (\{ + (?> {{string}} + | \g<-1> + | [^{}] + )* + }) + + simpleFlowType: | + (?> {{string}} + | {{flowObject}} + | [$_[:alpha:]][$_[:alnum:].]* + ) + (?:\s*{{genericArguments}})? + (?:\s*\[\s*\])? + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> (?:\?\s*){{simpleFlowType}} + | \g<-1> + ) + ) + + complexType: | + (?:\?\s*)? + ( + (?> {{simpleFlowType}} + | {{flowFunction}} + | \g<-1> + ) + ) + + multipleTypes: | + ( + (?> \s*{{flowOperators}} + | \s*{{complexType}} + | \g<-1> + )+ + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | \:\s*{{multipleTypes}} + ) + +contexts: + main: + # Normal. + - match: | + (?xi) + (?= + {{genericArguments}}? + {{flowFunction}} + ) + push: declaration + # Single parameter. + - match: | + (?xi) + (?= + {{complexType}} + \s*=> + (?!\s*{) + ) + push: [ + return, + meta-parameters, + optional-tail, + head + ] + + declaration: + - include: ~/facebook-flow/function#declaration + + head: + - include: ~/facebook-flow/function#head + + meta-parameters: + - include: ~/facebook-flow/function#meta-parameters + + optional-tail: + - include: ~/facebook-flow/function#optional-tail + + return: + - include: ~/facebook-flow/function#return diff --git a/integration/syntaxes/src/facebook-flow/function/index.yml b/integration/syntaxes/src/facebook-flow/function/index.yml new file mode 100644 index 00000000..bbfbcfbc --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/function/index.yml @@ -0,0 +1,160 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + genericArguments: | + (< + (?> {{string}} + | \g<-1> + | [^<>] + )* + >) + + parameters: | + (\( + (?> {{string}} + | \g<-1> + | [^()] + )* + \)) + + flowOperators: | + (?> &(?!\s*&) + | \|(?!\s*\|) + ) + + string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + + flowObject: | + (\{ + (?> {{string}} + | \g<-1> + | [^{}] + )* + }) + + simpleFlowType: | + (?> {{string}} + | {{flowObject}} + | [$_[:alpha:]][$_[:alnum:].]* + ) + (?:\s*{{genericArguments}})? + (?:\s*\[\s*\])? + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> (?:\?\s*){{simpleFlowType}} + | \g<-1> + ) + ) + + complexType: | + (?:\?\s*)? + ( + (?> {{simpleFlowType}} + | {{flowFunction}} + | \g<-1> + ) + ) + + multipleTypes: | + ( + (?> \s*{{flowOperators}} + | \s*{{complexType}} + | \g<-1> + )+ + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | \:\s*{{multipleTypes}} + ) + +contexts: + main: + # Normal. + - match: | + (?xi) + (?= + {{genericArguments}}? + {{flowFunction}} + ) + set: declaration + # Single parameter. + - match: | + (?xi) + (?= + {{commonIdentifier}} + {{genericArguments}} + \s*=> + (?!\s*\{) + ) + set: [ + return, + meta-parameters, + optional-tail, + head + ] + + declaration: + # Generic parameters. + - match: (?=<) + push: generic-arguments + # Parameters. + - match: (?=\() + set: [ + return, + parameters + ] + + generic-arguments: + - include: ~/facebook-flow/generic/arguments + + head: + - include: ~/facebook-flow/type-expression#head + + meta-parameters: + - meta_scope: meta.function.parameters.flow + - include: pop-now + + optional-tail: + - include: ~/facebook-flow/type-expression#optional-tail + + optional-type-expression: + - include: ~/facebook-flow/optional-type-expression + + parameters: + - include: ~/facebook-flow/function/parameters + + pop-now: + - match: "" + pop: true + + return: + - match: => + scope: storage.type.function.arrow.flow + set: optional-type-expression diff --git a/integration/syntaxes/src/facebook-flow/function/parameters/index.yml b/integration/syntaxes/src/facebook-flow/function/parameters/index.yml new file mode 100644 index 00000000..ec0fe5d8 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/function/parameters/index.yml @@ -0,0 +1,38 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \( + scope: punctuation.section.group.begin.flow + set: [ delimiters, optional-parameter ] + + delimiters: + - match: \, + scope: punctuation.separator.comma.flow + push: optional-parameter + - match: \) + scope: punctuation.section.group.end.flow + pop: true + + optional-parameter: + - meta_scope: meta.function.parameters.flow + # Rest. + - match: \.{3} + scope: keyword.operator.other.rest.flow + # Parameter and type. + - include: ~/facebook-flow/function/parameters/simple + # Just the type. + - include: ~/facebook-flow/optional-type-expression diff --git a/integration/syntaxes/src/facebook-flow/function/parameters/simple.yml b/integration/syntaxes/src/facebook-flow/function/parameters/simple.yml new file mode 100644 index 00000000..de5c92ef --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/function/parameters/simple.yml @@ -0,0 +1,33 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: | + (?xi) + ({{commonIdentifier}})(\?)? + (?=\s*:) + captures: + 1: variable.parameter.function.js.fjsx15 + 2: storage.modifier.flow + set: optional-associated-type + + optional-associated-type: + - include: ~/facebook-flow/optional-associated-type diff --git a/integration/syntaxes/src/facebook-flow/generic/arguments.no-pop.yml b/integration/syntaxes/src/facebook-flow/generic/arguments.no-pop.yml new file mode 100644 index 00000000..0f9faafe --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/generic/arguments.no-pop.yml @@ -0,0 +1,22 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?=<) + push: arguments + + arguments: + - include: ~/facebook-flow/generic/arguments diff --git a/integration/syntaxes/src/facebook-flow/generic/arguments.yml b/integration/syntaxes/src/facebook-flow/generic/arguments.yml new file mode 100644 index 00000000..e0dfaa58 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/generic/arguments.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \< + scope: punctuation.section.generic.begin.flow + set: [ delimiters, optional-type-expression ] + + delimiters: + - meta_scope: meta.generic.flow + - match: \, + scope: punctuation.separator.comma.flow + push: optional-type-expression + - match: \> + scope: punctuation.section.generic.end.flow + pop: true + + optional-type-expression: + - include: ~/facebook-flow/optional-type-expression diff --git a/integration/syntaxes/src/facebook-flow/index.yml b/integration/syntaxes/src/facebook-flow/index.yml new file mode 100644 index 00000000..497abc32 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/index.yml @@ -0,0 +1,36 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +name: Flow Statements and Expressions (Naomi) +hidden: true +scope: source.flow + +contexts: + main: + - match: "" + push: [naomi, entry] + + entry: + - include: ~/facebook-flow/declare + - include: ~/facebook-flow/interface + - include: ~/facebook-flow/module + - include: ~/facebook-flow/prolog + - include: ~/facebook-flow/type-aliasing + - include: ~/facebook-flow/type-expression + + naomi: + - meta_scope: naomi + - match: "" + pop: true diff --git a/integration/syntaxes/src/facebook-flow/indexer.yml b/integration/syntaxes/src/facebook-flow/indexer.yml new file mode 100644 index 00000000..3e9f4b98 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/indexer.yml @@ -0,0 +1,72 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: \[ + scope: punctuation.section.brackets.begin.flow + set: [ + optional-associated-type, + indexer-end, + optional-name + ] + + associated-type: + - include: ~/facebook-flow/associated-type + + comment-no-pop: + - include: ~/js/comment.no-pop + + indexer-end: + - match: \] + scope: punctuation.section.brackets.end.flow + pop: true + + optional-associated-type: + - include: ~/facebook-flow/optional-associated-type + + optional-name: + - include: comment-no-pop + # Named indexers are similar to function’s parameters. + - match: | + (?xi) + ({{commonIdentifier}})(\?)? + (?=\s*:) + captures: + 1: variable.parameter.function.js.fjsx15 + 2: storage.modifier.optional.flow + set: associated-type + # Strings. + - match: (?=(?>'|"|`)) + set: [ + associated-type, + string + ] + # Other type expressions. + - match: (?=\S) + set: type-expression + + string: + - include: ~/js/literal/string/double-quoted + - include: ~/js/literal/string/single-quoted + - include: ~/js/literal/string/template + + type-expression: + - include: ~/facebook-flow/type-expression diff --git a/integration/syntaxes/src/facebook-flow/interface.yml b/integration/syntaxes/src/facebook-flow/interface.yml new file mode 100644 index 00000000..3107eba8 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/interface.yml @@ -0,0 +1,82 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: interface\b + scope: storage.type.interface.flow + set: declaration + + body: + - include: comment-no-pop + - match: \{ + scope: punctuation.section.block.begin.flow + set: body-end + + body-end: + - include: comment-no-pop + - match: (?>(,)|(;)) + captures: + 1: punctuation.separator.comma.flow + 2: punctuation.terminator.flow + - match: \} + scope: punctuation.section.block.end.flow + pop: true + - match: (?=\S) + push: statement-or-expression + + comment: + - include: ~/js/comment + + comment-no-pop: + - include: ~/js/comment.no-pop + + co-contra-variant-no-pop: + - include: ~/facebook-flow/operator/covariant.no-pop + - include: ~/facebook-flow/operator/contravariant.no-pop + + declaration: + - include: comment-no-pop + # Extension. + - match: extends\b + scope: storage.modifier.extends.flow + push: optional-type-expression + # Generic parameters. + - match: (?=<) + push: generic-arguments + # Body. + - match: (?=\{) + set: body + # Identifier. + - match: (?xi){{commonIdentifier}} + scope: entity.name.interface.flow + + generic-arguments: + - include: ~/facebook-flow/generic/arguments + + optional-type-expression: + - include: ~/facebook-flow/optional-type-expression + + statement-or-expression: + - include: comment + - include: co-contra-variant-no-pop + - include: ~/facebook-flow/indexer + - include: ~/js/class/method + - include: ~/js/class/property diff --git a/integration/syntaxes/src/facebook-flow/module.yml b/integration/syntaxes/src/facebook-flow/module.yml new file mode 100644 index 00000000..97acb894 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/module.yml @@ -0,0 +1,52 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + # Common JS module. + - match: (?=module\s*.\s*exports) + set: [ + object-literal, + association, + common-js-module + ] + # ES module. + - match: module\b + scope: storage.type.module.flow + set: identifier + + association: + - match: ":" + scope: keyword.operator.other.flow + pop: true + + common-js-module: + - include: ~/js/node-js + + identifier: + - include: ~/js/literal/string/double-quoted + - include: ~/js/literal/string/single-quoted + - include: ~/js/literal/string/template + - match: (?xi){{commonIdentifier}} + scope: entity.name.module.flow + pop: true + + object-literal: + - include: ~/js/literal/object diff --git a/integration/syntaxes/src/facebook-flow/namespace-path.no-pop.yml b/integration/syntaxes/src/facebook-flow/namespace-path.no-pop.yml new file mode 100644 index 00000000..7bf46c6d --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/namespace-path.no-pop.yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + # Javascript/flow don’t have namespaces, this is just a visual cue to highlight + # only the last element when a type is expected. + main: + - match: | + (?xi) + ({{commonIdentifier}})\s* + (?> (\?\.) + | (\.) + ) + captures: + 1: variable.other.namespace.flow + 2: punctuation.accessor.optional-chain.flow + 3: punctuation.accessor.flow diff --git a/integration/syntaxes/src/facebook-flow/object.yml b/integration/syntaxes/src/facebook-flow/object.yml new file mode 100644 index 00000000..67c5f968 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/object.yml @@ -0,0 +1,180 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + constantIdentifier: | + [$_[:upper:]] + [$_[:upper:][:digit:]]* + +contexts: + main: + # Exact. + - match: ({)\s*(\|) + captures: + 1: punctuation.section.block.begin.flow + 2: punctuation.section.block.begin.flow + set: [ + meta-exact, + delimiters, + optional-property-or-method + ] + # Normal. + - match: \{ + scope: punctuation.section.block.begin.flow + set: [ + meta-scope, + delimiters, + optional-property-or-method + ] + + associated-type: + - include: ~/facebook-flow/associated-type + + comment-no-pop: + - include: ~/js/comment.no-pop + + co-contra-variant-no-pop: + - include: ~/facebook-flow/operator/covariant.no-pop + - include: ~/facebook-flow/operator/contravariant.no-pop + + constant: + # Single character. + - match: | + (?x) + ([_[:upper:]])\b + (?:\s*(\?\B))? + captures: + 1: >- + meta.object-literal.key.flow + string.unquoted.flow + 2: storage.modifier.optional.flow + set: associated-type + # Two or more characters. + - match: | + (?x) + ( + {{constantIdentifier}} + (?> \$\B + | [_[:upper:]]\b + ) + ) + (?:\s*(\?\B))? + captures: + 1: >- + meta.object-literal.key.flow + string.unquoted.flow + 2: storage.modifier.optional.flow + set: associated-type + + delimiters: + - match: (?:(,)|(;)) + captures: + 1: punctuation.separator.comma.flow + 2: punctuation.terminator.flow + push: optional-property-or-method + # Exact. + - match: (\|)\s*(}) + captures: + 1: punctuation.section.block.end.flow + 2: punctuation.section.block.end.flow + pop: true + # Normal. + - match: \} + scope: punctuation.section.block.end.flow + pop: true + + else-pop: + - match: (?=\S) + pop: true + + meta-scope: + - meta_scope: >- + meta.object-literal.flow + meta.block.flow + - include: pop-now + + meta-exact: + - meta_scope: >- + meta.object-literal.exact.flow + meta.block.flow + - include: pop-now + + optional-property-or-method: + - include: comment-no-pop + - match: (?=[|}]) + pop: true + - include: co-contra-variant-no-pop + - match: \.{3} + scope: keyword.operator.spread.flow + set: type-expression + - include: ~/js/class/modifier + - include: ~/js/class/method + - include: ~/facebook-flow/indexer + - include: constant + - include: variable + # String property name. + - match: (?=(?>'|"|`)) + set: [ + associated-type, + string + ] + - include: else-pop + + pop-now: + - match: "" + pop: true + + string: + - include: ~/js/literal/string/double-quoted + - include: ~/js/literal/string/single-quoted + - include: ~/js/literal/string/template + + type-expression: + - include: ~/facebook-flow/type-expression + + variable: + # Single character. + - match: | + (?xi) + ((?> \$\B + | [_[:alpha:]]\b + )) + (?:\s*(\?))? + captures: + 1: >- + meta.object-literal.key.flow + string.unquoted.flow + 2: storage.modifier.optional.flow + set: associated-type + # Two or more characters. + - match: | + (?xi) + ( + {{commonIdentifier}} + (?> \$\B + | [_[:alnum:]]\b + ) + ) + (?:\s*(\?))? + captures: + 1: >- + meta.object-literal.key.flow + string.unquoted.flow + 2: storage.modifier.optional.flow + set: associated-type diff --git a/integration/syntaxes/src/facebook-flow/operator/array-shorthand.yml b/integration/syntaxes/src/facebook-flow/operator/array-shorthand.yml new file mode 100644 index 00000000..684a29a6 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/operator/array-shorthand.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: ((\[)\s*(])) + captures: + 1: meta.sequence.flow + 2: punctuation.section.brackets.begin.flow + 3: punctuation.section.brackets.end.flow + pop: true diff --git a/integration/syntaxes/src/facebook-flow/operator/contravariant.no-pop.yml b/integration/syntaxes/src/facebook-flow/operator/contravariant.no-pop.yml new file mode 100644 index 00000000..0a34e284 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/operator/contravariant.no-pop.yml @@ -0,0 +1,19 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \- + scope: storage.modifier.contravariant.flow diff --git a/integration/syntaxes/src/facebook-flow/operator/covariant.no-pop.yml b/integration/syntaxes/src/facebook-flow/operator/covariant.no-pop.yml new file mode 100644 index 00000000..04215435 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/operator/covariant.no-pop.yml @@ -0,0 +1,19 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \+ + scope: storage.modifier.covariant.flow diff --git a/integration/syntaxes/src/facebook-flow/operator/index.yml b/integration/syntaxes/src/facebook-flow/operator/index.yml new file mode 100644 index 00000000..abaf231f --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/operator/index.yml @@ -0,0 +1,21 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/facebook-flow/operator/typeof + - include: ~/facebook-flow/operator/intersection + - include: ~/facebook-flow/operator/nullable + - include: ~/facebook-flow/operator/union diff --git a/integration/syntaxes/src/facebook-flow/operator/intersection.yml b/integration/syntaxes/src/facebook-flow/operator/intersection.yml new file mode 100644 index 00000000..d472c84f --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/operator/intersection.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \& + scope: keyword.operator.other.intersection.flow + set: optional-type-expression + + optional-type-expression: + - include: ~/facebook-flow/optional-type-expression diff --git a/integration/syntaxes/src/facebook-flow/operator/nullable.yml b/integration/syntaxes/src/facebook-flow/operator/nullable.yml new file mode 100644 index 00000000..1488f239 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/operator/nullable.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \? + scope: storage.modifier.nullable.flow + set: optional-type-expression + + optional-type-expression: + - include: ~/facebook-flow/optional-type-expression diff --git a/integration/syntaxes/src/facebook-flow/operator/typeof.yml b/integration/syntaxes/src/facebook-flow/operator/typeof.yml new file mode 100644 index 00000000..cda916e7 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/operator/typeof.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?i)typeof\b + scope: keyword.operator.word.typeof.flow + set: type + + type: + - include: ~/facebook-flow/type-expression diff --git a/integration/syntaxes/src/facebook-flow/operator/union.yml b/integration/syntaxes/src/facebook-flow/operator/union.yml new file mode 100644 index 00000000..ad068ec4 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/operator/union.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \|(?!}) + scope: keyword.operator.other.union.flow + set: optional-type-expression + + optional-type-expression: + - include: ~/facebook-flow/optional-type-expression diff --git a/integration/syntaxes/src/facebook-flow/optional-associated-type.yml b/integration/syntaxes/src/facebook-flow/optional-associated-type.yml new file mode 100644 index 00000000..ada1f212 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/optional-associated-type.yml @@ -0,0 +1,24 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?=:) + set: associated-type + - match: (?=\S) + pop: true + + associated-type: + - include: ~/facebook-flow/associated-type diff --git a/integration/syntaxes/src/facebook-flow/optional-modifier.no-pop.yml b/integration/syntaxes/src/facebook-flow/optional-modifier.no-pop.yml new file mode 100644 index 00000000..3b5725e1 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/optional-modifier.no-pop.yml @@ -0,0 +1,22 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?=\?) + push: optional-modifier + + optional-modifier: + - include: ~/facebook-flow/optional-modifier diff --git a/integration/syntaxes/src/facebook-flow/optional-modifier.yml b/integration/syntaxes/src/facebook-flow/optional-modifier.yml new file mode 100644 index 00000000..bac7d752 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/optional-modifier.yml @@ -0,0 +1,20 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \? + scope: storage.modifier.optional.flow + pop: true diff --git a/integration/syntaxes/src/facebook-flow/optional-type-expression.yml b/integration/syntaxes/src/facebook-flow/optional-type-expression.yml new file mode 100644 index 00000000..5e28f310 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/optional-type-expression.yml @@ -0,0 +1,20 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?=[>,;:)\]}]) + pop: true + - include: ~/facebook-flow/type-expression diff --git a/integration/syntaxes/src/facebook-flow/prolog.yml b/integration/syntaxes/src/facebook-flow/prolog.yml new file mode 100644 index 00000000..eb8d7cc0 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/prolog.yml @@ -0,0 +1,24 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x) + (?> //\s*@flow + | /\*\s*@flow\s\*/ + ) + scope: keyword.other.prolog.flow + pop: true diff --git a/integration/syntaxes/src/facebook-flow/simple.yml b/integration/syntaxes/src/facebook-flow/simple.yml new file mode 100644 index 00000000..d041f39d --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/simple.yml @@ -0,0 +1,51 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - include: ~/facebook-flow/namespace-path.no-pop + # Existential. + - match: \* + scope: support.type.existential.flow + pop: true + # Predefined types. + - match: | + (?x) + (?> any + | Array + | [Bb]oolean + | false + | Function + | Generator + | mixed + | [Nn]umber + | null + | Object + | [Ss]tring + | true + | undefined + | void + )\b + scope: support.type.primitive.flow + pop: true + # Other types. + - match: (?xi){{commonIdentifier}} + scope: variable.other.type.flow + pop: true diff --git a/integration/syntaxes/src/facebook-flow/tuple.yml b/integration/syntaxes/src/facebook-flow/tuple.yml new file mode 100644 index 00000000..9fc45a97 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/tuple.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \[ + scope: punctuation.section.brackets.begin.flow + set: [ delimiters, optional-type-expression ] + + delimiters: + - meta_scope: meta.sequence.flow + - match: \, + scope: punctuation.separator.comma.flow + push: optional-type-expression + - match: \] + scope: punctuation.section.brackets.end.flow + pop: true + + optional-type-expression: + - include: ~/facebook-flow/optional-type-expression diff --git a/integration/syntaxes/src/facebook-flow/type-aliasing.yml b/integration/syntaxes/src/facebook-flow/type-aliasing.yml new file mode 100644 index 00000000..b303b1fc --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/type-aliasing.yml @@ -0,0 +1,68 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + genericArguments: | + (< + [^<>]* + \g<-1>? + [^<>]* + >) + +contexts: + main: + - match: | + (?xi) + (?:(opaque)\s+)? + (type)\b + (?=\s+ + {{commonIdentifier}} + {{genericArguments}}? + ) + captures: + 1: storage.modifier.opaque.flow + 2: storage.type.flow + set: [ + punctuation, + identifier + ] + + identifier: + - match: (?xi){{commonIdentifier}} + scope: entity.name.type.flow + pop: true + + meta-scope: + - meta_scope: meta.declaration.type.flow + - match: "" + pop: true + + optional-type-expression: + - include: ~/facebook-flow/optional-type-expression + + punctuation: + - meta_scope: meta.declaration.type.flow + - include: ~/facebook-flow/generic/arguments.no-pop + - include: ~/facebook-flow/associated-type.no-pop + - match: = + scope: keyword.operator.other.assignment.flow + set: [ + meta-scope, + optional-type-expression + ] diff --git a/integration/syntaxes/src/facebook-flow/type-export.yml b/integration/syntaxes/src/facebook-flow/type-export.yml new file mode 100644 index 00000000..bdd54458 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/type-export.yml @@ -0,0 +1,86 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: typeof\b + scope: keyword.operator.word.typeof.flow + set: optional-target + - match: | + (?xi) + (?= + type + \s+{{commonIdentifier}} + ) + set: type-aliasing + - match: type\b + scope: storage.type.flow + set: optional-target + + alias: + - match: as\b + scope: keyword.control.import-export.as.js.fjsx15 + set: alias-name + + alias-name: + - match: (?xi){{commonIdentifier}} + scope: variable.other.type.js.fjsx15 + pop: true + + close-block: + - include: ~/js/import#close-block + + delimiter: + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: optional-target + # From. + - include: origin + - include: else-pop + + else-pop: + - match: (?=\S) + pop: true + + optional-target: + - match: (?=(?>[,}]|from)) + pop: true + # Multiple targets. + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: [ + close-block, + delimiter, + optional-target + ] + # Aliased. + - match: (?xi){{commonIdentifier}}(?=\s+as) + scope: variable.other.type.js.fjsx15 + set: alias + # Simple. + - match: (?xi){{commonIdentifier}} + scope: variable.other.type.js.fjsx15 + pop: true + + origin: + - include: ~/js/import#origin + + type-aliasing: + - include: ~/facebook-flow/type-aliasing diff --git a/integration/syntaxes/src/facebook-flow/type-expression.yml b/integration/syntaxes/src/facebook-flow/type-expression.yml new file mode 100644 index 00000000..25c6a8ca --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/type-expression.yml @@ -0,0 +1,82 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: comment-no-pop + # Functions need to be detected before expression groups. + - include: ~/facebook-flow/function + # Detect operators as soon as possible. + - include: ~/facebook-flow/operator + # Open new type expression group. + - match: \( + scope: punctuation.section.group.begin.flow + set: open-group + # Start of the type expression. + - match: (?=\S) + set: [ optional-tail, head ] + + close-group: + - match: \) + scope: punctuation.section.group.end.flow + set: optional-tail + + comment-no-pop: + - include: ~/js/comment.no-pop + + else-pop: + - match: (?=\S) + pop: true + + head: + - include: comment-no-pop + - include: ~/facebook-flow/object + - include: ~/facebook-flow/tuple + - include: ~/js/literal/number + - include: ~/js/literal/string/double-quoted + - include: ~/js/literal/string/single-quoted + - include: ~/js/literal/string/template + - include: ~/facebook-flow/simple + + open-group: + - include: comment-no-pop + # Functions need to be detected before expression groups. + - include: ~/facebook-flow/function.no-pop + # Open new type expression group. + - match: \( + scope: punctuation.section.group.begin.flow + push: open-group + # Close the current type expression group. + - include: close-group + # Start of the type expression. + - match: (?=\S) + push: optional-type-expression + + optional-tail: + - include: comment-no-pop + # Array shorthand or generic arguments. + - match: (?=[\[<]) + set: [ optional-tail, tail ] + # Other operators. + - include: ~/facebook-flow/operator + - include: else-pop + + optional-type-expression: + - include: ~/facebook-flow/optional-type-expression + + tail: + - include: comment-no-pop + - include: ~/facebook-flow/operator/array-shorthand + - include: ~/facebook-flow/generic/arguments diff --git a/integration/syntaxes/src/facebook-flow/type-import.yml b/integration/syntaxes/src/facebook-flow/type-import.yml new file mode 100644 index 00000000..1cd5f384 --- /dev/null +++ b/integration/syntaxes/src/facebook-flow/type-import.yml @@ -0,0 +1,76 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: typeof\b + scope: keyword.operator.word.typeof.flow + set: optional-target + - match: type\b + scope: storage.type.flow + set: optional-target + + alias: + - match: as\b + scope: keyword.control.import-export.as.js.fjsx15 + set: alias-name + + alias-name: + - match: (?xi){{commonIdentifier}} + scope: entity.name.type.js.fjsx15 + pop: true + + close-block: + - include: ~/js/import#close-block + + delimiter: + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: optional-target + # From. + - include: origin + - include: else-pop + + else-pop: + - match: (?=\S) + pop: true + + optional-target: + - match: (?=(?>[,}]|from)) + pop: true + # Multiple targets. + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: [ + close-block, + delimiter, + optional-target + ] + # Aliased. + - match: (?xi){{commonIdentifier}}(?=\s+as) + scope: variable.other.type.js.fjsx15 + set: alias + # Simple. + - match: (?xi){{commonIdentifier}} + scope: entity.name.type.js.fjsx15 + pop: true + + origin: + - include: ~/js/import#origin diff --git a/integration/syntaxes/src/facebook-jsx/attribute.yml b/integration/syntaxes/src/facebook-jsx/attribute.yml new file mode 100644 index 00000000..11a1ec54 --- /dev/null +++ b/integration/syntaxes/src/facebook-jsx/attribute.yml @@ -0,0 +1,112 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + attributeIdentifier: | + [_[:alpha:]] + [_.[:alnum:]\-]* + +contexts: + main: + - include: ~/facebook-flow/prolog + - include: ~/js/comment/eslint + - include: ~/js/comment/docblock + - include: ~/js/comment/block + - include: ~/js/comment/line + # Embedded JS. + - include: ~/facebook-jsx/embedded-js + - include: dangerous + - include: key + - include: ref + - include: fallback + + dangerous: + # Attribute with value. + - match: dangerouslySetInnerHTML\b(?=\s*=) + scope: >- + meta.attribute.builtin.html.jsx.jsx1 + entity.other.attribute-name.dangerous.html.jsx.jsx1 + set: [ meta, optional-value ] + # Simple attribute. + - match: dangerouslySetInnerHTML\b + scope: >- + meta.attribute.builtin.html.jsx.jsx1 + entity.other.attribute-name.dangerous.html.jsx.jsx1 + pop: true + + else-pop: + - match: (?=\S) + pop: true + + key: + # Attribute with value. + - match: key(?=\s*=) + scope: >- + meta.attribute.builtin.html.jsx.jsx1 + entity.other.attribute-name.key.html.jsx.jsx1 + set: [ meta, optional-value ] + # Simple attribute. + - match: key\b + scope: >- + meta.attribute.builtin.html.jsx.jsx1 + entity.other.attribute-name.key.html.jsx.jsx1 + pop: true + + optional-value: + # Normal value. + - match: = + scope: punctuation.separator.key-value.html.jsx.jsx1 + set: value + - include: else-pop + + fallback: + # Attribute with value. + - match: (?xi){{attributeIdentifier}}(?=\s*=) + scope: entity.other.attribute-name.html.jsx.jsx1 + set: [ meta, optional-value ] + # Simple attribute. + - match: (?xi){{attributeIdentifier}} + scope: entity.other.attribute-name.html.jsx.jsx1 + pop: true + + meta: + - meta_scope: meta.attribute-with-value.html.html5 + - include: pop-now + + pop-now: + - match: "" + pop: true + + ref: + # Attribute with value. + - match: ref(?=\s*=) + scope: >- + meta.attribute.builtin.html.jsx.jsx1 + entity.other.attribute-name.ref.html.jsx.jsx1 + set: [ meta, optional-value ] + # Simple attribute. + - match: ref\b + scope: >- + meta.attribute.builtin.html.jsx.jsx1 + entity.other.attribute-name.ref.html.jsx.jsx1 + pop: true + + value: + - include: ~/facebook-jsx/component + - include: ~/facebook-jsx/element + - include: ~/facebook-jsx/fragment + - include: ~/facebook-jsx/literal/string/double-quoted + - include: ~/facebook-jsx/literal/string/single-quoted + - include: else-pop diff --git a/integration/syntaxes/src/facebook-jsx/component.yml b/integration/syntaxes/src/facebook-jsx/component.yml new file mode 100644 index 00000000..91ca11d1 --- /dev/null +++ b/integration/syntaxes/src/facebook-jsx/component.yml @@ -0,0 +1,77 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + componentIdentifier: | + [[:upper:]] + [$_.:[:alnum:]]* + + namespaceIdentifier: | + [$_[:alpha:]] + [$_.[:alnum:]\-]* + +contexts: + main: + - match: | + (?x) + (<) + (?: + \s*({{namespaceIdentifier}}) + \s*(:) + )? + \s*({{componentIdentifier}}) + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.namespace.html.jsx.jsx1 + 3: punctuation.separator.namespace.html.jsx.jsx1 + 4: entity.name.tag.component.jsx.jsx1 + set: [ + meta, + namespaced-closing-tag, + close-open-tag + ] + + close-open-tag: + - include: ~/facebook-jsx/shared#close-open-tag + + meta: + - meta_scope: meta.tag.other.component.html.jsx.jsx1 + - match: "" + pop: true + + namespaced-closing-tag: + - include: ~/facebook-jsx/shared#component-closing-tag + + with-js-fence: + - match: | + (?x) + (<) + (?: + \s*({{namespaceIdentifier}}) + \s*(:) + )? + \s*({{componentIdentifier}}) + captures: + 1: >- + meta.jsx-fence.jsx.jsx1 + punctuation.definition.tag.begin.jsx.jsx1 + 2: entity.name.tag.namespace.html.jsx.jsx1 + 3: punctuation.separator.namespace.html.jsx.jsx1 + 4: entity.name.tag.component.jsx.jsx1 + set: [ + meta, + namespaced-closing-tag, + close-open-tag + ] diff --git a/integration/syntaxes/src/facebook-jsx/element.yml b/integration/syntaxes/src/facebook-jsx/element.yml new file mode 100644 index 00000000..6e7de335 --- /dev/null +++ b/integration/syntaxes/src/facebook-jsx/element.yml @@ -0,0 +1,84 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + elementIdentifier: | + [$_[:alpha:]] + [$_.[:alnum:]\-]* + + namespaceIdentifier: "{{elementIdentifier}}" + +contexts: + main: + - match: | + (?xi) + (<) + (?: + \s*({{namespaceIdentifier}}) + \s*(:) + )? + \s*({{elementIdentifier}}) + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.namespace.html.jsx.jsx1 + 3: punctuation.separator.namespace.html.jsx.jsx1 + 4: entity.name.tag.html.jsx.jsx1 + set: [ + meta, + namespaced-closing-tag, + close-open-tag + ] + + close-open-tag: + - include: ~/facebook-jsx/shared#close-open-tag + + meta: + - meta_scope: meta.tag.other.html.jsx.jsx1 + - include: pop-now + + namespaced-closing-tag: + - include: ~/facebook-jsx/shared#namespaced-closing-tag + + pop-now: + - match: "" + pop: true + + self-closing-tag: + - include: ~/facebook-jsx/shared#self-closing-tag + + simple-closing-tag: + - include: ~/facebook-jsx/shared#simple-closing-tag + + with-js-fence: + - match: | + (?xi) + (<) + (?: + \s*({{namespaceIdentifier}}) + \s*(:) + )? + \s*({{elementIdentifier}}) + captures: + 1: >- + meta.jsx-fence.jsx.jsx1 + punctuation.definition.tag.begin.jsx.jsx1 + 2: entity.name.tag.namespace.html.jsx.jsx1 + 3: punctuation.separator.namespace.html.jsx.jsx1 + 4: entity.name.tag.html.jsx.jsx1 + set: [ + meta, + namespaced-closing-tag, + close-open-tag + ] diff --git a/integration/syntaxes/src/facebook-jsx/embedded-js.yml b/integration/syntaxes/src/facebook-jsx/embedded-js.yml new file mode 100644 index 00000000..4c62a0f1 --- /dev/null +++ b/integration/syntaxes/src/facebook-jsx/embedded-js.yml @@ -0,0 +1,50 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \{ + scope: punctuation.definition.template-expression.begin.html.jsx.jsx1 + set: [ meta, close, content ] + + close: + - match: \} + scope: punctuation.definition.template-expression.end.html.jsx.jsx1 + pop: true + + comment-no-pop: + - include: ~/js/comment.no-pop + + content: + - clear_scopes: true + - meta_content_scope: >- + source.js + naomi + - match: (?=}) + pop: true + # This is necessary, otherwise the context will be locked if there’s only a + # comment in the embedded code. + - include: comment-no-pop + # Actual expression. + - match: (?=\S) + push: expression + + expression: + - include: ~/js/expression + + meta: + - meta_scope: meta.embedded-js.jsx.jsx1 + - match: "" + pop: true diff --git a/integration/syntaxes/src/facebook-jsx/fragment.yml b/integration/syntaxes/src/facebook-jsx/fragment.yml new file mode 100644 index 00000000..c0a7a8e4 --- /dev/null +++ b/integration/syntaxes/src/facebook-jsx/fragment.yml @@ -0,0 +1,66 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (<)\s*(>) + captures: + 1: punctuation.definition.tag.begin.jsx.jsx1 + 2: punctuation.definition.tag.end.jsx.jsx1 + set: [ + meta, + closing-tag + ] + + closing-tag: + # Closing tag. + - match: (()) + captures: + 1: meta.tag.close.jsx.jsx1 + 2: punctuation.definition.tag.begin.jsx.jsx1 + 3: punctuation.definition.tag.end.jsx.jsx1 + pop: true + - match: (?=.|\n) + push: [ meta-content, content ] + + content: + - include: ~/facebook-jsx/shared#content + + meta: + - meta_scope: meta.tag.other.fragment.jsx.jsx1 + - include: pop-now + + meta-content: + - clear_scopes: true + - meta_scope: >- + source.jsx + naomi + - include: pop-now + + pop-now: + - match: "" + pop: true + + with-js-fence: + - match: (<)\s*(>) + captures: + 1: >- + meta.jsx-fence.jsx.jsx1 + punctuation.definition.tag.begin.jsx.jsx1 + 2: punctuation.definition.tag.end.jsx.jsx1 + set: [ + meta, + closing-tag + ] diff --git a/integration/syntaxes/src/facebook-jsx/index.yml b/integration/syntaxes/src/facebook-jsx/index.yml new file mode 100644 index 00000000..2e1660a1 --- /dev/null +++ b/integration/syntaxes/src/facebook-jsx/index.yml @@ -0,0 +1,24 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +name: JSX (Naomi) +hidden: true +scope: source.jsx + +contexts: + main: + - include: ~/facebook-jsx/fragment + - include: ~/facebook-jsx/component + - include: ~/facebook-jsx/element diff --git a/integration/syntaxes/src/facebook-jsx/literal/string/double-quoted.yml b/integration/syntaxes/src/facebook-jsx/literal/string/double-quoted.yml new file mode 100644 index 00000000..a2ee3176 --- /dev/null +++ b/integration/syntaxes/src/facebook-jsx/literal/string/double-quoted.yml @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \" + scope: punctuation.definition.string.begin.html.html.jsx.jsx1 + set: string + + string: + - meta_scope: string.quoted.double.html.html.jsx.jsx1 + - match: \" + scope: punctuation.definition.string.end.html.html.jsx.jsx1 + pop: true diff --git a/integration/syntaxes/src/facebook-jsx/literal/string/single-quoted.yml b/integration/syntaxes/src/facebook-jsx/literal/string/single-quoted.yml new file mode 100644 index 00000000..3eab2f8a --- /dev/null +++ b/integration/syntaxes/src/facebook-jsx/literal/string/single-quoted.yml @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \' + scope: punctuation.definition.string.begin.html.jsx.jsx1 + set: string + + string: + - meta_scope: string.quoted.single.html.jsx.jsx1 + - match: \' + scope: punctuation.definition.string.end.html.jsx.jsx1 + pop: true diff --git a/integration/syntaxes/src/facebook-jsx/shared.yml b/integration/syntaxes/src/facebook-jsx/shared.yml new file mode 100644 index 00000000..e81db07c --- /dev/null +++ b/integration/syntaxes/src/facebook-jsx/shared.yml @@ -0,0 +1,130 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + elementIdentifier: | + [$_[:alpha:]] + [$_.[:alnum:]\-]* + +contexts: + main: + - match: "" + set: trap + + attribute: + - include: ~/facebook-jsx/attribute + + close-open-tag: + # Self closing tag. + - match: (?=/>) + pop: true + # Normal closing tag. + - match: \> + scope: punctuation.definition.tag.end.html.jsx.jsx1 + pop: true + # Attribute. + - match: (?=\S) + push: attribute + + component-closing-tag: + - include: self-closing-tag + - match: | + (?x) + ( + ( (\2)(:)(\4) + | (\4) + ) + (>) + ) + captures: + 1: meta.tag.close.html.jsx.jsx1 + 2: punctuation.definition.tag.begin.html.jsx.jsx1 + 3: entity.name.tag.namespace.html.jsx.jsx1 + 4: punctuation.separator.namespace.html.jsx.jsx1 + 5: entity.name.tag.component.jsx.jsx1 + 6: entity.name.tag.component.jsx.jsx1 + 7: punctuation.definition.tag.end.html.jsx.jsx1 + pop: true + - match: (?=.|\n) + push: [ meta-content, content ] + + content: + # Sub element. + - include: ~/facebook-jsx/fragment + - include: ~/facebook-jsx/component + - include: ~/facebook-jsx/element + # Embedded JS. + - include: ~/facebook-jsx/embedded-js + # Text. + - match: .|\n + pop: true + + meta-content: + - clear_scopes: true + - meta_scope: >- + source.jsx + naomi + - include: pop-now + + namespaced-closing-tag: + - include: self-closing-tag + - match: | + (?x) + ( + ( (\2)(:)(\4) + | (\4) + ) + (>) + ) + captures: + 1: meta.tag.close.html.jsx.jsx1 + 2: punctuation.definition.tag.begin.html.jsx.jsx1 + 3: entity.name.tag.namespace.html.jsx.jsx1 + 4: punctuation.separator.namespace.html.jsx.jsx1 + 5: entity.name.tag.jsx.jsx1 + 6: entity.name.tag.jsx.jsx1 + 7: punctuation.definition.tag.end.html.jsx.jsx1 + pop: true + # Content. + - match: (?=.|\n) + push: [ meta-content, content ] + + pop-now: + - match: "" + pop: true + + self-closing-tag: + - match: /> + scope: punctuation.definition.tag.end.html.jsx.jsx1 + pop: true + + simple-closing-tag: + - include: self-closing-tag + - match: (()) + captures: + 1: meta.tag.close.html.jsx.jsx1 + 2: punctuation.definition.tag.begin.html.jsx.jsx1 + 3: entity.name.tag.html.jsx.jsx1 + 4: punctuation.definition.tag.end.html.jsx.jsx1 + pop: true + # Content. + - match: (?=.|\n) + push: [ meta-content, content ] + + trap: + - match: . + scope: trap.jsx1 diff --git a/integration/syntaxes/src/github-markdown/code-block.yml b/integration/syntaxes/src/github-markdown/code-block.yml new file mode 100644 index 00000000..881ef76c --- /dev/null +++ b/integration/syntaxes/src/github-markdown/code-block.yml @@ -0,0 +1,64 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # JSON + - match: | + (?xi)^\s* + (```JSON) + captures: + 1: punctuation.definition.code-block.begin.md.md1 + push: + - match: ^\s*(```) + captures: + 1: punctuation.definition.code-block.end.md.md1 + pop: true + - match: "" + push: + - match: (?=^\s*```) + pop: true + # TODO: + # - include: scope:source.json + - match: "" + pop: true + # JavaScript + - match: | + (?xi)^\s* + ( + ``` + (?> EcmaScript + | ES + (?> [67] + | 201[5678] + ) + | JavaScript + | JS + ) + ) + captures: + 1: punctuation.definition.code-block.begin.md.md1 + push: + - match: ^\s*(```) + captures: + 1: punctuation.definition.code-block.end.md.md1 + pop: true + - match: "" + push: + - match: (?=^\s*```) + pop: true + - include: ~/~/js + - match: "" + pop: true diff --git a/integration/syntaxes/src/github-markdown/header.yml b/integration/syntaxes/src/github-markdown/header.yml new file mode 100644 index 00000000..01f072a5 --- /dev/null +++ b/integration/syntaxes/src/github-markdown/header.yml @@ -0,0 +1,77 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # Level 6. + - match: \s*(#{6})(.+$) + captures: + 1: >- + level-6.md.md1 + punctuation.definition.header.md.md1 + 2: >- + level-6.md.md1 + entity.name.header.md.md1 + pop: true + # Level 5. + - match: \s*(#{5})(.+$) + captures: + 1: >- + level-5.md.md1 + punctuation.definition.header.md.md1 + 2: >- + level-5.md.md1 + entity.name.header.md.md1 + pop: true + # Level 4. + - match: \s*(#{4})(.+$) + captures: + 1: >- + level-4.md.md1 + punctuation.definition.header.md.md1 + 2: >- + level-4.md.md1 + entity.name.header.md.md1 + pop: true + # Level 3. + - match: \s*(#{3})(.+$) + captures: + 1: >- + level-3.md.md1 + punctuation.definition.header.md.md1 + 2: >- + level-3.md.md1 + entity.name.header.md.md1 + pop: true + # Level 2. + - match: \s*(#{2})(.+$) + captures: + 1: >- + level-2.md.md1 + punctuation.definition.header.md.md1 + 2: >- + level-2.md.md1 + entity.name.header.md.md1 + pop: true + # Level 1. + - match: \s*(#{1})(.+$) + captures: + 1: >- + level-1.md.md1 + punctuation.definition.header.md.md1 + 2: >- + level-1.md.md1 + entity.name.header.md.md1 + pop: true diff --git a/integration/syntaxes/src/github-markdown/index.yml b/integration/syntaxes/src/github-markdown/index.yml new file mode 100644 index 00000000..b1cb4a4f --- /dev/null +++ b/integration/syntaxes/src/github-markdown/index.yml @@ -0,0 +1,36 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +name: Markdown (Github) (Naomi) +scope: text.html.markdown + +file_extensions: + - md + +contexts: + main: + - match: "" + push: [naomi, entry] + + entry: + - include: ~/github-markdown/header + - include: ~/github-markdown/code-block + - match: "" + pop: true + + naomi: + - meta_scope: naomi + - match: "" + pop: true diff --git a/integration/syntaxes/src/html/attribute/builtin.yml b/integration/syntaxes/src/html/attribute/builtin.yml new file mode 100644 index 00000000..1277ac5a --- /dev/null +++ b/integration/syntaxes/src/html/attribute/builtin.yml @@ -0,0 +1,192 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: id\b + scope: >- + meta.attribute.builtin.html.html5 + entity.other.attribute-name.id.html.html5 + pop: true + # Other builtin. + - match: | + (?xi) + (?> a + # accept, accept-charset, accessKey + (?> cce(?>pt(?:-charset)?|sskey) + # action + | ction + # align, alt + | l(?>ign|t) + # async + | sync + # autocomplete, autofocus, autoplay, autosave + | uto(?>complete|focus|play|save) + ) + | buffered + | c + # challenge, charset + (?> ha(?>llenge|rset) + # checked + | hecked + # cite + | ite + # class + | lass + | o + # code, codebase + (?> de(?:base)? + # cols, colspan + | ls(?:pan)? + # content. contenteditable, contextmenu, controls + | nt(?>e(?>nt(?:editable)?|xtmenu)|rols) + # cords + | ords + ) + ) + | d + # data, datetime + (?> at(?>a|etime) + # default, defer + | ef(?>ault|er) + # dir, dirname + | ir(?:name)? + # disabled + | isabled + # download + | ownload + # draggable, dropzone + | r(?>aggable|opzone) + ) + | enctype + # form, formaction + | for(?:m(?:action)?)? + | h + # headers + (?> eaders + # height + | eight + # hidden + | idden + # high + | igh + # href + | ref(?:lang)? + # http-equiv + | ttp-equiv + ) + | i + # icon + (?> con + # ismap + | smap + # itemprop + | temprop + ) + # keytype, kind + | k(?>eytype|ind) + | l + # label + (?> abel + # lang, language + | ang(?:uage)? + # list + | ist + # loop + | oop + # low + | ow + ) + | m + # manifest + (?> anifest + # max + | ax(?:length)? + # media + | edia + # method + | ethod + # min + | in + # multiple + | ultiple + # muted + | uted + ) + # name, novalidate + | n(?>ame|ovalidate) + # open, optimum + | op(?>en|timum) + | p + # pattern + (?> attern + # ping + | ing + # placeholder + | laceholder + # poster + | oster + # preload + | reload + ) + | r + # radiogroup + (?> adiogroup + # readonly, rel, required, reversed + | e(?>adonly|l|quired|versed) + # rows, rowspan + | ows(?:pan)? + ) + | s + # sandbox + (?> andbox + # scope, scoped + | coped? + # seamless + | eamless + # selected + | elected + # shape + | hape + # size, sizes + | izes? + # span + | pan + # spellcheck + | pellcheck + # src, srcdoc, srclang, srcset + | rc(?>doc|lang|set)? + # start, step, style, summary + | t(?>art|ep|yle) + # summary + | ummary + ) + | t + # tabindex, target + (?> a(?>bindex|rget) + # title + | itle + # type + | ype + ) + | usemap + | value + # width, wrap + | w(?>idth|rap) + )\b(?!-) + scope: >- + meta.attribute.builtin.html.html5 + entity.other.attribute-name.html.html5 + pop: true diff --git a/integration/syntaxes/src/html/attribute/data.yml b/integration/syntaxes/src/html/attribute/data.yml new file mode 100644 index 00000000..332aae49 --- /dev/null +++ b/integration/syntaxes/src/html/attribute/data.yml @@ -0,0 +1,22 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?i)data-[_:[:alnum:]\-.]* + scope: >- + meta.attribute.data.html.html5 + entity.other.attribute-name.html.html5 + pop: true diff --git a/integration/syntaxes/src/html/attribute/index.yml b/integration/syntaxes/src/html/attribute/index.yml new file mode 100644 index 00000000..6eda483a --- /dev/null +++ b/integration/syntaxes/src/html/attribute/index.yml @@ -0,0 +1,249 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + attributeIdentifier: | + [_:[:alpha:]] + [_:[:alnum:]\-.]* + +contexts: + main: + # Style: + - match: style\b + scope: >- + meta.attribute.builtin.html.html5 + entity.other.attribute-name.style.html.html5 + set: [ meta, style-begin, key-value-separator ] + # Event handler. + - match: | + (?xi)on + # onabort + (?> abort + # onafterprint + | afterprint + # onauxclick + | auxclick + # onbeforeprint, onbeforeunload + | before(?>print|unload) + # onblur + | blur + # oncancel + | cancel + # oncanplay, oncanplaythrough + | canplay(?:through)? + # onchange + | change + # onclick + | click + # onclose + | close + # oncopy + | copy + # oncuechange + | cuechange + # oncut + | cut + # ondblclick + | dblclick + # ondrag, ondragend ondragenter ondragexit ondragleave ondragover ondragstart + | drag(?>end|enter|exit|leave|over|start)? + # ondrop + | drop + # ondurationchange + | durationchange + # onemptied + | emptied + # onended + | ended + # onerror + | error + # onfocus + | focus + # onhashchange + | hashchange + # oninput + | input + # oninvalid + | invalid + # onkeydown, onkeypress, onkeyup + | key(?>down|press|up) + # onlanguagechange + | languagechange + # onload, onloadeddata, onloadedmetadata, onloadend, onloadstart + | load(?>ed(?>data|metadata)|end|start) + # onmessage + | message + # onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup + | mouse(?>down|enter|leave|move|out|over|up) + # onoffline + | offline + # ononline + | online + # onpagehide, onpageshow + | page(?>hide|show) + # onpaste + | paste + # onpause + | pause + # onplay, onplaying + | play(?:ing)? + # onpopstate + | popstate + # onprogress + | progress + # onratechange + | ratechange + # onreadystatechange + | readystatechange + # onrejectionhandled + | rejectionhandled + # onreset + | reset + # onresize + | resize + # onscroll + | scroll + # onseeked, onseeking + | seek(?>ed|ing) + # onselect + | select + # onshow + | show + # onstalled + | stalled + # onstorage + | storage + # onsubmit + | submit + # onsuspend + | suspend + # ontimeupdate + | timeupdate + # ontoggle + | toggle + # onunhandlerejection + | unhandledrejection + # onunload + | unload + # onvolumechange + | volumechange + # onwaiting + | waiting + # onwheel + | wheel + )\b + scope: >- + meta.attribute.builtin.event-handler.html.html5 + entity.other.attribute-name.html.html5 + set: [ meta, script-begin, key-value-separator ] + # With value. + - match: (?xi)(?={{attributeIdentifier}}\s*=) + set: [ meta, value, name ] + # Simple attribute. + - match: (?xi)(?={{attributeIdentifier}}) + set: name + + close-double-quote: + - match: \" + scope: punctuation.definition.string.end.html.html5 + pop: true + + close-single-quote: + - match: \' + scope: punctuation.definition.string.end.html.html5 + pop: true + + css: + - match: "" + push: + - include: ~/css/ruleset/block#delimiter + + key-value-separator: + - match: \= + scope: punctuation.separator.key-value.html.html5 + set: wait-non-space + + meta: + - meta_scope: meta.attribute-with-value.html.html5 + - include: pop-now + + meta-script: + - clear_scopes: true + - meta_content_scope: source.js + - include: pop-now + + meta-style: + - clear_scopes: true + - meta_content_scope: source.css + - include: pop-now + + name: + - include: ~/html/attribute/builtin + - include: ~/html/attribute/data + - include: ~/html/attribute/other + + pop-now: + - match: "" + pop: true + + script: + - include: ~/~/js + + script-begin: + - match: \' + scope: punctuation.definition.string.begin.html.html5 + with_prototype: + - match: (?=') + pop: true + set: [ close-single-quote, meta-script, script ] + - match: \" + scope: punctuation.definition.string.begin.html.html5 + with_prototype: + - match: (?=") + pop: true + set: [ close-double-quote, meta-script, script ] + # Unquoted script. + - match: "" + with_prototype: + - match: (?=[\s'"`=<>]) + pop: true + set: [ meta-script, script ] + + style-begin: + - match: \' + scope: punctuation.definition.string.begin.html.html5 + with_prototype: + - match: (?=') + pop: true + set: [ close-single-quote, meta-style, css ] + - match: \" + scope: punctuation.definition.string.begin.html.html5 + with_prototype: + - match: (?=") + pop: true + set: [ close-double-quote, meta-style, css ] + # Unquoted script. + - match: "" + with_prototype: + - match: (?=[\s'"`=<>]) + pop: true + set: [ meta-style, css ] + + value: + - include: ~/html/attribute/value + + wait-non-space: + - match: (?=\S) + pop: true diff --git a/integration/syntaxes/src/html/attribute/other.yml b/integration/syntaxes/src/html/attribute/other.yml new file mode 100644 index 00000000..0b807599 --- /dev/null +++ b/integration/syntaxes/src/html/attribute/other.yml @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_:[:alpha:]] + [_:[:alnum:]\-.]* + +contexts: + main: + - match: (?xi){{commonIdentifier}} + scope: entity.other.attribute-name.html.html5 + pop: true diff --git a/integration/syntaxes/src/html/attribute/value.yml b/integration/syntaxes/src/html/attribute/value.yml new file mode 100644 index 00000000..113a261e --- /dev/null +++ b/integration/syntaxes/src/html/attribute/value.yml @@ -0,0 +1,28 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \= + scope: punctuation.separator.key-value.html.html5 + set: value + - match: (?=\S) + pop: true + + value: + - include: ~/html/literal/string/double-quoted + - include: ~/html/literal/string/single-quoted + - include: ~/html/literal/number + - include: ~/html/literal/string/unquoted diff --git a/integration/syntaxes/src/html/element/cdata.yml b/integration/syntaxes/src/html/element/cdata.yml new file mode 100644 index 00000000..2a6c3631 --- /dev/null +++ b/integration/syntaxes/src/html/element/cdata.yml @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# https://w3c.github.io/html/syntax.html#cdata-sections +contexts: + main: + - match: ( + scope: punctuation.definition.tag.end.html.html5 + pop: true diff --git a/integration/syntaxes/src/html/element/comment.yml b/integration/syntaxes/src/html/element/comment.yml new file mode 100644 index 00000000..f4b8f70e --- /dev/null +++ b/integration/syntaxes/src/html/element/comment.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# https://w3c.github.io/html/syntax.html#comments +contexts: + main: + - match: + scope: punctuation.definition.comment.end.html.html5 + pop: true + + email-no-pop: + - include: ~/shared/email.no-pop + + link-no-pop: + - include: ~/shared/link.no-pop diff --git a/integration/syntaxes/src/html/element/doctype.yml b/integration/syntaxes/src/html/element/doctype.yml new file mode 100644 index 00000000..a35178ee --- /dev/null +++ b/integration/syntaxes/src/html/element/doctype.yml @@ -0,0 +1,24 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?i)() + captures: + 0: meta.tag.sgml.doctype.html.html5 + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.doctype.html.html5 + 3: punctuation.definition.tag.end.html.html5 + pop: true diff --git a/integration/syntaxes/src/html/element/form-sectioning-root.yml b/integration/syntaxes/src/html/element/form-sectioning-root.yml new file mode 100644 index 00000000..7f52492c --- /dev/null +++ b/integration/syntaxes/src/html/element/form-sectioning-root.yml @@ -0,0 +1,39 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # Closing tag. + - match: () + captures: + 0: meta.tag.close.html.html5 + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + 3: punctuation.definition.tag.end.html.html5 + set: meta + # Open tag. + - match: (<)(fieldset)\b + captures: + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + set: [ meta, close-open-tag ] + + close-open-tag: + - include: ~/html/element/shared#close-open-tag + + meta: + - meta_scope: meta.tag.form.sectioning.root.html.html5 + - match: "" + pop: true diff --git a/integration/syntaxes/src/html/element/form.yml b/integration/syntaxes/src/html/element/form.yml new file mode 100644 index 00000000..6c858711 --- /dev/null +++ b/integration/syntaxes/src/html/element/form.yml @@ -0,0 +1,54 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + # button, form, label, legend, option, select, textarea + otherTags: (?>(?>button|form|l(?>abel|egend)|option|select|textarea)) + +contexts: + main: + - include: void-elements + - include: other-elements + + close-open-tag: + - include: ~/html/element/shared#close-open-tag + + meta: + - meta_scope: meta.tag.form.html.html5 + - match: "" + pop: true + + other-elements: + # Closing tag. + - match: () + captures: + 0: meta.tag.close.html.html5 + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + 3: punctuation.definition.tag.end.html.html5 + set: meta + # Open tag. + - match: (<)({{otherTags}})\b + captures: + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + set: [ meta, close-open-tag ] + + void-elements: + - match: (<)(input)\b + captures: + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + set: [ meta, close-open-tag ] diff --git a/integration/syntaxes/src/html/element/index.yml b/integration/syntaxes/src/html/element/index.yml new file mode 100644 index 00000000..e7dbdb53 --- /dev/null +++ b/integration/syntaxes/src/html/element/index.yml @@ -0,0 +1,28 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/html/element/comment + - include: ~/html/element/doctype + - include: ~/html/element/cdata + - include: ~/html/element/sectioning + - include: ~/html/element/sectioning-root + - include: ~/html/element/form + - include: ~/html/element/form-sectioning-root + - include: ~/html/element/script + - include: ~/html/element/style + - include: ~/html/element/other + - include: ~/html/element/text/character-reference diff --git a/integration/syntaxes/src/html/element/other.yml b/integration/syntaxes/src/html/element/other.yml new file mode 100644 index 00000000..946877eb --- /dev/null +++ b/integration/syntaxes/src/html/element/other.yml @@ -0,0 +1,39 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # Closing tag. + - match: () + captures: + 0: meta.tag.close.html.html5 + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + 3: punctuation.definition.tag.end.html.html5 + set: meta + # Open tag. + - match: (<)(\w+)\b + captures: + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + set: [ meta, close-open-tag ] + + close-open-tag: + - include: ~/html/element/shared#close-open-tag + + meta: + - meta_scope: meta.tag.html.html5 + - match: "" + pop: true diff --git a/integration/syntaxes/src/html/element/script.yml b/integration/syntaxes/src/html/element/script.yml new file mode 100644 index 00000000..456af720 --- /dev/null +++ b/integration/syntaxes/src/html/element/script.yml @@ -0,0 +1,51 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: closing-tag + # Open tag. + - match: (<)(script)\b + captures: + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + set: [ script, meta, close-open-tag ] + + close-open-tag: + - include: ~/html/element/shared#close-open-tag + + closing-tag: + - match: () + captures: + 0: meta.tag.close.html.html5 + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + 3: punctuation.definition.tag.end.html.html5 + pop: true + + meta: + - meta_scope: meta.tag.html.html5 + - match: "" + pop: true + + script: + - clear_scopes: true + - include: closing-tag + # TODO: + # - match: "" + # push: scope:source.js + with_prototype: + - match: (?=b(?>lockquote|ody)|d(?>etails|ialog)|figure|td) + +contexts: + main: + # Closing tag. + - match: () + captures: + 0: meta.tag.close.html.html5 + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + 3: punctuation.definition.tag.end.html.html5 + set: meta + # Open tag. + - match: \s*(<)({{tags}})\b + captures: + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + set: [ meta, close-open-tag ] + + close-open-tag: + - include: ~/html/element/shared#close-open-tag + + meta: + - meta_scope: meta.tag.sectioning.root.html.html5 + - match: "" + pop: true diff --git a/integration/syntaxes/src/html/element/sectioning.yml b/integration/syntaxes/src/html/element/sectioning.yml new file mode 100644 index 00000000..db98a9e9 --- /dev/null +++ b/integration/syntaxes/src/html/element/sectioning.yml @@ -0,0 +1,43 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + # article, aside, nav, section + tags: (?>a(?>rticle|side)|nav|section) + +contexts: + main: + # Closing tag. + - match: () + captures: + 0: meta.tag.close.html.html5 + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + 3: punctuation.definition.tag.end.html.html5 + set: meta + # Open tag. + - match: (<)({{tags}})\b + captures: + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + set: [ meta, close-open-tag ] + + close-open-tag: + - include: ~/html/element/shared#close-open-tag + + meta: + - meta_scope: meta.tag.sectioning.html.html5 + - match: "" + pop: true diff --git a/integration/syntaxes/src/html/element/shared.yml b/integration/syntaxes/src/html/element/shared.yml new file mode 100644 index 00000000..ca7ff8e0 --- /dev/null +++ b/integration/syntaxes/src/html/element/shared.yml @@ -0,0 +1,38 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + elementIdentifier: | + [$_[:alpha:]] + [$_.[:alnum:]\-]* + +contexts: + main: + - match: "" + set: trap + + attribute: + - include: ~/html/attribute + + close-open-tag: + - match: /?> + scope: punctuation.definition.tag.end.html.html5 + pop: true + - match: (?=\S) + push: attribute + + trap: + - match: . + scope: trap.html5 diff --git a/integration/syntaxes/src/html/element/style.yml b/integration/syntaxes/src/html/element/style.yml new file mode 100644 index 00000000..0b21eef0 --- /dev/null +++ b/integration/syntaxes/src/html/element/style.yml @@ -0,0 +1,51 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: closing-tag + # Open tag. + - match: (<)(style)\b + captures: + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + set: [ script, meta, close-open-tag ] + + close-open-tag: + - include: ~/html/element/shared#close-open-tag + + closing-tag: + - match: () + captures: + 0: meta.tag.close.html.html5 + 1: punctuation.definition.tag.begin.html.html5 + 2: entity.name.tag.html.html5 + 3: punctuation.definition.tag.end.html.html5 + pop: true + + meta: + - meta_scope: meta.tag.html.html5 + - match: "" + pop: true + + script: + - clear_scopes: true + - include: closing-tag + # TODO: + # - match: "" + # push: scope:source.css + with_prototype: + - match: (?={{decimal}}|{{hex}}|\w+); + scope: constant.character.entity.html.html5 + pop: true diff --git a/integration/syntaxes/src/html/index.yml b/integration/syntaxes/src/html/index.yml new file mode 100644 index 00000000..6ca63c1a --- /dev/null +++ b/integration/syntaxes/src/html/index.yml @@ -0,0 +1,51 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +name: HTML 5 (Naomi) +scope: text.html + +file_extensions: + - html + - html5 + - htm + - htm5 + - shtml + - shtml5 + - xhtml + - xhtml5 + - inc + - inc5 + - tmpl + - tmpl5 + - tpl + - tpl5 + +first_line_match: + +contexts: + main: + - match: "" + push: [naomi, entry] + + entry: + # - include: ~/html/php + - include: ~/html/element + - match: "" + pop: true + + naomi: + - meta_scope: naomi + - match: "" + pop: true diff --git a/integration/syntaxes/src/html/literal/number.yml b/integration/syntaxes/src/html/literal/number.yml new file mode 100644 index 00000000..b1cc8c55 --- /dev/null +++ b/integration/syntaxes/src/html/literal/number.yml @@ -0,0 +1,58 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + literalDecimal: "[0-9]+" + + literalFloat: | + -? + (?> [0-9]*[.]{{literalDecimal}} + | {{literalDecimal}}[.][0-9]* + ) + + scientificNotation: | + -? + (?> {{literalFloat}} + | {{literalDecimal}} + ) + [e][+-]? + {{literalDecimal}} + +contexts: + main: + - include: float + - include: integer + + float: + - match: (?xi){{scientificNotation}}(?=\s|>|$) + scope: constant.numeric.float.scientific.html.html5 + pop: true + - match: (?x){{literalFloat}}(?=\s|>|$) + scope: constant.numeric.float.html.html5 + pop: true + + integer: + - match: (?i)-?0b[01]+(?=\s|>|$) + scope: constant.numeric.binary.html.html5 + pop: true + - match: (?:-?0[0-7]+)(?=\s|>|$) + scope: constant.numeric.octal.html.html5 + pop: true + - match: (?i)-?0[x][0-9a-f]+(?=\s|>|$) + scope: constant.numeric.hex.html.html5 + pop: true + - match: (?:-?[1-9][0-9]*|0)(?=\s|>|$) + scope: constant.numeric.decimal.html.html5 + pop: true diff --git a/integration/syntaxes/src/html/literal/string/double-quoted.yml b/integration/syntaxes/src/html/literal/string/double-quoted.yml new file mode 100644 index 00000000..a0c69dec --- /dev/null +++ b/integration/syntaxes/src/html/literal/string/double-quoted.yml @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \" + scope: punctuation.definition.string.begin.html.html5 + set: string + + string: + - meta_scope: string.quoted.double.html.html5 + - match: \" + scope: punctuation.definition.string.end.html.html5 + pop: true diff --git a/integration/syntaxes/src/html/literal/string/single-quoted.yml b/integration/syntaxes/src/html/literal/string/single-quoted.yml new file mode 100644 index 00000000..61e52eb7 --- /dev/null +++ b/integration/syntaxes/src/html/literal/string/single-quoted.yml @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \' + scope: punctuation.definition.string.begin.html.html5 + set: string + + string: + - meta_scope: string.quoted.single.html.html5 + - match: \' + scope: punctuation.definition.string.end.html.html5 + pop: true diff --git a/integration/syntaxes/src/html/literal/string/unquoted.yml b/integration/syntaxes/src/html/literal/string/unquoted.yml new file mode 100644 index 00000000..1b936372 --- /dev/null +++ b/integration/syntaxes/src/html/literal/string/unquoted.yml @@ -0,0 +1,20 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: "[^\\s<>]+" + scope: string.unquoted.html.html5 + pop: true diff --git a/integration/syntaxes/src/html/php.yml b/integration/syntaxes/src/html/php.yml new file mode 100644 index 00000000..d0bf836d --- /dev/null +++ b/integration/syntaxes/src/html/php.yml @@ -0,0 +1,22 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?=<\?php) + push: php + + php: + - include: ~/naomi.php7 diff --git a/integration/syntaxes/src/jest-snapshot.yml b/integration/syntaxes/src/jest-snapshot.yml new file mode 100644 index 00000000..d837b346 --- /dev/null +++ b/integration/syntaxes/src/jest-snapshot.yml @@ -0,0 +1,182 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +name: Jest Snapshot (Naomi) +scope: source.js.jest-snapshot + +file_extensions: + - js.snap + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + myVariable: + words: + - foo + - bar + - baz + +contexts: + main: + - match: "" + push: [naomi, entry] + + array: + - match: \[ + scope: punctuation.section.brackets.begin.js.jest-snapshot + set: array-close + + array-close: + - match: \] + scope: punctuation.section.brackets.end.js.jest-snapshot + pop: false + - include: comma-no-pop + - match: (?=\S) + push: snapshot-content + + assignment: + - match: \= + scope: keyword.operator.other.assignment.js.jest-snapshot + + close-object: + - meta_scope: meta.object-literal.js.jest-snapshot + - match: \} + scope: punctuation.section.block.end.js.jest-snapshot + pop: false + - include: comma-no-pop + - match: (?=\S) + push: [ key-value, key-bind, key ] + + close-snapshot: + - match: \` + scope: punctuation.definition.snapshot.end.js.jest-snapshot + pop: true + - match: (?=\S) + push: snapshot-content + + comma-no-pop: + - match: \, + scope: punctuation.separator.comma.js.jest-snapshot + + entry: + # Version. + - match: | + (?xi) + //\s+Jest\s+Snapshot.* + scope: keyword.declaration.snapshot-version.js.jest-snapshot + # Exports. + - match: exports\b + scope: support.type.object.js.jest-snapshot + push: [ value, assignment, property-access ] + # Terminator. + - match: ; + scope: punctuation.terminator.js.jest-snapshot + + key: + - meta_scope: meta.object-literal.key.jest-snapshot + # - include: ~/js/literal/object/property#any-key + + key-bind: + - match: ":" + scope: punctuation.separator.key-value.js.jest-snapshot + pop: true + + key-value: + # Core constants. + - include: ~/js/core#constants + # Other values. + - include: snapshot-content + + js-literals: + - include: ~/js/literal + + jsx: + - include: ~/js + + naomi: + - meta_scope: naomi + - match: "" + pop: true + + meta-jsx: + - clear_scopes: true + - meta_content_scope: >- + source.jsx + naomi + - include: pop-now + + object: + - match: \{ + scope: punctuation.section.block.begin.js.jest-snapshot + set: close-object + + pop-now: + - match: "" + pop: true + + property-access: + - include: ~/js/property-access + + snapshot-content: + # Object {} + - match: (?xi)(?={{commonIdentifier}}\s*{) + set: [ object, type ] + # Type[]. + - match: (?xi)(?={{commonIdentifier}}\s*\[) + set: type-array + # JSX. + - match: (?xi)(?=<{{commonIdentifier}}) + set: [ meta-jsx, jsx ] + # Other values. + - include: js-literals + + support-type: + - match: \[Function] + scope: >- + source.js.jest-snapshot + support.type.js.jest-snapshot + pop: true + + type: + - match: | + (?x) + (?> Array + | Object + | Promise + ) + scope: support.type.js.jest-snapshot + pop: true + - match: (?xi){{commonIdentifier}} + scope: variable.other.type.js.jest-snapshot + pop: true + + type-array: + - match: "" + set: [ array, type ] + + value: + # Snapshot. + - match: (`) + captures: + 0: source.js.jest-snapshot + 1: keyword.operator.assignment.js.fjsx15 + 2: punctuation.definition.snapshot.begin.js.fjsx15 + with_prototype: + - include: support-type + set: [ close-snapshot ] + # Other values. + - include: js-literals diff --git a/integration/syntaxes/src/js/arrow-function.no-pop.yml b/integration/syntaxes/src/js/arrow-function.no-pop.yml new file mode 100644 index 00000000..ccb43d70 --- /dev/null +++ b/integration/syntaxes/src/js/arrow-function.no-pop.yml @@ -0,0 +1,154 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + genericArguments: | + (< + (?> {{string}} + | \g<-1> + | [^<>] + )* + >) + + parameters: | + (\( + (?> {{string}} + | \g<-1> + | [^()] + )* + \)) + + flowOperators: | + (?> &(?!\s*&) + | \|(?!\s*\|) + ) + + string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + + flowObject: | + (\{ + (?> {{string}} + | \g<-1> + | [^{}] + )* + }) + + simpleFlowType: | + (?> {{string}} + | {{flowObject}} + | [$_[:alpha:]][$_[:alnum:].]* + ) + (?:\s*{{genericArguments}})? + (?:\s*\[\s*\])? + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> (?:\?\s*){{simpleFlowType}} + | \g<-1> + ) + ) + + complexType: | + (?:\?\s*)? + ( + (?> {{simpleFlowType}} + | {{flowFunction}} + | \g<-1> + ) + ) + + multipleTypes: | + ( + (?> \s*{{flowOperators}} + | \s*{{complexType}} + | \g<-1> + )+ + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | \:\s*{{multipleTypes}} + ) + + normalArrowFunction: | + (?:async\b\s*)? + (?:{{genericArguments}}\s*)? + {{parameters}} + (?:\s*{{type}})? + \s*=> + + singleParameterArrowFunction: | + (?:async\b\s+)? + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=> + + anyArrowFunction: | + (?> {{normalArrowFunction}} + | {{singleParameterArrowFunction}} + ) + + normalArrowFunctionAssignedToVariable: | + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=\s* + {{normalArrowFunction}} + + singleParameterArrowFunctionAssignedToVariable: | + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=\s* + {{singleParameterArrowFunction}} + + anyArrowFunctionAssignedToVariable: | + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=\s* + (?> {{normalArrowFunction}} + | {{singleParameterArrowFunction}} + ) + +contexts: + main: + # Normal arrow function. + - match: | + (?xi) + (?={{normalArrowFunction}}) + push: normal-arrow-function + # Single parameter. + - match: | + (?xi) + (?={{singleParameterArrowFunction}}) + push: single-parameter-arrow-function + + normal-arrow-function: + - meta_scope: meta.function.js.fjsx15 + - include: ~/js/arrow-function#normal-arrow-function + + single-parameter-arrow-function: + - meta_scope: meta.function.js.fjsx15 + - include: ~/js/arrow-function#single-parameter-arrow-function diff --git a/integration/syntaxes/src/js/arrow-function/body.yml b/integration/syntaxes/src/js/arrow-function/body.yml new file mode 100644 index 00000000..e1ab7fea --- /dev/null +++ b/integration/syntaxes/src/js/arrow-function/body.yml @@ -0,0 +1,49 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: => + scope: storage.type.function.arrow.js.fjsx15 + set: possible-multi-statement-body + + close-body: + - meta_scope: >- + meta.function.js.fjsx15 + meta.block.js.fjsx15 + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + set: optional-expression-tail + - match: "" + push: optional-statement-or-expression + + comment-no-pop: + - include: ~/js/comment.no-pop + + optional-expression: + - include: ~/js/optional-expression + + optional-expression-tail: + - include: ~/js/expression#optional-tail + + optional-statement-or-expression: + - include: ~/js/optional-statement-or-expression + + possible-multi-statement-body: + - include: comment-no-pop + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: close-body + - include: optional-expression diff --git a/integration/syntaxes/src/js/arrow-function/index.yml b/integration/syntaxes/src/js/arrow-function/index.yml new file mode 100644 index 00000000..b9c33ea4 --- /dev/null +++ b/integration/syntaxes/src/js/arrow-function/index.yml @@ -0,0 +1,159 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + genericArguments: | + (< + (?> {{string}} + | \g<-1> + | [^<>] + )* + >) + + parameters: | + (\( + (?> {{string}} + | \g<-1> + | [^()] + )* + \)) + + flowOperators: | + (?> &(?!\s*&) + | \|(?!\s*\|) + ) + + string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + + flowObject: | + (\{ + (?> {{string}} + | \g<-1> + | [^{}] + )* + }) + + simpleFlowType: | + (?> {{string}} + | {{flowObject}} + | [$_[:alpha:]][$_[:alnum:].]* + ) + (?:\s*{{genericArguments}})? + (?:\s*\[\s*\])? + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> (?:\?\s*){{simpleFlowType}} + | \g<-1> + ) + ) + + complexType: | + (?:\?\s*)? + ( + (?> {{simpleFlowType}} + | {{flowFunction}} + | \g<-1> + ) + ) + + multipleTypes: | + ( + (?> \s*{{flowOperators}} + | \s*{{complexType}} + | \g<-1> + )+ + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | \:\s*{{multipleTypes}} + ) + + normalArrowFunction: | + (?:async\b\s*)? + (?:{{genericArguments}}\s*)? + {{parameters}} + (?:\s*{{type}})? + \s*=> + + singleParameterArrowFunction: | + (?:async\b\s+)? + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=> + + anyArrowFunction: | + (?> {{normalArrowFunction}} + | {{singleParameterArrowFunction}} + ) + + normalArrowFunctionAssignedToVariable: | + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=\s* + {{normalArrowFunction}} + + singleParameterArrowFunctionAssignedToVariable: | + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=\s* + {{singleParameterArrowFunction}} + + anyArrowFunctionAssignedToVariable: | + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=\s* + (?> {{normalArrowFunction}} + | {{singleParameterArrowFunction}} + ) + +contexts: + main: + # Normal arrow function. + - match: | + (?xi) + (?={{normalArrowFunction}}) + set: normal-arrow-function + # Single parameter. + - match: | + (?xi) + (?={{singleParameterArrowFunction}}) + set: single-parameter-arrow-function + + normal-arrow-function: + - meta_scope: meta.function.js.fjsx15 + - include: ~/js/async.no-pop + - include: ~/facebook-flow/generic/arguments.no-pop + - include: ~/js/function/parameters.no-pop + - include: ~/js/arrow-function/body + + single-parameter-arrow-function: + - meta_scope: meta.function.js.fjsx15 + - include: ~/js/async.no-pop + - include: ~/js/function/parameter/simple.no-pop + - include: ~/js/arrow-function/body diff --git a/integration/syntaxes/src/js/async.no-pop.yml b/integration/syntaxes/src/js/async.no-pop.yml new file mode 100644 index 00000000..81234a8b --- /dev/null +++ b/integration/syntaxes/src/js/async.no-pop.yml @@ -0,0 +1,19 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: async\b + scope: storage.modifier.async.js.fjsx15 diff --git a/integration/syntaxes/src/js/class/body.yml b/integration/syntaxes/src/js/class/body.yml new file mode 100644 index 00000000..db20e119 --- /dev/null +++ b/integration/syntaxes/src/js/class/body.yml @@ -0,0 +1,53 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: comment-no-pop + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: [ body-end, statement-or-expression ] + + body-end: + - meta_scope: >- + meta.class.js.fjsx15 + meta.block.js.fjsx15 + - include: comment-no-pop + - match: (?>(,)|(;)) + captures: + 1: punctuation.separator.comma.js.fjsx15 + 2: punctuation.terminator.js.fjsx15 + push: statement-or-expression + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + pop: true + - match: (?=\S) + push: statement-or-expression + + comment-no-pop: + - include: ~/js/comment.no-pop + + statement-or-expression: + - include: comment-no-pop + - include: ~/facebook-flow/operator/covariant.no-pop + - include: ~/facebook-flow/operator/contravariant.no-pop + - include: ~/js/decorator + - include: ~/js/react-js + - include: ~/js/class/modifier + - include: ~/js/class/method + - include: ~/js/class/property + - include: ~/facebook-flow/indexer + - match: (?=\S) + pop: true diff --git a/integration/syntaxes/src/js/class/index.yml b/integration/syntaxes/src/js/class/index.yml new file mode 100644 index 00000000..a91d44fe --- /dev/null +++ b/integration/syntaxes/src/js/class/index.yml @@ -0,0 +1,88 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: class\b + scope: storage.type.class.js.fjsx15 + set: declaration + + body: + - include: ~/js/class/body + + comment-no-pop: + - include: ~/js/comment.no-pop + + declaration: + - meta_scope: meta.declaration.class.js.fjsx15 + - include: comment-no-pop + # Body. + - match: (?=\{) + set: body + # Generic parameters. + - match: (?=<) + push: generic-arguments + # Interfaces. + - match: implements\b + scope: storage.modifier.js.fjsx15 + push: [ + optional-target-class-or-namespace, + optional-generic-arguments, + target-class-or-namespace + ] + # Extensions. + - match: extends\b + scope: storage.modifier.extends.js.fjsx15 + push: [ + optional-generic-arguments, + target-class-or-namespace + ] + # Identifier. + - match: (?xi){{commonIdentifier}} + scope: entity.name.class.js.fjsx15 + + generic-arguments: + - include: ~/facebook-flow/generic/arguments + + optional-generic-arguments: + - include: ~/facebook-flow/generic/arguments + - match: "" + pop: true + + optional-target-class-or-namespace: + - match: \, + scope: punctuation.definition.implement-list.separator.js.fjsx15 + set: [ + optional-target-class-or-namespace, + optional-generic-arguments, + target-class-or-namespace + ] + - match: (?=\{) + pop: true + + target-class-or-namespace: + - include: comment-no-pop + - include: ~/facebook-flow/namespace-path.no-pop + - match: (?xi){{commonIdentifier}} + scope: entity.other.inherited-class.js.fjsx15 + pop: true + + type-expression: + - include: ~/facebook-flow/type-expression diff --git a/integration/syntaxes/src/js/class/method.yml b/integration/syntaxes/src/js/class/method.yml new file mode 100644 index 00000000..e9b14b91 --- /dev/null +++ b/integration/syntaxes/src/js/class/method.yml @@ -0,0 +1,133 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + indexer: | + (\[ + (?> {{string}} + | \g<-1> + | [^\[\]] + )* + \]) + + methodIdentifier: | + (?> {{string}} + | {{indexer}} + | {{commonIdentifier}} + ) + + genericParameters: | + (< + (?> {{string}} + | \g<-1> + | [^<>] + )* + >) + + string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + +contexts: + main: + # Method without identifier. + - match: (?=\() + set: declaration + # Normal method. + - match: | + (?xi) + (?= + {{methodIdentifier}} + \s*{{genericParameters}}? + \s*\( + ) + set: declaration + + body: + - include: ~/js/function/body + + comment-no-pop: + - include: ~/js/comment.no-pop + + computed-identifier-end: + - match: \] + scope: punctuation.definition.function.identifier.end.js.fjsx15 + pop: true + + declaration: + - meta_scope: >- + meta.declaration.function.method.js.fjsx15 + meta.function.js.fjsx15 + - include: comment-no-pop + # Body. + - match: (?=\{) + set: body + # Generic parameters. + - match: (?=<) + push: generic-arguments + # Parameters. + - match: (?=\() + push: parameters + # Support identifier. + - match: constructor\b + scope: entity.name.function.constructor.js.fjsx15 + set: [ + optional-support-body, + support-parameters + ] + # Identifier. + - match: (?xi){{commonIdentifier}} + scope: entity.name.function.js.fjsx15 + # Computed identifier. + - match: \[ + scope: punctuation.definition.function.identifier.begin.js.fjsx15 + push: [ computed-identifier-end, optional-expression ] + # String identifiers + - match: (?=['"`]) + push: + - include: ~/js/literal/string/double-quoted + - include: ~/js/literal/string/single-quoted + - include: ~/js/literal/string/template + - include: else-pop + + else-pop: + - match: (?=\S) + pop: true + + generic-arguments: + - include: ~/facebook-flow/generic/arguments + + optional-body: + - include: body + - include: else-pop + + optional-expression: + - include: ~/js/optional-expression + + optional-support-body: + - include: body + - include: else-pop + + parameters: + - include: ~/js/function/parameters + + support-parameters: + - include: ~/js/function/parameters diff --git a/integration/syntaxes/src/js/class/modifier.yml b/integration/syntaxes/src/js/class/modifier.yml new file mode 100644 index 00000000..785a0bc6 --- /dev/null +++ b/integration/syntaxes/src/js/class/modifier.yml @@ -0,0 +1,53 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # static + - match: static\b(?!\s*(?>[:,=(]|$)) + scope: storage.modifier.js.fjsx15 + set: modifier-trap + # private + - match: \#(?!\s*(?>[:,=(]|$)) + scope: storage.modifier.js.fjsx15 + set: modifier-trap + # async + - match: async\b(?!\s*(?>[:,=(]|$)) + scope: storage.modifier.js.fjsx15 + set: modifier-trap + # get/set + - match: (?>get|set)\b(?!\s*(?>[:,=(]|$)) + scope: storage.modifier.js.fjsx15 + set: modifier-trap + # generator + - match: \*(?!\s*(?>[:,=(]|$)) + scope: storage.modifier.js.fjsx15 + set: modifier-trap + + comment-no-pop: + - include: ~/js/comment.no-pop + + method-declaration: + - include: ~/js/class/method#declaration + + modifier-trap: + - include: main + - match: (?=\S) + set: property-or-method + + property-or-method: + - include: comment-no-pop + - include: ~/js/class/method + - include: ~/js/class/property diff --git a/integration/syntaxes/src/js/class/property.yml b/integration/syntaxes/src/js/class/property.yml new file mode 100644 index 00000000..5b1cac63 --- /dev/null +++ b/integration/syntaxes/src/js/class/property.yml @@ -0,0 +1,50 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - include: ~/js/variable#function-assigned-to-variable + - match: (?xi)(?={{commonIdentifier}}) + set: [ + optional-type-and-value, + identifier + ] + + associated-type: + - include: ~/facebook-flow/associated-type + + identifier: + - include: ~/js/constant + - include: ~/js/variable + + optional-expression: + - include: ~/js/optional-expression + + optional-type-and-value: + - match: \? + scope: keyword.operator.other.optional.flow + # Type. + - match: (?=:) + push: associated-type + # Value. + - match: (?==) + set: optional-expression + - match: (?=\S) + pop: true diff --git a/integration/syntaxes/src/js/comment.no-pop.yml b/integration/syntaxes/src/js/comment.no-pop.yml new file mode 100644 index 00000000..31ce0fab --- /dev/null +++ b/integration/syntaxes/src/js/comment.no-pop.yml @@ -0,0 +1,20 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?=/(?>/|\*)) + push: + - include: ~/js/comment diff --git a/integration/syntaxes/src/js/comment/block.yml b/integration/syntaxes/src/js/comment/block.yml new file mode 100644 index 00000000..97bbba45 --- /dev/null +++ b/integration/syntaxes/src/js/comment/block.yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: /\* + scope: punctuation.definition.comment.begin.js.fjsx15 + set: block + + block: + - meta_scope: comment.block.js.fjsx15 + - include: email-no-pop + - include: link-no-pop + - match: \*/ + scope: punctuation.definition.comment.end.js.fjsx15 + pop: true + + email-no-pop: + - include: ~/shared/email.no-pop + + link-no-pop: + - include: ~/shared/link.no-pop diff --git a/integration/syntaxes/src/js/comment/docblock.yml b/integration/syntaxes/src/js/comment/docblock.yml new file mode 100644 index 00000000..89a76d39 --- /dev/null +++ b/integration/syntaxes/src/js/comment/docblock.yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: /\*\*(?!/) + scope: punctuation.definition.comment.begin.js.fjsx15 + set: block + + block: + - meta_scope: comment.block.documentation.js.fjsx15 + - include: email-no-pop + - include: link-no-pop + - match: \*/ + scope: punctuation.definition.comment.end.js.fjsx15 + pop: true + + email-no-pop: + - include: ~/shared/email.no-pop + + link-no-pop: + - include: ~/shared/link.no-pop diff --git a/integration/syntaxes/src/js/comment/eslint.yml b/integration/syntaxes/src/js/comment/eslint.yml new file mode 100644 index 00000000..0da5fe37 --- /dev/null +++ b/integration/syntaxes/src/js/comment/eslint.yml @@ -0,0 +1,56 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # Line. + - match: \/\/(?=\s*eslint) + scope: punctuation.definition.comment.begin.js.fjsx15 + set: line + # Block. + - match: \/\*(?=\s*eslint) + scope: punctuation.definition.comment.begin.js.fjsx15 + set: block + + line: + - include: enable-disable + - match: \s*$ + pop: true + + block: + - include: enable-disable + - match: \*/ + scope: punctuation.definition.comment.end.js.fjsx15 + pop: true + + enable-disable: + - match: (?i)eslint-(?>enable|disable)(?:-line)? + scope: keyword.other.js.fjsx15 + push: rules-loop + + rules-loop: + - match: (?=(?>$|\*\/)) + pop: true + # Delimiter. + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + # Rule. + - match: | + (?xi) + ( + [$_[:alpha:]] + [$_\-/[:alnum:]]* + ) + scope: variable.other.eslint.rule.js.fjsx15 diff --git a/integration/syntaxes/src/js/comment/index.yml b/integration/syntaxes/src/js/comment/index.yml new file mode 100644 index 00000000..aba57fac --- /dev/null +++ b/integration/syntaxes/src/js/comment/index.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/facebook-flow/prolog + - include: ~/facebook-flow/comment + # - include: ~/js/comment/eslint + - include: ~/js/comment/docblock + - include: ~/js/comment/block + - include: ~/js/comment/line diff --git a/integration/syntaxes/src/js/comment/line.yml b/integration/syntaxes/src/js/comment/line.yml new file mode 100644 index 00000000..200ce014 --- /dev/null +++ b/integration/syntaxes/src/js/comment/line.yml @@ -0,0 +1,38 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: // + scope: punctuation.definition.comment.begin.js.fjsx15 + set: line + + no-pop: + - match: // + scope: punctuation.definition.comment.begin.js.fjsx15 + push: line + + line: + - meta_scope: comment.line.js.fjsx15 + - include: email-no-pop + - include: link-no-pop + - match: \n|$ + pop: true + + email-no-pop: + - include: ~/shared/email.no-pop + + link-no-pop: + - include: ~/shared/link.no-pop diff --git a/integration/syntaxes/src/js/constant.yml b/integration/syntaxes/src/js/constant.yml new file mode 100644 index 00000000..0e21a2d7 --- /dev/null +++ b/integration/syntaxes/src/js/constant.yml @@ -0,0 +1,60 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + constantIdentifier: | + [$_[:upper:]] + [$_[:upper:][:digit:]]* + +contexts: + main: + - include: object + - include: normal + + object: + - match: | + (?x) + (\#)? + ({{constantIdentifier}}) + (?=\s*\??\.) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.object.constant.js.fjsx15 + pop: true + + normal: + # Single character. + - match: | + (?x) + (\#)? + ([_[:upper:]])\b + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.constant.js.fjsx15 + pop: true + # Two or more characters. + - match: | + (?x) + (\#)? + ( + {{constantIdentifier}} + (?> \$\B + | [_[:upper:][:digit:]]\b + ) + ) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.constant.js.fjsx15 + pop: true diff --git a/integration/syntaxes/src/js/core.yml b/integration/syntaxes/src/js/core.yml new file mode 100644 index 00000000..d93a877f --- /dev/null +++ b/integration/syntaxes/src/js/core.yml @@ -0,0 +1,603 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + arrayFunctions: | + (?> from + | isArray + )\b + + dateFunctions: | + (?> [gs]et + (?> Date + | Day + | FullYear + | Hours + | Milliseconds + | Minutes + | Month + | Seconds + | Time(?>ZoneOffset) + | UTC + (?> Date + | Day + | FullYear + | Hours + | Milliseconds + | minutes + | Month + | Seconds + ) + ) + | now + | parse + | to + (?> DateString + | GMTString + | ISOString + | JSON + | Locale + (?> DateString + | Format + | String + | TimeString + ) + | Source + | String + | TimeString + | UTCString + | valueOf + ) + | UTC + )\b + + globalFunctions: | + (?> decodeURI(?:Component)? + | encodeURI(?:Component)? + | eval + | is(?>Finite|NaN) + | parse(?>Float|Int) + )\b + + jsonFunctions: | + (?> parse + | stringify + )\b + + mathFunctions: | + (?> abs + | acosh? + | asinh? + | atan(?>2|h)? + | cbrt + | ceil + | clz32 + | cosh? + | exp + | exp(?:m1)? + | floor + | fround + | hypot + | imul + | log(?>10|1p|2)? + | max + | min + | pow + | random + | round + | sign + | sinh? + | sqrt + | tanh? + | trunc + )\b + + objectFunctions: | + (?> assign + | create + | definePropert(?>ies|y) + | freeze + | getOwnProperty(?>Descriptors?|Names|Symbols) + | getPrototypeOf + | is(?>Extensible|Frozen|Sealed)? + | keys + | preventExtensions + | seal + | setPrototypeOf + )\b + + stringFunctions: | + (?> from(?>CharCode|CodePoint) + | char(?>At|CodeAt) + | codePointAt + | concat + | endsWith + | includes + | indexOf + | lastIndexOf + | localeCompare + | match + | normalize + | pad(?>End|start) + | repeat + | replace + | search + | slice + | split + | substr(?:ing)? + | to + (?> Locale(?>Lower|Upper) + | LowerCase + | String + | UpperCase + ) + | trim(?>Left|Right)? + | valueOf + | raw + )\b + + symbolFunctions: | + (?> for + | KeyFor + )\b + +contexts: + main: + - include: console + # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects + - include: constants + - include: variables + - include: functions + - include: function-properties + - include: import-properties + - include: fundamental-objects + - include: numbers-and-dates + - include: text-processing + - include: indexed-collections + - include: keyed-collections + - include: structured-data + - include: control-abstraction-objects + - include: reflection + - include: internationalization + - include: web-assembly + + array-property-or-function: + # Function call. + - match: (?x){{arrayFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{arrayFunctions}} + scope: support.function.js.fjsx15 + pop: true + - include: other-property-or-function + + arguments: + - include: ~/js/function-call/arguments + + console: + - match: (console)\s*(\.) + captures: + 1: support.type.object.console.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: console-property-or-function + + console-property-or-function: + # error + - match: error(?=\s*\() + scope: support.function.console.error.js.fjsx15 + set: [ + console-error-meta-scope, + arguments + ] + - match: error\b + scope: support.function.console.error.js.fjsx15 + pop: true + # info + - match: info(?=\s*\() + scope: support.function.console.info.js.fjsx15 + set: [ + console-info-meta-scope, + arguments + ] + - match: info\b + scope: support.function.console.info.js.fjsx15 + pop: true + # log + - match: log(?=\s*\() + scope: support.function.console.log.js.fjsx15 + set: [ + console-log-meta-scope, + arguments + ] + - match: log\b + scope: support.function.console.log.js.fjsx15 + pop: true + # warn + - match: warn(?=\s*\() + scope: support.function.console.warn.js.fjsx15 + set: [ + console-warn-meta-scope, + arguments + ] + - match: warn\b + scope: support.function.console.warn.js.fjsx15 + pop: true + - include: other-property-or-function + + console-error-meta-scope: + - meta_scope: meta.function-call.console.error.js.fjsx15 + - include: pop-now + + console-info-meta-scope: + - meta_scope: meta.function-call.console.info.js.fjsx15 + - include: pop-now + + console-log-meta-scope: + - meta_scope: meta.function-call.console.log.js.fjsx15 + - include: pop-now + + console-warn-meta-scope: + - meta_scope: meta.function-call.console.warn.js.fjsx15 + - include: pop-now + + constants: + - match: | + (?x) + (?> (false) + | (Infinity) + | (NaN) + | (null) + | (true) + | (undefined) + )\b + captures: + 1: constant.language.boolean.false.js.fjsx15 + 2: constant.language.infinity.js.fjsx15 + 3: constant.language.nan.js.fjsx15 + 4: constant.language.null.js.fjsx15 + 5: constant.language.boolean.true.js.fjsx15 + 6: constant.language.undefined.js.fjsx15 + pop: true + + control-abstraction-objects: + - match: | + (?x) + (?> Generator(?:Function)? + | Promise + )\b + scope: support.type.object.js.fjsx15 + pop: true + + date-property-or-function: + # Function call. + - match: (?x){{dateFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{dateFunctions}} + scope: support.function.js.fjsx15 + pop: true + - include: other-property-or-function + + else-pop: + - match: (?=\S) + pop: true + + function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - include: pop-now + + functions: + # Function call. + - match: (?x){{globalFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{globalFunctions}} + scope: support.function.js.fjsx15 + pop: true + + fundamental-objects: + - match: (Object)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: object-property-or-function + - match: (Symbol)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: symbol-property-or-function + - match: | + (?x) + (?> Boolean + | Error + | EvalError + | Function + | InternalError + | Object + | RangeError + | ReferenceError + | Symbol + | SyntaxError + | TypeError + | URIError + )\b + scope: support.type.object.js.fjsx15 + pop: true + + function-properties: + - match: | + (?x) + (function) + \s*(\.) + \s*(sent) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.variable.js.fsjx15 + pop: true + + import-properties: + - match: | + (?x) + (import) + \s*(\.) + \s*(meta) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.variable.js.fsjx15 + pop: true + + indexed-collections: + - match: (Array)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: array-property-or-function + - match: | + (?x) + (?> Array + | Float(?>32|64)Array + | Int(?>8|16|32)Array + | Uint(?>8|16|32)Array + | Uint8ClampedArray + )\b + scope: support.type.object.js.fjsx15 + pop: true + + internationalization: + - match: | + (?x) + (Intl)\b + (?: + \s*(\.)\s* + ((?> Collator + | DateTimeFormat + | NumberFormat + ))\b + )? + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.type.js.fsjx15 + pop: true + + json-property-or-function: + # Function call. + - match: (?x){{jsonFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{jsonFunctions}} + scope: support.function.js.fjsx15 + pop: true + - include: other-property-or-function + + keyed-collections: + - match: | + (?x) + (?> Map + | Set + | Weak(?>Map|Set) + )\b + scope: support.type.object.js.fjsx15 + pop: true + + math-property-or-function: + # Function call. + - match: (?x){{mathFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{mathFunctions}} + scope: support.function.js.fjsx15 + pop: true + # Constants. + - match: | + (?x) + (?> E + | LN(?>10|2) + | LOG(?>10E|2E) + | PI + | SQRT(?>1_2|2) + )\b + scope: support.constant.js.fjsx15 + pop: true + - include: other-property-or-function + + numbers-and-dates: + - match: (Date)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: date-property-or-function + - match: (Math)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: math-property-or-function + - match: | + (?x) + (?> Date + | Math + | Number + )\b + scope: support.type.object.js.fjsx15 + pop: true + + object-property-or-function: + # Function call. + - match: (?x){{objectFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{objectFunctions}} + scope: support.function.js.fjsx15 + pop: true + - include: other-property-or-function + + other-property-or-function: + - include: ~/js/operator/other#other-property-or-function + + reflection: + - match: | + (?x) + (?> Proxy + | Reflect + )\b + scope: support.type.object.js.fjsx15 + pop: true + + string-property-or-function: + # Function call. + - match: (?x){{stringFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{stringFunctions}} + scope: support.function.js.fjsx15 + pop: true + - include: other-property-or-function + + structured-data: + - match: (JSON)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: json-property-or-function + - match: | + (?x) + (?> ArrayBuffer + | DataView + | JSON + )\b + scope: support.type.object.js.fjsx15 + pop: true + + symbol-property-or-function: + # Function call. + - match: (?x){{symbolFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{symbolFunctions}} + scope: support.function.js.fjsx15 + pop: true + - include: other-property-or-function + + text-processing: + - match: (String)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: string-property-or-function + - match: | + (?x) + (?> RegExp + | String + )\b + scope: support.type.object.js.fjsx15 + pop: true + + pop-now: + - match: "" + pop: true + + variables: + # super() + - match: super(?=\s*\() + scope: variable.language.super.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Other variables. + - match: prototype\b + scope: variable.language.prototype.js.fjsx15 + pop: true + - match: super\b + scope: variable.language.super.js.fjsx15 + pop: true + - match: this\b + scope: variable.language.this.js.fjsx15 + pop: true + + web-assembly: + - match: | + (?x) + (WebAssembly)\b + (?: + \s*(\.)\s* + ((?> CompileError + | Instance + | LinkError + | Memory + | Module + | RuntimeError + | Table + ))\b + )? + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.type.js.fsjx15 + pop: true diff --git a/integration/syntaxes/src/js/decorator.yml b/integration/syntaxes/src/js/decorator.yml new file mode 100644 index 00000000..2fd8374b --- /dev/null +++ b/integration/syntaxes/src/js/decorator.yml @@ -0,0 +1,58 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + decoratorIdentifier: | + [$._[:alpha:]] + [$._[:alnum:]]* + +contexts: + main: + - match: (?xi)(@)(?={{decoratorIdentifier}}) + scope: punctuation.definition.annotation.js.fjsx15 + set: [ + meta, + decorator-identifier + ] + + arguments: + - include: ~/js/expression + + decorator-identifier: + # With arguments. + - match: (?xi){{decoratorIdentifier}}(?=\s*\() + scope: variable.annotation.js.fjsx15 + set: [ + possible-chain, + arguments + ] + # Without arguments. + - match: (?xi){{decoratorIdentifier}} + scope: variable.annotation.js.fjsx15 + set: possible-chain + + meta: + - meta_scope: meta.annotation.js.fjsx15 + - match: "" + pop: true + + # The decorator might be followed by a chain of function calls and we want to + # to highlight them as decorators too. + possible-chain: + - match: \. + scope: punctuation.definition.decorator.chain.js.fjsx15 + set: decorator-identifier + - match: (?=\S) + pop: true diff --git a/integration/syntaxes/src/js/destructuring.yml b/integration/syntaxes/src/js/destructuring.yml new file mode 100644 index 00000000..0363da23 --- /dev/null +++ b/integration/syntaxes/src/js/destructuring.yml @@ -0,0 +1,56 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + +contexts: + main: + # Array. + - match: | + (?x) + (?= + (\[ + (?> {{string}} + | \g<-1> + | [^\[\]] + )* + \]) + \s*= + ) + set: destructuring-array + # Object. + - match: | + (?x) + (?= + (\{ + (?> {{string}} + | \g<-1> + | [^\{\}] + )* + \}) + \s*= + ) + set: destructuring-object + + destructuring-array: + - include: ~/js/destructuring/array + + destructuring-object: + - include: ~/js/destructuring/object diff --git a/integration/syntaxes/src/js/destructuring/array.yml b/integration/syntaxes/src/js/destructuring/array.yml new file mode 100644 index 00000000..eacbfc5d --- /dev/null +++ b/integration/syntaxes/src/js/destructuring/array.yml @@ -0,0 +1,52 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \[ + scope: punctuation.section.brackets.begin.js.fjsx15 + set: [ + delimiters, + optional-expression, + optional-type, + optional-variable + ] + + delimiters: + - meta_scope: meta.binding.destructuring.sequence.js.fjsx15 + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: [ + optional-expression, + optional-type, + optional-variable + ] + - match: \] + scope: punctuation.section.brackets.end.js.fjsx15 + pop: true + + optional-expression: + - include: ~/js/optional-expression + + optional-type: + - include: ~/facebook-flow/optional-associated-type + + optional-variable: + - match: (?=[,)\]}]) + pop: true + - include: ~/js/operator/rest.no-pop + - include: ~/js/destructuring/array + - include: ~/js/destructuring/object + - include: ~/js/variable-declaration#variable-or-constant diff --git a/integration/syntaxes/src/js/destructuring/object/index.yml b/integration/syntaxes/src/js/destructuring/object/index.yml new file mode 100644 index 00000000..a801979b --- /dev/null +++ b/integration/syntaxes/src/js/destructuring/object/index.yml @@ -0,0 +1,51 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: delimiters + + comment-no-pop: + - include: ~/js/comment.no-pop + + default-value: + - include: ~/js/optional-expression + + delimiters: + - meta_scope: meta.binding.destructuring.mapping.js.fjsx15 + - include: comment-no-pop + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + pop: true + # Rest operator. + - include: ~/js/operator/rest.no-pop + # Default value. + - match: (?==) + push: default-value + # Property. + - match: (?=\S) + set: property-or-variable + + property-or-variable: + - include: comment-no-pop + - match: (?=[,)\]}]) + pop: true + - include: ~/js/destructuring/object/property + - include: ~/js/destructuring/array + - include: ~/js/destructuring/object diff --git a/integration/syntaxes/src/js/destructuring/object/property.yml b/integration/syntaxes/src/js/destructuring/object/property.yml new file mode 100644 index 00000000..98f56bf7 --- /dev/null +++ b/integration/syntaxes/src/js/destructuring/object/property.yml @@ -0,0 +1,107 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + # String property name. + - match: (?=(?>'|"|`)) + set: [ + optional-bind, + meta-key, + string + ] + # Computed property name. + - match: \[ + scope: punctuation.section.brackets.begin.js.fjsx15 + set: [ + optional-bind, + meta-computed-key, + computed-property-end, + optional-expression + ] + # Normal property with an bind. + - match: (?xi)({{commonIdentifier}})(?=\s*:) + scope: string.unquoted.js.fjsx15 + set: [ + optional-bind, + meta-key + ] + # Simple variable or constant. + - match: "" + set: [ object-destructuring-delimiters, variable-or-constant ] + + bind: + - meta_scope: meta.binding.destructuring.mapping.js.fjsx15 + - include: comment-no-pop + - match: (?=\)) + pop: true + - include: ~/js/destructuring/array + - include: ~/js/destructuring/object + - include: ~/js/variable-declaration#variable-or-constant + + comment-no-pop: + - include: ~/js/comment.no-pop + + computed-property-end: + - match: \] + scope: punctuation.section.brackets.end.js.fjsx15 + pop: true + + meta-computed-key: + - meta_scope: meta.binding.destructuring.mapping.key.computed.js.fjsx15 + - include: pop-now + + meta-destructuring: + - meta_scope: meta.binding.destructuring.mapping.js.fjsx15 + - include: pop-now + + meta-key: + # The object literal meta scope is necessary to allow color schemes to make + # object destructuring keys similar to object literals. + - meta_scope: >- + meta.binding.destructuring.mapping.key.js.fjsx15 + meta.object-literal.key.js.fjsx15 + - include: pop-now + + object-destructuring-delimiters: + - meta_scope: meta.binding.destructuring.mapping.js.fjsx15 + - include: ~/js/destructuring/object#delimiters + + optional-bind: + - match: ":" + scope: punctuation.binding.js.fjsx15 + push: bind + - match: (?=\S) + set: object-destructuring-delimiters + + optional-expression: + - include: ~/js/optional-expression + + pop-now: + - match: "" + pop: true + + string: + - include: ~/js/literal/string/double-quoted + - include: ~/js/literal/string/single-quoted + - include: ~/js/literal/string/template + + variable-or-constant: + - include: ~/js/variable-declaration#variable-or-constant diff --git a/integration/syntaxes/src/js/export.yml b/integration/syntaxes/src/js/export.yml new file mode 100644 index 00000000..7b422351 --- /dev/null +++ b/integration/syntaxes/src/js/export.yml @@ -0,0 +1,113 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: export\b + scope: keyword.control.import-export.export.js.fjsx15 + set: possible-statement-or-expression + + alias: + - match: as\b + scope: keyword.control.import-export.as.js.fjsx15 + set: alias-name + + alias-name: + - match: (?xi){{commonIdentifier}} + scope: variable.other.readwrite.js.fjsx15 + pop: true + + close-block: + - include: ~/js/import#close-block + + delimiter: + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: optional-target + # From. + - include: origin + - include: else-pop + + else-pop: + - match: (?=\S) + pop: true + + expression: + - include: ~/js/expression + + optional-alias: + - match: (?=as\b) + set: alias + - include: else-pop + + optional-target: + - match: (?=(?>[,}]|from)) + pop: true + # Type. + - include: ~/facebook-flow/type-export + # Aliased all. + - match: \*(?=\s*as\b) + scope: keyword.control.import-export.star.js.fjsx15 + set: alias + # All. + - match: \* + scope: keyword.control.import-export.star.js.fjsx15 + pop: true + # Multiple targets. + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: [ + close-block, + delimiter, + optional-target + ] + # default. + - match: default\b + scope: keyword.control.import-export.default.js.fjsx15 + set: optional-alias + # Aliased. + - match: (?xi){{commonIdentifier}}(?=\s+as\b) + scope: variable.other.readwrite.js.fjsx15 + set: alias + # Simple. + - match: (?xi){{commonIdentifier}} + scope: variable.other.readwrite.js.fjsx15 + pop: true + + origin: + - include: ~/js/import#origin + + possible-statement-or-expression: + - match: (?=(?>[*{]|type(?:of)?)) + set: [ delimiter, optional-target ] + # Default from. + - match: default\b(?=\s+from\b) + scope: keyword.control.import-export.default.js.fjsx15 + set: origin + # Default statements and expressions. + - match: default\b + scope: keyword.control.import-export.default.js.fjsx15 + set: expression + # Other statements. + - include: ~/js/statement + # Renamed default. + - match: (?xi){{commonIdentifier}} + scope: variable.other.readwrite.js.fjsx15 + set: origin diff --git a/integration/syntaxes/src/js/expression.yml b/integration/syntaxes/src/js/expression.yml new file mode 100644 index 00000000..d8ab487f --- /dev/null +++ b/integration/syntaxes/src/js/expression.yml @@ -0,0 +1,155 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: comment-no-pop + - include: shared-main + # Start of the expression. + - match: (?=\S) + set: [ optional-tail, head ] + + close-group: + - match: \) + scope: punctuation.section.group.end.js.fjsx15 + pop: true + + comma: + - include: ~/js/operator/comma + + comment-no-pop: + - include: ~/js/comment.no-pop + + do-expression: + - match: do\b + scope: keyword.control.do-expression.js.fjsx15 + set: [ meta-do-expression, do-expression-body-begin ] + + do-expression-body-begin: + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: do-expression-body-end + + do-expression-body-end: + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + pop: true + - match: (?=\S) + push: statement-or-expression + + function-call: + - include: comment-no-pop + - include: main + + function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - match: "" + pop: true + + globals: + - include: ~/js/node-js + - include: ~/js/react-js + - include: ~/js/jest + - include: ~/js/web + - include: ~/js/core + + head: + - include: comment-no-pop + - include: do-expression + - include: globals + - include: ~/js/jsx1 + - include: ~/js/literal + - include: ~/js/class + - include: ~/js/function-expression + - include: ~/js/function-call + - include: ~/js/variable#function-assigned-to-variable + - include: ~/js/constant + - include: ~/js/variable + # Open new expression group. + - match: \( + scope: punctuation.section.group.begin.js.fjsx15 + set: open-group + + meta-do-expression: + - meta_scope: meta.do-expression.js.fjsx15 + - match: "" + pop: true + + open-group: + - meta_scope: meta.group.js.fjsx15 + - include: comment-no-pop + # Close the current expression group. + - include: close-group + # Type cast. + - match: (?=:) + set: [ close-group, type-cast ] + # Other expressions. + - match: (?=\S) + push: + - include: shared-main + # Start of the expression. + - match: "" + set: [ optional-tail, head ] + + optional-tail: + - include: comment-no-pop + # Function call. + - match: (?=\() + push: [ + function-call-meta-scope, + function-call + ] + # Property access. + - match: (?=\[) + push: property-access + # Other operators. At this point, operators will have a higher priority than + # regex literals. + - include: ~/js/operator + # Anything else not expected. + - match: (?=\S) + pop: true + + property-access: + - include: comment-no-pop + - include: ~/js/property-access + + regex-literal: + - include: ~/js/literal/string/regex + + shared-main: + - include: comma + # At this stage, regex literals will have a higher priority than operators. + - match: (?=/) + set: [ optional-tail, regex-literal ] + # Arrow functions need to be detected before expression groups. + - include: ~/js/arrow-function + # At this point is possible to predict JSX tags before operators because + # there’s no left operand for a "<" operator to be valid. + - include: ~/js/jsx1-early + # Prevent floating point being highlighted as a dot operator followed by an + # integer. + - match: (?=\.\d) + set: + - include: ~/js/literal/number + # Detect operators as soon as possible. + - include: ~/js/operator + + statement-or-expression: + - include: comment-no-pop + - include: ~/js/statement + - include: ~/js/expression + + type-cast: + - include: ~/facebook-flow/cast diff --git a/integration/syntaxes/src/js/function-call/arguments.yml b/integration/syntaxes/src/js/function-call/arguments.yml new file mode 100644 index 00000000..8e3ede16 --- /dev/null +++ b/integration/syntaxes/src/js/function-call/arguments.yml @@ -0,0 +1,37 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \( + scope: punctuation.section.group.begin.js.fjsx15 + set: delimiter + + comment-no-pop: + - include: ~/js/comment.no-pop + + delimiter: + - meta_scope: meta.group.js.fjsx15 + - include: comment-no-pop + - match: \) + scope: punctuation.section.group.end.js.fjsx15 + pop: true + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + - match: (?=\S) + push: expression + + expression: + - include: ~/js/expression diff --git a/integration/syntaxes/src/js/function-call/index.yml b/integration/syntaxes/src/js/function-call/index.yml new file mode 100644 index 00000000..712df537 --- /dev/null +++ b/integration/syntaxes/src/js/function-call/index.yml @@ -0,0 +1,100 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + comment: /\*.*?\*/ + + genericArguments: | + (< + (?> {{string}} + | \g<-1> + | [^<>] + )* + >) + + string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + +contexts: + main: + # Generic function call. + - match: | + (?xi) + (?= + (?:\#\s*)? + {{commonIdentifier}} + \s*{{genericArguments}} + \s*(\?\.)? + \s*\( + ) + set: [ + meta, + arguments, + generic-arguments, + identifier, + optional-modifier + ] + # Simple function call. + - match: | + (?xi) + (?= + (?:\#\s*)? + {{commonIdentifier}} + (?:\s*{{comment}})? + \s*(\?\.)? + \s*\( + ) + set: [ + meta, + arguments, + identifier, + optional-modifier + ] + + arguments: + - include: ~/js/comment.no-pop + - include: ~/js/function-call/arguments + + else-pop: + - match: (?=\S) + pop: true + + expression: + - include: ~/js/expression + + identifier: + - match: (?xi){{commonIdentifier}} + scope: variable.function.js.fjsx15 + pop: true + + generic-arguments: + - include: ~/facebook-flow/generic/arguments + + meta: + - meta_scope: meta.function-call.js.fjsx15 + - match: "" + pop: true + + optional-modifier: + - match: \# + scope: storage.modifier.js.fjsx15 + - include: else-pop diff --git a/integration/syntaxes/src/js/function-expression.yml b/integration/syntaxes/src/js/function-expression.yml new file mode 100644 index 00000000..4752e4d5 --- /dev/null +++ b/integration/syntaxes/src/js/function-expression.yml @@ -0,0 +1,77 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - include: ~/js/core#function-properties + - match: | + (?x) + (?= + (?:async\s+)? + function\b + ) + set: [ + declaration, + keyword + ] + + body: + - include: ~/js/function/body + + comment-no-pop: + - include: ~/js/comment.no-pop + + declaration: + - meta_scope: meta.function.js.fjsx15 + - include: comment-no-pop + # Body. + - match: (?=\{) + set: body + # Generic parameters. + - match: (?=<) + push: generic-arguments + # Parameters. + - match: (?=\() + push: parameters + # Identifier. + - match: | + (?xi) + (?:(\*)\s*)? + (?:({{commonIdentifier}}))? + captures: + 1: storage.modifier.js.fjsx15 + 2: entity.name.function.js.fjsx15 + - include: else-pop + + else-pop: + - match: (?=\S) + pop: true + + keyword: + - include: ~/js/async.no-pop + - match: function\b + scope: storage.type.function.js.fjsx15 + pop: true + + generic-arguments: + - include: ~/facebook-flow/generic/arguments + + parameters: + - include: ~/js/function/parameters diff --git a/integration/syntaxes/src/js/function/body.yml b/integration/syntaxes/src/js/function/body.yml new file mode 100644 index 00000000..c2079bf8 --- /dev/null +++ b/integration/syntaxes/src/js/function/body.yml @@ -0,0 +1,36 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: [ + close-body, + optional-statement-or-expression + ] + + close-body: + - meta_scope: >- + meta.function.js.fjsx15 + meta.block.js.fjsx15 + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + pop: true + - match: "" + push: optional-statement-or-expression + + optional-statement-or-expression: + - include: ~/js/optional-statement-or-expression diff --git a/integration/syntaxes/src/js/function/index.yml b/integration/syntaxes/src/js/function/index.yml new file mode 100644 index 00000000..dcc04a1b --- /dev/null +++ b/integration/syntaxes/src/js/function/index.yml @@ -0,0 +1,93 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - include: ~/js/core#function-properties + - match: | + (?x) + (?= + (?:async\s+)? + function\b + ) + set: [ + declaration, + keyword + ] + + body: + - include: ~/js/function/body + + comment-no-pop: + - include: ~/js/comment.no-pop + + declaration: + - meta_scope: >- + meta.declaration.function.js.fjsx15 + meta.function.js.fjsx15 + - include: comment-no-pop + # Body. + - match: (?=\{) + set: body + # Generic parameters. + - match: (?=<) + push: generic-arguments + # Parameters. + - match: (?=\() + set: [ + optional-body, + meta-declaration-scope, + parameters + ] + # Identifier. + - match: | + (?xi) + (?:(\*)\s*)? + (?:({{commonIdentifier}}))? + captures: + 1: storage.modifier.js.fjsx15 + 2: entity.name.function.js.fjsx15 + - include: else-pop + + else-pop: + - match: (?=\S) + pop: true + + generic-arguments: + - include: ~/facebook-flow/generic/arguments + + keyword: + - include: ~/js/async.no-pop + - match: function\b + scope: storage.type.function.js.fjsx15 + pop: true + + meta-declaration-scope: + - meta_scope: meta.declaration.function.js.fjsx15 + - match: "" + pop: true + + optional-body: + - match: (?=\{) + set: body + - include: else-pop + + parameters: + - include: ~/js/function/parameters diff --git a/integration/syntaxes/src/js/function/parameter/destructuring/array.yml b/integration/syntaxes/src/js/function/parameter/destructuring/array.yml new file mode 100644 index 00000000..79ecdcbd --- /dev/null +++ b/integration/syntaxes/src/js/function/parameter/destructuring/array.yml @@ -0,0 +1,54 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \[ + scope: punctuation.section.brackets.begin.js.fjsx15 + set: [ meta, delimiters, optional-parameter ] + + comment-no-pop: + - include: ~/js/comment.no-pop + + delimiters: + - include: comment-no-pop + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: optional-parameter + - match: \] + scope: punctuation.section.brackets.end.js.fjsx15 + set: optional-type-and-default-value + + meta: + - meta_scope: >- + meta.binding.destructuring.sequence.js.fjsx15 + meta.block.js.fjsx15 + - match: "" + pop: true + + optional-parameter: + - include: comment-no-pop + - match: (?=[,)\]}]) + pop: true + - include: ~/js/operator/rest.no-pop + - include: ~/js/function/parameter/destructuring/array + - include: ~/js/function/parameter/destructuring/object + - include: ~/js/function/parameter/simple + + optional-type-and-default-value: + - match: (?=,) + pop: true + - include: ~/facebook-flow/associated-type.no-pop + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/function/parameter/destructuring/object/index.yml b/integration/syntaxes/src/js/function/parameter/destructuring/object/index.yml new file mode 100644 index 00000000..8af65f59 --- /dev/null +++ b/integration/syntaxes/src/js/function/parameter/destructuring/object/index.yml @@ -0,0 +1,55 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: [ meta, delimiters, optional-parameter ] + + comment-no-pop: + - include: ~/js/comment.no-pop + + delimiters: + - include: comment-no-pop + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: optional-parameter + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + set: optional-type-and-default-value + + meta: + - meta_scope: >- + meta.binding.destructuring.mapping.js.fjsx15 + meta.block.js.fjsx15 + - match: "" + pop: true + + optional-parameter: + - include: comment-no-pop + - match: (?=[,)\]}]) + pop: true + - include: ~/js/operator/rest.no-pop + - include: ~/js/function/parameter/destructuring/object/property + - include: ~/js/function/parameter/destructuring/array + - include: ~/js/function/parameter/destructuring/object + - include: ~/js/function/parameter/simple + + optional-type-and-default-value: + - match: (?=,) + pop: true + - include: ~/facebook-flow/associated-type.no-pop + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/function/parameter/destructuring/object/property.yml b/integration/syntaxes/src/js/function/parameter/destructuring/object/property.yml new file mode 100644 index 00000000..d2f51afc --- /dev/null +++ b/integration/syntaxes/src/js/function/parameter/destructuring/object/property.yml @@ -0,0 +1,71 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + # String property name. + - match: (?=(?>'|"|`)) + set: [ + optional-alias, + string + ] + # Computed property name. + - match: \[ + scope: punctuation.definition.object.computed-property.begin.js.fjsx15 + set: [ + optional-alias, + computed-property-end, + optional-expression + ] + # Normal property with an alias. + - match: (?xi){{commonIdentifier}}(?=\s*:) + scope: meta.binding.destructuring.mapping.key.js.fjsx15 + set: optional-alias + + comment-no-pop: + - include: ~/js/comment.no-pop + + computed-property-end: + - match: \] + scope: punctuation.definition.object.computed-property.end.js.fjsx15 + pop: true + + optional-alias: + - match: ":" + scope: punctuation.binding.js.fjsx15 + set: optional-parameter + - match: (?=\S) + pop: true + + optional-parameter: + - include: comment-no-pop + - match: (?=\)) + pop: true + - include: ~/js/function/parameter/destructuring/array + - include: ~/js/function/parameter/destructuring/object + - include: ~/js/function/parameter/simple + + optional-expression: + - include: ~/js/optional-expression + + string: + - include: ~/js/literal/string/double-quoted + - include: ~/js/literal/string/single-quoted + - include: ~/js/literal/string/template diff --git a/integration/syntaxes/src/js/function/parameter/simple.no-pop.yml b/integration/syntaxes/src/js/function/parameter/simple.no-pop.yml new file mode 100644 index 00000000..af85c493 --- /dev/null +++ b/integration/syntaxes/src/js/function/parameter/simple.no-pop.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: | + (?xi) + (?= + (?:\.{3})? + {{commonIdentifier}} + ) + push: parameter + + parameter: + - include: ~/js/function/parameter/simple diff --git a/integration/syntaxes/src/js/function/parameter/simple.yml b/integration/syntaxes/src/js/function/parameter/simple.yml new file mode 100644 index 00000000..cf4cd431 --- /dev/null +++ b/integration/syntaxes/src/js/function/parameter/simple.yml @@ -0,0 +1,136 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + genericArguments: | + (< + (?> {{string}} + | \g<-1> + | [^<>] + )* + >) + + parameters: | + (\( + (?> {{string}} + | \g<-1> + | [^()] + )* + \)) + + flowOperators: | + (?> &(?!\s*&) + | \|(?!\s*\|) + ) + + string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + + flowObject: | + (\{ + (?> {{string}} + | \g<-1> + | [^{}] + )* + }) + + simpleFlowType: | + (?> {{string}} + | {{flowObject}} + | [$_[:alpha:]][$_[:alnum:].]* + ) + (?:\s*{{genericArguments}})? + (?:\s*\[\s*\])? + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> (?:\?\s*){{simpleFlowType}} + | \g<-1> + ) + ) + + complexType: | + (?:\?\s*)? + ( + (?> {{simpleFlowType}} + | {{flowFunction}} + | \g<-1> + ) + ) + + multipleTypes: | + ( + (?> \s*{{flowOperators}} + | \s*{{complexType}} + | \g<-1> + )+ + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | \:\s*{{multipleTypes}} + ) + +contexts: + main: + # With default value. + - match: | + (?xi) + {{commonIdentifier}} + (?= + \s*\?? + \s*{{type}}? + (?:\s*/\*.*?\*/)? + \s*=(?!\s*>) + ) + scope: variable.parameter.function.js.fjsx15 + set: [ + optional-default-value, + optional-modifier-and-type + ] + # Normal parameter. + - match: (?xi){{commonIdentifier}} + scope: variable.parameter.function.js.fjsx15 + set: optional-modifier-and-type + + comment-no-pop: + - include: ~/js/comment.no-pop + + expression: + - include: ~/js/expression + + optional-default-value: + - meta_scope: meta.function.parameter.optional.js.fjsx15 + - include: comment-no-pop + - match: (?=(?>[,;:)\]}]|=>)) + pop: true + - match: (?==) + push: expression + + optional-modifier-and-type: + - include: comment-no-pop + - include: ~/facebook-flow/optional-modifier.no-pop + - include: ~/facebook-flow/optional-associated-type diff --git a/integration/syntaxes/src/js/function/parameters.no-pop.yml b/integration/syntaxes/src/js/function/parameters.no-pop.yml new file mode 100644 index 00000000..d07b088f --- /dev/null +++ b/integration/syntaxes/src/js/function/parameters.no-pop.yml @@ -0,0 +1,22 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?=\() + push: parameters + + parameters: + - include: ~/js/function/parameters diff --git a/integration/syntaxes/src/js/function/parameters.yml b/integration/syntaxes/src/js/function/parameters.yml new file mode 100644 index 00000000..297d5896 --- /dev/null +++ b/integration/syntaxes/src/js/function/parameters.yml @@ -0,0 +1,48 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \( + scope: punctuation.section.group.begin.js.fjsx15 + set: delimiters + + comment-no-pop: + - include: ~/js/comment.no-pop + + delimiters: + - meta_scope: >- + meta.function.parameters.js.fjsx15 + meta.group.js.fjsx15 + - include: comment-no-pop + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + - match: \) + scope: punctuation.section.group.end.js.fjsx15 + set: optional-return-type + # Rest. + - include: ~/js/operator/rest.no-pop + # Actual parameter. + - match: (?=\S) + push: parameter + + optional-return-type: + - include: ~/facebook-flow/optional-associated-type + + parameter: + - include: comment-no-pop + - include: ~/js/function/parameter/destructuring/array + - include: ~/js/function/parameter/destructuring/object + - include: ~/js/function/parameter/simple diff --git a/integration/syntaxes/src/js/import.yml b/integration/syntaxes/src/js/import.yml new file mode 100644 index 00000000..ecba509a --- /dev/null +++ b/integration/syntaxes/src/js/import.yml @@ -0,0 +1,132 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - include: ~/js/core#import-properties + # Dynamic import. + - match: import\b(?=\s*\() + scope: support.function.import.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Import the entire module. + - match: (?x)import\b(?=\s*(?>"|'|`)) + scope: keyword.control.import-export.import.js.fjsx15 + set: origin-path + # Other. + - match: (?x)import\b + scope: keyword.control.import-export.import.js.fjsx15 + set: [ + delimiter, + optional-target + ] + + alias: + - match: as\b + scope: keyword.control.import-export.as.js.fjsx15 + set: alias-name + + alias-name: + - match: (?xi){{commonIdentifier}} + scope: variable.other.readwrite.js.fjsx15 + pop: true + + arguments: + - include: ~/js/expression + + block-optional-target: + - include: comment-no-pop + - match: (?=(?>[,}])) + pop: true + - include: shared-optional-target + + close-block: + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + pop: true + + comment-no-pop: + - include: ~/js/comment.no-pop + + delimiter: + - include: comment-no-pop + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: optional-target + # From. + - include: origin + - include: else-pop + + else-pop: + - match: (?=\S) + pop: true + + function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - match: "" + pop: true + + origin: + - include: comment-no-pop + - match: from\b + scope: keyword.control.import-export.origin.js.fjsx15 + set: origin-path + + origin-path: + - include: comment-no-pop + - include: ~/js/literal/string/double-quoted + - include: ~/js/literal/string/single-quoted + - include: ~/js/literal/string/template + + optional-target: + - include: comment-no-pop + - match: (?=(?>[,}]|from)) + pop: true + - include: shared-optional-target + + shared-optional-target: + # Type. + - include: ~/facebook-flow/type-import + # Aliased All. + - match: \*(?=\s*as) + scope: keyword.control.import-export.star.js.fjsx15 + set: alias + # All. + - match: \* + scope: keyword.control.import-export.star.js.fjsx15 + pop: true + # Multiple targets. + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: [ + close-block, + delimiter, + block-optional-target + ] + # Aliased. + - match: (?xi){{commonIdentifier}}(?=\s+as) + scope: variable.other.readwrite.js.fjsx15 + set: alias + # Simple. + - match: (?xi){{commonIdentifier}} + scope: variable.other.readwrite.js.fjsx15 + pop: true diff --git a/integration/syntaxes/src/js/index.yml b/integration/syntaxes/src/js/index.yml new file mode 100644 index 00000000..016a06d2 --- /dev/null +++ b/integration/syntaxes/src/js/index.yml @@ -0,0 +1,37 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +name: JavaScript (Naomi) +scope: source.js + +file_extensions: + - js + - jsx + - mjs + +contexts: + main: + - match: "" + push: [naomi, entry] + + entry: + - include: ~/js/comment + - include: ~/js/statement + - include: ~/js/expression + + naomi: + - meta_scope: naomi + - match: "" + pop: true diff --git a/integration/syntaxes/src/js/jest.yml b/integration/syntaxes/src/js/jest.yml new file mode 100644 index 00000000..9091034e --- /dev/null +++ b/integration/syntaxes/src/js/jest.yml @@ -0,0 +1,190 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # jest. + - match: (jest)\s*(\.) + captures: + 1: support.type.object.jest.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: jest-property-or-function + # afterAll/Each, beforeAll/Each, describe, it, test. + - match: | + (?x) + (?> after(?>All|Each) + | before(?>All|Each) + | describe + | it + | test + )\b + (?= + (?> \.(?>each|only|skip) + | \s*\( + ) + ) + scope: support.function.jest.fn.js.fjsx15 + set: [ + meta-scope, + arguments, + optional-each-skip-only + ] + # expect + - match: expect\b + scope: support.function.jest.js.fjsx15 + set: expect-chain + + accessor-no-pop: + - match: \. + scope: punctuation.accessor.js.fjsx15 + + arguments: + - include: ~/js/function-call/arguments + + else-pop: + - match: (?=\S) + pop: true + + expect-chain: + - include: accessor-no-pop + # Expect arguments. + - match: (?=\s*\() + push: [ + meta-scope, + arguments + ] + # Other. + - match: (?>not|resolves|rejects)\b + scope: support.type.object.jest.matcher.other.js.fjsx15 + # Matchers. + - match: | + (?x) + to + (?> Be + (?> Called + | CloseTo + | Defined + | Falsy + | GreaterThan(?:OrEqual)? + | InstanceOf + | LessThan(?:OrEqual)? + | Null + | Truthy + | Undefined + )? + | Contain(?:Equal)? + | Equal + | Have + (?> Been + (?> Called(?>Times|With)? + | LastCalledWith + | NthCalledWith + ) + | LastReturnedWith + | NthReturnedWith + | Returned(?>Times|With)? + ) + | Have(?>Length|Property) + | Match(?:Object|(?:Inline)?Snapshot)? + | StrictEqual + | Throw(?:Error(?:Matching(?:Inline)?Snapshot)?)? + )\b + (?=\s*\() + scope: support.function.jest.matcher.fjsx15 + set: [ + matcher-meta-scope, + arguments + ] + # Other. + - match: | + (?x) + (?> addSnapshotSerializer + | any(?:thing)? + | array(?:Containing)? + | assertions + | extend + | hasAssertions + | objectContaining + | string(?>Containing|Matching) + )\b + (?=\s*\() + scope: support.function.jest.matcher.fjsx15 + set: [ + meta-scope, + arguments + ] + - include: else-pop + + jest-property-or-function: + - match: + - words: + - clearAllTimers + - disableAutomock + - enableAutomock + - fn + - isMockFunction + - genMockFromModule + - mock + - unmock + - doMock + - dontMock + - clearAllMocks + - resetAllMocks + - restoreAllMocks + - resetModules + - runAllTicks + - runAllTimers + - advanceTimersByTime + - runOnlyPendingTimers + - setMock + - setTimeout + - useFakeTimers + - useRealTimers + - spyOn + - (?=\s*\() + scope: support.function.jest.js.fjsx15 + set: [ + meta-scope, + arguments + ] + - include: else-pop + + matcher-meta-scope: + - meta_scope: meta.function-call.jest.matcher.js.fjsx15 + - include: pop-now + + meta-scope: + - meta_scope: meta.function-call.jest.js.fjsx15 + - include: pop-now + + optional-each-skip-only: + - include: accessor-no-pop + # each + - match: each\b + scope: support.function.jest.each.js.fjsx15 + pop: true + # only + - match: only\b + scope: support.function.jest.only.js.fjsx15 + pop: true + # skip + - match: skip\b + scope: support.function.jest.skip.js.fjsx15 + pop: true + - include: else-pop + + pop-now: + - match: "" + pop: true diff --git a/integration/syntaxes/src/js/jsx1-early.yml b/integration/syntaxes/src/js/jsx1-early.yml new file mode 100644 index 00000000..d9029373 --- /dev/null +++ b/integration/syntaxes/src/js/jsx1-early.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_.:[:alnum:]]* + +contexts: + main: + - match: (?xi)(?=<(?>\s*>|{{commonIdentifier}})) + set: [ meta, jsx ] + + jsx: + - include: ~/js/jsx1#jsx + + meta: + - clear_scopes: true + - meta_scope: >- + source.jsx + naomi + - match: "" + pop: true diff --git a/integration/syntaxes/src/js/jsx1.yml b/integration/syntaxes/src/js/jsx1.yml new file mode 100644 index 00000000..69626ebf --- /dev/null +++ b/integration/syntaxes/src/js/jsx1.yml @@ -0,0 +1,37 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_.:[:alnum:]]* + +contexts: + main: + - match: (?xi)(?=<(?>\s*>|{{commonIdentifier}})) + set: [ meta, jsx ] + + jsx: + - include: ~/facebook-jsx/fragment#with-js-fence + - include: ~/facebook-jsx/component#with-js-fence + - include: ~/facebook-jsx/element#with-js-fence + + meta: + - clear_scopes: true + - meta_scope: >- + source.jsx + naomi + - match: "" + pop: true diff --git a/integration/syntaxes/src/js/literal/array.yml b/integration/syntaxes/src/js/literal/array.yml new file mode 100644 index 00000000..7320128b --- /dev/null +++ b/integration/syntaxes/src/js/literal/array.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \[ + scope: punctuation.section.brackets.begin.js.fjsx15 + set: [ delimiters, optional-expression ] + + delimiters: + - meta_scope: meta.sequence.js.fjsx15 + - match: \] + scope: punctuation.section.brackets.end.js.fjsx15 + pop: true + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: optional-expression + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/literal/index.yml b/integration/syntaxes/src/js/literal/index.yml new file mode 100644 index 00000000..5d5c339b --- /dev/null +++ b/integration/syntaxes/src/js/literal/index.yml @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/js/literal/number + - include: ~/js/literal/array + - include: ~/js/literal/object + - include: ~/js/literal/string/double-quoted + - include: ~/js/literal/string/single-quoted + - include: ~/js/literal/string/styled-component + # - include: ~/js/literal/string/polymer-template + - include: ~/js/literal/string/template + - include: ~/js/literal/string/regex diff --git a/integration/syntaxes/src/js/literal/number.yml b/integration/syntaxes/src/js/literal/number.yml new file mode 100644 index 00000000..67839029 --- /dev/null +++ b/integration/syntaxes/src/js/literal/number.yml @@ -0,0 +1,73 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + literalDecimal: | + [0-9][0-9_]* + + literalFloat: | + (?> [0-9]*[.]{{literalDecimal}} + | {{literalDecimal}}[.][0-9]* + ) + + scientificNotation: | + ( + (?> {{literalFloat}} + | {{literalDecimal}} + ) + [e][+-]? + {{literalDecimal}} + ) + +contexts: + main: + - include: float + - include: integer + + float: + - match: (?xi){{scientificNotation}} + scope: constant.numeric.float.scientific.js.fjsx15 + pop: true + - match: (?x){{literalFloat}} + scope: constant.numeric.float.js.fjsx15 + pop: true + + integer: + - match: (?i)(0b)([01_]+) + captures: + 1: >- + constant.numeric.binary.js.fjsx15 + punctuation.definition.numeric.js.fjsx15 + 2: constant.numeric.binary.js.fjsx15 + pop: true + - match: (?i)(0o)([0-7]+) + captures: + 1: >- + constant.numeric.octal.js.fjsx15 + punctuation.definition.numeric.js.fjsx15 + 2: constant.numeric.octal.js.fjsx15 + pop: true + - match: (?i)(0x)([0-9a-f_]+) + captures: + 1: >- + constant.numeric.hex.js.fjsx15 + punctuation.definition.numeric.js.fjsx15 + 2: constant.numeric.hex.js.fjsx15 + pop: true + - match: ([1-9][0-9_]*|0)(?:\s*(n))? + captures: + 1: constant.numeric.decimal.js.fjsx15 + 2: storage.type.numeric.bigint.js.fjsx15 + pop: true diff --git a/integration/syntaxes/src/js/literal/object/index.yml b/integration/syntaxes/src/js/literal/object/index.yml new file mode 100644 index 00000000..68859f72 --- /dev/null +++ b/integration/syntaxes/src/js/literal/object/index.yml @@ -0,0 +1,57 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: delimiters + + anything-else: + - include: comment-no-pop + - match: (?=[,}]) + pop: true + # Spread. + - include: ~/js/operator/spread + # Methods. + - include: ~/js/class/modifier + - include: ~/js/class/method + # Key. + - include: ~/js/literal/object/property + # Any other expression. + - include: ~/js/optional-expression + + comment-no-pop: + - include: ~/js/comment.no-pop + + constant: + - include: ~/js/constant + + delimiters: + - meta_scope: >- + meta.object-literal.js.fjsx15 + meta.block.js.fjsx15 + - include: comment-no-pop + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + pop: true + # Anything else. + - match: (?=\S) + push: anything-else + + variable: + - include: ~/js/variable diff --git a/integration/syntaxes/src/js/literal/object/property.yml b/integration/syntaxes/src/js/literal/object/property.yml new file mode 100644 index 00000000..d0795ec3 --- /dev/null +++ b/integration/syntaxes/src/js/literal/object/property.yml @@ -0,0 +1,294 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + constantIdentifier: | + [$_[:upper:]] + [$_[:upper:][:digit:]]* + + keyIdentifier: | + (?> {{string}} + | [$_[:alnum:]] + [$_[:alnum:]]* + ) + + indexer: | + (\[ + (?> {{string}} + | \g<-1> + | [^\[\]] + )* + \]) + + genericArguments: | + (< + (?> {{string}} + | \g<-1> + | [^<>] + )* + >) + + parameters: | + (\( + (?> {{string}} + | \g<-1> + | [^()] + )* + \)) + + flowOperators: | + (?> &(?!\s*&) + | \|(?!\s*\|) + ) + + string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + + flowObject: | + (\{ + (?> {{string}} + | \g<-1> + | [^{}] + )* + }) + + simpleFlowType: | + (?> {{string}} + | {{flowObject}} + | [$_[:alpha:]][$_[:alnum:].]* + ) + (?:\s*{{genericArguments}})? + (?:\s*\[\s*\])? + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> (?:\?\s*){{simpleFlowType}} + | \g<-1> + ) + ) + + complexType: | + (?:\?\s*)? + ( + (?> {{simpleFlowType}} + | {{flowFunction}} + | \g<-1> + ) + ) + + multipleTypes: | + ( + (?> \s*{{flowOperators}} + | \s*{{complexType}} + | \g<-1> + )+ + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | \:\s*{{multipleTypes}} + ) + + normalArrowFunction: | + (?:async\b\s*)? + (?:{{genericArguments}}\s*)? + {{parameters}} + (?:\s*{{type}})? + \s*=> + + singleParameterArrowFunction: | + (?:async\b\s+)? + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=> + + anyArrowFunction: | + (?> {{normalArrowFunction}} + | {{singleParameterArrowFunction}} + ) + + normalArrowFunctionAssignedToVariable: | + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=\s* + {{normalArrowFunction}} + + singleParameterArrowFunctionAssignedToVariable: | + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=\s* + {{singleParameterArrowFunction}} + + anyArrowFunctionAssignedToVariable: | + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=\s* + (?> {{normalArrowFunction}} + | {{singleParameterArrowFunction}} + ) + +contexts: + main: + # Function assigned to property. + - match: | + (?xi) + (?= + {{keyIdentifier}} + \s*:\s* + (?:async\b\s+)? + function + (?> \s+{{commonIdentifier}} + | \( + ) + ) + set: [ + function-declaration, + meta-declaration-function, + function-keyword, + meta-key, + method-identifier + ] + # Single parameter arrow function assigned to property. + - match: | + (?xi) + (?= + {{keyIdentifier}} + \s*:\s* + {{singleParameterArrowFunction}} + ) + set: [ + arrow-function, + meta-key, + method-identifier + ] + # Arrow function assigned to property. + - match: | + (?xi) + (?= + {{keyIdentifier}} + \s*:\s* + {{normalArrowFunction}} + ) + set: [ + arrow-function, + meta-key, + method-identifier + ] + # Computed property name. + - match: \[ + scope: punctuation.section.brackets.begin.js.fjsx15 + set: [ + associated-value, + meta-computed-key, + computed-property-end, + optional-expression + ] + # Other keys. + - match: | + (?xi) + (?= + {{keyIdentifier}} + \s*: + ) + set: [ + associated-value, + meta-key, + any-key + ] + + any-key: + - include: string + - include: number + # TODO: The correct option in this case is to highlight keys as unquoted + # strings but some users will prefer the old behavior and so a configurable + # property is desired in this case. + - match: "[^:]*" + scope: string.unquoted.js.fjsx15 + pop: true + # - include: constant + # - include: variable + + arrow-function: + - include: ~/js/arrow-function + + associated-value: + - match: ":" + scope: punctuation.separator.key-value.js.fjsx15 + set: optional-expression + + constant: + - include: ~/js/variable + + computed-property-end: + - match: \] + scope: punctuation.section.brackets.end.js.fjsx15 + pop: true + + function-declaration: + - include: ~/js/function#declaration + + function-keyword: + - include: ~/js/function#keyword + + meta-computed-key: + - meta_scope: meta.object-literal.key.computed.js.fjsx15 + - include: pop-now + + meta-declaration-function: + - meta_scope: meta.declaration.function.js.fjsx15 + - include: pop-now + + meta-key: + - meta_scope: meta.object-literal.key.js.fjsx15 + - include: pop-now + + method-identifier: + - match: | + (?xi) + ({{keyIdentifier}}) + \s*(:) + captures: + 1: entity.name.function.js.fjsx15 + 2: punctuation.separator.key-value.js.fjsx15 + pop: true + + number: + - include: ~/js/literal/number + + optional-expression: + - include: ~/js/optional-expression + + pop-now: + - match: "" + pop: true + + string: + - include: ~/js/literal/string/double-quoted + - include: ~/js/literal/string/single-quoted + - include: ~/js/literal/string/template + + variable: + - include: ~/js/variable diff --git a/integration/syntaxes/src/js/literal/string/double-quoted.yml b/integration/syntaxes/src/js/literal/string/double-quoted.yml new file mode 100644 index 00000000..597ad900 --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/double-quoted.yml @@ -0,0 +1,52 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + hexEscapedChar: | + x[a-f0-9]{2} + + unicodeEscapedChar: | + (?> u[a-f0-9]{4} + | u\{[a-f0-9]+} + ) + + doubleQuotedEscapeSequences: | + \\ + (?> ["\\bfnrtv] + | {{hexEscapedChar}} + | {{unicodeEscapedChar}} + ) + +contexts: + main: + - match: \" + scope: punctuation.definition.string.begin.js.fjsx15 + set: string + + trap: + - meta_content_scope: context.trap + + string: + - meta_scope: string.quoted.double.js.fjsx15 + # New line trap. + - match: (?- + text.html + naomi + - include: ~/html/element + + close: + - match: \` + scope: punctuation.definition.polymer-html.end.js.fjsx15 + pop: true + + meta: + - meta_scope: meta.polymer.html.js.fjsx15 + - match: "" + pop: true diff --git a/integration/syntaxes/src/js/literal/string/regex/anchor.yml b/integration/syntaxes/src/js/literal/string/regex/anchor.yml new file mode 100644 index 00000000..59b6d42a --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/regex/anchor.yml @@ -0,0 +1,21 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # ^ $ \b + - match: (?>\\b|\^|\$) + scope: keyword.control.anchor.regexp.js.fjsx15 + pop: true diff --git a/integration/syntaxes/src/js/literal/string/regex/backref.yml b/integration/syntaxes/src/js/literal/string/regex/backref.yml new file mode 100644 index 00000000..c8efd84e --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/regex/backref.yml @@ -0,0 +1,20 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \\[1-9][0-9]* + scope: keyword.other.back-reference.regexp.js.fjsx15 + pop: true diff --git a/integration/syntaxes/src/js/literal/string/regex/backslash.yml b/integration/syntaxes/src/js/literal/string/regex/backslash.yml new file mode 100644 index 00000000..8d1736c0 --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/regex/backslash.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # Character classes/sets. + - match: (?i)\\[wsd]| + scope: constant.other.character-class.escape.backslash.regexp + pop: true + # Other escape sequences. + - match: | + (?x) + \\ + (?> c[A-Z] + | x[\da-fA-F]{2} + | u[\da-fA-F]{4} + | . + ) + scope: constant.character.escape.backslash.regexp.js.fjsx15 + pop: true diff --git a/integration/syntaxes/src/js/literal/string/regex/capturing-group.yml b/integration/syntaxes/src/js/literal/string/regex/capturing-group.yml new file mode 100644 index 00000000..a012f356 --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/regex/capturing-group.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \((?!\?) + scope: punctuation.definition.group.begin.regexp.js.fjsx15 + set: [ meta, close, regex-content ] + + close: + - match: \) + scope: punctuation.definition.group.end.regexp.js.fjsx15 + pop: true + - match: (?=\S) + push: regex-content + + meta: + - meta_scope: meta.group.regexp.js.fjsx15 + - match: "" + pop: true + + regex-content: + - include: ~/js/literal/string/regex#regex-content diff --git a/integration/syntaxes/src/js/literal/string/regex/character-class/index.yml b/integration/syntaxes/src/js/literal/string/regex/character-class/index.yml new file mode 100644 index 00000000..5068b48f --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/regex/character-class/index.yml @@ -0,0 +1,42 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \. + scope: constant.other.character-class.regexp.js.fjsx15 + pop: true + - match: ((\[)(\^)?) + captures: + 1: constant.other.character-class.regexp.js.fjsx15 + 2: punctuation.definition.character-class.begin.regexp.js.fjsx15 + 3: keyword.operator.negation.regexp.js.fjsx15 + set: close + + close: + - match: \] + scope: >- + constant.other.character-class.regexp.js.fjsx15 + punctuation.definition.character-class.end.regexp.js.fjsx15 + pop: true + - match: (?=\S) + push: content + + content: + - include: ~/js/literal/string/regex/character-class/range + - include: ~/js/literal/string/regex/backslash + - match: . + scope: constant.other.character-class.regexp.js.fjsx15 + pop: true diff --git a/integration/syntaxes/src/js/literal/string/regex/character-class/range.yml b/integration/syntaxes/src/js/literal/string/regex/character-class/range.yml new file mode 100644 index 00000000..497450fe --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/regex/character-class/range.yml @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + possibleRange: | + (?> \w + | \d + | \\ + (?> c[A-Z] + | x[\da-fA-F]{2} + | u[\da-fA-F]{4} + ) + ) + +contexts: + main: + - match: (?xi){{possibleRange}}-{{possibleRange}} + scope: constant.other.character-class.range.regexp.js.fjsx15 + pop: true diff --git a/integration/syntaxes/src/js/literal/string/regex/index.yml b/integration/syntaxes/src/js/literal/string/regex/index.yml new file mode 100644 index 00000000..289af54b --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/regex/index.yml @@ -0,0 +1,54 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: / + scope: punctuation.definition.string.begin.js.fjsx15 + set: [ + regex-meta, + close-regex, + regex-content + ] + + close-regex: + - match: (/)([a-z]*) + captures: + 1: punctuation.definition.string.end.js.fjsx15 + 2: keyword.other.flag.js.fjsx15 + pop: true + - match: (?=\S) + push: regex-content + + pop-now: + - match: "" + pop: true + + regex-content: + - include: ~/js/literal/string/regex/anchor + - include: ~/js/literal/string/regex/backref + - include: ~/js/literal/string/regex/backslash + - include: ~/js/literal/string/regex/capturing-group + - include: ~/js/literal/string/regex/character-class + - include: ~/js/literal/string/regex/lookahead + - include: ~/js/literal/string/regex/negative-lookahead + - include: ~/js/literal/string/regex/non-capturing-group + - include: ~/js/literal/string/regex/operator + - include: ~/js/literal/string/regex/quantifier + - include: pop-now + + regex-meta: + - meta_scope: string.regexp.js.fjsx15 + - include: pop-now diff --git a/integration/syntaxes/src/js/literal/string/regex/lookahead.yml b/integration/syntaxes/src/js/literal/string/regex/lookahead.yml new file mode 100644 index 00000000..1a56b878 --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/regex/lookahead.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \(\?= + scope: punctuation.definition.group.assertion.begin.regexp.js.fjsx15 + set: [ meta, close, regex-content ] + + close: + - match: \) + scope: punctuation.definition.group.assertion.end.regexp.js.fjsx15 + pop: true + - match: (?=\S) + push: regex-content + + meta: + - meta_scope: meta.group.assertion.look-ahead.regexp.js.fjsx15 + - match: "" + pop: true + + regex-content: + - include: ~/js/literal/string/regex#regex-content diff --git a/integration/syntaxes/src/js/literal/string/regex/negative-lookahead.yml b/integration/syntaxes/src/js/literal/string/regex/negative-lookahead.yml new file mode 100644 index 00000000..72df5730 --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/regex/negative-lookahead.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \(\?! + scope: punctuation.definition.group.assertion.begin.regexp.js.fjsx15 + set: [ meta, close, regex-content ] + + close: + - match: \) + scope: punctuation.definition.group.assertion.end.regexp.js.fjsx15 + pop: true + - match: (?=\S) + push: regex-content + + meta: + - meta_scope: meta.group.assertion.look-ahead.negative.regexp.js.fjsx15 + - match: "" + pop: true + + regex-content: + - include: ~/js/literal/string/regex#regex-content diff --git a/integration/syntaxes/src/js/literal/string/regex/non-capturing-group.yml b/integration/syntaxes/src/js/literal/string/regex/non-capturing-group.yml new file mode 100644 index 00000000..da31cb92 --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/regex/non-capturing-group.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: "\\(\\?:" + scope: punctuation.definition.group.no-capture.begin.regexp.js.fjsx15 + set: [ meta, close, regex-content ] + + close: + - match: \) + scope: punctuation.definition.group.no-capture.end.regexp.js.fjsx15 + pop: true + - match: (?=\S) + push: regex-content + + meta: + - meta_scope: meta.group.regexp.js.fjsx15 + - match: "" + pop: true + + regex-content: + - include: ~/js/literal/string/regex#regex-content diff --git a/integration/syntaxes/src/js/literal/string/regex/operator.yml b/integration/syntaxes/src/js/literal/string/regex/operator.yml new file mode 100644 index 00000000..ecfa6e69 --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/regex/operator.yml @@ -0,0 +1,20 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \| + scope: keyword.operator.or.regexp.js.fjsx15 + pop: true diff --git a/integration/syntaxes/src/js/literal/string/regex/quantifier.yml b/integration/syntaxes/src/js/literal/string/regex/quantifier.yml new file mode 100644 index 00000000..d6618496 --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/regex/quantifier.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # Operator quantifier. + - match: "[*+]?\\??" + scope: keyword.operator.quantifier.regexp.js.fjsx15 + pop: true + # Brace quantifier. + - match: | + (?x) + \{ + (?> \d+,\d+ + | \d+, + | \d+ + ) + } + scope: keyword.operator.quantifier.regexp + pop: true diff --git a/integration/syntaxes/src/js/literal/string/single-quoted.yml b/integration/syntaxes/src/js/literal/string/single-quoted.yml new file mode 100644 index 00000000..26e7edac --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/single-quoted.yml @@ -0,0 +1,52 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + hexEscapedChar: | + x[a-f0-9]{2} + + unicodeEscapedChar: | + (?> u[a-f0-9]{4} + | u\{[a-f0-9]+} + ) + + singleQuotedEscapeSequences: | + \\ + (?> ['\\bfnrtv] + | {{hexEscapedChar}} + | {{unicodeEscapedChar}} + ) + +contexts: + main: + - match: \' + scope: punctuation.definition.string.begin.js.fjsx15 + set: string + + trap: + - meta_content_scope: context.trap + + string: + - meta_scope: string.quoted.single.js.fjsx15 + # New line trap. + - match: (? createGlobalStyle + | css + | injectGlobal + )) + (?=\s*`) + captures: + 1: support.function.styled-component.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: variable.other.component.js.fjsx15 + set: [ + meta-styled-component, + styled-component-begin + ] + - match: keyframes(?=\s*`) + scope: support.function.styled-component.js.fjsx15 + set: [ + meta-styled-component, + styled-component-begin-keyframes + ] + # Other functions. + - match: | + (?x) + ( + [[:upper:]] + [[:alnum:]]* + ) + (.) + (withComponent) + (?=\s*\() + captures: + 1: variable.other.component.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.styled-component.js.fjsx15 + set: [ + meta-styled-component, + optional-extend, + meta-function-call, + arguments + ] + + arguments: + - include: ~/js/function-call/arguments + + close: + - match: \` + scope: punctuation.definition.styled-component.end.js.fjsx15 + pop: true + + comment-no-pop: + - include: ~/css/comment.no-pop + - include: ~/js/comment/line#no-pop + + embedded-expression-no-pop: + - include: ~/js/literal/string/template#embedded-expression-no-pop + + keyframe-block-identifier: + - include: ~/css/keyframe-block-list#block-identifier + + meta-function-call: + - meta_scope: meta.function-call.js.fjsx15 + - include: pop-now + + meta-styled-component: + - meta_scope: meta.styled-component.js.fjsx15 + - include: pop-now + + optional-extend: + - match: (\.)(extend)(?=`) + captures: + 1: punctuation.accessor.js.fjsx15 + 2: support.function.styled-component.js.fjsx15 + set: styled-component-begin + + pop-now: + - match: "" + pop: true + + ruleset-block: + - include: ~/css/ruleset/block + + ruleset-block-content: + - include: ~/css/ruleset/block-content + + shared-content: + # Close. + - match: (?=`) + set: close + # Terminator. + - match: ; + scope: punctuation.terminator.css.css3 + + styled-component-begin: + - match: (?=\() + set: arguments + - match: \` + scope: punctuation.definition.styled-component.begin.js.fjsx15 + with_prototype: + - include: embedded-expression-no-pop + set: styled-component-content + + styled-component-begin-keyframes: + - match: \` + scope: punctuation.definition.styled-component.begin.js.fjsx15 + with_prototype: + - include: embedded-expression-no-pop + set: styled-component-content-keyframes + + styled-component-content: + - clear_scopes: true + - meta_content_scope: source.css + - include: comment-no-pop + - include: shared-content + # Recover ruleset block. + - match: (?=\{) + push: ruleset-block + # Anything else. + - match: (?=\S) + push: ruleset-block-content + + styled-component-content-keyframes: + - clear_scopes: true + - meta_content_scope: source.css + - include: comment-no-pop + - include: shared-content + - match: (?=\S) + push: [ ruleset-block, keyframe-block-identifier ] diff --git a/integration/syntaxes/src/js/literal/string/template.yml b/integration/syntaxes/src/js/literal/string/template.yml new file mode 100644 index 00000000..fab2d0cd --- /dev/null +++ b/integration/syntaxes/src/js/literal/string/template.yml @@ -0,0 +1,72 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + hexEscapedChar: | + x[a-f0-9]{2} + + unicodeEscapedChar: | + (?> u[a-f0-9]{4} + | u\{[a-f0-9]+\} + ) + + escapeSequences: | + \\ + (?> [`\\$bfnrtv] + | {{hexEscapedChar}} + | {{unicodeEscapedChar}} + ) + +contexts: + main: + # Simple tag. + - match: (?xi){{commonIdentifier}}(?=\s*\`) + scope: entity.name.function.tag.js.fjsx15 + set: main + # Simple template string. + - match: \` + scope: punctuation.definition.string.begin.js.fjsx15 + with_prototype: + - include: embedded-expression-no-pop + set: + - meta_scope: string.template.js.fjsx15 + # Close. + - match: \` + scope: punctuation.definition.string.end.js.fjsx15 + pop: true + # Escape. + - match: (?xi){{escapeSequences}} + scope: constant.character.escape.js.fjsx15 + + close-embedded-expression: + - clear_scopes: true + - meta_scope: >- + source.js + meta.template-expression.js.fjsx15 + - match: \} + scope: punctuation.definition.template-expression.end.js.fjsx15 + pop: true + + embedded-content: + - include: ~/js/optional-expression + + embedded-expression-no-pop: + - match: \$\{ + scope: punctuation.definition.template-expression.begin.js.fjsx15 + push: [ close-embedded-expression, embedded-content ] diff --git a/integration/syntaxes/src/js/node-js.yml b/integration/syntaxes/src/js/node-js.yml new file mode 100644 index 00000000..0035ac41 --- /dev/null +++ b/integration/syntaxes/src/js/node-js.yml @@ -0,0 +1,144 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + globalFunctions: | + (?> (?>clear|set)Immediate + | require + )\b + + processFunctions: | + (?> abort + | chdir + | cpuUsage + | cwd + | disconnect + | emitWarning + | exit + # getegid, geteuid, getgid, getuid, getgroups + | get(?>e[gu]id|[gu]id|groups) + | hrtime + | initgroups + | kill + | memoryUsage + | nextTick + | send + # setegid, seteuid, setgid, setuid, setgroups + | set(?>e[gu]id|[gu]id|groups) + # umask, uptime + | u(?>mask|ptime) + )\b + +contexts: + main: + - include: global-constant + - include: global-function + # Module property or function. + - match: (module)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: module-property-or-function + # Proccess property or function. + - match: (process)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: process-property-or-function + # Just the global objects. + - match: (?>module|process)\b + scope: support.type.object.js.fjsx15 + pop: true + + arguments: + - include: ~/js/function-call/arguments + + else-pop: + - match: (?=\S) + pop: true + + function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - include: pop-now + + global-constant: + - match: __(?>dirname|filename)\b + scope: support.constant.js.fjsx15 + pop: true + + global-function: + # Function call. + - match: (?x){{globalFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{globalFunctions}} + scope: support.function.js.fjsx15 + pop: true + + module-property-or-function: + # Properties. + - match: (?>default|exports|parent)\b + scope: support.variable.js.fjsx15 + pop: true + - include: other-property-or-function + + other-property-or-function: + - include: ~/js/operator/other#other-property-or-function + + pop-now: + - match: "" + pop: true + + process-property-or-function: + # Function call. + - match: (?x){{processFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{processFunctions}} + scope: support.function.js.fjsx15 + pop: true + # Properties. + - match: | + (?x) + # arch, argv, argv0 + (?> ar(?>ch|gv0?) + | channel + | config + | connected + | env + # execArgv, execPath + | exec(?>Argv|Path) + | exitCode + | mainModule + | pid + | platform + | release + # stderr, stdin, stdout + | std(?>err|in|out) + | title + # version, versions + | versions? + )\b + scope: support.variable.js.fjsx15 + pop: true + - include: other-property-or-function diff --git a/integration/syntaxes/src/js/operator/arithmetic.yml b/integration/syntaxes/src/js/operator/arithmetic.yml new file mode 100644 index 00000000..ffde3461 --- /dev/null +++ b/integration/syntaxes/src/js/operator/arithmetic.yml @@ -0,0 +1,52 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:----------------| + # | -- | Decrement. | + # | - | Subtraction. | + # | ++ | Increment. | + # | + | Addition. | + # | += | | + # | * | Multiplication. | + # | *= | | + # | ** | Exponentiation. | + # | **= | | + # | / | Division. | + # | /= | | + # | % | Modulus. | + # | %= | | + main: + - match: | + (?x) + (?> -- + | \+\+ + ) + scope: keyword.operator.arithmetic.js.fjsx15 + pop: true + - match: | + (?x) + (?> -=? + | \+=? + | \*\*?=? + | /=? + | %=? + ) + scope: keyword.operator.arithmetic.js.fjsx15 + set: optional-expression + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/operator/assignment.yml b/integration/syntaxes/src/js/operator/assignment.yml new file mode 100644 index 00000000..0c97b6ca --- /dev/null +++ b/integration/syntaxes/src/js/operator/assignment.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \= + scope: keyword.operator.other.assignment.js.fjsx15 + set: optional-expression + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/operator/await.yml b/integration/syntaxes/src/js/operator/await.yml new file mode 100644 index 00000000..240886ce --- /dev/null +++ b/integration/syntaxes/src/js/operator/await.yml @@ -0,0 +1,29 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: await\b + scope: keyword.control.flow.await.js.fjsx15 + set: optional-expression + + just-pop: + - match: \s*(await)\b + captures: + 1: keyword.control.flow.await.js.fjsx15 + pop: true + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/operator/bitwise.yml b/integration/syntaxes/src/js/operator/bitwise.yml new file mode 100644 index 00000000..63b84085 --- /dev/null +++ b/integration/syntaxes/src/js/operator/bitwise.yml @@ -0,0 +1,48 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:---------------------------------| + # | ~ | Bitwise not. | + # | ~= | Bitwise not assignment. | + # | & | Bitwise AND. | + # | &= | Bitwise AND assignment. | + # | | | Bitwise OR. | + # | |= | Bitwise OR assignment. | + # | ^ | Bitwise XOR. | + # | ^= | Bitwise XOR assignment. | + # | << | Left shift. | + # | <<= | Left shift assignment. | + # | >> | Right shift. | + # | >>= | Right shift assignment. | + # | >>> | Unsigned right shift. | + # | >>>= | Unsigned right shift assignment. | + main: + - match: | + (?x) + (?> ~=? + | &(?!&)=? + | \|(?!\|)=? + | \^=? + | <<=? + | >>>=? + | >>=? + ) + scope: keyword.operator.bitwise.js.fjsx15 + set: optional-expression + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/operator/comma.yml b/integration/syntaxes/src/js/operator/comma.yml new file mode 100644 index 00000000..37a87b97 --- /dev/null +++ b/integration/syntaxes/src/js/operator/comma.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \, + scope: keyword.operator.comma.js.fjsx15 + set: optional-expression + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/operator/comparison.yml b/integration/syntaxes/src/js/operator/comparison.yml new file mode 100644 index 00000000..cc21d5cd --- /dev/null +++ b/integration/syntaxes/src/js/operator/comparison.yml @@ -0,0 +1,41 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:--------------------------| + # | == | Loose equality. | + # | === | Strict equality. | + # | != | Not equal. | + # | !== | Strict inequality. | + # | >= | Greater than or equal to. | + # | <= | Less than or equal to. | + # | > | Greater than. | + # | < | Less than. | + main: + - match: | + (?x) + (?> ===? + | !==? + | >= + | <= + | >(?!>) + | <(?!<) + ) + scope: keyword.operator.comparison.js.fjsx15 + set: optional-expression + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/operator/delete.yml b/integration/syntaxes/src/js/operator/delete.yml new file mode 100644 index 00000000..4c55c788 --- /dev/null +++ b/integration/syntaxes/src/js/operator/delete.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: delete\b + scope: keyword.operator.word.delete.js.fjsx15 + set: optional-expression + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/operator/in.yml b/integration/syntaxes/src/js/operator/in.yml new file mode 100644 index 00000000..9f61d8ee --- /dev/null +++ b/integration/syntaxes/src/js/operator/in.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: in\b + scope: keyword.operator.word.in.js.fjsx15 + set: optional-expression + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/operator/index.yml b/integration/syntaxes/src/js/operator/index.yml new file mode 100644 index 00000000..58c3af11 --- /dev/null +++ b/integration/syntaxes/src/js/operator/index.yml @@ -0,0 +1,39 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # It is impossible to detect multiline arrow functions, but we can still + # detect its body as if it were an operator. + - include: ~/js/arrow-function/body + # Position dependent operators. + - include: ~/js/operator/pipe + - include: ~/js/operator/comparison + - include: ~/js/operator/assignment + # Position independent operators. + - include: ~/js/operator/arithmetic + - include: ~/js/operator/await + - include: ~/js/operator/bitwise + - include: ~/js/operator/delete + - include: ~/js/operator/in + - include: ~/js/operator/logical + - include: ~/js/operator/new + - include: ~/js/operator/of + - include: ~/js/operator/other + - include: ~/js/operator/relational + - include: ~/js/operator/shebang + - include: ~/js/operator/spread + - include: ~/js/operator/typeof + - include: ~/js/operator/void diff --git a/integration/syntaxes/src/js/operator/logical.yml b/integration/syntaxes/src/js/operator/logical.yml new file mode 100644 index 00000000..bd181c02 --- /dev/null +++ b/integration/syntaxes/src/js/operator/logical.yml @@ -0,0 +1,33 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:------------| + # | && | And. | + # | || | Or. | + # | ! | Not. | + main: + - match: | + (?x) + (?> && + | \|\| + | !!? + ) + scope: keyword.operator.logical.js.fjsx15 + set: optional-expression + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/operator/new.yml b/integration/syntaxes/src/js/operator/new.yml new file mode 100644 index 00000000..83234f37 --- /dev/null +++ b/integration/syntaxes/src/js/operator/new.yml @@ -0,0 +1,96 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + # Convetion. + classIdentifier: | + [$_[:upper:]] + [$_[:alnum:]]* + +contexts: + main: + # new.target + - match: (new)\s*(\.)\s*(target) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.constant.js.fjsx15 + pop: true + # Type after new. + - match: (?xi)new(?=\s+{{commonIdentifier}}) + scope: keyword.operator.word.new.js.fjsx15 + set: [ + optional-tail, + meta-instance-call-constructor-scope, + optional-arguments, + type + ] + # Any other expression after the keyword. + - match: (?i)new\b + scope: keyword.operator.word.new.js.fjsx15 + set: [ + optional-tail, + meta-instance-scope, + optional-expression + ] + + arguments: + - include: ~/js/function-call#arguments + + else-pop: + - match: (?=\S) + pop: true + + meta-instance-call-constructor-scope: + - meta_scope: meta.instance.constructor.js.fjsx15 + - meta_content_scope: meta.function-call.constructor.js.fjsx15 + - include: pop-now + + meta-instance-scope: + - meta_scope: meta.instance.js.fjsx15 + - include: pop-now + + optional-arguments: + - match: (?=\() + set: arguments + - include: else-pop + + optional-expression: + - include: ~/js/optional-expression + + optional-tail: + - include: ~/js/expression#optional-tail + + pop-now: + - match: "" + pop: true + + type: + - include: ~/js/core + # Object before target property. + - match: (?xi)({{commonIdentifier}})\s*(\.) + captures: + 1: variable.other.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + # Class constructors. + - match: (?x){{classIdentifier}} + scope: variable.other.type.js.fjsx15 + pop: true + # Other expressions. + - include: ~/js/expression diff --git a/integration/syntaxes/src/js/operator/of.yml b/integration/syntaxes/src/js/operator/of.yml new file mode 100644 index 00000000..98a2af0a --- /dev/null +++ b/integration/syntaxes/src/js/operator/of.yml @@ -0,0 +1,24 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # Technically there’s no “of” operator, but this will simplify for loops. + - match: of\b + scope: keyword.operator.word.of.js.fjsx15 + set: optional-expression + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/operator/other.yml b/integration/syntaxes/src/js/operator/other.yml new file mode 100644 index 00000000..c6f97fe2 --- /dev/null +++ b/integration/syntaxes/src/js/operator/other.yml @@ -0,0 +1,72 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: yield\b + scope: keyword.control.flow.js.fjsx15 + set: [ optional-tail, yield-head ] + # | Operator | Description | + # |:----------:|:--------------------| + # | ... | Spread. | + # | :: | Bind. | + # | . | Accessor. | + # | ?. | Optional chain. | + # | ?? | Nullish coalescing. | + # | ? | Ternary. | + - match: \:{2} + scope: keyword.operator.bind.js.fjsx15 + set: optional-expression + - match: \?\? + scope: keyword.operator.nullish-coalescing.js.fjsx15 + set: optional-expression + - match: \?\. + scope: punctuation.accessor.optional-chain.js.fjsx15 + set: [ optional-tail, accessor-head ] + - match: \.(?!\.) + scope: punctuation.accessor.js.fjsx15 + set: [ optional-tail, accessor-head ] + - match: \? + scope: keyword.operator.ternary.js.fjsx15 + set: [ + ternary-else, + optional-expression + ] + + accessor-head: + - include: ~/js/comment.no-pop + - include: ~/js/function-call + - include: ~/js/variable#function-assigned-to-variable + - include: ~/js/constant + - include: ~/js/variable + + # Used near accessor to highlight global functions and properties. + other-property-or-function: + - match: (?=\S) + set: [ optional-tail, accessor-head ] + + optional-expression: + - include: ~/js/optional-expression + + optional-tail: + - include: ~/js/expression#optional-tail + + ternary-else: + - match: ":" + scope: keyword.operator.ternary.js.fjsx15 + set: optional-expression + + yield-head: + - include: ~/js/expression#head diff --git a/integration/syntaxes/src/js/operator/pipe.yml b/integration/syntaxes/src/js/operator/pipe.yml new file mode 100644 index 00000000..b6df24ba --- /dev/null +++ b/integration/syntaxes/src/js/operator/pipe.yml @@ -0,0 +1,54 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: \|> + scope: keyword.operator.pipe.js.fjsx15 + set: target + + else-pop: + - match: (?=\S) + pop: true + + target: + - include: ~/js/arrow-function + # Await keyword. + - match: await\b + scope: keyword.control.flow.js.fjsx15 + set: function-identifier + # Simple identifier. + - match: | + (?xi) + (?= + {{commonIdentifier}}\s* + (?>\|>|$) + ) + set: function-identifier + - include: else-pop + + function-identifier: + # Simple function. + - match: (?xi){{commonIdentifier}} + scope: >- + meta.function-call.js.fjsx15 + variable.function.js.fjsx15 + pop: true + - include: else-pop diff --git a/integration/syntaxes/src/js/operator/relational.yml b/integration/syntaxes/src/js/operator/relational.yml new file mode 100644 index 00000000..332c94ce --- /dev/null +++ b/integration/syntaxes/src/js/operator/relational.yml @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: instanceof\b + scope: keyword.operator.word.instanceof.js.fjsx15 + set: optional-expression + - match: in\b + scope: keyword.operator.word.in.js.fjsx15 + set: optional-expression + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/operator/rest.no-pop.yml b/integration/syntaxes/src/js/operator/rest.no-pop.yml new file mode 100644 index 00000000..dbc9a182 --- /dev/null +++ b/integration/syntaxes/src/js/operator/rest.no-pop.yml @@ -0,0 +1,22 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?=\.{3}) + push: rest-operator + + rest-operator: + - include: ~/js/operator/rest diff --git a/integration/syntaxes/src/js/operator/rest.yml b/integration/syntaxes/src/js/operator/rest.yml new file mode 100644 index 00000000..c7af9b94 --- /dev/null +++ b/integration/syntaxes/src/js/operator/rest.yml @@ -0,0 +1,20 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \.{3} + scope: keyword.operator.rest.js.fjsx15 + pop: true diff --git a/integration/syntaxes/src/js/operator/shebang.yml b/integration/syntaxes/src/js/operator/shebang.yml new file mode 100644 index 00000000..8ded2f62 --- /dev/null +++ b/integration/syntaxes/src/js/operator/shebang.yml @@ -0,0 +1,19 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: ^#!.+$ + scope: keyword.operator.other.shebang.js.fjsx15 diff --git a/integration/syntaxes/src/js/operator/spread.yml b/integration/syntaxes/src/js/operator/spread.yml new file mode 100644 index 00000000..72c567d5 --- /dev/null +++ b/integration/syntaxes/src/js/operator/spread.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \.{3} + scope: keyword.operator.spread.js.fjsx15 + set: optional-expression + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/operator/terminator.yml b/integration/syntaxes/src/js/operator/terminator.yml new file mode 100644 index 00000000..b0e4d210 --- /dev/null +++ b/integration/syntaxes/src/js/operator/terminator.yml @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \; + scope: keyword.other.terminator.js.fjsx15 + set: statement-or-expression + + comment-no-pop: + - include: ~/js/comment.no-pop + + statement-or-expression: + - include: main + - match: (?=[,:)\]}]) + pop: true + - include: comment-no-pop + - include: ~/js/statement + - include: ~/js/expression diff --git a/integration/syntaxes/src/js/operator/typeof.yml b/integration/syntaxes/src/js/operator/typeof.yml new file mode 100644 index 00000000..8d446ca3 --- /dev/null +++ b/integration/syntaxes/src/js/operator/typeof.yml @@ -0,0 +1,36 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + # Type after typeof. + - match: (?xi)(typeof)(?=\s+{{commonIdentifier}}) + scope: keyword.operator.word.typeof.js.fjsx15 + set: [ optional-tail, type ] + # Any other expression after the keyword. + - match: (?i)typeof\b + scope: keyword.operator.word.typeof.js.fjsx15 + set: optional-tail + + optional-tail: + - include: ~/js/expression#optional-tail + + type: + - include: ~/js/operator/new#type diff --git a/integration/syntaxes/src/js/operator/void.yml b/integration/syntaxes/src/js/operator/void.yml new file mode 100644 index 00000000..d8600bf8 --- /dev/null +++ b/integration/syntaxes/src/js/operator/void.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: void\b + scope: keyword.operator.word.void.js.fjsx15 + set: optional-expression + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/optional-expression.yml b/integration/syntaxes/src/js/optional-expression.yml new file mode 100644 index 00000000..dec57e92 --- /dev/null +++ b/integration/syntaxes/src/js/optional-expression.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: expression-escape + - include: ~/js/expression + + expression-escape: + - match: (?=[,;:)\]}]) + pop: true diff --git a/integration/syntaxes/src/js/optional-statement-or-expression.yml b/integration/syntaxes/src/js/optional-statement-or-expression.yml new file mode 100644 index 00000000..23e5abd2 --- /dev/null +++ b/integration/syntaxes/src/js/optional-statement-or-expression.yml @@ -0,0 +1,22 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?=[)\]}]) + pop: true + - include: ~/js/comment.no-pop + - include: ~/js/statement + - include: ~/js/expression diff --git a/integration/syntaxes/src/js/prolog.yml b/integration/syntaxes/src/js/prolog.yml new file mode 100644 index 00000000..a7b17a7b --- /dev/null +++ b/integration/syntaxes/src/js/prolog.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \'use strict';?$ + scope: keyword.other.prolog.strict.js.fjsx15 + pop: true + - match: \"use strict";?$ + scope: keyword.other.prolog.strict.js.fjsx15 + pop: true diff --git a/integration/syntaxes/src/js/property-access.yml b/integration/syntaxes/src/js/property-access.yml new file mode 100644 index 00000000..704fc167 --- /dev/null +++ b/integration/syntaxes/src/js/property-access.yml @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \[ + scope: punctuation.section.brackets.begin.js.fjsx15 + set: index + + index: + - meta_scope: meta.brackets.js.fjsx15 + - match: \] + scope: punctuation.section.brackets.end.js.fjsx15a + pop: true + - match: "" + push: optional-expression + + optional-expression: + - include: ~/js/optional-expression diff --git a/integration/syntaxes/src/js/react-js.yml b/integration/syntaxes/src/js/react-js.yml new file mode 100644 index 00000000..a29d6638 --- /dev/null +++ b/integration/syntaxes/src/js/react-js.yml @@ -0,0 +1,199 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + componetnFunctions: | + (this) + \s*(\.)\s* + ((?> forceUpdate + | setState + ))\b + + propTypeFunctions: | + (?: + (React) + \s*(\.)\s* + )? + (PropTypes) + \s*(\.)\s* + ((?> arrayOf + | instanceOf + | oneOf(?:Type)? + | shape + ))\b + + reactFunctions: | + (React) + \s*(\.)\s* + ((?> createElement + | createFactory + | cloneElement + | isValidElement + ))\b + + reactDomFunctions: | + (ReactD[oO][mM]) + \s*(\.)\s* + ((?> findDOMNode + | render(?:ToS(?>taticMarkup|tring))? + | unmountComponentAtNode + ))\b + +contexts: + main: + - include: proptype-functions + - include: proptypes + - include: component-functions + - include: react-functions + - include: react-dom-functions + + arguments: + - include: ~/js/expression + + component-functions: + # Function call. + - match: (?x){{reactFunctions}}(?=\s*\() + captures: + 1: variable.language.this.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{reactFunctions}} + captures: + 1: variable.language.this.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 + pop: true + + function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - include: pop-now + + optional-property-type-and-value: + - include: ~/js/class/property#optional-type-and-value + + pop-now: + - match: "" + pop: true + + proptypes: + # Normal. + - match: | + (?x) + (?: + (React) + \s*(\.)\s* + )? + (PropTypes) + \s*(\.)\s* + ((?> any + | array + | bool + | element + | func + | node + | number + | object + | symbol + | string + ))\b + (?: + \s*(\.)\s* + (isRequired\b) + )? + captures: + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.type.object.fjsx15 + 4: punctuation.accessor.js.fjsx15 + 5: support.type.object.fjsx15 + 6: punctuation.accessor.js.fjsx15 + 7: support.type.object.fjsx15 + pop: true + # “isRequired” after function call. + - match: | + (?x) + (?<=\)) + \s*(\.)\s* + (isRequired\b) + captures: + 1: punctuation.accessor.js.fjsx15 + 2: support.type.object.fjsx15 + pop: true + + proptype-functions: + # Function call. + - match: (?x){{propTypeFunctions}}(?=\s*\() + captures: + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.type.object.fjsx15 + 4: punctuation.accessor.js.fjsx15 + 5: support.function.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{propTypeFunctions}} + captures: + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.type.object.fjsx15 + 4: punctuation.accessor.js.fjsx15 + 5: support.function.fjsx15 + pop: true + + react-dom-functions: + # Function call. + - match: (?x){{reactDomFunctions}}(?=\s*\() + captures: + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{reactDomFunctions}} + captures: + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 + pop: true + + react-functions: + # Function call. + - match: (?x){{reactFunctions}}(?=\s*\() + captures: + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{reactFunctions}} + captures: + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 + pop: true diff --git a/integration/syntaxes/src/js/statement.yml b/integration/syntaxes/src/js/statement.yml new file mode 100644 index 00000000..5c26564d --- /dev/null +++ b/integration/syntaxes/src/js/statement.yml @@ -0,0 +1,283 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - include: ~/facebook-flow/declare + - include: ~/facebook-flow/interface + - include: ~/facebook-flow/type-aliasing + - include: ~/js/decorator + - include: ~/js/import + - include: ~/js/export + - include: ~/js/class + - include: ~/js/function + - include: ~/js/variable-declaration + - include: block + - include: break-continue + - include: debugger + - include: do-while + - include: empty + - include: for + - include: if-else + - include: label + - include: return + - include: switch-case + - include: throw + - include: try-catch-finally + + asi-checked-optional-expression: + - match: (?=\s*\n) + pop: true + - include: optional-expression + + block: + - match: \{ + scope: punctuation.section.block.begin.js.fjsx15 + set: block-end + + block-end: + - meta_scope: meta.block.js.fjsx15 + - match: \} + scope: punctuation.section.block.end.js.fjsx15 + pop: true + - match: "" + push: optional-statement-or-expression + + break-continue: + - match: | + (?xi) + (?>(break)|(continue))\b + (?:\s+({{commonIdentifier}}))? + captures: + 1: keyword.control.flow.break.js.fjsx15 + 2: keyword.control.flow.break.continue.js.fjsx15 + 3: entity.name.label.js.fjsx15 + pop: true + + colon: + - match: ":" + scope: punctuation.separator.js.fjsx15 + pop: true + + comment-no-pop: + - include: ~/js/comment.no-pop + + debugger: + - match: debugger\b + scope: keyword.other.js.fjsx15 + pop: true + + do-while: + - match: do\b + scope: keyword.control.loop.js.fjsx15 + set: [ + meta-loop-do, + optional-while, + optional-statement-or-expression + ] + - match: while\b + scope: keyword.control.loop.js.fjsx15 + set: [ + meta-loop-while, + optional-statement-or-expression, + optional-expression + ] + + else-pop: + - match: (?=\S) + pop: true + + empty: + - match: \; + scope: punctuation.terminator.js.fjsx15 + pop: true + + expression: + - include: ~/js/expression + + for: + - match: for\b + scope: keyword.control.loop.js.fjsx15 + set: [ + meta-loop-for, + optional-statement-or-expression, + for-header, + optional-await + ] + + for-header: + - match: \( + scope: punctuation.section.group.begin.js.fjsx15 + set: [ meta-group, for-header-end ] + + for-header-end: + - match: \) + scope: punctuation.section.group.end.js.fjsx15 + pop: true + - match: (?=(?>const|let|var)) + push: statement-or-expression + - match: (?=\S) + push: + - include: empty + - include: expression + + if-else: + - match: if\b + scope: keyword.control.conditional.js.fjsx15 + set: [ + meta-conditional, + optional-statement-or-expression, + optional-expression + ] + - match: else\b + scope: keyword.control.conditional.js.fjsx15 + set: [ + meta-conditional, + optional-else-if + ] + + label: + - match: | + (?xi) + (?!default) + ({{commonIdentifier}}) + \s*(:) + captures: + 1: entity.name.label.js.fjsx15 + 2: punctuation.separator.js.fjsx15 + set: optional-statement-or-expression + + meta-group: + - meta_scope: meta.group.js.fjsx15 + - include: pop-now + + meta-conditional: + - meta_scope: meta.conditional.js.fjsx15 + - include: pop-now + + meta-loop-do: + - meta_scope: meta.loop.do.js.fjsx15 + - include: pop-now + + meta-loop-for: + - meta_scope: meta.loop.for.js.fjsx15 + - include: pop-now + + meta-loop-while: + - meta_scope: meta.loop.while.js.fjsx15 + - include: pop-now + + meta-switch: + - meta_scope: meta.switch.js.fjsx15 + - include: pop-now + + no-meta-if: + - match: if\b + scope: keyword.control.conditional.js.fjsx15 + set: [ + optional-statement-or-expression, + optional-expression + ] + + optional-await: + - include: ~/js/operator/await#just-pop + - include: else-pop + + optional-else-if: + - include: no-meta-if + - include: optional-statement-or-expression + + optional-expression: + - include: ~/js/optional-expression + + optional-statement-or-expression: + - include: ~/js/optional-statement-or-expression + + optional-while: + - include: comment-no-pop + - match: while\b + scope: keyword.control.loop.js.fjsx15 + set: optional-expression + + pop-now: + - match: "" + pop: true + + return: + - match: return\b + scope: keyword.control.flow.return.js.fjsx15 + set: asi-checked-optional-expression + + statement-or-expression: + - include: ~/js/comment + - include: ~/js/statement + - include: ~/js/expression + - include: else-pop + + statement-or-expression-header: + - match: \( + scope: punctuation.section.group.begin.js.fjsx15 + set: [ + meta-group, + statement-or-expression-header-end + ] + + statement-or-expression-header-end: + - match: \) + scope: punctuation.section.group.end.js.fjsx15 + pop: true + - match: (?=\S) + push: statement-or-expression + + switch-case: + - match: switch\b + scope: keyword.control.switch.js.fjsx15 + set: [ + meta-switch, + optional-expression + ] + - match: case\b + scope: keyword.control.switch.js.fjsx15 + set: [ + colon, + optional-expression + ] + - match: default\b + scope: keyword.control.switch.js.fjsx15 + set: [ + colon, + optional-expression + ] + + throw: + - match: throw\b + scope: keyword.control.flow.break.throw.js.fjsx15 + set: asi-checked-optional-expression + + try-catch-finally: + - match: try\b + scope: keyword.control.trycatch.js.fjsx15 + pop: true + - match: catch\b + scope: keyword.control.trycatch.js.fjsx15 + set: optional-expression + - match: finally\b + scope: keyword.control.trycatch.js.fjsx15 + pop: true diff --git a/integration/syntaxes/src/js/type/arguments.yml b/integration/syntaxes/src/js/type/arguments.yml new file mode 100644 index 00000000..27dee4ed --- /dev/null +++ b/integration/syntaxes/src/js/type/arguments.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \( + scope: punctuation.definition.type.arguments.begin.js.fjsx15 + set: arguments + + arguments: + - match: \) + scope: punctuation.definition.type.arguments.end.js.fjsx15 + pop: true + - match: \, + scope: punctuation.definition.type.arguments.js.fjsx15 + - match: "" + push: + # - include: ~/js/statement-and-expression + - match: "" + pop: true diff --git a/integration/syntaxes/src/js/type/support/arguments.yml b/integration/syntaxes/src/js/type/support/arguments.yml new file mode 100644 index 00000000..27dee4ed --- /dev/null +++ b/integration/syntaxes/src/js/type/support/arguments.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \( + scope: punctuation.definition.type.arguments.begin.js.fjsx15 + set: arguments + + arguments: + - match: \) + scope: punctuation.definition.type.arguments.end.js.fjsx15 + pop: true + - match: \, + scope: punctuation.definition.type.arguments.js.fjsx15 + - match: "" + push: + # - include: ~/js/statement-and-expression + - match: "" + pop: true diff --git a/integration/syntaxes/src/js/variable-declaration.yml b/integration/syntaxes/src/js/variable-declaration.yml new file mode 100644 index 00000000..67027c45 --- /dev/null +++ b/integration/syntaxes/src/js/variable-declaration.yml @@ -0,0 +1,125 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + constantIdentifier: | + [$_[:upper:]] + [$_[:upper:][:digit:]]* + +contexts: + main: + - match: (?=(?>const|let|var)\b) + set: [ + optional-type-and-initial-value, + variable-or-constant, + keyword + ] + + associated-type: + - include: ~/facebook-flow/associated-type + + comment-no-pop: + - include: ~/js/comment.no-pop + + else-pop: + - match: (?=\S) + pop: true + + keyword: + - match: (?>const|let|var)\b + scope: storage.type.js.fjsx15 + pop: true + + optional-expression: + - include: ~/js/optional-expression + + optional-type-and-initial-value: + - meta_scope: meta.declaration.variable.js.fjsx15 + - match: (?=:) + push: associated-type + - match: \, + scope: punctuation.separator.comma.js.fjsx15 + push: variable-or-constant + - match: (?==) + push: optional-expression + - include: else-pop + + optional-type: + - include: comment-no-pop + - include: ~/facebook-flow/optional-associated-type + + constant: + # Single character. + - match: | + (?x) + (\#)? + ([_[:upper:]])\b + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.constant.js.fjsx15 + pop: true + # Two or more characters. + - match: | + (?x) + (\#)? + ( + {{constantIdentifier}} + (?> \$\B + | [_[:upper:][:digit:]]\b + ) + ) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.constant.js.fjsx15 + pop: true + + variable: + # Single character. + - match: | + (?xi) + (\#)? + ((?> \$\B + | [_[:alpha:]]\b + )) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.readwrite.js.fjsx15 + pop: true + # Two or more characters. + - match: | + (?xi) + (\#)? + ( + {{commonIdentifier}} + (?> \$\B + | [_[:alnum:]]\b + ) + ) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.readwrite.js.fjsx15 + pop: true + + variable-or-constant: + - include: comment-no-pop + - include: ~/js/destructuring/array + - include: ~/js/destructuring/object + - include: ~/js/variable#function-assigned-to-variable + - include: constant + - include: variable diff --git a/integration/syntaxes/src/js/variable.yml b/integration/syntaxes/src/js/variable.yml new file mode 100644 index 00000000..f7caa573 --- /dev/null +++ b/integration/syntaxes/src/js/variable.yml @@ -0,0 +1,255 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + genericArguments: | + (< + (?> {{string}} + | \g<-1> + | [^<>] + )* + >) + + parameters: | + (\( + (?> {{string}} + | \g<-1> + | [^()] + )* + \)) + + flowOperators: | + (?> &(?!\s*&) + | \|(?!\s*\|) + ) + + string: | + (?> '(?:\'|[^'])*?' + | "(?:\"|[^"])*?" + | `(?:\`|[^`])*?` + ) + + flowObject: | + (\{ + (?> {{string}} + | \g<-1> + | [^{}] + )* + }) + + simpleFlowType: | + (?> {{string}} + | {{flowObject}} + | [$_[:alpha:]][$_[:alnum:].]* + ) + (?:\s*{{genericArguments}})? + (?:\s*\[\s*\])? + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> (?:\?\s*){{simpleFlowType}} + | \g<-1> + ) + ) + + complexType: | + (?:\?\s*)? + ( + (?> {{simpleFlowType}} + | {{flowFunction}} + | \g<-1> + ) + ) + + multipleTypes: | + ( + (?> \s*{{flowOperators}} + | \s*{{complexType}} + | \g<-1> + )+ + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | \:\s*{{multipleTypes}} + ) + + normalArrowFunction: | + (?:async\b\s*)? + (?:{{genericArguments}}\s*)? + {{parameters}} + (?:\s*{{type}})? + \s*=> + + singleParameterArrowFunction: | + (?:async\b\s+)? + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=> + + anyArrowFunction: | + (?> {{normalArrowFunction}} + | {{singleParameterArrowFunction}} + ) + + normalArrowFunctionAssignedToVariable: | + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=\s* + {{normalArrowFunction}} + + singleParameterArrowFunctionAssignedToVariable: | + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=\s* + {{singleParameterArrowFunction}} + + anyArrowFunctionAssignedToVariable: | + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=\s* + (?> {{normalArrowFunction}} + | {{singleParameterArrowFunction}} + ) + +contexts: + main: + - include: object + - include: simple + + arrow-body: + - include: ~/js/arrow-function/body + + assignment: + - match: = + scope: keyword.operator.assignment.js.fjsx15 + pop: true + + comment-no-pop: + - include: ~/js/comment.no-pop + + function-assigned-to-variable: + # Normal arrow function assigned to variable. + - match: | + (?x) + (?={{normalArrowFunctionAssignedToVariable}}) + set: [ + normal-arrow-function, + assignment, + optional-type, + function-identifier + ] + # Single parameter arrow function assigned to variable. + - match: | + (?x) + (?={{singleParameterArrowFunctionAssignedToVariable}}) + set: [ + single-parameter-arrow-function, + assignment, + optional-type, + function-identifier + ] + # Function assigned to variable. + - match: | + (?x) + (?= + {{commonIdentifier}} + (?:\s*{{type}})? + \s*=\s* + (?:async\b\s+)? + function\s + ) + set: [ + function, + assignment, + optional-type, + function-identifier + ] + + function: + - meta_scope: >- + meta.declaration.function.js.fjsx15 + meta.function.js.fjsx15 + - include: ~/js/function + + function-identifier: + - match: (?xi){{commonIdentifier}} + scope: entity.name.function.js.fjsx15 + pop: true + + normal-arrow-function: + - meta_scope: meta.declaration.function.arrow.js.fjsx15 + - include: ~/js/async.no-pop + - include: ~/facebook-flow/generic/arguments.no-pop + - include: ~/js/function/parameters.no-pop + - match: (?==>) + set: arrow-body + + single-parameter-arrow-function: + - meta_scope: meta.declaration.function.arrow.js.fjsx15 + - include: ~/js/async.no-pop + - include: ~/js/function/parameter/simple.no-pop + - match: (?==>) + set: arrow-body + + optional-type: + - include: comment-no-pop + - include: ~/facebook-flow/optional-associated-type + + object: + - match: | + (?xi) + (\#)? + ({{commonIdentifier}}) + (?=\s*\??\.) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.object.js.fjsx15 + pop: true + + simple: + # Single character. + - match: | + (?xi) + (\#)? + ((?> \$\B + | [_[:alpha:]]\b + )) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.readwrite.js.fjsx15 + pop: true + # Two or more characters. + - match: | + (?xi) + (\#)? + ( + {{commonIdentifier}} + (?> \$\B + | [_[:alnum:]]\b + ) + ) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.readwrite.js.fjsx15 + pop: true diff --git a/integration/syntaxes/src/js/web.yml b/integration/syntaxes/src/js/web.yml new file mode 100644 index 00000000..66103053 --- /dev/null +++ b/integration/syntaxes/src/js/web.yml @@ -0,0 +1,459 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + documentFunctions: | + (?> adoptNode + | close + | create + # createAttribute + (?> Attribute + # createCDATASection + | CDATASection + # createComment + | Comment + # createDocumentFragment + | DocumentFragment + # ccreateElement, reateElementNS + | Element(?:NS)? + # createExpression + | Event + # createExpression + | Expression + # createNodeIterator + | NodeIterator + # createNSResolver + | NSResolver + # createProcessingInstruction + | ProcessingInstruction + # createRange + | Range + # createTextNode + | TextNode + # createTreeWalker + | TreeWalker + ) + | elementFromPoint + | enableStyleSheetsForSet + | evaluate + | execCommand + | exitFullscreen + | getElement + # getElementById + (?> ById + | sBy + # getElementsByClassName + (?> ClassName + # getElementsByName + | Name + # getElementsByTagName, getElementsByTagNameNS + | TagName(?:NS)? + ) + ) + | getSelection + | hasFocus + | importNode + | open + | query + # queryCommand, queryCommandEnabled, queryCommandSupported + (?> Command(?>Enabled|Supported) + # querySelector, querySelectorAll + | Selector(?:All)? + ) + | releaseCapture + # write, writeln + | write(?:ln)? + )\b + + windowFunctions: | + (?> addEventListener + | alert + | atob + | blur + | btoa + # cancelAnimationFrame, cancelIddleCallback + | cancel(?>AnimationFrame|IdleCallback) + # clearInterval, clearTimeout + | clear(?>Interval|Timeout) + | close + | confirm + | convertPointFromNodeToPage + | createImageBitmap + | event + | fetch + | focus + | forward + | get + # getAttention + (?> Attention + # getComputedStyle + | ComputedStyle + # getDefaultComputedStyle + | DefaultComputedStyle + # getSelection + | Selection + ) + | home + | matchMedia + | minimize + # moveBy, moveTo + | move(?>By|To) + | open + | postMessage + | print + | prompt + # requestAnimationFrame, requestIdleCallback + | request(?>AnimationFrame|IdleCallback) + | removeEventListener + # resizeBy, resizeTo + | resize(?>By|To) + | restore + | routeEvent + | scroll + # scrollBy, scrollByPages + (?> By(?:Pages)? + # ScrollTo + | To + )? + # setInterval, setTimeout + | set(?>Interval|Timeout) + | sizeToContent + | stop + | updateCommands + )\b + +contexts: + main: + # Document property or function. + - match: (document)\s*(\.) + captures: + 1: support.type.object.dom.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: document-property-or-function + # Window property or function. + - match: (window)\s*(\.) + captures: + 1: support.type.object.dom.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: window-property-or-function + # Just the global objects. + - match: (?>document|window)\b + scope: support.type.object.dom.js.fjsx15 + pop: true + + arguments: + - include: ~/js/function-call/arguments + + document-property-or-function: + # Function call. + - match: (?x){{documentFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{documentFunctions}} + scope: support.function.js.fjsx15 + pop: true + # Properties. + - match: | + (?x) + (?> activeElement + | body + | characterSet + | childElementCount + | children + | compatMode + | currentScript + | defaultView + | designMode + | dir + | doctype + | documentElement + | documentURI + | documentURIObject + | domain + | embeds + | firstElementChild + | forms + | fullscreenElement + | fullscreenEnabled + | head + | hidden + | images + | implementation + | last + (?> ElementChild + | Modified + | StyleSheetSet + ) + | links + | location + | on + (?> abort + | animationcancel + | animationend + | blur + | change + | click + | close + | contextmenu + | dblclick + | error + | focus + | fullscreenchange + | fullscreenerror + | gotpointercapture + | input + | keydown + | keypress + | keyup + | load + | loadend + | loadstart + | lostpointercapture + | mousedown + | mousemove + | mouseout + | mouseover + | mouseup + | offline + | online + | pointercancel + | pointerdown + | pointerenter + | pointerleave + | pointermove + | pointerout + | pointerover + | pointerup + | reset + | resize + | scroll + | select + | submit + | transitioncancel + | transitionend + | visibilitychange + | wheel + ) + | plugins + | pointerLockElement + | popupNode + | preferredStyleSheetSet + | readyState + | referrer + | scripts + | scrollingElement + | selectedStyleSheetSet + | styleSheets + | styleSheetSets + | title + | tooltipNode + | URL + | visibilityState + )\b + scope: support.variable.js.fjsx15 + pop: true + # Bail. + - include: other-property-or-function + + function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - include: pop-now + + other-property-or-function: + - include: ~/js/operator/other#other-property-or-function + + pop-now: + - match: "" + pop: true + + window-property-or-function: + # Function call. + - match: (?x){{windowFunctions}}(?=\s*\() + scope: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: (?x){{windowFunctions}} + scope: support.function.js.fjsx15 + pop: true + # Properties. + - match: | + (?x) + (?> applicationCache + | caches + | closed + | console + | controllers + | crypto + | devicePixelRatio + | document + | frameElement + | frames + | fullScreen + | history + | indexedDB + # innerHeight, innerWidth + | inner(?>Height|Width) + | isSecureContext + | length + | localStorage + # location, locationbar + | location(?:bar)? + | menubar + | messageManager + | name + | navigator + | onabort + | onafterprint + | onanimation + # onanimationcancel + (?> cancel + # onanimationend + | end + # onanimationiteration + | iteration + ) + | onappinstalled + | onauxclick + | onbefore + # onbeforeinstallprompt + (?> installprompt + # onbeforeprint + | print + # onbeforeunload + | unload + ) + | onblur + | onchange + | onclick + | onclose + | oncontextmenu + | ondblclick + | ondevice + # ondevicelight + (?> light + # ondevicemotion + | motion + # ondeviceorientation + | orientation + # ondeviceorientationabsolute + | orientationabsolute + # ondevice$roximity + | proximity + ) + | onerror + | onfocus + # ongamepadconnected, ongamepaddisconnected + | ongamepad(?>connected|disconnected) + | ongotpointercapture + | onhashchange + | oninput + # onkeydown, onkeypress, onkeyup + | onkey(?>down|press|up) + | onlanguagechange + # onload, onloadend, onloadstart + | onload(?>end|start)? + | onlostpointercapture + | onmessage + | onmessageerror + # onmousedown, onmousemove, onmouseout, onmouseover, onmouseup + | onmouse(?>down|move|out|over|up) + | onpointer + # onpointercancel + (?> cancel + # onpointerenter + | enter + # onpointerleave + | leave + # onpointermove + | move + # onpointerout + | out + # onpointerover + | over + # onpointerup + | up + ) + | onpopstate + | onrejectionhandled + | onreset + | onresize + | onscroll + | onselect + | onselectionchange + | onselectstart + | onstorage + | onsubmit + # ontouchcancel, ontouchmove, ontouchstart + | ontouch(?>cancel|move|start) + # ontransitioncancel, ontransitionend + | ontransition(?>cancel|end) + | onunhandledrejection + | onunload + | onuserproximity + | onvrdisplay + # onvrdisplayactivate + (?> activate + # onvrdisplayblur + | blur + # onvrdisplayconnect + | connect + # onvrdisplaydeactivate + | deactivate + # onvrdisplaydisconnect + | disconnect + # onvrdisplayfocus + | focus + # onvrdisplaypresentchange + | presentchange + ) + | onwheel + | opener + | origin + # outerHeight, outerWidth + | outer(?>Height|Width) + | pageYOffset + | parent + | performance + | personalbar + # screen, screenX, screenY + | screen[XY]? + | scroll + # scrollbars + (?> bars + # scrollX, scrollY + | [XY] + ) + | self + | sessionStorage + | speechSynthesis + # status, statusbar + | status(?:bar)? + | toolbar + | top + | URL + | visualViewport + | window + )\b + scope: support.variable.js.fjsx15 + pop: true + # Bail. + - include: other-property-or-function diff --git a/integration/syntaxes/src/mql/array-access.yml b/integration/syntaxes/src/mql/array-access.yml new file mode 100644 index 00000000..3efc3a84 --- /dev/null +++ b/integration/syntaxes/src/mql/array-access.yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x) + \s*(\[) + captures: + 1: punctuation.definition.array.access.begin.mql.mql4 + set: index + + index: + - match: \s*(]) + captures: + 1: punctuation.definition.array.access.end.mql.mql4 + pop: true + - match: "" + push: + - match: (?=\s*]) + pop: true + - include: ~/mql/statement-and-expression diff --git a/integration/syntaxes/src/mql/cast.yml b/integration/syntaxes/src/mql/cast.yml new file mode 100644 index 00000000..8b5da621 --- /dev/null +++ b/integration/syntaxes/src/mql/cast.yml @@ -0,0 +1,56 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + + typeIdentifier: | + {{commonIdentifier}} + (?> \s*\*+ + | \s*<.*?> + (?:\s*\**) + | \b + ) + +contexts: + main: + - match: | + (?xi) + (?= + \s*\( + {{typeIdentifier}} + \s*\) + ) + set: [ + definition, + type, + definition + ] + + definition: + - match: \s*(\() + captures: + 1: punctuation.definition.cast.begin.mql.mql4 + pop: true + - match: \s*(\)) + captures: + 1: punctuation.definition.cast.end.mql.mql4 + pop: true + + type: + - include: ~/mql/type + diff --git a/integration/syntaxes/src/mql/cd-tor.inside.yml b/integration/syntaxes/src/mql/cd-tor.inside.yml new file mode 100644 index 00000000..051eca0f --- /dev/null +++ b/integration/syntaxes/src/mql/cd-tor.inside.yml @@ -0,0 +1,59 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + + typeIdentifier: | + {{commonIdentifier}} + +contexts: + main: + - match: | + (?xi) + (?=\s* + (?> \b + | \B(?:~)? + ) + {{commonIdentifier}} + \s*\( + ) + set: [ + body, + parameters, + name + ] + + name: + - match: | + (?xi)\s* + ( + (?> \b + | \B(?:~)? + ) + {{commonIdentifier}} + )\b + scope: >- + support.core.mql.mql4 + entity.name.function.mql.mql4 + pop: true + + parameters: + - include: ~/mql/function/parameters + + body: + - include: ~/mql/function/body diff --git a/integration/syntaxes/src/mql/cd-tor.outside.yml b/integration/syntaxes/src/mql/cd-tor.outside.yml new file mode 100644 index 00000000..68135bb2 --- /dev/null +++ b/integration/syntaxes/src/mql/cd-tor.outside.yml @@ -0,0 +1,69 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + + typeIdentifier: | + {{commonIdentifier}} + +contexts: + main: + - match: | + (?xi) + (?= + \s*\b + {{commonIdentifier}}::(?:~)?{{commonIdentifier}} + \s*\( + ) + set: [ + body, + parameters, + name, + scope-operator, + class + ] + + class: + - match: (?xi)\s*\b({{commonIdentifier}})\b + captures: + 1: entity.name.class.mql.mql4 + pop: true + + scope-operator: + - match: \s*(::) + captures: + 1: keyword.operator.other.scope.mql.mql4 + pop: true + + name: + - match: | + (?xi) + (?> \b + | \B(?:~)? + ) + {{commonIdentifier}}\b + scope: >- + support.core.mql.mql4 + entity.name.function.mql.mql4 + pop: true + + parameters: + - include: ~/mql/function/parameters + + body: + - include: ~/mql/function/body diff --git a/integration/syntaxes/src/mql/class.yml b/integration/syntaxes/src/mql/class.yml new file mode 100644 index 00000000..83723dc0 --- /dev/null +++ b/integration/syntaxes/src/mql/class.yml @@ -0,0 +1,89 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - match: \s*\b(class)\b + captures: + 1: >- + storage.type.mql.mql4 + keyword.declaration.class.mql.mql4 + set: identifier + + identifier: + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: entity.name.class.mql.mql4 + set: inheritance + + inheritance: + - include: comment + # End of declaration. + - match: \s*(;) + captures: + 1: punctuation.definition.class.body.end.mql.mql4 + pop: true + # Body beginning. + - match: \s*(\{) + captures: + 1: punctuation.definition.class.body.begin.mql.mql4 + set: body-content + # Inherited class access. + - match: | + (?xi) + \s*(:) + \s*( + (?> public + | protected + | private + ) + )\s* + captures: + 1: >- + storage.modifier.mql.mql4 + keyword.operator.other.inherit.mql.mql4 + 2: >- + storage.modifier.mql.mql4 + keyword.other.access.mql.mql4 + # Inherited class. + - match: "" + push: + - include: ~/mql/type + + body-content: + - include: comment + - match: \s*(};?) + captures: + 1: punctuation.definition.class.body.end.mql.mql4 + pop: true + - match: "" + push: + - match: (?=\s*}) + pop: true + - include: comment + - include: ~/mql/cd-tor.inside + - include: ~/mql/statement/hanging + - include: ~/mql/function + - include: ~/mql/variable-declaration + + comment: + - include: ~/mql/comment.no-pop diff --git a/integration/syntaxes/src/mql/comment.no-pop.yml b/integration/syntaxes/src/mql/comment.no-pop.yml new file mode 100644 index 00000000..3a44eac6 --- /dev/null +++ b/integration/syntaxes/src/mql/comment.no-pop.yml @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x) + (?=\s*/ + (?> / + | \* + ) + ) + push: + - include: ~/mql/comment diff --git a/integration/syntaxes/src/mql/comment/index.yml b/integration/syntaxes/src/mql/comment/index.yml new file mode 100644 index 00000000..5a3e6dfa --- /dev/null +++ b/integration/syntaxes/src/mql/comment/index.yml @@ -0,0 +1,18 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/mql/comment/normal diff --git a/integration/syntaxes/src/mql/comment/normal.yml b/integration/syntaxes/src/mql/comment/normal.yml new file mode 100644 index 00000000..37a81cb8 --- /dev/null +++ b/integration/syntaxes/src/mql/comment/normal.yml @@ -0,0 +1,54 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(//) + captures: + 1: punctuation.definition.comment.begin.mql.mql4 + set: line + - match: \s*(/\*) + captures: + 1: punctuation.definition.comment.begin.mql.mql4 + set: block + + line: + - meta_scope: comment.line.mql.mql4 + - include: email + - include: link + - match: \s*$ + pop: true + + block: + - meta_scope: comment.block.mql.mql4 + - include: email + - include: link + - match: \s*(\*/) + captures: + 1: punctuation.definition.comment.end.mql.mql4 + set: + # Used to fix the block comment indentation settings. + # https://forum.sublimetext.com/t/everything-you-n-ever-wanted-to-know-about-indentation-in-st3/26207/6 + - match: \s*$\n? + scope: meta.block-end.mql.mql4 + pop: true + - match: '' + pop: true + + link: + - include: ~/shared/link + + email: + - include: ~/shared/email diff --git a/integration/syntaxes/src/mql/constant/index.yml b/integration/syntaxes/src/mql/constant/index.yml new file mode 100644 index 00000000..d858f3a8 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/index.yml @@ -0,0 +1,49 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # Types that look like constants. + - include: ~/mql/type/support/enums + # Actual constants. + - include: ~/mql/constant/support/align-mode + - include: ~/mql/constant/support/anchor + - include: ~/mql/constant/support/applied-price + - include: ~/mql/constant/support/border + - include: ~/mql/constant/support/chart-events + - include: ~/mql/constant/support/chart-properties + - include: ~/mql/constant/support/chart-positioning + - include: ~/mql/constant/support/chart-representation + - include: ~/mql/constant/support/color + - include: ~/mql/constant/support/core + - include: ~/mql/constant/support/corner + - include: ~/mql/constant/support/custom-indicator-properties + - include: ~/mql/constant/support/drawing-styles + - include: ~/mql/constant/support/error-codes + - include: ~/mql/constant/support/indicator-lines + - include: ~/mql/constant/support/init-ret-code + - include: ~/mql/constant/support/gann + - include: ~/mql/constant/support/object-periods + - include: ~/mql/constant/support/object-property + - include: ~/mql/constant/support/object-type + - include: ~/mql/constant/support/order-selection + - include: ~/mql/constant/support/order-type + - include: ~/mql/constant/support/other + - include: ~/mql/constant/support/series-identifiers + - include: ~/mql/constant/support/smoothing-methods + - include: ~/mql/constant/support/symbol-properties + - include: ~/mql/constant/support/timeframes + - include: ~/mql/constant/support/uninit-reason + - include: ~/mql/constant/normal diff --git a/integration/syntaxes/src/mql/constant/normal.yml b/integration/syntaxes/src/mql/constant/normal.yml new file mode 100644 index 00000000..3b1d76b4 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/normal.yml @@ -0,0 +1,36 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + constantIdentifier: | + [_[:upper:]] + [_[:upper:][:digit:]]+ + +contexts: + main: + # Multiple characters. + - match: | + (?x)\s* + ({{constantIdentifier}})\b + captures: + 1: entity.name.constant.mql.mql4 + pop: true + # Single character. + - match: | + (?x)\s* + ([[:upper:]])\b + captures: + 1: entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/align-mode.yml b/integration/syntaxes/src/mql/constant/support/align-mode.yml new file mode 100644 index 00000000..035d109a --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/align-mode.yml @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + ALIGN_ + (?> LEFT + | CENTER + | RIGHT + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/anchor.yml b/integration/syntaxes/src/mql/constant/support/anchor.yml new file mode 100644 index 00000000..84dc52f4 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/anchor.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + ANCHOR_ + (?> BOTTOM + | CENTER + | LEFT(?:_(?>LOWER|UPPER))? + | LOWER + | RIGHT(?:_(?>LOWER|UPPER))? + | TOP + | UPPER + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/applied-price.yml b/integration/syntaxes/src/mql/constant/support/applied-price.yml new file mode 100644 index 00000000..e627cfe5 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/applied-price.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + PRICE_ + (?> CLOSE + | HIGH + | LOW + | MEDIAN + | OPEN + | TYPICAL + | WEIGHTED + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/border.yml b/integration/syntaxes/src/mql/constant/support/border.yml new file mode 100644 index 00000000..5d609b5c --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/border.yml @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + BORDER_ + (?> FLAT + | RAISED + | SUNKEN + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/chart-events.yml b/integration/syntaxes/src/mql/constant/support/chart-events.yml new file mode 100644 index 00000000..b42a0db4 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/chart-events.yml @@ -0,0 +1,37 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + CHARTEVENT_ + (?> KEYDOWN + | MOUSE_MOVE + | OBJECT_ + (?:CREATE|CHANGE|DELETE) + | CLICK + | OBJECT_ + (?>CLICK|DRAG|ENDEDIT) + | CHART_CHANGE + | CUSTOM(?:_LAST)? + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/chart-positioning.yml b/integration/syntaxes/src/mql/constant/support/chart-positioning.yml new file mode 100644 index 00000000..ca9882fd --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/chart-positioning.yml @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + CHART_ + (?> BEGIN + | CURRENT_POS + | END + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/chart-properties.yml b/integration/syntaxes/src/mql/constant/support/chart-properties.yml new file mode 100644 index 00000000..56dd6c81 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/chart-properties.yml @@ -0,0 +1,91 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + CHART_ + (?> AUTOSCROLL + | BRING_TO_TOP + | COLOR_ + (?> ASK + | BACKGROUND + | BID + | CANDLE_ + (?>BEAR|BULL) + | CHART_ + (?>DOWN|LINE|UP) + | FOREGROUND + | GRID + | LAST + | STOP_LEVEL + | VOLUME + ) + | COMMENT + | DRAG_TRADE_LEVELS + | EVENT_ + (?> MOUSE_MOVE + | OBJECT_ + (?>CREATE|DELETE) + ) + | FIRST_VISIBLE_BAR + | FIXED_ + (?>MAX|MIN|POSITION) + | FOREGROUND + | HEIGHT_IN_PIXELS + | IS_OFFLINE + | MODE + | MOUSE_SCROLL + | POINTS_PER_BAR + | PRICE_ + (?>MAX|MIN) + | SCALE + (?> _PT_PER_BAR + | FIX(?:_11)? + )? + | SHIFT(?:_SIZE)? + | SHOW_ + (?> ASK_LINE + | BID_LINE + | DATE_SCALE + | GRID + | LAST_LINE + | OBJECT_DESCR + | OHLC + | PERIOD_SEP + | PRICE_SCALE + | TRADE_LEVELS + | VOLUMES + ) + | VISIBLE_BARS + | WIDTH_IN_ + (?:BARS|PIXELS) + | WINDOW + (?> S_TOTAL + | _ + (?> HANDLE + | IS_VISIBLE + | YDISTANCE + ) + ) + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/chart-representation.yml b/integration/syntaxes/src/mql/constant/support/chart-representation.yml new file mode 100644 index 00000000..8a51900f --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/chart-representation.yml @@ -0,0 +1,33 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + CHART_ + (?> BARS + | CANDLES + | LINE + | VOLUME_ + (?>HIDE|TICK) + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/color.yml b/integration/syntaxes/src/mql/constant/support/color.yml new file mode 100644 index 00000000..48548dda --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/color.yml @@ -0,0 +1,155 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + clr + (?> AliceBlue + | AntiqueWhite + | Aqua(?:marine)? + | Beige + | Bisque + | Black + | BlanchedAlmond + | Blue(?:Violet)? + | Brown + | BurlyWood + | CadetBlue + | Chartreuse + | Chocolate + | Coral + | Corn + (?>flowerBlue|silk) + | Crimson + | Dark + (?> Blue + | Goldenrod + | Gray + | Green + | Khaki + | OliveGreen + | Orange + | Orchid + | Salmon + | SeaGreen + | Slate + (?>Blue|Gray) + | Turquoise + | Violet + ) + | Deep + (?:Pink|SkyBlue) + | DimGray + | DodgerBlue + | FireBrick + | ForestGreen + | Gainsboro + | Gold(?:enrod)? + | Gray + | Green(?:Yellow)? + | Honeydew + | HotPink + | IndianRed + | Indigo + | Ivory + | Khaki + | Lavender(?:Blush)? + | LawnGreen + | LemonChiffon + | Light + (?> Blue + | Coral + | Cyan + | Goldenrod + | Gray + | Green + | Pink + | Salmon + | SeaGreen + | SkyBlue + | SlateGray + | SteelBlue + | Yellow + ) + | Lime(?:Green)? + | Linen + | Magenta + | Maroon + | Medium + (?> Aquamarine + | Blue + | Orchid + | Purple + | SeaGreen + | SlateBlue + | SpringGreen + | Turquoise + | VioletRed + ) + | MidnightBlue + | MintCream + | MistyRose + | Moccasin + | NavajoWhite + | Navy + | OldLace + | Olive(?:Drab)? + | Orange(?:Red)? + | Orchid + | PaleGoldenrod + | Pale + (?:Green|Turquoise|VioletRed) + | PapayaWhip + | PeachPuff + | Peru + | Pink + | Plum + | PowderBlue + | Purple + | Red + | RosyBrown + | RoyalBlue + | SaddleBrown + | Salmon + | SandyBrown + | Sea + (?:Green|shell) + | Sienna + | Silver + | SkyBlue + | Slate + (?:Blue|Gray) + | Snow + | SpringGreen + | SteelBlue + | Tan + | Teal + | Thistle + | Tomato + | Turquoise + | Violet + | Wheat + | White(?:Smoke)? + | Yellow(?:Green)? + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/core.yml b/integration/syntaxes/src/mql/constant/support/core.yml new file mode 100644 index 00000000..bf713d26 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/core.yml @@ -0,0 +1,37 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*\b(NULL)\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + - include: case-insentive + + case-insentive: + - match: | + (?xi)\s* + \b( + (?> true + | false + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/corner.yml b/integration/syntaxes/src/mql/constant/support/corner.yml new file mode 100644 index 00000000..76ce5d50 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/corner.yml @@ -0,0 +1,30 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + CORNER_ + (?> LEFT_(?>UPPER|LOWER) + | RIGHT_(?>UPPER|LOWER) + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/custom-indicator-properties.yml b/integration/syntaxes/src/mql/constant/support/custom-indicator-properties.yml new file mode 100644 index 00000000..0778d2e5 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/custom-indicator-properties.yml @@ -0,0 +1,43 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + INDICATOR_ + (?> CALCULATIONS + | COLOR_INDEX + | DATA + | DIGITS + | HEIGHT + | LEVEL + (?> COLOR + | S(?:TYLE)? + | TEXT + | VALUE + | WIDTH + ) + | MAXIMUM + | MINIMUM + | SHORTNAME + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/drawing-styles.yml b/integration/syntaxes/src/mql/constant/support/drawing-styles.yml new file mode 100644 index 00000000..26c66f55 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/drawing-styles.yml @@ -0,0 +1,41 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ( + (?> DRAW_ + (?> ARROW + | HISTOGRAM + | LINE + | NONE + | SECTION + | ZIGZAG + ) + | + STYLE_ + (?> DASH(?:DOT){0,2} + | DOT + | SOLID + ) + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/error-codes.yml b/integration/syntaxes/src/mql/constant/support/error-codes.yml new file mode 100644 index 00000000..2f6ae288 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/error-codes.yml @@ -0,0 +1,153 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + ERR_ + (?> ACCOUNT_DISABLED + | ARRAY_ + (?> AS_PARAMETER_EXPECTED + | INDEX_OUT_OF_RANGE + ) + | BROKER_BUSY + | CANNOT_ + (?> CALL_FUNCTION + | LOAD_LIBRARY + | OPEN_FILE + ) + | COMMON_ERROR + | CUSTOM_INDICATOR_ERROR + | DLL_CALLS_NOT_ALLOWED + | DOUBLE_PARAMETER_EXPECTED + | END_OF_FILE + | EXTERNAL_EXPERT_CALLS_NOT_ALLOWED + | FUNCTION_NOT_ + (?> ALLOWED_IN_TESTING_MODE + | CONFIRMED + ) + | GLOBAL_VARIABLE + (?> _NOT_FOUND + | S_PROCESSING_ERROR + ) + | HISTORY_WILL_UPDATED + | INCOMPATIBLE_ + (?> ACCESS_TO_FILE + | ARRAYS + ) + | INCORRECT_SERIES_ARRAY_USING + | INTEGER_PARAMETER_EXPECTED + | INVALID_ + (?> ACCOUNT + | FUNCTION_PARAMETER + (?> _VALUE + | S_COUNT + ) + | PRICE(?:_PARAM)? + | STOPS + | TICKET + | TRADE_(?:PARAMETERS|VOLUME) + ) + | LONG + (?> _POSITIONS_ONLY_ALLOWED + | S_NOT_ALLOWED + ) + | MALFUNCTIONAL_TRADE + | MARKET_CLOSED + | NO + (?> _ + (?> CONNECTION + | ERROR + | MEMORY_FOR_ + (?> ARRAYSTRING + | FUNCTION_CALL_STACK + | PARAMETER_STRING + | TEMP_STRING + ) + | MQLERROR + | OBJECT_NAME + | ORDER_SELECTED + | RESULT + | SPECIFIED_SUBWINDOW + ) + | T_ + (?> ENOUGH_ + (?> MEMORY_FOR_RETURNED_STRING + | MONEY + | RIGHTS + | STACK_FOR_PARAMETER + ) + | INITIALIZED_ + (?> ARRAY(?:STRING)? + | STRING + ) + ) + ) + | OBJECT_ + (?> ALREADY_EXISTS + | COORDINATES_ERROR + | DOES_NOT_EXIST + ) + | OFF_QUOTES + | OLD_VERSION + | ORDER_LOCKED + | PRICE_CHANGED + | RECURSIVE_STACK_OVERFLOW + | REMAINDER_FROM_ZERO_DIVIDE + | REQUOTE + | SEND_MAIL_ERROR + | SERVER_BUSY + | SHORTS_NOT_ALLOWED + | SOME_(?>ARRAY_ERROR|FILE_ERROR|OBJECT_ERROR) + | STRING_ + (?> FUNCTION_INTERNAL_ERROR + | PARAMETER_EXPECTED + ) + | SYSTEM_BUSY + | TOO_ + (?> FREQUENT_REQUESTS + | LONG_STRING + | MANY_(?>OPENED_FILES|REQUESTS) + ) + | TRADE_ + (?> CONTEXT_BUSY + | DISABLED + | ERROR + | EXPIRATION_DENIED + | MODIFY_DENIED + | NOT_ALLOWED + | TIMEOUT + | TOO_MANY_ORDERS + ) + | UNKNOWN_ + (?> COMMAND + | OBJECT_(?>PROPERTY|TYPE) + | SYMBOL + ) + | WRONG_ + (?> FILE_NAME + | FUNCTION_POINTER + | JUMP + ) + | ZERO_DIVIDE + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/gann.yml b/integration/syntaxes/src/mql/constant/support/gann.yml new file mode 100644 index 00000000..8dbc058b --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/gann.yml @@ -0,0 +1,30 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + GANN_ + (?> UP_TREND + | DOWN_TREND + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/indicator-lines.yml b/integration/syntaxes/src/mql/constant/support/indicator-lines.yml new file mode 100644 index 00000000..0dd5d8f1 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/indicator-lines.yml @@ -0,0 +1,39 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + MODE_ + (?> MAIN + | CHIKOUSPAN + | GATOR(?>JAW|LIPS|TEETH) + | KIJUNSEN + | LOWER + | MINUSDI + | PLUSDI + | SENKOUSPAN[AB] + | SIGNAL + | TENKANSEN + | UPPER + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/init-ret-code.yml b/integration/syntaxes/src/mql/constant/support/init-ret-code.yml new file mode 100644 index 00000000..1669083e --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/init-ret-code.yml @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + INIT_ + (?> SUCCEEDED + | FAILED + | PARAMETERS_INCORRECT + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/object-periods.yml b/integration/syntaxes/src/mql/constant/support/object-periods.yml new file mode 100644 index 00000000..e263e7e9 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/object-periods.yml @@ -0,0 +1,40 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + OBJ_ + (?> NO_PERIODS + | PERIOD_ + (?> M15? + | M5 + | M30 + | H1 + | H4 + | D1 + | W1 + | MN1 + ) + | ALL_PERIODS + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/object-property.yml b/integration/syntaxes/src/mql/constant/support/object-property.yml new file mode 100644 index 00000000..4ec5e22f --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/object-property.yml @@ -0,0 +1,78 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + OBJPROP_ + (?> ALIGN + | ANCHOR + | ANGLE + | ARROWCODE + | BACK + | BGCOLOR + | BMPFILE + | BORDER_ + (?>COLOR|TYPE) + | COLOR + | CORNER + | CREATETIME + | DEVIATION + | DRAWLINES + | ELLIPSE + | FIBOLEVELS + | FIRSTLEVEL + | FONT(?:SIZE)? + | HIDDEN + | LEVEL + (?> COLOR + | S(TYLE)? + | TEXT + | VALUE + | WIDTH + ) + | NAME + | PRICE + (?>1|2|3)? + | RAY(?:_RIGHT)? + | READONLY + | SCALE + | SELECT + (?>ABLE|ED) + | STATE + | STYLE + | SYMBOL + | TEXT + | TIME + (?>1|2|3|FRAMES)? + | TOOLTIP + | TYPE + | WIDTH + | XDISTANCE + | XOFFSET + | XSIZE + | YDISTANCE + | YOFFSET + | YSIZE + | ZORDER + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/object-type.yml b/integration/syntaxes/src/mql/constant/support/object-type.yml new file mode 100644 index 00000000..f5c4ff94 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/object-type.yml @@ -0,0 +1,66 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + OBJ_ + (?> ARROW + (?:_ + (?> BUY + | CHECK + | DOWN + | LEFT_PRICE + | RIGHT_PRICE + | SELL + | STOP + | THUMB_(?>DOWN|UP) + | UP + ) + )? + | BITMAP(?:_LABEL)? + | BUTTON + | CHANNEL + | CYCLES + | EDIT + | ELLIPSE + | EVENT + | EXPANSION + | FIBO + (?> ARC + | CHANNEL + | FAN + | TIMES + )? + | GANN(?>FAN|GRID|LINE)? + | HLINE + | LABEL + | PITCHFORK + | RECTANGLE(?:_LABEL)? + | REGRESSION + | STDDEVCHANNEL + | TEXT + | TREND(?:BYANGLE)? + | TRIANGLE + | VLINE + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/order-selection.yml b/integration/syntaxes/src/mql/constant/support/order-selection.yml new file mode 100644 index 00000000..48690250 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/order-selection.yml @@ -0,0 +1,29 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + (?> MODE_(?>HISTORY|TRADES) + | SELECT_BY_(?>POS|TICKET) + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/order-type.yml b/integration/syntaxes/src/mql/constant/support/order-type.yml new file mode 100644 index 00000000..2a9feaa1 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/order-type.yml @@ -0,0 +1,30 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + OP_ + (?> BUY(?>LIMIT|STOP)? + | SELL(?>LIMIT|STOP)? + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/other.yml b/integration/syntaxes/src/mql/constant/support/other.yml new file mode 100644 index 00000000..5b39ce00 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/other.yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + (?> CHARTS_MAX + | CLR_NONE + | EMPTY(?:_VALUE)? + | INVALID_HANDLE + | IS_(?>DEBUG_MODE|PROFILE_MODE) + | WHOLE_ARRAY + | WRONG_VALUE + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/series-identifiers.yml b/integration/syntaxes/src/mql/constant/support/series-identifiers.yml new file mode 100644 index 00000000..a7ed71c6 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/series-identifiers.yml @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + MODE_ + (?> CLOSE + | OPEN + | VOLUME + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/smoothing-methods.yml b/integration/syntaxes/src/mql/constant/support/smoothing-methods.yml new file mode 100644 index 00000000..9132f3ff --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/smoothing-methods.yml @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + MODE_ + (?> EMA + | LWMA + | SM(?>A|MA) + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/symbol-properties.yml b/integration/syntaxes/src/mql/constant/support/symbol-properties.yml new file mode 100644 index 00000000..cec278e7 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/symbol-properties.yml @@ -0,0 +1,55 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + MODE_ + (?> ASK + | BID + | CLOSEBY_ALLOWED + | DIGITS + | EXPIRATION + | FREEZELEVEL + | HIGH + | LOT(?>SIZE|STEP) + | LOW + | MARGIN + (?> CALCMODE + | HEDGED + | INIT + | MAINTENANCE + | REQUIRED + ) + | MAXLOT + | MINLOT + | POINT + | PROFITCALCMODE + | SPREAD + | STARTING + | STOPLEVEL + | SWAP(?>LONG|SHORT|TYPE) + | TICK(?>SIZE|VALUE) + | TIME + | TRADEALLOWED + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/timeframes.yml b/integration/syntaxes/src/mql/constant/support/timeframes.yml new file mode 100644 index 00000000..4e26b011 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/timeframes.yml @@ -0,0 +1,42 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + PERIOD_ + (?> CURRENT + | D1 + | H + (?> 12? + | [23468] + ) + | M + (?> 1[025]? + | 20? + | 30? + | [456] + | N1 + ) + | W1 + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/constant/support/uninit-reason.yml b/integration/syntaxes/src/mql/constant/support/uninit-reason.yml new file mode 100644 index 00000000..21350a50 --- /dev/null +++ b/integration/syntaxes/src/mql/constant/support/uninit-reason.yml @@ -0,0 +1,36 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + \b( + REASON_ + (?> ACCOUNT + | CHART(?>CHANGE|CLOSE) + | CLOSE + | INITFAILED + | PARAMETERS + | PROGRAM + | RE(?>COMPILE|MOVE) + | TEMPLATE + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.constant.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/enum.yml b/integration/syntaxes/src/mql/enum.yml new file mode 100644 index 00000000..cc0e25b4 --- /dev/null +++ b/integration/syntaxes/src/mql/enum.yml @@ -0,0 +1,81 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - match: \s*\b(enum)\b + captures: + 1: >- + storage.type.mql.mql4 + keyword.enum.mql.mql4 + set: identifier + + identifier: + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: entity.name.enum.mql.mql4 + set: body + + body: + - include: comment + - match: \s*(\{) + captures: + 1: punctuation.definition.enum.body.begin.mql.mql4 + set: body-content + + body-content: + - include: comment + # End of enum. + - match: \s*(};?) + captures: + 1: punctuation.definition.enum.body.end.mql.mql4 + pop: true + # definition. + - match: \s*(,) + captures: + 1: punctuation.definition.enum.items.mql.mql4 + # Optional value. + - match: \s*(=) + captures: + 1: keyword.operator.other.assignment.mql.mql4 + push: + - match: (?=\s*[,}]) + pop: true + - match: "" + push: + - include: statement-and-expression + - match: "" + pop: true + # Item. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: >- + enum.item.mql.mql4 + entity.name.variable.mql.mql4 + + comment: + - include: ~/mql/comment.no-pop + + statement-and-expression: + - include: ~/mql/statement-and-expression diff --git a/integration/syntaxes/src/mql/function-call/arguments.yml b/integration/syntaxes/src/mql/function-call/arguments.yml new file mode 100644 index 00000000..4141c990 --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/arguments.yml @@ -0,0 +1,44 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(\() + captures: + 1: punctuation.definition.function.arguments.begin.mql.mql4 + set: arguments + + arguments: + - match: \s*(\)) + captures: + 1: punctuation.definition.function.arguments.end.mql.mql4 + pop: true + - match: \s*(,) + captures: + 1: punctuation.definition.function.arguments.mql.mql4 + - match: "" + push: + - match: | + (?x) + (?=\s* + (?> , + | \) + ) + ) + pop: true + - include: statement-and-expression + + statement-and-expression: + - include: ~/mql/statement-and-expression diff --git a/integration/syntaxes/src/mql/function-call/index.yml b/integration/syntaxes/src/mql/function-call/index.yml new file mode 100644 index 00000000..f356efcd --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/index.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/mql/function-call/support/account + - include: ~/mql/function-call/support/array + - include: ~/mql/function-call/support/chart + - include: ~/mql/function-call/support/checkup + - include: ~/mql/function-call/support/common + - include: ~/mql/function-call/support/conversion + - include: ~/mql/function-call/support/custom-indicator + - include: ~/mql/function-call/support/datetime + - include: ~/mql/function-call/support/file + - include: ~/mql/function-call/support/indicators + - include: ~/mql/function-call/support/market + - include: ~/mql/function-call/support/math + - include: ~/mql/function-call/support/object + - include: ~/mql/function-call/support/string + - include: ~/mql/function-call/support/timeseries + - include: ~/mql/function-call/support/trade-signals + - include: ~/mql/function-call/support/trade + - include: ~/mql/function-call/normal diff --git a/integration/syntaxes/src/mql/function-call/normal.yml b/integration/syntaxes/src/mql/function-call/normal.yml new file mode 100644 index 00000000..075d1aae --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/normal.yml @@ -0,0 +1,140 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + + logicalOperators: | + (?> && + | \|\| + | ! + ) + + comparisonOperators: | + (?> == + | != + | >= + | <= + | >(?!>) + | <(?!<) + ) + + bitwiseOperators: | + (?> ~=? + | &=? + | \|=? + | \^=? + | <<=? + | >>>=? + | >>=? + ) + + arithmeticOperators: | + (?> -- + | -=? + | \+\+ + | \+=? + | \*\* + | \*=? + | /=? + | %=? + ) + + functionIdentifier: | + (?> operator + (?> {{comparisonOperators}} + | {{logicalOperators}} + | {{bitwiseOperators}} + | {{arithmeticOperators}} + | = + ) + | {{commonIdentifier}} + ) + + typeIdentifier: | + {{commonIdentifier}} + (?:\s*<.*?>\s+)? + (?:\s*\**)? + +scope: ... + +contexts: + main: + # Scoped function call. + - match: | + (?xi) + (?=\s* + \b{{typeIdentifier}}::{{functionIdentifier}} + \s*\( + ) + set: [ + name, + scope-operator, + class + ] + # Normal function call. + - match: | + (?xi) + (?=\s* + \b{{functionIdentifier}} + \s*\( + ) + set: name + + class: + - match: | + (?xi)\s* + \b({{typeIdentifier}})\b + captures: + 1: entity.name.class.mql.mql4 + pop: true + + scope-operator: + - match: \s*(::) + captures: + 1: keyword.operator.other.scope.mql.mql4 + pop: true + + name: + # Special function name. + - match: | + (?x)\s* + ((?> On + (?> Calculate + | Deinit + | Init + | Start + ) + ))(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + # Common function name. + - match: | + (?xi)\s* + ({{functionIdentifier}}) + captures: + 1: entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments + diff --git a/integration/syntaxes/src/mql/function-call/support/account.yml b/integration/syntaxes/src/mql/function-call/support/account.yml new file mode 100644 index 00000000..dc3575c5 --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/account.yml @@ -0,0 +1,45 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ( + Account + (?> Balance + | Company + | Credit + | Currency + | Equity + | FreeMargin(?>Check|Mode)? + | Info(?>Double|Integer|String) + | Leverage + | Margin + | Name + | Number + | Profit + | Server + | Stopout(?>Level|Mode) + ) + )(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/array.yml b/integration/syntaxes/src/mql/function-call/support/array.yml new file mode 100644 index 00000000..fed1d3c3 --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/array.yml @@ -0,0 +1,49 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ( + Array + (?> Bsearch + | Compare + | Copy + (?>Rates|Series)? + | Dimension + | Fill + | Free + | GetAsSeries + | Initialize + | Is + (?>Dynamic|Series) + | Maximum + | Minimum + | Range + | Resize + | SetAsSeries + | Size + | Sort + ) + )(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/chart.yml b/integration/syntaxes/src/mql/function-call/support/chart.yml new file mode 100644 index 00000000..0e8a3f2a --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/chart.yml @@ -0,0 +1,68 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> Chart + (?> ApplyTemplate + | Close + | First + | Get(?>Double|Integer|String) + | ID + | Indicator(?>Delete|Name|sTotal) + | Navigate + | Next + | Open + | Period + | PriceOnDropped + | Redraw + | SaveTemplate + | ScreenShot + | Set(?>Double|Integer|String|SymbolPeriod) + | Symbol + | Time(?>OnDropped|PriceToXY) + | Window(?>Find|OnDropped) + | XOnDropped + | XYToTimePrice + | YOnDropped + ) + | Period + | Symbol + | Window + (?> BarsPerChart + | ExpertName + | Find + | FirstVisibleBar + | Handle + | IsVisible + | OnDropped + | Price(?:Max|Min|OnDropped) + | Redraw + | ScreenShot + | sTotal + | TimeOnDropped + | (?>X|Y)OnDropped + ) + ))(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/checkup.yml b/integration/syntaxes/src/mql/function-call/support/checkup.yml new file mode 100644 index 00000000..55e93cbc --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/checkup.yml @@ -0,0 +1,52 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> Digits + | GetLastError + | Is + (?> Connected + | Demo + | DllsAllowed + | ExpertEnabled + | LibrariesAllowed + | Optimization + | Stopped + | Testing + | Trade(?>Allowed|ContextBusy) + | VisualMode + ) + | MQLInfo(?>Integer|String) + | MQLSetInteger + | Point + | Terminal + (?> Company + | Info(?>Double|Integer|String) + | Name + | Path + ) + | UninitializeReason + ))(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/common.yml b/integration/syntaxes/src/mql/function-call/support/common.yml new file mode 100644 index 00000000..e9ada39f --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/common.yml @@ -0,0 +1,48 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> Alert + | CheckPointer + | Comment + | Crypt(?>De|En)code + | DebugBreak + | ExpertRemove + | Get(?>MicrosecondCount|Pointer|TickCount) + | MessageBox + | PeriodSeconds + | PlaySound + | Print(?:Format)? + | ResetLastError + | Resource(?>Create|Free|ReadImage|Save) + | Send(?>FTP|Mail|Notification) + | SetUserError + | Sleep + | TerminalClose + | TesterStatistics + | WebRequest + | ZeroMemory + ))(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/conversion.yml b/integration/syntaxes/src/mql/function-call/support/conversion.yml new file mode 100644 index 00000000..841ce68d --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/conversion.yml @@ -0,0 +1,48 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> Char(?>ArrayToString|ToStr(?:ing)?) + | ColorTo(?>ARGB|String) + | DoubleToStr(?:ing)? + | EnumToString + | IntegerToString + | NormalizeDouble + | Short(?>ArrayToString|ToString) + | String + (?> Format + | To + (?> CharArray + | Color + | Double + | Integer + | ShortArray + | Time + ) + ) + | StrTo(?>Double|Integer|Time) + | TimeToStr(?:ing)? + ))(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/custom-indicator.yml b/integration/syntaxes/src/mql/function-call/support/custom-indicator.yml new file mode 100644 index 00000000..f0b32667 --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/custom-indicator.yml @@ -0,0 +1,48 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> HideTestIndicators + | Indicator + (?> Buffers + | Counted + | Digits + | Set(?>Double|Integer|String) + | ShortName + ) + | Set + (?> Index + (?> Arrow + | Buffer + | DrawBegin + | EmptyValue + | Label + | Shift + | Style + ) + | Level(?>Style|Value) + ) + ))(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/datetime.yml b/integration/syntaxes/src/mql/function-call/support/datetime.yml new file mode 100644 index 00000000..602c654a --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/datetime.yml @@ -0,0 +1,50 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> Day(?:Of(?>Week|Year))? + | Hour + | Minute + | Month + | Seconds + | StructToTime + | Time + (?> Current + | Day + (?> lightSavings + | Of(?>Week|Year) + )? + | GMT(?:Offset)? + | Hour + | Local + | Minute + | Month + | Seconds + | ToStruct + | Year + ) + | Year + ))(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/file.yml b/integration/syntaxes/src/mql/function-call/support/file.yml new file mode 100644 index 00000000..b0f96c80 --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/file.yml @@ -0,0 +1,64 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> File + (?> Close + | Copy + | Delete + | Find(?>Close|First|Next) + | Flush + | GetInteger + | Is(?>Ending|Exist|LineEnding) + | Move + | Open(?:History)? + | Read + (?> Array + | Bool + | Datetime + | Double + | Float + | Integer + | Long + | Number + | String + | Struct + ) + | Seek + | Size + | Tell + | Write + (?> Array + | Double + | Float + | Integer + | Long + | String + | Struct + )? + ) + | Folder(?>Clean|Create|Delete) + ))(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/indicators.yml b/integration/syntaxes/src/mql/function-call/support/indicators.yml new file mode 100644 index 00000000..5d1154e4 --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/indicators.yml @@ -0,0 +1,54 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ( + i + (?> A(?>C|DX?|lligator|O|TR) + | Bands(?:OnArray)? + | (?>Bears|Bulls)Power + | BWMFI + | CCI(?:OnArray)? + | Custom + | DeMarker + | Envelopes(?:OnArray)? + | Force + | Fractals + | Gator + | Ichimoku + | MA(?>CD|OnArray)? + | MFI + | Momentum(?:OnArray)? + | OBV + | OsMA + | RSI(?:OnArray)? + | RVI + | SAR + | StdDev(?:OnArray)? + | Stochastic + | WPR + ) + )(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/market.yml b/integration/syntaxes/src/mql/function-call/support/market.yml new file mode 100644 index 00000000..28e2612c --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/market.yml @@ -0,0 +1,41 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> MarketInfo + | Symbol + (?> Info + (?> Double + | Integer + | Session(?:Quote|Trade) + | String + | Tick + ) + | Name + | Select + | sTotal + ) + ))(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/math.yml b/integration/syntaxes/src/mql/function-call/support/math.yml new file mode 100644 index 00000000..16b41992 --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/math.yml @@ -0,0 +1,50 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ( + Math + (?> Abs + | Arc + (?:cos|sin|tan) + | Ceil + | Cos + | Exp + | Floor + | IsValidNumber + | Log(?:10)? + | Max + | Min + | Mod + | Pow + | Rand + | Round + | Sin + | Sqrt + | Srand + | Tan + ) + )(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/object.yml b/integration/syntaxes/src/mql/function-call/support/object.yml new file mode 100644 index 00000000..53addfbb --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/object.yml @@ -0,0 +1,57 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> Object + (?> Create + | Delete + | Description + | Find + | Get + (?> Double + | FiboDescription + | Integer + | ShiftByValue + | String + | TimeByValue + | ValueByShift + | ValueByTime + )? + | Move + | Name + | sDeleteAll + | Set + (?> Double + | FiboDescription + | Integer + | String + | Text + )? + | sTotal + | Type + ) + | Text(?>GetSize|Out|SetFont) + ))(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/string.yml b/integration/syntaxes/src/mql/function-call/support/string.yml new file mode 100644 index 00000000..663ef740 --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/string.yml @@ -0,0 +1,48 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ( + String + (?> Add + | BufferLen + | Compare + | Concatenate + | Fill + | Find + | GetChar(?:acter)? + | Init + | Len + | Replace + | SetChar(?:acter)? + | Split + | Substr + | To + (?:Lower|Upper) + | Trim + (?:Left|Right) + ) + )(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/timeseries.yml b/integration/syntaxes/src/mql/function-call/support/timeseries.yml new file mode 100644 index 00000000..3a0da8f5 --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/timeseries.yml @@ -0,0 +1,49 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> Bars + | Copy + (?> Close + | High + | Low + | Open + | Rates + | TickVolume + | Time + ) + | i + (?> Bar(?:s|Shift) + | Close + | High(?:est)? + | Low(?:est)? + | Open + | Time + | Volume + ) + | RefreshRates + | SeriesInfoInteger + ))(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/trade-signals.yml b/integration/syntaxes/src/mql/function-call/support/trade-signals.yml new file mode 100644 index 00000000..b31eac18 --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/trade-signals.yml @@ -0,0 +1,43 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ( + Signal + (?> Base + (?> Get(?>Double|Integer|String) + | Select + | Total + ) + | Info + (?> Get(?>Double|Integer|String) + | Set(?>Double|Integer) + | Total + ) + | Subscribe + | Unsubscribe + ) + )(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function-call/support/trade.yml b/integration/syntaxes/src/mql/function-call/support/trade.yml new file mode 100644 index 00000000..f21dbef6 --- /dev/null +++ b/integration/syntaxes/src/mql/function-call/support/trade.yml @@ -0,0 +1,57 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ( + Order + (?> Close + (?> By + | Price + | Time + )? + | Comment + | Commission + | Delete + | Expiration + | Lots + | MagicNumber + | Modify + | OpenPrice + | OpenTime + | Print + | Profit + | Select + | Send + | sHistoryTotal + | StopLoss + | sTotal + | Swap + | Symbol + | TakeProfit + | Ticket + | Type + ) + )(?=\s*\() + captures: + 1: >- + support.mql.mql4 + entity.name.function.mql.mql4 + set: arguments + + arguments: + - include: ~/mql/function-call/arguments diff --git a/integration/syntaxes/src/mql/function/body.yml b/integration/syntaxes/src/mql/function/body.yml new file mode 100644 index 00000000..1c905b04 --- /dev/null +++ b/integration/syntaxes/src/mql/function/body.yml @@ -0,0 +1,123 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - include: comment-no-pop + # End. + - match: \s*(;) + captures: + 1: punctuation.definition.function.declaration.end.mql.mql4 + pop: true + # Pure virtual or constant. + - match: | + (?x)\s* + (?> (const)\s* + | + ( + =\s* + (?> 0 + | NULL + )\s* + )? + ) + captures: + 1: >- + storage.modifier.mql.mql4 + keyword.other.constant-function.mql.mql4 + 2: >- + storage.modifier.mql.mql4 + keyword.other.pure-virtual.mql.mql4 + # Initialization. + - match: \s*(:) + captures: + 1: punctuation.definition.function.initializations.mql.mql4 + set: initializations + # Normal body. + - include: body-start + + initializations: + - match: "" + set: [ + definition, + end-initialization, + initialization-expression, + begin-initialization, + initialized-identifier + ] + + initialized-identifier: + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: entity.name.ambiguous.mql.mql4 + pop: true + + begin-initialization: + - match: \s*(\() + captures: + 1: punctuation.definition.initialization.begin.mql.mql4 + pop: true + + initialization-expression: + - match: (?=\s*\)) + pop: true + - match: \s*(,) + captures: + 1: punctuation.definition.initialization.mql.mql4 + - match: (?=\S) + push: statement-and-expression + + end-initialization: + - match: \s*(\)) + captures: + 1: punctuation.definition.initialization.end.mql.mql4 + pop: true + + definition: + - include: body-start + - match: \s*(,) + captures: + 1: punctuation.definition.initialization.mql.mql4 + set: initializations + + body-start: + - match: \s*(\{) + captures: + 1: punctuation.definition.function.body.begin.mql.mql4 + set: body-content + + body-content: + - match: \s*(}) + captures: + 1: punctuation.definition.function.body.end.mql.mql4 + pop: true + - match: "" + push: + - include: statement-and-expression + - match: "" + pop: true + + comment-no-pop: + - include: ~/mql/comment.no-pop + + statement-and-expression: + - include: ~/mql/statement-and-expression diff --git a/integration/syntaxes/src/mql/function/index.yml b/integration/syntaxes/src/mql/function/index.yml new file mode 100644 index 00000000..5e49bf75 --- /dev/null +++ b/integration/syntaxes/src/mql/function/index.yml @@ -0,0 +1,200 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + + logicalOperators: | + (?> && + | \|\| + | ! + ) + + comparisonOperators: | + (?> == + | != + | >= + | <= + | >(?!>) + | <(?!<) + ) + + bitwiseOperators: | + (?> ~=? + | &=? + | \|=? + | \^=? + | <<=? + | >>>=? + | >>=? + ) + + arithmeticOperators: | + (?> -- + | -=? + | \+\+ + | \+=? + | \*\* + | \*=? + | /=? + | %=? + ) + + functionIdentifier: | + (?> operator + (?> {{comparisonOperators}} + | {{logicalOperators}} + | {{bitwiseOperators}} + | {{arithmeticOperators}} + | = + | \[\s*] + ) + | {{commonIdentifier}} + ) + + typeIdentifier: | + {{commonIdentifier}} + (?> \s*\*+ + | \s*<.*?> + (?:\s*\**) + | \b + ) + +contexts: + main: + # Member function. + - match: | + (?xi)\s* + (?=\b + (?: + (?> virtual + | static + )\s+ + )? + {{typeIdentifier}} + \s*{{commonIdentifier}} + ::{{functionIdentifier}} + ) + set: [ + body, + parameters, + name, + scope-operator, + class, + return-type, + modifier + ] + # Free function. + - match: | + (?xi)\s* + (?=\b + (?: + (?> virtual + | static + )\s+ + )? + {{typeIdentifier}} + \s*{{functionIdentifier}} + \s*\( + ) + set: [ + body, + parameters, + name, + return-type, + modifier + ] + + modifier: + - match: | + (?xi)\s* + ((?> virtual + | static + )) + captures: + 1: >- + storage.modifier.mql.mql4 + keyword.other.access.mql.mql4 + pop: true + - match: "" + pop: true + + return-type: + - include: ~/mql/type + + class: + - match: | + (?xi)\s* + \b({{commonIdentifier}})\b + captures: + 1: entity.name.class.mql.mql4 + pop: true + + scope-operator: + - match: \s*(::) + captures: + 1: keyword.operator.other.scope.mql.mql4 + pop: true + + name: + # Special function name. + - match: | + (?x)\s* + ((?> On + (?> Calculate + | ChartEvent + | Deinit + | Init + | Start + | Timer + ) + ))(?=\s*\() + captures: + 1: >- + support.core.mql.mql4 + entity.name.function.mql.mql4 + pop: true + # Operator functions. + - match: | + (?x)\s* + ((?> operator\s* + (?> {{comparisonOperators}} + | {{logicalOperators}} + | {{bitwiseOperators}} + | {{arithmeticOperators}} + | = + | \[\s*] + )? + ))(?=\s*\() + captures: + 1: >- + support.core.mql.mql4 + entity.name.function.mql.mql4 + pop: true + # Common function name. + - match: | + (?xi)\s* + ({{functionIdentifier}}) + captures: + 1: entity.name.function.mql.mql4 + pop: true + + parameters: + - include: ~/mql/function/parameters + + body: + - include: ~/mql/function/body diff --git a/integration/syntaxes/src/mql/function/parameter.yml b/integration/syntaxes/src/mql/function/parameter.yml new file mode 100644 index 00000000..97ee6353 --- /dev/null +++ b/integration/syntaxes/src/mql/function/parameter.yml @@ -0,0 +1,113 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + + typeIdentifier: | + {{commonIdentifier}} + (?:\s*<.*?>\s+)? + (?:\s*\**)? + +contexts: + main: + - match: | + (?xi) + (?=\s* + (?:const)? + {{typeIdentifier}} + ) + set: [ + parameter, + type + ] + + type: + - match: \s*(const) + captures: + 1: >- + storage.type.mql.mql4 + keyword.declaration.const.mql.mql4 + - include: ~/mql/type + + parameter: + - include: comment-no-pop + # End of parameter. + - match: | + (?x) + (?=\s* + (?> , + | \) + ) + ) + pop: true + # Reference. + - match: \s*(&) + captures: + 1: >- + storage.modifier.mql.mql4 + keyword.operator.other.reference.mql.mql4 + # Array indicator. + - match: \s*(\[) + captures: + 1: punctuation.definition.array.begin.mql.mql4 + push: array + # Default value. + - match: \s*(=) + captures: + 1: keyword.operator.other.assignment.mql.mql4 + set: value + # Identifier. + - match: | + (?xi) + (?=\s*{{commonIdentifier}}) + push: identifier + + identifier: + - meta_scope: function.parameter.mql.mql4 + - include: ~/mql/constant + - include: ~/mql/variable + + array: + - match: \s*(]) + captures: + 1: punctuation.definition.array.end.mql.mql4 + pop: true + - match: "" + push: + - include: statement-and-expression + + value: + - match: | + (?x) + (?=\s* + (?> , + | \) + ) + ) + pop: true + - match: "" + push: + - include: statement-and-expression + - match: "" + pop: true + + comment-no-pop: + - include: ~/mql/comment.no-pop + + statement-and-expression: + - include: ~/mql/statement-and-expression diff --git a/integration/syntaxes/src/mql/function/parameters.yml b/integration/syntaxes/src/mql/function/parameters.yml new file mode 100644 index 00000000..211bacca --- /dev/null +++ b/integration/syntaxes/src/mql/function/parameters.yml @@ -0,0 +1,62 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # Function without parameters. + - match: | + (?x)\s* + (\() + (?: + \s*(void)\s* + )? + (\)) + captures: + 1: punctuation.definition.function.parameters.begin.mql.mql4 + 2: >- + support.type.mql.mql4 + entity.name.type.mql.mql4 + 3: punctuation.definition.function.parameters.end.mql.mql4 + pop: true + # Parameters. + - match: \s*(\() + captures: + 1: punctuation.definition.function.parameters.begin.mql.mql4 + set: parameters + + parameters: + - match: \s*(\,) + captures: + 1: punctuation.definition.function.parameters.mql.mql4 + - match: \s*(\)) + captures: + 1: punctuation.definition.function.parameters.end.mql.mql4 + pop: true + - match: "" + push: + - include: comment-no-pop + - include: preprocessor + - include: parameter + - match: "" + pop: true + + preprocessor: + - include: ~/mql/preprocessor + + comment-no-pop: + - include: ~/mql/comment.no-pop + + parameter: + - include: ~/mql/function/parameter diff --git a/integration/syntaxes/src/mql/goto.yml b/integration/syntaxes/src/mql/goto.yml new file mode 100644 index 00000000..5baa4d94 --- /dev/null +++ b/integration/syntaxes/src/mql/goto.yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: \s*(goto) + captures: + 1: keyword.control.mql.mql4 + set: label + + label: + - match: | + (?xi) + ({{commonIdentifier}}) + captures: + 1: entity.name.label.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/index.yml b/integration/syntaxes/src/mql/index.yml new file mode 100644 index 00000000..e490080f --- /dev/null +++ b/integration/syntaxes/src/mql/index.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +name: MQL 4 (Naomi) +scope: source.mql + +file_extensions: + - mq4 + - mqh4 + - mql4 + +contexts: + main: + - match: "" + push: [naomi, statement-and-expression] + + naomi: + - meta_scope: naomi + - match: "" + pop: true + + statement-and-expression: + - include: ~/mql/statement-and-expression diff --git a/integration/syntaxes/src/mql/input.yml b/integration/syntaxes/src/mql/input.yml new file mode 100644 index 00000000..8d0f010e --- /dev/null +++ b/integration/syntaxes/src/mql/input.yml @@ -0,0 +1,24 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*\b(input)\s + captures: + 1: keyword.input.mql.mql4 + set: input + + input: + - include: ~/mql/unguarded-variable-declaration diff --git a/integration/syntaxes/src/mql/literal/character.yml b/integration/syntaxes/src/mql/literal/character.yml new file mode 100644 index 00000000..3ef3246d --- /dev/null +++ b/integration/syntaxes/src/mql/literal/character.yml @@ -0,0 +1,53 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + hexEscapedChar: | + \\x[a-f0-9]{1,4} + + decimalEscapedChar: | + \\d[0-9]{1,5} + + escapeSequences: | + (?> \\\\ + | \\" + | \\n + | \\r + | \\t + | {{hexEscapedChar}} + | {{decimalEscapedChar}} + ) + +contexts: + main: + - match: | + (?xi)\s* + (') + (?> ({{escapeSequences}}) + | (.) + ) + (') + captures: + 1: >- + string.quoted.single.mql.mql4 + punctuation.definition.string.begin.mql.mql4 + 2: >- + string.quoted.single.mql.mql4 + constant.character.escape.a.mql.mql4 + 3: string.quoted.single.mql.mql4 + 4: >- + string.quoted.single.mql.mql4 + punctuation.definition.string.end.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/literal/color.yml b/integration/syntaxes/src/mql/literal/color.yml new file mode 100644 index 00000000..dd958aa0 --- /dev/null +++ b/integration/syntaxes/src/mql/literal/color.yml @@ -0,0 +1,75 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + colorValue: | + (?:0x)?[0-9]+ + +contexts: + main: + - match: \s*(C') + captures: + 1: >- + constant.color.mql.mql4 + punctuation.definition.color.begin.mql.mql4 + set: [ + end, + blue-value, + definition, + green-value, + definition, + red-value + ] + + end: + - match: \' + scope: >- + constant.color.mql.mql4 + punctuation.definition.color.end.mql.mql4 + pop: true + + definition: + - match: \, + scope: >- + constant.color.mql.mql4 + punctuation.definition.color.mql.mql4 + pop: true + + red-value: + - match: | + (?x) + {{colorValue}} + scope: >- + constant.color.mql.mql4 + color.value.r.mql.mql4 + pop: true + + green-value: + - match: | + (?x) + {{colorValue}} + scope: >- + constant.color.mql.mql4 + color.value.g.mql.mql4 + pop: true + + blue-value: + - match: | + (?x) + {{colorValue}} + scope: >- + constant.color.mql.mql4 + color.value.b.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/literal/datetime.yml b/integration/syntaxes/src/mql/literal/datetime.yml new file mode 100644 index 00000000..05173d0f --- /dev/null +++ b/integration/syntaxes/src/mql/literal/datetime.yml @@ -0,0 +1,103 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(D') + captures: + 1: >- + constant.datetime.mql.mql4 + punctuation.definition.datetime.begin.mql.mql4 + set: year-value + + end: + - match: \' + scope: >- + constant.datetime.mql.mql4 + punctuation.definition.datetime.end.mql.mql4 + pop: true + + date-definition: + - match: (?=\') + pop: true + - match: \. + scope: >- + constant.datetime.mql.mql4 + punctuation.definition.date.mql.mql4 + pop: true + + time-definition: + - meta_content_scope: constant.datetime.mql.mql4 + - match: (?=') + pop: true + - match: ":" + scope: >- + constant.datetime.mql.mql4 + punctuation.definition.time.mql.mql4 + pop: true + + year-value: + - meta_content_scope: constant.datetime.mql.mql4 + - include: end + - match: "[0-9]{4}" + scope: datetime.year.mql.mql4 + set: [ + month-value, + date-definition + ] + + month-value: + - meta_content_scope: constant.datetime.mql.mql4 + - include: end + - match: "[0-9]{2}" + scope: datetime.month.mql.mql4 + set: [ + day-value, + date-definition + ] + + day-value: + - meta_content_scope: constant.datetime.mql.mql4 + - include: end + - match: "[0-9]{2}" + scope: datetime.day.mql.mql4 + set: hour-value + + hour-value: + - meta_content_scope: constant.datetime.mql.mql4 + - include: end + - match: "[0-9]{2}" + scope: datetime.hour.mql.mql4 + set: [ + minute-value, + time-definition + ] + + minute-value: + - meta_content_scope: constant.datetime.mql.mql4 + - include: end + - match: "[0-9]{2}" + scope: datetime.minute.mql.mql4 + set: [ + second-value, + time-definition + ] + + second-value: + - meta_content_scope: constant.datetime.mql.mql4 + - include: end + - match: "[0-9]{2}" + scope: datetime.second.mql.mql4 + set: end diff --git a/integration/syntaxes/src/mql/literal/index.yml b/integration/syntaxes/src/mql/literal/index.yml new file mode 100644 index 00000000..ec1c2669 --- /dev/null +++ b/integration/syntaxes/src/mql/literal/index.yml @@ -0,0 +1,22 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/mql/literal/string + - include: ~/mql/literal/number + - include: ~/mql/literal/color + - include: ~/mql/literal/datetime + - include: ~/mql/literal/character diff --git a/integration/syntaxes/src/mql/literal/number.yml b/integration/syntaxes/src/mql/literal/number.yml new file mode 100644 index 00000000..500e7f7c --- /dev/null +++ b/integration/syntaxes/src/mql/literal/number.yml @@ -0,0 +1,57 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + literalDecimal: | + [0-9]+ + + literalFloat: | + (?> [0-9]*[.]{{literalDecimal}} + | {{literalDecimal}}[.][0-9]* + ) + + scientificNotation: | + ( + (?> {{literalFloat}} + | {{literalDecimal}} + ) + [e][+-]? + {{literalDecimal}} + ) + +contexts: + main: + - include: float + - include: integer + + float: + - match: (?xi)\s*({{scientificNotation}}) + captures: + 1: constant.numeric.float.scientific.mql.mql4 + pop: true + - match: (?x)\s*({{literalFloat}}) + captures: + 1: constant.numeric.float.mql.mql4 + pop: true + + integer: + - match: (?i)\s*(0[x][0-9a-f]+) + captures: + 1: constant.numeric.hex.mql.mql4 + pop: true + - match: \s*([1-9][0-9]*|0) + captures: + 1: constant.numeric.decimal.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/literal/string.yml b/integration/syntaxes/src/mql/literal/string.yml new file mode 100644 index 00000000..cce503db --- /dev/null +++ b/integration/syntaxes/src/mql/literal/string.yml @@ -0,0 +1,60 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + hexEscapedChar: | + x[a-f0-9]{1,4} + + decimalEscapedChar: | + d[0-9]{1,5} + + escapeSequences: | + \\ + (?> [\\"nrt] + | {{hexEscapedChar}} + | {{decimalEscapedChar}} + ) + +contexts: + main: + - match: \s*(") + captures: + 1: >- + string.quoted.double.mql.mql4 + punctuation.definition.string.begin.mql.mql4 + with_prototype: + - match: \s*(") + captures: + 1: >- + string.quoted.double.mql.mql4 + punctuation.definition.string.end.mql.mql4 + pop: true + set: escape-a + + escape-a: + - meta_content_scope: >- + string.quoted.double.mql.mql4 + string.content.mql.mql4 + - match: (?x){{escapeSequences}} + scope: constant.character.escape.a.mql.mql4 + set: escape-b + + escape-b: + - meta_content_scope: >- + string.quoted.double.mql.mql4 + string.content.mql.mql4 + - match: (?x){{escapeSequences}} + scope: constant.character.escape.b.mql.mql4 + set: escape-a diff --git a/integration/syntaxes/src/mql/new.yml b/integration/syntaxes/src/mql/new.yml new file mode 100644 index 00000000..547979cf --- /dev/null +++ b/integration/syntaxes/src/mql/new.yml @@ -0,0 +1,30 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?i)\s*\b(new)\b + captures: + 1: keyword.other.mql.mql4 + set: [ + arguments, + type + ] + + arguments: + - include: ~/mql/function-call/arguments + + type: + - include: ~/mql/type diff --git a/integration/syntaxes/src/mql/operator/arithmetic.yml b/integration/syntaxes/src/mql/operator/arithmetic.yml new file mode 100644 index 00000000..7e43c532 --- /dev/null +++ b/integration/syntaxes/src/mql/operator/arithmetic.yml @@ -0,0 +1,51 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:----------------| + # | -- | Decrement. | + # | - | Subtraction. | + # | ++ | Increment. | + # | + | Addition. | + # | += | | + # | * | Multiplication. | + # | *= | | + # | / | Division. | + # | /= | | + # | % | Modulus. | + # | %= | | + main: + - match: | + (?x)\s* + ((?> -- + | -=? + | \+\+ + | \+=? + | /=? + | %=? + )) + captures: + 1: keyword.operator.arithmetic.mql.mql4 + pop: true + # Multiplication operator needs an extra check to prevent it being confused + # with the pointer operator. + - match: | + (?x) + (?<=^|\w|\)|]|}) + \s*(\*) + captures: + 1: keyword.operator.arithmetic.multiplication.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/operator/bitwise.yml b/integration/syntaxes/src/mql/operator/bitwise.yml new file mode 100644 index 00000000..ba449256 --- /dev/null +++ b/integration/syntaxes/src/mql/operator/bitwise.yml @@ -0,0 +1,46 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:---------------------------------| + # | ~ | Bitwise not. | + # | ~= | Bitwise not assignment. | + # | & | Bitwise AND. | + # | &= | Bitwise AND assignment. | + # | | | Bitwise OR. | + # | |= | Bitwise OR assignment. | + # | ^ | Bitwise XOR. | + # | ^= | Bitwise XOR assignment. | + # | << | Left shift. | + # | <<= | Left shift assignment. | + # | >> | Right shift. | + # | >>= | Right shift assignment. | + # | >>> | Unsigned right shift. | + # | >>>= | Unsigned right shift assignment. | + main: + - match: | + (?x)\s* + ((?> ~=? + | &=? + | \|=? + | \^=? + | <<=? + | >>>=? + | >>=? + )) + captures: + 1: keyword.operator.bitwise.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/operator/comparison.yml b/integration/syntaxes/src/mql/operator/comparison.yml new file mode 100644 index 00000000..86b3e8c0 --- /dev/null +++ b/integration/syntaxes/src/mql/operator/comparison.yml @@ -0,0 +1,37 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:--------------------------| + # | == | Equal. | + # | != | Not equal. | + # | >= | Greater than or equal to. | + # | <= | Less than or equal to. | + # | > | Greater than. | + # | < | Less than. | + main: + - match: | + (?x)\s* + ((?> == + | != + | >= + | <= + | >(?!>) + | <(?!<) + )) + captures: + 1: keyword.operator.comparison.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/operator/index.yml b/integration/syntaxes/src/mql/operator/index.yml new file mode 100644 index 00000000..da7649b3 --- /dev/null +++ b/integration/syntaxes/src/mql/operator/index.yml @@ -0,0 +1,28 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/mql/operator/other + - include: ~/mql/operator/comparison + - include: ~/mql/operator/logical + - include: ~/mql/operator/bitwise + - include: ~/mql/operator/arithmetic + - include: ~/mql/operator/pointer + # Assignment. + - match: \s*(=) + captures: + 1: keyword.operator.other.assignment.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/operator/logical.yml b/integration/syntaxes/src/mql/operator/logical.yml new file mode 100644 index 00000000..5d1c0f5c --- /dev/null +++ b/integration/syntaxes/src/mql/operator/logical.yml @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:------------| + # | && | And. | + # | || | Or. | + # | ! | Not. | + main: + - match: | + (?x)\s* + ((?> && + | \|\| + | ! + )) + captures: + 1: keyword.operator.logical.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/operator/other.yml b/integration/syntaxes/src/mql/operator/other.yml new file mode 100644 index 00000000..646b9432 --- /dev/null +++ b/integration/syntaxes/src/mql/operator/other.yml @@ -0,0 +1,57 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:----------:|:--------------------| + # | & | Reference. | + # | . | Member access. | + # | -> | Member access. | + # | :: | Scope resolution. | + # | ? | | + # | : | | + main: + - match: \s*(&)(?![&=]) + captures: + 1: keyword.operator.other.reference.mql.mql4 + pop: true + - match: | + (?x)\s* + ((?> -> + | \. + )) + captures: + 1: keyword.operator.other.member-access.mql.mql4 + set: member-access + - match: \s*(\?) + captures: + 1: keyword.operator.other.ternary.mql.mql4 + set: ternary-condition + + ternary-condition: + - match: \s*(:) + captures: + 1: keyword.operator.other.ternary.mql.mql4 + pop: true + - match: "" + push: + - match: (?=\s*:) + pop: true + - include: ~/mql/statement-and-expression + + member-access: + - include: ~/mql/function-call/normal + - include: ~/mql/constant/normal + - include: ~/mql/variable diff --git a/integration/syntaxes/src/mql/operator/pointer.yml b/integration/syntaxes/src/mql/operator/pointer.yml new file mode 100644 index 00000000..01047943 --- /dev/null +++ b/integration/syntaxes/src/mql/operator/pointer.yml @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x) + \s*(\*+) + captures: + 1: >- + storage.modifier.mql.mql4 + keyword.operator.other.pointer.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/preprocessor.yml b/integration/syntaxes/src/mql/preprocessor.yml new file mode 100644 index 00000000..4c9d627e --- /dev/null +++ b/integration/syntaxes/src/mql/preprocessor.yml @@ -0,0 +1,124 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + # Include. + - match: \s*(\#include) + captures: + 1: keyword.preprocessor.mql.mql4 + set: include-value + # Define. + - match: | + (?xi) + \s*(\#define) + \s*({{commonIdentifier}}) + captures: + 1: keyword.preprocessor.mql.mql4 + 2: entity.name.variable.mql.mql4 + set: value + # Property. + - match: | + (?x)\s* + (\#property) + captures: + 1: keyword.preprocessor.mql.mql4 + set: [ + value, + property-identifier + ] + # Other keyword value pairs. + - match: | + (?x)\s* + (\# + (?> elif + | else + | endif + | if(?:n?def)? + | import + | pragma + ) + ) + captures: + 1: keyword.preprocessor.mql.mql4 + set: value + + include-value: + - match: \s*(\<.+?\>) + scope: string.unquoted.mql.mql4 + pop: true + - include: ~/mql/literal/string + + value: + - match: \s*$ + pop: true + - match: "" + push: + - include: statement-and-expression + + statement-and-expression: + - include: ~/mql/statement-and-expression + + property-identifier: + # Expected properties. + - match: | + (?x)\s*\b + ((?> copyright + | description + | icon + | indicator_ + (?> chart_window + | buffers + | color[1-8] + | height + | label[1-8] + | level + (?> color + | style + | width + ) + | maximum + | minimum + | separate_window + | style[1-8] + | width[1-8] + ) + | library + | link + | script_show_ + (?>confirm|inputs) + | stacksize + | strict + | tester_ + (?>file|indicator|library) + | version + )) + captures: + 1: >- + support.mql.mql4 + entity.name.property.mql.mql4 + pop: true + # Not expected property. + - match: | + (?x)\s* + ({{commonIdentifier}}) + captures: + 1: entity.name.unknown.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/property.yml b/integration/syntaxes/src/mql/property.yml new file mode 100644 index 00000000..267df5b4 --- /dev/null +++ b/integration/syntaxes/src/mql/property.yml @@ -0,0 +1,18 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/mql/variable-declaration diff --git a/integration/syntaxes/src/mql/sizeof.yml b/integration/syntaxes/src/mql/sizeof.yml new file mode 100644 index 00000000..d171244e --- /dev/null +++ b/integration/syntaxes/src/mql/sizeof.yml @@ -0,0 +1,36 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?xi)\s*\b + (sizeof)\s*(\() + captures: + 1: keyword.other.mql.mql4 + 2: punctuation.definition.function.parameters.begin.mql.mql4 + set: [ + definition, + type + ] + + type: + - include: ~/mql/type + + definition: + - match: \s*(\)) + captures: + 1: punctuation.definition.function.parameters.end.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/statement-and-expression.yml b/integration/syntaxes/src/mql/statement-and-expression.yml new file mode 100644 index 00000000..30279224 --- /dev/null +++ b/integration/syntaxes/src/mql/statement-and-expression.yml @@ -0,0 +1,115 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + + expressionGroupBegin: | + \s*(\() + +contexts: + main: + - include: cast-operator + # Open new expression group. + - match: | + (?xi) + {{expressionGroupBegin}} + captures: + 1: punctuation.definition.expression.group.a.begin.mql.mql4 + set: open-b-close-a + # Expression contents. + - include: sequence + + open-a-close-b: + - include: cast-operator + # Open new expression group. + - match: | + (?xi) + {{expressionGroupBegin}} + captures: + 1: punctuation.definition.expression.group.a.begin.mql.mql4 + push: open-b-close-a + # Close current expression group. + - match: \s*(\)) + captures: + 1: punctuation.definition.expression.group.b.end.mql.mql4 + pop: true + # Expression contents. + - match: "" + push: + - include: sequence + - match: "" + pop: true + + open-b-close-a: + - include: cast-operator + # Open new expression group. + - match: | + (?xi) + {{expressionGroupBegin}} + captures: + 1: punctuation.definition.expression.group.b.begin.mql.mql4 + push: open-a-close-b + # Close current expression group. + - match: \s*(\)) + captures: + 1: punctuation.definition.expression.group.a.end.mql.mql4 + pop: true + # Expression contents. + - match: "" + push: + - include: sequence + - match: "" + pop: true + + cast-operator: + - include: ~/mql/cast + + sequence: + - include: ~/mql/terminator + # Comments. + - include: ~/mql/comment + # Expression keywords. + - include: ~/mql/sizeof + - include: ~/mql/new + # Simple statements. + - include: ~/mql/goto + - include: ~/mql/statement/hanging + - include: ~/mql/statement/bodied + - include: ~/mql/statement/simple + # Complex statements. + - include: ~/mql/preprocessor + - include: ~/mql/input + - include: ~/mql/cd-tor.outside + - include: ~/mql/template + - include: ~/mql/class + - include: ~/mql/struct + - include: ~/mql/typedef + - include: ~/mql/enum + - include: ~/mql/function + # Expression. + - include: ~/mql/array-access + - include: ~/mql/literal + - include: ~/mql/function-call + - include: ~/mql/operator + - include: ~/mql/variable-declaration + # When it comes to constants and variables, there's no way to tell apart + # without an intellisense, so it’ll treat that anything that looks a + # uppercase variable as if it was a constant. + - include: ~/mql/constant + # Constant matching failed, so it could be a variable. + - include: ~/mql/variable diff --git a/integration/syntaxes/src/mql/statement/bodied.yml b/integration/syntaxes/src/mql/statement/bodied.yml new file mode 100644 index 00000000..f6a75830 --- /dev/null +++ b/integration/syntaxes/src/mql/statement/bodied.yml @@ -0,0 +1,99 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # Header only. + - match: (?xi)\s*\b(return)\b + captures: + 1: keyword.control.flow-break.mql.mql4 + set: [ + terminator, + optional-header + ] + # Body only. + - match: | + (?xi)\s*\b + ((?> do + | else + ))\b + captures: + 1: keyword.control.mql.mql4 + set: body + # Header and body. + - match: | + (?xi)\s*\b + ((?> else\s+if + | for + | if + | switch + | while + ))\b + captures: + 1: keyword.control.mql.mql4 + set: [ + body, + header + ] + + optional-header: + - match: (?=\s*;) + pop: true + - match: (?=\s*\() + set: header + + header: + - match: \s*(\() + captures: + 1: punctuation.definition.control.header.begin.mql.mql4 + set: header-content + + header-content: + - match: \s*(\)) + captures: + 1: punctuation.definition.control.header.end.mql.mql4 + pop: true + - match: "" + push: + - match: (?=\)) + pop: true + - include: statement-and-expression + + terminator: + - match: \s*(;) + captures: + 1: keyword.other.terminator.mql.mql4 + pop: true + + body: + - match: \s*(\{) + captures: + 1: punctuation.definition.control.body.begin.mql.mql4 + set: body-content + - include: statement-and-expression + + body-content: + - match: \s*(}) + captures: + 1: punctuation.definition.control.body.end.mql.mql4 + pop: true + - match: "" + push: + - match: (?=\s*}) + pop: true + - include: statement-and-expression + + statement-and-expression: + - include: ~/mql/statement-and-expression diff --git a/integration/syntaxes/src/mql/statement/hanging.yml b/integration/syntaxes/src/mql/statement/hanging.yml new file mode 100644 index 00000000..4e9bc3b0 --- /dev/null +++ b/integration/syntaxes/src/mql/statement/hanging.yml @@ -0,0 +1,47 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?xi)\s*\b + ((?> private + | protected + | public + ))\b + captures: + 1: >- + storage.modifier.mql.mql4 + keyword.other.access.mql.mql4 + set: operator + - match: | + (?xi)\s*\b + ((?> case + | default + ))\b + captures: + 1: keyword.control.mql.mql4 + set: operator + + operator: + - match: \s*(:) + captures: + 1: keyword.operator.other.scope.mql.mql4 + pop: true + - match: "" + push: statement-and-expression + + statement-and-expression: + - include: ~/mql/statement-and-expression diff --git a/integration/syntaxes/src/mql/statement/simple.yml b/integration/syntaxes/src/mql/statement/simple.yml new file mode 100644 index 00000000..7891165d --- /dev/null +++ b/integration/syntaxes/src/mql/statement/simple.yml @@ -0,0 +1,33 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> break + | continue + ))\b + captures: + 1: keyword.control.flow-break.mql.mql4 + pop: true + - match: | + (?xi)\s*\b + ((?> default + | delete + ))\b + captures: + 1: keyword.control.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/struct.yml b/integration/syntaxes/src/mql/struct.yml new file mode 100644 index 00000000..e03c5c23 --- /dev/null +++ b/integration/syntaxes/src/mql/struct.yml @@ -0,0 +1,86 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - match: \s*\b(struct)\b + captures: + 1: >- + storage.type.mql.mql4 + keyword.declaration.struct.mql.mql4 + set: identifier + + identifier: + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: entity.name.struct.mql.mql4 + set: [ + body, + inheritance + ] + + inheritance: + - match: (?=\s*\{) + pop: true + - match: | + (?xi)\s* + (:) + \s*( + (?> public + | protected + | private + ) + )\s* + captures: + 1: >- + storage.modifier.mql.mql4 + keyword.operator.other.inherit.mql.mql4 + 2: >- + storage.modifier.mql.mql4 + keyword.other.access.mql.mql4 + - include: ~/mql/type + + body: + - include: comment + - match: \s*(\{) + captures: + 1: punctuation.definition.struct.body.begin.mql.mql4 + set: body-content + + body-content: + - include: comment + - match: \s*(\};?) + captures: + 1: punctuation.definition.struct.body.end.mql.mql4 + pop: true + - match: "" + push: + - match: (?=\s*}) + pop: true + - include: comment + - include: ~/mql/cd-tor.inside + - include: ~/mql/statement/hanging + - include: ~/mql/function + - include: ~/mql/variable-declaration + + comment: + - include: ~/mql/comment.no-pop diff --git a/integration/syntaxes/src/mql/template.yml b/integration/syntaxes/src/mql/template.yml new file mode 100644 index 00000000..f1f0d1c4 --- /dev/null +++ b/integration/syntaxes/src/mql/template.yml @@ -0,0 +1,53 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - match: \s*\b(template)\b + captures: + 1: >- + storage.type.mql.mql4 + keyword.template.mql.mql4 + set: parameters + + parameters: + - match: \s*(<) + captures: + 1: punctuation.definition.template.parameters.begin.mql.mql4 + set: parameters-content + + parameters-content: + - match: \s*(>) + captures: + 1: punctuation.definition.template.parameters.end.mql.mql4 + set: target + - match: | + (?xi)\s* + (typename) + \s*({{commonIdentifier}}) + \s*(,)? + captures: + 1: keyword.other.mql.mql4 + 2: entity.name.type.mql.mql4 + 3: punctuation.definition.template.parameter.mql.mql4 + + target: + - include: ~/mql/function + - include: ~/mql/class diff --git a/integration/syntaxes/src/mql/terminator.yml b/integration/syntaxes/src/mql/terminator.yml new file mode 100644 index 00000000..5e84cc7d --- /dev/null +++ b/integration/syntaxes/src/mql/terminator.yml @@ -0,0 +1,21 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(;) + captures: + 1: keyword.other.terminator.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/mql/type/index.yml b/integration/syntaxes/src/mql/type/index.yml new file mode 100644 index 00000000..dd2e9f74 --- /dev/null +++ b/integration/syntaxes/src/mql/type/index.yml @@ -0,0 +1,21 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/mql/type/support/core + - include: ~/mql/type/support/enums + - include: ~/mql/type/support/structures + - include: ~/mql/type/normal diff --git a/integration/syntaxes/src/mql/type/modifiers.yml b/integration/syntaxes/src/mql/type/modifiers.yml new file mode 100644 index 00000000..32c0a0e1 --- /dev/null +++ b/integration/syntaxes/src/mql/type/modifiers.yml @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x) + (?=\s*(?>\*|<)) + push: + - include: ~/mql/operator/pointer + - include: ~/mql/type/template-arguments + - match: (?=\s*\S) + pop: true diff --git a/integration/syntaxes/src/mql/type/normal.yml b/integration/syntaxes/src/mql/type/normal.yml new file mode 100644 index 00000000..c7056ab1 --- /dev/null +++ b/integration/syntaxes/src/mql/type/normal.yml @@ -0,0 +1,31 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - match: | + (?xi)\s* + \b({{commonIdentifier}})\b + captures: + 1: entity.name.type.mql.mql4 + set: modifiers + + modifiers: + - include: ~/mql/type/modifiers diff --git a/integration/syntaxes/src/mql/type/support/core.yml b/integration/syntaxes/src/mql/type/support/core.yml new file mode 100644 index 00000000..c79b1b41 --- /dev/null +++ b/integration/syntaxes/src/mql/type/support/core.yml @@ -0,0 +1,40 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> bool + | char + | color + | datetime + | double + | float + | int + | long + | short + | string + | u(?>char|int|long|short) + | void + ))\b + captures: + 1: >- + support.mql.mql4 + entity.name.type.mql.mql4 + set: modifiers + + modifiers: + - include: ~/mql/type/modifiers diff --git a/integration/syntaxes/src/mql/type/support/enums.yml b/integration/syntaxes/src/mql/type/support/enums.yml new file mode 100644 index 00000000..cd6c5009 --- /dev/null +++ b/integration/syntaxes/src/mql/type/support/enums.yml @@ -0,0 +1,49 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ( + ENUM_ + (?> ALIGN_MODE + | ANCHOR_POINT + | APPLIED_PRICE + | ARROW_ANCHOR + | BASE_CORNER + | BORDER_TYPE + | CHART_ + (?> EVENT + | MODE + | POSITION + | PROPERTY_(?>DOUBLE|INTEGER|STRING) + ) + | GANN_DIRECTION + | LINE_STYLE + | MA_METHOD + | OBJECT_PROPERTY_(?>DOUBLE|INTEGER|STRING) + | TIMEFRAMES + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.type.mql.mql4 + set: modifiers + + modifiers: + - include: ~/mql/type/modifiers + diff --git a/integration/syntaxes/src/mql/type/support/structures.yml b/integration/syntaxes/src/mql/type/support/structures.yml new file mode 100644 index 00000000..511bd521 --- /dev/null +++ b/integration/syntaxes/src/mql/type/support/structures.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ( + Mql + (?> DateTime + | Rates + | Tick + ) + )\b + captures: + 1: >- + support.mql.mql4 + entity.name.type.mql.mql4 + set: modifiers + + modifiers: + - include: ~/mql/type/modifiers + diff --git a/integration/syntaxes/src/mql/type/template-arguments.yml b/integration/syntaxes/src/mql/type/template-arguments.yml new file mode 100644 index 00000000..3d39a4ca --- /dev/null +++ b/integration/syntaxes/src/mql/type/template-arguments.yml @@ -0,0 +1,51 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - match: \s*(<) + captures: + 1: punctuation.definition.template.arguments.begin.mql.mql4 + set: [ + definition, + argument + ] + - match: (?=\S) + pop: true + + argument: + - include: ~/mql/type + + definition: + - match: \> + scope: punctuation.definition.template.arguments.end.mql.mql4 + pop: true + - match: \, + scope: punctuation.definition.template.arguments.mql.mql4 + set: [ + definition, + argument + ] + - match: \< + scope: punctuation.definition.template.arguments.begin.mql.mql4 + push: [ + definition, + argument + ] diff --git a/integration/syntaxes/src/mql/typedef.yml b/integration/syntaxes/src/mql/typedef.yml new file mode 100644 index 00000000..df0c00c5 --- /dev/null +++ b/integration/syntaxes/src/mql/typedef.yml @@ -0,0 +1,121 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + + typeIdentifier: | + {{commonIdentifier}} + (?> \s*\*+ + | \s*<.*?> + (?:\s*\**) + | \b + ) + +contexts: + main: + - match: | + (?xi)\s* + \b(typedef)\b + (?=\s* + {{typeIdentifier}} + \s*{{commonIdentifier}} + ) + captures: + 1: >- + storage.type.mql.mql4 + keyword.declaration.typedef.mql.mql4 + set: [ + identifier, + type + ] + + comment: + - include: ~/mql/comment.no-pop + + type: + - include: ~/mql/type + + identifier: + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: entity.name.typedef.mql.mql4 + pop: true + + # - match: \s*\b(typedef)\b + # captures: + # 1: >- + # storage.type.mql.mql4 + # keyword.declaration.typedef.mql.mql4 + # set: identifier + + identifieraaaa: + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: entity.name.typedef.mql.mql4 + set: [ + body, + inheritance + ] + + inheritance: + - match: (?=\s*\{) + pop: true + - match: | + (?xi)\s* + (:) + \s*( + (?> public + | protected + | private + ) + )\s* + captures: + 1: >- + storage.modifier.mql.mql4 + keyword.operator.other.inherit.mql.mql4 + 2: >- + storage.modifier.mql.mql4 + keyword.other.access.mql.mql4 + - include: ~/mql/type + + body: + - include: comment + - match: \s*(\{) + captures: + 1: punctuation.definition.typedef.body.begin.mql.mql4 + set: body-content + + body-content: + - include: comment + - match: \s*(\};?) + captures: + 1: punctuation.definition.typedef.body.end.mql.mql4 + pop: true + - match: "" + push: + - match: (?=\s*}) + pop: true + - include: comment + - include: ~/mql/cd-tor.inside + - include: ~/mql/statement/hanging + - include: ~/mql/function + - include: ~/mql/variable-declaration diff --git a/integration/syntaxes/src/mql/unguarded-variable-declaration.yml b/integration/syntaxes/src/mql/unguarded-variable-declaration.yml new file mode 100644 index 00000000..9b6578ee --- /dev/null +++ b/integration/syntaxes/src/mql/unguarded-variable-declaration.yml @@ -0,0 +1,100 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - match: "" + set: [ + punctuation, + variable, + type + ] + + type: + - match: \s*(const) + captures: + 1: >- + storage.type.mql.mql4 + keyword.declaration.const.mql.mql4 + - match: | + (?x)\s* + ((?> extern + | static + )) + captures: + 1: >- + storage.modifier.mql.mql4 + keyword.other.access.mql.mql4 + - include: ~/mql/type + + variable: + - include: ~/mql/constant + - include: ~/mql/variable + + punctuation: + - include: terminator + - match: (?=\s*\)) + pop: true + - match: \s*(,) + captures: + 1: keyword.operator.other.comma.mql.mql4 + set: [ + punctuation, + variable + ] + - match: \s*(\[) + captures: + 1: punctuation.definition.array.index.begin.mql.mql4 + push: array-index + - match: \s*(=) + captures: + 1: keyword.operator.other.assignment.mql.mql4 + push: value + + array-index: + - match: \s*(,) + captures: + 1: punctuation.definition.array.index.mql.mql4 + - match: \s*(]) + captures: + 1: punctuation.definition.array.index.end.mql.mql4 + pop: true + - match: "" + push: + - include: statement-and-expression + + value: + - match: | + (?x) + (?=\s* + (?> , + | ; + ) + ) + pop: true + - match: "" + push: + - include: statement-and-expression + + statement-and-expression: + - include: ~/mql/statement-and-expression + + terminator: + - include: ~/mql/terminator diff --git a/integration/syntaxes/src/mql/variable-declaration.yml b/integration/syntaxes/src/mql/variable-declaration.yml new file mode 100644 index 00000000..91800a53 --- /dev/null +++ b/integration/syntaxes/src/mql/variable-declaration.yml @@ -0,0 +1,51 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + + typeIdentifier: | + {{commonIdentifier}} + (?> \s*\*+ + | \s*<.*?> + (?:\s*\**) + | \b + ) + +contexts: + main: + - match: | + (?xi) + (?=\s* + (?: + (?> const + | extern + | static + )\s+ + )? + {{typeIdentifier}} + \s*{{commonIdentifier}}\s* + (?> = + | \[ + | , + | ; + ) + ) + set: actual-declaration + + actual-declaration: + - include: ~/mql/unguarded-variable-declaration diff --git a/integration/syntaxes/src/mql/variable.yml b/integration/syntaxes/src/mql/variable.yml new file mode 100644 index 00000000..7159b847 --- /dev/null +++ b/integration/syntaxes/src/mql/variable.yml @@ -0,0 +1,40 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - include: support-variable + - include: common-variable + + common-variable: + - match: | + (?xi)\s* + \b({{commonIdentifier}})\b + captures: + 1: entity.name.variable.mql.mql4 + pop: true + + support-variable: + - match: (?i)\s*\b(this)\b + captures: + 1: >- + support.mql.mql4 + entity.name.variable.mql.mql4 + pop: true diff --git a/integration/syntaxes/src/php/array-access.yml b/integration/syntaxes/src/php/array-access.yml new file mode 100644 index 00000000..948c9ca8 --- /dev/null +++ b/integration/syntaxes/src/php/array-access.yml @@ -0,0 +1,38 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + (?<= [$_[:alnum:]] + | ] + | \) + ) + \s*(\[) + captures: + 1: punctuation.definition.array.access.begin.php.php7 + set: index + + index: + - match: \s*(]) + captures: + 1: punctuation.definition.array.access.end.php.php7 + pop: true + - match: "" + push: + - include: ~/php/statement-and-expression + - match: "" + pop: true diff --git a/integration/syntaxes/src/php/class.yml b/integration/syntaxes/src/php/class.yml new file mode 100644 index 00000000..913c19d3 --- /dev/null +++ b/integration/syntaxes/src/php/class.yml @@ -0,0 +1,128 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +scope: ... + +contexts: + main: + - match: | + (?xi) + (?=\s*\b + (?: + (?> private + | protected + | public + )\s+ + )? + (?: + (?> abstract + | final + )\s+ + )? + class\b + ) + set: [ + declaration, + keyword + ] + + keyword: + - match: (?i)\s*\b(class)(?!\\)\b + captures: + 1: >- + storage.type.php.php7 + keyword.declaration.class.php.php7 + pop: true + - include: ~/php/modifier.no-pop + + comment: + - include: ~/php/comment.no-pop + + declaration: + - include: comment + # Extends. + - match: (?i)\s*\b(extends)\b + captures: + 1: >- + storage.modifier.php.php7 + keyword.inherit.php.php7 + push: extend-target + # Implements. + - match: (?i)\s*\b(implements)\b + captures: + 1: >- + storage.modifier.php.php7 + keyword.implement.php.php7 + push: implement-targets + # Class’s name. + - match: (?xi)\s*\b({{commonIdentifier}})\b + captures: + 1: entity.name.class.php.php7 + # Body. + - match: \s*(\{) + scope: punctuation.definition.class.body.begin.php.php7 + set: body + + body: + - match: \s*(}) + captures: + 1: punctuation.definition.class.body.end.php.php7 + pop: true + - include: body-content + + body-content: + - match: "" + push: + - include: ~/php/statement-and-expression + - match: "" + pop: true + + extend-target: + - include: comment + - match: (?=\s*\{) + pop: true + - match: (?i)(?=\s*\bimplements\b) + pop: true + - include: ~/php/type + + implement-targets: + - include: comment + - match: (?=\s*\{) + pop: true + - match: (?=\s*\S) + push: [ + implement-target-definition, + implement-target + ] + + implement-target: + - include: comment + - include: ~/php/type + + implement-target-definition: + - include: comment + - match: \s*(,) + captures: + 1: punctuation.definition.implement-list.separator.php.php7 + pop: true + - match: (?=\s*\S) + pop: true diff --git a/integration/syntaxes/src/php/closure.yml b/integration/syntaxes/src/php/closure.yml new file mode 100644 index 00000000..51d39551 --- /dev/null +++ b/integration/syntaxes/src/php/closure.yml @@ -0,0 +1,120 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +scope: ... + +contexts: + main: + - match: | + (?xi) + (?=\s*\b + (?: + (?> private + | protected + | public + )\s+ + )? + (?:static\s+)? + function\b + ) + set: [ + body, + optional-imported-variables-and-return-type-hint, + parameters, + keyword + ] + + keyword: + - match: (?i)\s*\b(function)(?!\\)\b + captures: + 1: >- + storage.type.php.php7 + keyword.declaration.function.php.php7 + pop: true + - include: ~/php/modifier.no-pop + + parameters: + - include: ~/php/function/parameters + + optional-imported-variables-and-return-type-hint: + - match: (?=\s*(?>:|\{)) + pop: true + - include: ~/php/function/return-type-hint + - match: \s*(use) + captures: + 1: >- + storage.modifier.php.php7 + keyword.import.variable.php.php7 + set: imported-variables-begin + + imported-variables-begin: + - match: \s*(\() + captures: + 1: punctuation.definition.function.parameters.begin.php.php7 + set: imported-variables + + imported-variables: + - match: \s*(\)) + captures: + 1: punctuation.definition.function.parameters.end.php.php7 + pop: true + # Starts with a variable. + - match: (?=\s*\$) + push: [ + target-definition, + target-variable, + ] + # Starts with a reference operator. + - match: (?=\s*&) + push: [ + target-definition, + target-variable, + reference-operator + ] + + comment: + - include: ~/php/comment.no-pop + + reference-operator: + - include: comment + - match: (?=\s*\$) + pop: true + - match: \s*(\&) + captures: + 1: keyword.operator.other.reference.php.php7 + pop: true + + target-definition: + - include: comment + - match: (?=\s*\)) + pop: true + - match: \s*(,) + captures: + 1: punctuation.definition.function.parameters.php.php7 + pop: true + + target-variable: + - include: comment + - include: ~/php/variable + + body: + - include: ~/php/function/body diff --git a/integration/syntaxes/src/php/comment.no-pop.yml b/integration/syntaxes/src/php/comment.no-pop.yml new file mode 100644 index 00000000..5fb1a336 --- /dev/null +++ b/integration/syntaxes/src/php/comment.no-pop.yml @@ -0,0 +1,27 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x) + (?= + (?> \/\/ + | \/\* + | \# + ) + ) + push: + - include: ~/php/comment diff --git a/integration/syntaxes/src/php/comment/documentation.yml b/integration/syntaxes/src/php/comment/documentation.yml new file mode 100644 index 00000000..ed058259 --- /dev/null +++ b/integration/syntaxes/src/php/comment/documentation.yml @@ -0,0 +1,41 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(/\*\*) + captures: + 1: punctuation.definition.comment.documentation.begin.php.php7 + set: content + + content: + - meta_scope: comment.block.documentation.php.php7 + - match: \s*(\*/) + captures: + 1: punctuation.definition.comment.documentation.end.php.php7 + set: + # Used to fix the block comment indentation settings. + # https://forum.sublimetext.com/t/everything-you-n-ever-wanted-to-know-about-indentation-in-st3/26207/6 + - match: \s*$\n? + scope: meta.block-end.php.php7 + pop: true + - match: '' + pop: true + - match: "" + push: + - include: ~/php/comment/phpdoc + - include: ~/php/comment/phpunit + - match: (?=\s*\*/) + pop: true diff --git a/integration/syntaxes/src/php/comment/index.yml b/integration/syntaxes/src/php/comment/index.yml new file mode 100644 index 00000000..99affdc6 --- /dev/null +++ b/integration/syntaxes/src/php/comment/index.yml @@ -0,0 +1,19 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/php/comment/documentation + - include: ~/php/comment/normal diff --git a/integration/syntaxes/src/php/comment/normal.yml b/integration/syntaxes/src/php/comment/normal.yml new file mode 100644 index 00000000..95bd33e5 --- /dev/null +++ b/integration/syntaxes/src/php/comment/normal.yml @@ -0,0 +1,54 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(//|#) + captures: + 1: punctuation.definition.comment.begin.php.php7 + set: line + - match: \s*(/\*) + captures: + 1: punctuation.definition.comment.begin.php.php7 + set: block + + line: + - meta_scope: comment.line.php.php7 + - include: email + - include: link + - match: \s*$ + pop: true + + block: + - meta_scope: comment.block.php.php7 + - include: email + - include: link + - match: \s*(\*/) + captures: + 1: punctuation.definition.comment.end.php.php7 + set: + # Used to fix the block comment indentation settings. + # https://forum.sublimetext.com/t/everything-you-n-ever-wanted-to-know-about-indentation-in-st3/26207/6 + - match: \s*$\n? + scope: meta.block-end.php.php7 + pop: true + - match: '' + pop: true + + link: + - include: ~/shared/link + + email: + - include: ~/shared/email diff --git a/integration/syntaxes/src/php/comment/phpdoc.yml b/integration/syntaxes/src/php/comment/phpdoc.yml new file mode 100644 index 00000000..a64e9c39 --- /dev/null +++ b/integration/syntaxes/src/php/comment/phpdoc.yml @@ -0,0 +1,151 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - match: | + (?xi)\s* + (\{@)(inheritDoc)(}) + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.definition.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + 3: >- + keyword.documentation.php.php7 + punctuation.definition.keyword.end.php.php7 + pop: true + - include: param + - include: return + - include: throws + - include: var + - include: other-tags + + variable: + - include: ~/php/variable + + types: + # $this. + - match: \s*(\$this)\b + captures: + 1: >- + support.php.php7 + entity.name.variable.php.php7 + pop: true + # Variables. + - match: (?=\s*(?>\$|$)) + pop: true + # Actual type. + - match: (?=\s*\S) + set: [ + type-definition, + type + ] + + type: + - include: ~/php/type + + type-definition: + - match: | + (?x) + (?=\s* + (?>\$|$) + ) + pop: true + - match: \s*(\|) + captures: + 1: keyword.operator.other.php.php7 + set: [ + type-definition, + type + ] + + param: + - match: \s*\B(@)(param)\b + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.definition.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + set: [ + variable, + types + ] + + return: + - match: \s*\B(@)(return)\b + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.definition.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + set: types + + throws: + - match: \s*\B(@)(throws)\b + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.definition.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + set: type + + var: + - match: \s*\B(@)(var)\b + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.definition.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + set: types + + other-tags: + - match: | + (?x)\s*\B(@) + ((?> api + | access + | author + | category + | copyright + | deprecated + | example + | filesource + | global + | ignore + | internal + | license + | link + | method + | package + | property(?>-(?>read|write))? + | see + | since + | source + | subpackage + | todo + | tutorial + | version + ))\b + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.definition.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/comment/phpunit.yml b/integration/syntaxes/src/php/comment/phpunit.yml new file mode 100644 index 00000000..ce977c7f --- /dev/null +++ b/integration/syntaxes/src/php/comment/phpunit.yml @@ -0,0 +1,189 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - include: covers + - include: dataProvider + - include: depends + - include: expectedExceptionCode + - include: expectedExceptionMessage + - include: simple-tags + - include: boolean-tags + - include: string-tags + - include: type-tags + + scope-operator: + - match: \s*(::) + captures: + 1: keyword.operator.other.scope-resolution.php.php7 + pop: true + + constant: + - include: ~/php/constant/normal + + number: + - include: ~/php/literal/number + + type: + - include: ~/php/type + + function: + - match: (?xi)\s*({{commonIdentifier}}) + captures: + 1: entity.name.function.php.php7 + pop: true + + covers: + - match: | + (?x)\s*\B(@)(covers)\b + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + push: [ + function, + scope-operator, + type + ] + + dataProvider: + - match: | + (?x)\s*\B(@)(dataProvider)\b + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + push: function + + depends: + - match: | + (?x)\s*\B(@)(depends)\b + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + push: function + + expectedExceptionCode: + - match: | + (?x)\s*\B(@)(expectedExceptionCode)\b + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + push: number + + expectedExceptionMessage: + - match: | + (?x)\s*\B(@)(expectedExceptionMessage)\b + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + push: + - match: (?=\s+[^ ]+\s*$) + set: [ + constant, + scope-operator, + type + ] + - match: .+$ + scope: string.php.php7 + pop: true + + simple-tags: + - match: | + (?x)\s*\B(@) + ((?> after(?:Class)? + | before(?:Class)? + | coversNothing + | codeCoverage (?>Ignore(?>Start|End)?) + | large + | medium + | requires + | run (?>TestsInSeparateProcesses|InSeparateProcess) + | small + | test(?:dox)? + | ticket + ))\b + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + + boolean-tags: + - match: | + (?x)\s*\B(@) + ((?> backup (?>Globals|StaticAttributes) + | backupGlobals + | preserveGlobalState + ))\b + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + push: + - match: | + (?x)\s* + ((?> enabled + | disabled + )) + captures: + 1: keyword.documentation.php.php7 + pop: true + + string-tags: + - match: | + (?x)\s*\B(@) + ((?> expectedExceptionMessageRegExp + | group + ))\b + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + push: + - match: .+$ + scope: string.php.php7 + pop: true + + type-tags: + - match: | + (?x)\s*\B(@) + ((?> coversDefaultClass + | expectedException + | uses + ))\b + captures: + 1: >- + keyword.documentation.php.php7 + punctuation.keyword.begin.php.php7 + 2: keyword.documentation.php.php7 + push: type + diff --git a/integration/syntaxes/src/php/constant/index.yml b/integration/syntaxes/src/php/constant/index.yml new file mode 100644 index 00000000..aecf91b1 --- /dev/null +++ b/integration/syntaxes/src/php/constant/index.yml @@ -0,0 +1,27 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/php/namespace/path.no-pop + - include: ~/php/constant/support/core + - include: ~/php/constant/support/error + - include: ~/php/constant/support/array + - include: ~/php/constant/support/string + - include: ~/php/constant/support/magic + - include: ~/php/constant/support/math + - include: ~/php/constant/support/math-gmp + - include: ~/php/constant/support/output + - include: ~/php/constant/normal diff --git a/integration/syntaxes/src/php/constant/normal.yml b/integration/syntaxes/src/php/constant/normal.yml new file mode 100644 index 00000000..5299a806 --- /dev/null +++ b/integration/syntaxes/src/php/constant/normal.yml @@ -0,0 +1,40 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + constantIdentifier: | + [_[:upper:]] + [_[:upper:][:digit:]]+ + +contexts: + main: + # Multiple characters. + - match: | + (?x)\s* + ((?>\\|\b)) + ({{constantIdentifier}})\b + captures: + 1: punctuation.definition.constant.php.php7 + 2: entity.name.constant.php.php7 + pop: true + # Single character. + - match: | + (?x)\s* + ((?>\\|\b)) + ([[:upper:]])\b + captures: + 1: punctuation.definition.constant.php.php7 + 2: entity.name.constant.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/constant/support/array.yml b/integration/syntaxes/src/php/constant/support/array.yml new file mode 100644 index 00000000..5b8f2c67 --- /dev/null +++ b/integration/syntaxes/src/php/constant/support/array.yml @@ -0,0 +1,46 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> CASE_(?>UPPER|LOWER) + | SORT_ + (?> ASC + | DESC + | REGULAR + | NUMERIC + | STRING + | LOCALE_STRING + | NATURAL + | FLAG_CASE + ) + | ARRAY_FILTER_USE_(?>KEY|BOTH) + | COUNT_(?>NORMAL|RECURSIVE) + | EXTR_ + (?> OVERWRITE + | SKIP + | PREFIX_ + (?>SAME|ALL|INVALID|IF_EXISTS) + | IF_EXISTS + | REFS + ) + ))\b + captures: + 1: >- + support.php.php7 + entity.name.constant.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/constant/support/core.yml b/integration/syntaxes/src/php/constant/support/core.yml new file mode 100644 index 00000000..86c3e9a2 --- /dev/null +++ b/integration/syntaxes/src/php/constant/support/core.yml @@ -0,0 +1,70 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: normal + - include: case-insenstive + + normal: + - match: | + (?x)\s*\b + ((?> + PHP_ + (?> VERSION(?:_ID)? + | MAJOR_VERSION + | MINOR_VERSION + | RELEASE_VERSION + | EXTRA_VERSION + | ZTS + | DEBUG + | MAXPATHLEN + | OS + | SAPI + | EOL + | INT_(?>MAX|MIN|SIZE) + | EXTENSION_DIR + | PREFIX + | BINDIR + | BINARY + | MANDIR + | LIBDIR + | DATADIR + | SYSCONFDIR + | LOCALSTATEDIR + | CONFIG_FILE_(?>PATH|SCAN_DIR) + | SHLIB_SUFFIX + ) + | PEAR_(?>INSTALL_DIR|EXTENSION_DIR) + | DEFAULT_INCLUDE_PATH + ))\b + captures: + 1: >- + support.php.php7 + entity.name.constant.php.php7 + pop: true + + case-insenstive: + - match: | + (?xi)\s*\b + ((?> TRUE + | FALSE + | NULL + ))\b + captures: + 1: >- + support.php.php7 + entity.name.constant.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/constant/support/error.yml b/integration/syntaxes/src/php/constant/support/error.yml new file mode 100644 index 00000000..5bcd1657 --- /dev/null +++ b/integration/syntaxes/src/php/constant/support/error.yml @@ -0,0 +1,39 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ( + E_ + (?> ERROR + | WARNING + | PARSE + | NOTICE + | CORE_(?>ERROR|WARNING) + | COMPILE_(?>ERROR|WARNING) + | USER_(?>ERROR|WARNING|NOTICE) + | DEPRECATED + | USER_DEPRECATED + | ALL + | STRICT + ) + )\b + captures: + 1: >- + support.php.php7 + entity.name.constant.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/constant/support/magic.yml b/integration/syntaxes/src/php/constant/support/magic.yml new file mode 100644 index 00000000..47e0e30d --- /dev/null +++ b/integration/syntaxes/src/php/constant/support/magic.yml @@ -0,0 +1,37 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ( + __ + (?> LINE + | FILE + | DIR + | FUNCTION + | CLASS + | TRAIT + | METHOD + | NAMESPACE + )__ + )\b + captures: + 1: >- + support.php.php7 + preprocessor.php.php7 + entity.name.constant.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/constant/support/math-gmp.yml b/integration/syntaxes/src/php/constant/support/math-gmp.yml new file mode 100644 index 00000000..e9a34100 --- /dev/null +++ b/integration/syntaxes/src/php/constant/support/math-gmp.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ( + GMP_ + (?> ROUND_(?>ZERO|PLUSINF|MINUSINF) + | MSW_FIRST + | LSW_FIRST + | LITTLE_ENDIAN + | BIG_ENDIAN + | NATIVE_ENDIAN + | VERSION + ) + )\b + captures: + 1: >- + support.php.php7 + entity.name.constant.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/constant/support/math.yml b/integration/syntaxes/src/php/constant/support/math.yml new file mode 100644 index 00000000..ac8633c8 --- /dev/null +++ b/integration/syntaxes/src/php/constant/support/math.yml @@ -0,0 +1,38 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> INF + | M_ + (?> 1_PI + | 2_(?>PI|SQRTPI) + | EULER(?>2|10|PI)? + | E + | LN(?>2|10|PI) + | LOG(?>2E|10E) + | PI(?>_2|_4)? + | SQRT(?>1_2|2|3|PI) + ) + | NAN + | PHP_ROUND_HALF_(?>DOWN|EVEN|ODD|UP) + ))\b + captures: + 1: >- + support.php.php7 + entity.name.constant.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/constant/support/output.yml b/integration/syntaxes/src/php/constant/support/output.yml new file mode 100644 index 00000000..04541d06 --- /dev/null +++ b/integration/syntaxes/src/php/constant/support/output.yml @@ -0,0 +1,37 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ( + PHP_OUTPUT_HANDLER_ + (?> START + | WRITE + | FLUSH(?:ABLE)? + | CLEAN(?:ABLE)? + | FINAL + | CONT + | END + | REMOVABLE + | STDFLAGS + ) + )\b + captures: + 1: >- + support.php.php7 + entity.name.constant.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/constant/support/string.yml b/integration/syntaxes/src/php/constant/support/string.yml new file mode 100644 index 00000000..8593c25f --- /dev/null +++ b/integration/syntaxes/src/php/constant/support/string.yml @@ -0,0 +1,50 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s*\b + ((?> CRYPT_(?>SALT_LENGTH|STD_DES|EXT_DES|MD5|BLOWFISH) + | HTML_(?>SPECIALCHARS|ENTITIES) + | ENT_ + (?> COMPAT + | QUOTES + | NOQUOTES + | IGNORE + | SUBSTITUTE + | DISALLOWED + | HTML401 + | XML1 + | XHTML + | HTML5 + ) + | CHAR_MAX + | LC_ + (?> CTYPE + | NUMERIC + | TIME + | COLLATE + | MONETARY + | ALL + | MESSAGES + ) + | STR_PAD_(?>LEFT|RIGHT|BOTH) + ))\b + captures: + 1: >- + support.php.php7 + entity.name.constant.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/declare.yml b/integration/syntaxes/src/php/declare.yml new file mode 100644 index 00000000..3e4ae94a --- /dev/null +++ b/integration/syntaxes/src/php/declare.yml @@ -0,0 +1,95 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +scope: ... + +contexts: + main: + - match: (?i)\s*\b(declare)\b + captures: + 1: keyword.declare.php.php7 + push: declaration + + declaration: + - match: \s*(\() + captures: + 1: punctuation.definition.declare.parameters.begin.php.php7 + push: parameters + - match: \s*(\)) + captures: + 1: punctuation.definition.declare.parameters.end.php.php7 + set: body + + parameters: + - match: (?=\s*\)) + pop: true + - match: (?=\s*\S) + push: [ + value, + operator, + directive + ] + + directive: + - match: (?=\s*=) + pop: true + - match: | + (?x)\s*\b + ((?> ticks + | encoding + | strict + ))\b + captures: + 1: keyword.directive.php.php7 + pop: true + + operator: + - match: \s*(=) + captures: + 1: keyword.operator.other.assignment.php.php7 + pop: true + + value: + - include: ~/php/literal + - include: ~/php/constant + + body: + - match: \s*(;) + captures: + 1: punctuation.definition.declare.body.begin.php.php7 + pop: true + - match: \s*(\{) + captures: + 1: punctuation.definition.declare.body.begin.php.php7 + set: bracketed-body + + bracketed-body: + - match: \s*(}) + captures: + 1: punctuation.definition.declare.body.end.php.php7 + pop: true + - match: "" + push: + - include: ~/php/statement-and-expression + - match: "" + pop: true + diff --git a/integration/syntaxes/src/php/function-call/arguments.yml b/integration/syntaxes/src/php/function-call/arguments.yml new file mode 100644 index 00000000..43c050de --- /dev/null +++ b/integration/syntaxes/src/php/function-call/arguments.yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(\() + captures: + 1: punctuation.definition.function.arguments.begin.php.php7 + set: arguments + + arguments: + - match: \s*(\)) + captures: + 1: punctuation.definition.function.arguments.end.php.php7 + pop: true + - match: \s*(,) + scope: punctuation.definition.function.arguments.php.php7 + - match: "" + push: + - include: ~/php/statement-and-expression + - match: "" + pop: true diff --git a/integration/syntaxes/src/php/function-call/index.yml b/integration/syntaxes/src/php/function-call/index.yml new file mode 100644 index 00000000..fa4543d2 --- /dev/null +++ b/integration/syntaxes/src/php/function-call/index.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/php/function-call/support/array + - include: ~/php/function-call/support/class-object + - include: ~/php/function-call/support/core + - include: ~/php/function-call/support/directories + - include: ~/php/function-call/support/error + - include: ~/php/function-call/support/filesystem + - include: ~/php/function-call/support/math + - include: ~/php/function-call/support/math-gmp + - include: ~/php/function-call/support/magic + - include: ~/php/function-call/support/mb_string + - include: ~/php/function-call/support/output + - include: ~/php/function-call/support/spl + - include: ~/php/function-call/support/string + - include: ~/php/function-call/support/variable + - include: ~/php/function-call/normal diff --git a/integration/syntaxes/src/php/function-call/normal.yml b/integration/syntaxes/src/php/function-call/normal.yml new file mode 100644 index 00000000..3c4132c5 --- /dev/null +++ b/integration/syntaxes/src/php/function-call/normal.yml @@ -0,0 +1,54 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +scope: ... + +contexts: + main: + # Closure. + - match: | + (?xi) + (?= + \s*\B(\$)({{commonIdentifier}})\b + \s*\( + ) + set: [ + arguments, + variable + ] + # Actual function. + - match: | + (?xi)\s* + ((?>\\|\b)) + ( + {{commonIdentifier}} + )(?=\s*\() + captures: + 1: punctuation.definition.function.php.php7 + 2: entity.name.function.php.php7 + set: arguments + + variable: + - include: ~/php/variable + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function-call/support/array.yml b/integration/syntaxes/src/php/function-call/support/array.yml new file mode 100644 index 00000000..c2167718 --- /dev/null +++ b/integration/syntaxes/src/php/function-call/support/array.yml @@ -0,0 +1,102 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> array + (?:_ + (?> change_key_case + | chunk + | column + | combine + | count_values + | diff + (?:_(?>assoc|key|uassoc|ukey))? + | fill(?:_keys)? + | filter + | flip + | intersect + (?:_(?>assoc|key|uassoc|ukey))? + | key_exists + | keys + | map + | merge(?:_recursive)? + | multisort + | pad + | pop + | product + | push + | rand + | reduce + | replace(?:_recursive)? + | reverse + | search + | shift + | slice + | splice + | sum + | udiff + (?:_(?>assoc|uassoc))? + | uintersect + (?:_(?>assoc|uassoc))? + | unique + | unshift + | values + | walk(?:_recursive)? + ) + ) + | arsort + | asort + | compact + | count + | current + | each + | end + | extract + | in_array + | key(?:_exists)? + | krsort + | ksort + | list + | natcasesort + | natsort + | next + | pos + | prev + | range + | reset + | rsort + | shuffle + | sizeof + | sort + | uasort + | uksort + | usort + ) + ) + (?=\s*\() + captures: + 1: punctuation.definition.support.php.php7 + 2: >- + support.php.php7 + entity.name.function.php.php7 + set: arguments + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function-call/support/class-object.yml b/integration/syntaxes/src/php/function-call/support/class-object.yml new file mode 100644 index 00000000..56fff98f --- /dev/null +++ b/integration/syntaxes/src/php/function-call/support/class-object.yml @@ -0,0 +1,51 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> + class_ + (?>alias|exists) + | get_ + (?> called_class + | class + (?:_(?>methods|vars))? + | declared_ + (?>classes|interfaces|traits) + | object_vars + | parent_class + ) + | interface_exists + | is_ + (?>a|subclass_of) + | method_exists + | property_exists + | trait_exists + ) + ) + (?=\s*\() + captures: + 1: punctuation.definition.support.php.php7 + 2: >- + support.php.php7 + entity.name.function.php.php7 + set: arguments + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function-call/support/core.yml b/integration/syntaxes/src/php/function-call/support/core.yml new file mode 100644 index 00000000..ce977727 --- /dev/null +++ b/integration/syntaxes/src/php/function-call/support/core.yml @@ -0,0 +1,93 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> assert(?:_options)? + | cli_ + (?>get_process_title|set_process_title) + | dl + | define + | extension_loaded + | gc_ + (?> collect_cycles + | disable + | enabled? + | mem_caches + ) + | get + (?> env + | lastmod + | mygid + | myinode + | mypid + | myuid + | opt + | rusage + | _ + (?> cfg_var + | current_user + | defined_constants + | extension_funcs + | include + (?>_path|d_files) + | loaded_extensions + | magic_quotes_ + (?>gpc|runtime) + | required_files + | resources + ) + ) + | ini_ + (?> alter + | get(?:_all)? + | restore + | set + ) + | main + | memory_get_ + (?>peak_usage|usage) + | php + (?> _ini_ + (?>loaded_file|scanned_files) + | _sapi_name + | _uname + ) + | php + (?>credits|info|version) + | putenv + | restore_include_path + | set_ + (?>include_path|time_limit) + | sys_get_temp_dir + | version_compare + | zend_ + (?>thread_id|version) + ) + ) + (?=\s*\() + captures: + 1: punctuation.definition.support.php.php7 + 2: >- + support.php.php7 + entity.name.function.php.php7 + set: arguments + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function-call/support/directories.yml b/integration/syntaxes/src/php/function-call/support/directories.yml new file mode 100644 index 00000000..8d5dc60a --- /dev/null +++ b/integration/syntaxes/src/php/function-call/support/directories.yml @@ -0,0 +1,42 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> ch + (?>dir|root) + | closedir + | dir + | getcwd + | opendir + | re + (?>addir|winddir) + | scandir + ) + ) + (?=\s*\() + captures: + 1: punctuation.definition.support.php.php7 + 2: >- + support.php.php7 + entity.name.function.php.php7 + set: arguments + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function-call/support/error.yml b/integration/syntaxes/src/php/function-call/support/error.yml new file mode 100644 index 00000000..1f10d412 --- /dev/null +++ b/integration/syntaxes/src/php/function-call/support/error.yml @@ -0,0 +1,43 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> debug_ + (?>backtrace|print_backtrace) + | error_ + (?>clear_last|get_last|log|reporting) + | restore_ + (?>error_handler|exception_handler) + | set_ + (?>error_handler|exception_handler) + | trigger_error + | user_error + ) + ) + (?=\s*\() + captures: + 1: punctuation.definition.support.php.php7 + 2: >- + support.php.php7 + entity.name.function.php.php7 + set: arguments + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function-call/support/filesystem.yml b/integration/syntaxes/src/php/function-call/support/filesystem.yml new file mode 100644 index 00000000..f8aba66a --- /dev/null +++ b/integration/syntaxes/src/php/function-call/support/filesystem.yml @@ -0,0 +1,116 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> basename + | ch(?>grp|mod|own) + | clearstatcache + | copy + | delete + | dirname + | disk + (?>_ + (?>free_space|total_space) + | freespace + ) + | f + (?> close + | eof + | flush + | getc(?:sv)? + | getss? + | ile + (?>_ + (?>exists|get_contents|put_contents) + | atime + | ctime + | group + | inode + | mtime + | owner + | perms + | size + | type + )? + | lock + | nmatch + | open + | passthru + | putcsv + | puts + | read + | scanf + | seek + | stat + | tell + | truncate + | write + ) + | glob + | is_ + (?> dir + | executable + | file + | link + | readable + | uploaded_file + | writable + | writeable + ) + | lchgrp + | lchown + | link(?:info)? + | lstat + | mkdir + | move_uploaded_file + | parse_ini_ + (?>file|string) + | pathinfo + | pclose + | popen + | read + (?>file|link) + | realpath + (?>_cache_ + (?>get|size) + )? + | rename + | rewind + | rmdir + | set_file_buffer + | stat + | symlink + | tempnam + | tmpfile + | touch + | umask + | unlink + ) + ) + (?=\s*\() + captures: + 1: punctuation.definition.support.php.php7 + 2: >- + support.php.php7 + entity.name.function.php.php7 + set: arguments + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function-call/support/magic.yml b/integration/syntaxes/src/php/function-call/support/magic.yml new file mode 100644 index 00000000..fcd84829 --- /dev/null +++ b/integration/syntaxes/src/php/function-call/support/magic.yml @@ -0,0 +1,46 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + (__ + (?> call(?:Static)? + | clone + | construct + | debugInfo + | destruct + | get + | invoke + | isset + | set(?:_state)? + | sleep + | toString + | unset + | wakeup + ) + ) + (?=\s*\() + captures: + 1: punctuation.definition.support.php.php7 + 2: >- + support.php.php7 + entity.name.function.php.php7 + set: arguments + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function-call/support/math-gmp.yml b/integration/syntaxes/src/php/function-call/support/math-gmp.yml new file mode 100644 index 00000000..e3ab8660 --- /dev/null +++ b/integration/syntaxes/src/php/function-call/support/math-gmp.yml @@ -0,0 +1,75 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + gmp_ + (?> abs + | add + | and + | clrbit + | cmp + | com + | div + (?> _(?>r|qr?) + | exact + )? + | export + | fact + | gcd(?:ext)? + | hamdist + | import + | init + | intval + | invert + | jacobi + | legendre + | mod + | mul + | neg + | nextprime + | or + | perfect_square + | popcount + | powm? + | prob_prime + | random + (?:_(?>bits|range|seed))? + | root(?:rem)? + | scan + (?>0|1) + | setbit + | sign + | sqrt(?:rem)? + | strval + | sub + | testbit + | xor + ) + ) + (?=\s*\() + captures: + 1: punctuation.definition.support.php.php7 + 2: >- + support.php.php7 + entity.name.function.php.php7 + set: arguments + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function-call/support/math.yml b/integration/syntaxes/src/php/function-call/support/math.yml new file mode 100644 index 00000000..e65bb6aa --- /dev/null +++ b/integration/syntaxes/src/php/function-call/support/math.yml @@ -0,0 +1,69 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> abs + | acosh? + | asinh? + | atan[2h]? + | base_convert + | bindec + | ceil + | cosh? + | decbin + | dechex + | decoct + | deg2rad + | exp(?:m1)? + | floor + | fmod + | getrandmax + | hexdec + | hypot + | intdiv + | is_ + (?:finite|infinite|nan) + | lcg_value + | log(?:10|1p)? + | max + | min + | mt_ + (?:getrandmax|rand|srand) + | octdec + | pi + | pow + | rad2deg + | rand + | round + | sinh? + | sqrt + | srand + | tanh? + ) + )\b + captures: + 1: punctuation.definition.support.php.php7 + 2: >- + support.php.php7 + entity.name.function.php.php7 + set: arguments + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function-call/support/mb_string.yml b/integration/syntaxes/src/php/function-call/support/mb_string.yml new file mode 100644 index 00000000..57f691ae --- /dev/null +++ b/integration/syntaxes/src/php/function-call/support/mb_string.yml @@ -0,0 +1,94 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + mb_ + (?> check_encoding + | convert_ + (?> case + | encoding + | kana + | variables + ) + | decode_(?>mimeheader|numericentity) + | detect_(?>encoding|order) + | encode_(?>mimeheader|numericentity) + | encoding_aliases + | ereg + (?> i(?:_replace)? + | _ + (?> match + | lala + | replace(?:_callback)? + | search + (?:_ + (?> getpos + | getregs + | init + | pos + | regs + | setpos + ) + )? + ) + )? + | get_info + | http_(?:input|output) + | internal_encoding + | language + | list_encodings + | output_handler + | parse_str + | preferred_mime_name + | regex_(?>encoding|set_options) + | send_mail + | split + | str + (?> cut + | i + (?> mwidth + | pos + | str + ) + | len + | pos + | r + (?> chr + | i(?>chr|pos) + | pos + ) + | str + | to(?>lower|upper) + | width + ) + | substitute_character + | substr(?:_count)? + ) + ) + (?=\s*\() + captures: + 1: punctuation.definition.support.php.php7 + 2: >- + support.php.php7 + entity.name.function.php.php7 + set: arguments + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function-call/support/output.yml b/integration/syntaxes/src/php/function-call/support/output.yml new file mode 100644 index 00000000..1f264cf3 --- /dev/null +++ b/integration/syntaxes/src/php/function-call/support/output.yml @@ -0,0 +1,51 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> flush + | output_ + (?>add_rewrite_var|reset_rewrite_vars) + | ob_ + (?> clean + | end_clean + | end_flush + | flush + | get_clean + | get_contents + | get_flush + | get_length + | get_level + | get_status + | gzhandler + | implicit_flush + | list_handlers + | start + ) + ) + )\b + captures: + 1: punctuation.definition.support.php.php7 + 2: >- + support.php.php7 + entity.name.function.php.php7 + set: arguments + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function-call/support/spl.yml b/integration/syntaxes/src/php/function-call/support/spl.yml new file mode 100644 index 00000000..2e8e1134 --- /dev/null +++ b/integration/syntaxes/src/php/function-call/support/spl.yml @@ -0,0 +1,47 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> class_ + (?>implements|parents|uses) + | iterator_ + (?>apply|count|to_array) + | spl_autoload + (?:_ + (?> call + | extensions + | functions + | register + | unregister + ) + )? + | spl_(?>classes|object_hash) + ) + ) + (?=\s*\() + captures: + 1: punctuation.definition.support.php.php7 + 2: >- + support.php.php7 + entity.name.function.php.php7 + set: arguments + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function-call/support/string.yml b/integration/syntaxes/src/php/function-call/support/string.yml new file mode 100644 index 00000000..1749add6 --- /dev/null +++ b/integration/syntaxes/src/php/function-call/support/string.yml @@ -0,0 +1,131 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> add + (?>cslashes|slashes) + | bin2hex + | chop + | chr + | chunk_split + | convert_ + (?> cyr_string + | uu(?>decode|encode) + ) + | count_chars + | crc32 + | crypt + | explode + | fprintf + | get_html_translation_table + | hebrevc? + | hex2bin + | html_entity_decode + | htmlentities + | htmlspecialchars(?:_decode)? + | implode + | join + | lcfirst + | levenshtein + | localeconv + | ltrim + | md5_file + | md5 + | metaphone + | money_format + | nl_langinfo + | nl2br + | number_format + | ord + | parse_str + | printf? + | quoted_printable_ + (?>encode|decode) + | quotemeta + | rtrim + | setlocale + | sha1_file + | sha1 + | similar_text + | soundex + | sprintf + | sscanf + | str + (?> _ + (?> getcsv + | ireplace + | pad + | repeat + | replace + | rot13 + | shuffle + | split + | word_count + ) + | casecmp + | chr + | cmp + | coll + | cspn + | ip_tags + | ipcslashes + | ipos + | ipslashes + | istr + | len + | natcasecmp + | natcmp + | ncasecmp + | ncmp + | pbrk + | pos + | rchr + | rev + | ripos + | rpos + | spn + | str + | tok + | tolower + | toupper + | tr + ) + | substr + (?:_ + (?>compare|count|replace) + )? + | trim + | uc + (?>first|words) + | vfprintf + | vprintf + | vsprintf + | wordwrap + ) + )\b + captures: + 1: punctuation.definition.support.php.php7 + 2: >- + support.php.php7 + entity.name.function.php.php7 + set: arguments + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function-call/support/variable.yml b/integration/syntaxes/src/php/function-call/support/variable.yml new file mode 100644 index 00000000..a80d123d --- /dev/null +++ b/integration/syntaxes/src/php/function-call/support/variable.yml @@ -0,0 +1,67 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> boolval + | debug_zval_dump + | doubleval + | empty + | floatval + | get_defined_vars + | get_resource_type + | gettype + | import_request_variables + | intval + | is_ + (?> array + | bool + | callable + | double + | float + | int(?:eger)? + | long + | null + | numeric + | object + | real + | resource + | scalar + | string + ) + | isset + | print_r + | serialize + | settype + | strval + | unserialize + | unset + | var_ + (?>dump|export) + ) + )\b + captures: + 1: punctuation.definition.support.php.php7 + 2: >- + support.php.php7 + entity.name.function.php.php7 + set: arguments + + arguments: + - include: ~/php/function-call/arguments diff --git a/integration/syntaxes/src/php/function/body.yml b/integration/syntaxes/src/php/function/body.yml new file mode 100644 index 00000000..a307e078 --- /dev/null +++ b/integration/syntaxes/src/php/function/body.yml @@ -0,0 +1,38 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # Function without body. + - match: \s*(;) + captures: + 1: punctuation.definition.function.declaration.end.php.php7 + pop: true + # Normal body. + - match: \s*(\{) + captures: + 1: punctuation.definition.function.body.begin.php.php7 + set: body-content + + body-content: + - match: \s*(}) + captures: + 1: punctuation.definition.function.body.end.php.php7 + pop: true + - match: "" + push: + - include: ~/php/statement-and-expression + - match: "" + pop: true diff --git a/integration/syntaxes/src/php/function/index.yml b/integration/syntaxes/src/php/function/index.yml new file mode 100644 index 00000000..00fa0571 --- /dev/null +++ b/integration/syntaxes/src/php/function/index.yml @@ -0,0 +1,73 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +scope: ... + +contexts: + main: + - match: | + (?xi) + (?=\s*\b + (?:abstract\s+)? + (?: + (?> private + | protected + | public + )\s+ + )? + (?: + (?> abstract + | static + )\s+ + )? + function\s+{{commonIdentifier}} + ) + set: [ + body, + optional-return-type-hint, + parameters, + name, + keyword + ] + + keyword: + - match: (?i)\s*\b(function)(?!\\)\b + captures: + 1: >- + storage.type.php.php7 + keyword.declaration.function.php.php7 + pop: true + - include: ~/php/modifier.no-pop + + name: + - include: ~/php/function/name + + parameters: + - include: ~/php/function/parameters + + optional-return-type-hint: + - match: (?=;|{) + pop: true + - include: ~/php/function/return-type-hint + + body: + - include: ~/php/function/body diff --git a/integration/syntaxes/src/php/function/name.yml b/integration/syntaxes/src/php/function/name.yml new file mode 100644 index 00000000..b01bf1d0 --- /dev/null +++ b/integration/syntaxes/src/php/function/name.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - include: ~/php/namespace/path.no-pop + - include: ~/php/function/support/magic + - match: | + (?xi)\s* + ((?>\\|\b)) + ({{commonIdentifier}})\b + captures: + 1: punctuation.definition.function.php.php7 + 2: entity.name.function.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/function/parameter.yml b/integration/syntaxes/src/php/function/parameter.yml new file mode 100644 index 00000000..151654a3 --- /dev/null +++ b/integration/syntaxes/src/php/function/parameter.yml @@ -0,0 +1,33 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - match: | + (?xi)\s* + \B(\$)({{commonIdentifier}})\b + captures: + 1: >- + function.parameter.php.php7 + punctuation.definition.variable.begin.php.php7 + 2: >- + function.parameter.php.php7 + entity.name.variable.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/function/parameters.yml b/integration/syntaxes/src/php/function/parameters.yml new file mode 100644 index 00000000..747da694 --- /dev/null +++ b/integration/syntaxes/src/php/function/parameters.yml @@ -0,0 +1,136 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - match: \s*(\() + captures: + 1: punctuation.definition.function.parameters.begin.php.php7 + set: parameters + + comment: + - include: ~/php/comment.no-pop + + parameters: + - include: comment + - match: \s*(\)) + captures: + 1: punctuation.definition.function.parameters.end.php.php7 + pop: true + # Starts with a variable. + - match: (?=\s*\$) + push: [ + param-definition, + param-optional-default-value, + param-variable + ] + # Starts with a variadic or reference operator. + - match: (?=\s*(?>\.\.\.|&)) + push: [ + param-definition, + param-optional-default-value, + param-variable, + variadic-or-reference-operator + ] + # Starts with a type hint. + - match: (?=\s*\S) + push: [ + param-definition, + param-optional-default-value, + param-variable, + variadic-or-reference-operator, + variable-type + ] + + variable-type: + - include: comment + - include: ~/php/type + + variadic-or-reference-operator: + - include: comment + - match: (?=\s*\$) + pop: true + - match: \s*(\&) + captures: + 1: keyword.operator.other.reference.php.php7 + pop: true + - match: \s*(\.\.\.) + captures: + 1: keyword.operator.other.rest.php.php7 + pop: true + + reference-operator: + - include: comment + - match: (?=\s*\$) + pop: true + - match: \s*(\&) + captures: + 1: keyword.operator.other.reference.php.php7 + pop: true + + param-variable: + - include: comment + - include: ~/php/function/parameter + + param-optional-default-value: + - include: comment + - match: (?=\s*(?>,|\))) + pop: true + - match: \s*(=) + captures: + 1: keyword.operator.other.assignment.php.php7 + set: param-default-value + + param-default-value: + - include: comment + - match: (?=\s*(?>,|\))) + pop: true + - include: ~/php/constant + - include: ~/php/literal + # Constant inside class. + - match: | + (?xi) + (?=\s*{{commonIdentifier}}) + push: [ + default-value-constant, + default-value-scope-operator, + default-value-type + ] + + param-definition: + - include: comment + - match: (?=\s*\)) + pop: true + - match: \s*(,) + captures: + 1: punctuation.definition.function.parameters.php.php7 + pop: true + + default-value-type: + - include: ~/php/type + + default-value-scope-operator: + - match: "::" + captures: + 1: keyword.operator.other.scope-resolution.php.php7 + pop: true + + default-value-constant: + - include: ~/php/constant diff --git a/integration/syntaxes/src/php/function/return-type-hint.yml b/integration/syntaxes/src/php/function/return-type-hint.yml new file mode 100644 index 00000000..bc4621b2 --- /dev/null +++ b/integration/syntaxes/src/php/function/return-type-hint.yml @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(:) + captures: + 1: punctuation.definition.function.php.php7 + set: return-type + + return-type: + - include: ~/php/comment.no-pop + - include: ~/php/type diff --git a/integration/syntaxes/src/php/function/support/magic.yml b/integration/syntaxes/src/php/function/support/magic.yml new file mode 100644 index 00000000..0ac6f634 --- /dev/null +++ b/integration/syntaxes/src/php/function/support/magic.yml @@ -0,0 +1,40 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + (__ + (?> call(?:Static)? + | clone + | construct + | debugInfo + | destruct + | get + | invoke + | isset + | set(?:_state)? + | sleep + | toString + | unset + | wakeup + ) + ) + captures: + 1: >- + support.php.php7 + entity.name.function.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/goto.yml b/integration/syntaxes/src/php/goto.yml new file mode 100644 index 00000000..267d6be1 --- /dev/null +++ b/integration/syntaxes/src/php/goto.yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: \s*(goto) + captures: + 1: keyword.control.php.php7 + set: label + + label: + - match: | + (?xi) + ({{commonIdentifier}}) + captures: + 1: entity.name.label.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/index.yml b/integration/syntaxes/src/php/index.yml new file mode 100644 index 00000000..f6b8917e --- /dev/null +++ b/integration/syntaxes/src/php/index.yml @@ -0,0 +1,65 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +name: PHP (Naomi) +scope: text.html + +file_extensions: + - php + - php7 + +contexts: + main: + - match: "" + embed: entry + + html5-element: + - include: ~/html/element + + entry: + # Normal open tag. + - match: \s*(<\?php) + captures: + 1: keyword.embedded.begin.php.php7 + set: embedded + # Short open tag. + - match: \s*(<\?=) + captures: + 1: keyword.embedded.begin.php.php7 + set: embedded-short + + embedded: + - meta_scope: >- + embedded.php.php7 + source.php.php7 + - include: content + + embedded-short: + - meta_scope: >- + embedded.short.php.php7 + source.php.php7 + - include: content + + content: + - match: \s*(\?>) + captures: + 1: keyword.embedded.end.php.php7 + pop: true + - match: "" + with_prototype: + - match: (?=\s*\?>) + pop: true + push: + - include: ~/php/statement-and-expression diff --git a/integration/syntaxes/src/php/interface.yml b/integration/syntaxes/src/php/interface.yml new file mode 100644 index 00000000..2d78e328 --- /dev/null +++ b/integration/syntaxes/src/php/interface.yml @@ -0,0 +1,91 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +scope: ... + +contexts: + main: + - match: (?i)\s*\b(interface)(?!\\)\b + captures: + 1: >- + storage.type.php.php7 + keyword.declaration.interface.php.php7 + set: declaration + + comment: + - include: ~/php/comment.no-pop + + declaration: + - include: comment + # Extends. + - match: (?i)\s*\b(extends)\b + captures: + 1: >- + storage.modifier.php.php7 + keyword.inherit.php.php7 + push: extend-targets + # interface’s name. + - match: (?xi)\s*\b({{commonIdentifier}})\b + captures: + 1: entity.name.interface.php.php7 + # Body. + - match: \s*(\{) + captures: + 1: punctuation.definition.interface.body.begin.php.php7 + set: body + + body: + - match: \s*(}) + captures: + 1: punctuation.definition.interface.body.end.php.php7 + pop: true + - include: body-content + + body-content: + - match: "" + push: + - include: ~/php/statement-and-expression + - match: "" + pop: true + + extend-targets: + - include: comment + - match: (?=\s*\{) + pop: true + - match: (?=\s*\S) + push: [ + extend-target-definition, + extend-target + ] + + extend-target: + - include: comment + - include: ~/php/type + + extend-target-definition: + - include: comment + - match: \s*(,) + captures: + 1: punctuation.definition.extend.php.php7 + pop: true + - match: (?=\s*\S) + pop: true diff --git a/integration/syntaxes/src/php/literal/array.yml b/integration/syntaxes/src/php/literal/array.yml new file mode 100644 index 00000000..b25a44d4 --- /dev/null +++ b/integration/syntaxes/src/php/literal/array.yml @@ -0,0 +1,73 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(\[) + captures: + 1: punctuation.definition.array.begin.php.php7 + set: short-array-items + - match: | + (?x) + \s*(array) + \s*(\() + captures: + 1: entity.name.type.array.php.php7 + 2: punctuation.definition.array.begin.php.php7 + set: items + + short-array-items: + - match: \s*(]) + captures: + 1: punctuation.definition.array.end.php.php7 + pop: true + - match: (?=\s*\S) + push: key-or-value + + items: + - match: \s*(\)) + captures: + 1: punctuation.definition.array.end.php.php7 + pop: true + - match: (?=\s*\S) + push: key-or-value + + key-or-value: + - include: end + - include: item-definition + - match: "" + push: + - include: ~/php/statement-and-expression + - match: "" + pop: true + + value: + - include: end + - include: item-definition + - match: "" + push: + - include: ~/php/statement-and-expression + - match: "" + pop: true + + item-definition: + - match: \s*(,) + captures: + 1: punctuation.definition.array.php.php7 + pop: true + + end: + - match: (?=\s*(?>\)|])) + pop: true diff --git a/integration/syntaxes/src/php/literal/index.yml b/integration/syntaxes/src/php/literal/index.yml new file mode 100644 index 00000000..c89050f4 --- /dev/null +++ b/integration/syntaxes/src/php/literal/index.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/php/literal/array + - include: ~/php/literal/number + - include: ~/php/literal/string/single-quoted + - include: ~/php/literal/string/double-quoted + - include: ~/php/literal/string/nowdoc + - include: ~/php/literal/string/heredoc diff --git a/integration/syntaxes/src/php/literal/number.yml b/integration/syntaxes/src/php/literal/number.yml new file mode 100644 index 00000000..122bd3e9 --- /dev/null +++ b/integration/syntaxes/src/php/literal/number.yml @@ -0,0 +1,65 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + literalDecimal: | + [0-9]+ + + literalFloat: | + (?> [0-9]*[.]{{literalDecimal}} + | {{literalDecimal}}[.][0-9]* + ) + + scientificNotation: | + ( + (?> {{literalFloat}} + | {{literalDecimal}} + ) + [e][+-]? + {{literalDecimal}} + ) + +contexts: + main: + - include: float + - include: integer + + float: + - match: (?xi)\s*({{scientificNotation}}) + captures: + 1: constant.numeric.float.scientific.php.php7 + pop: true + - match: (?x)\s*({{literalFloat}}) + captures: + 1: constant.numeric.float.php.php7 + pop: true + + integer: + - match: \s*(0b[01]+) + captures: + 1: constant.numeric.binary.php.php7 + pop: true + - match: \s*(0[0-7]+) + captures: + 1: constant.numeric.octal.php.php7 + pop: true + - match: (?i)\s*(0[x][0-9a-f]+) + captures: + 1: constant.numeric.hex.php.php7 + pop: true + - match: \s*([1-9][0-9]*|0) + captures: + 1: constant.numeric.decimal.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/literal/string/double-quoted.yml b/integration/syntaxes/src/php/literal/string/double-quoted.yml new file mode 100644 index 00000000..0270b57b --- /dev/null +++ b/integration/syntaxes/src/php/literal/string/double-quoted.yml @@ -0,0 +1,121 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + octalEscapedChar: | + [0-7]{1,3} + + hexEscapedChar: | + x[a-f0-9]{1,2} + + unicodeEscapedChar: | + u\{[a-f0-9]+\} + + doubleQuotedEscapeSequences: | + \\ + (?> [\\"nrtvef$] + | {{octalEscapedChar}} + | {{hexEscapedChar}} + | {{unicodeEscapedChar}} + ) + + embeddedVariableStart: | + \$ + +contexts: + main: + - match: \s*(") + scope: >- + string.quoted.double.php.php7 + punctuation.definition.string.begin.php.php7 + with_prototype: + - match: \s*(") + scope: >- + string.quoted.double.php.php7 + punctuation.definition.string.end.php.php7 + pop: true + set: escape-a-variable-a + + escape-a-variable-a: + - meta_content_scope: string.quoted.double.php.php7 + - match: (?x)(?=\s*{{doubleQuotedEscapeSequences}}) + set: [ + escape-b-variable-a, + escape-a + ] + - match: (?x)(?=\s*{{embeddedVariableStart}}) + set: [ + escape-a-variable-b, + variable-a + ] + + escape-b-variable-a: + - meta_content_scope: string.quoted.double.php.php7 + - match: (?x)(?=\s*{{doubleQuotedEscapeSequences}}) + set: [ + escape-a-variable-a, + escape-b + ] + - match: (?x)(?=\s*{{embeddedVariableStart}}) + set: [ + escape-b-variable-b, + variable-a + ] + + escape-a-variable-b: + - meta_content_scope: string.quoted.double.php.php7 + - match: (?x)(?=\s*{{doubleQuotedEscapeSequences}}) + set: [ + escape-b-variable-b, + escape-a + ] + - match: (?x)(?=\s*{{embeddedVariableStart}}) + set: [ + escape-a-variable-a, + variable-b + ] + + escape-b-variable-b: + - meta_content_scope: string.quoted.double.php.php7 + - match: (?x)(?=\s*{{doubleQuotedEscapeSequences}}) + set: [ + escape-a-variable-b, + escape-b + ] + - match: (?x)(?=\s*{{embeddedVariableStart}}) + set: [ + escape-b-variable-a, + variable-b + ] + + escape-a: + - match: (?x)\s*({{doubleQuotedEscapeSequences}}) + captures: + 1: constant.character.escape.a.php.php7 + pop: true + + escape-b: + - match: (?x)\s*({{doubleQuotedEscapeSequences}}) + captures: + 1: constant.character.escape.b.php.php7 + pop: true + + variable-a: + - meta_scope: variable.a.php.php7 + - include: ~/php/literal/string/embedded-variable + + variable-b: + - meta_scope: variable.b.php.php7 + - include: ~/php/literal/string/embedded-variable diff --git a/integration/syntaxes/src/php/literal/string/embedded-variable.yml b/integration/syntaxes/src/php/literal/string/embedded-variable.yml new file mode 100644 index 00000000..0e55cb3a --- /dev/null +++ b/integration/syntaxes/src/php/literal/string/embedded-variable.yml @@ -0,0 +1,41 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + + simpleVariableIdentifier: | + (?> \{{{commonIdentifier}}\} + | {{commonIdentifier}} + ) + + simpleVariable: | + (\$)({{simpleVariableIdentifier}}) + (?: + (\[)([^\]]*)(\]) + )* + +contexts: + main: + - match: (?xi)\s*{{simpleVariable}} + captures: + 1: punctuation.definition.variable.begin.php.php7 + 2: entity.name.variable.php.php7 + 3: keyword.operator.other.subscript.begin.php.php7 + 4: array.key.php.php7 + 5: keyword.operator.other.subscript.end.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/literal/string/heredoc.yml b/integration/syntaxes/src/php/literal/string/heredoc.yml new file mode 100644 index 00000000..9b5093a1 --- /dev/null +++ b/integration/syntaxes/src/php/literal/string/heredoc.yml @@ -0,0 +1,131 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + octalEscapedChar: | + [0-7]{1,3} + + hexEscapedChar: | + x[a-f0-9]{1,2} + + unicodeEscapedChar: | + u\{[a-f0-9]+\} + + heredocEscapeSequences: | + \\ + (?> [\\nrtvef$] + | {{octalEscapedChar}} + | {{hexEscapedChar}} + | {{unicodeEscapedChar}} + ) + + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + + embeddedVariableStart: | + \$ + +contexts: + main: + - match: (?xi)\s*(<<<{{commonIdentifier}}) + captures: + 1: >- + string.unquoted.heredoc.php.php7 + punctuation.definition.string.begin.php.php7 + with_prototype: + # HACK: This pattern is not matching the one captured when the heredoc + # was opened, it’ll work in most cases but another solution must be + # used. + - match: | + (?xi) + ^[_[:alpha:]][_[:alnum:]]*;$ + scope: >- + string.unquoted.heredoc.php.php7 + punctuation.definition.string.end.php.php7 + pop: true + set: escape-a-variable-a + + escape-a-variable-a: + - meta_content_scope: string.unquoted.heredoc.php.php7 + - match: (?x)(?=\s*{{heredocEscapeSequences}}) + set: [ + escape-b-variable-a, + escape-a + ] + - match: (?x)(?=\s*{{embeddedVariableStart}}) + set: [ + escape-a-variable-b, + variable-a + ] + + escape-b-variable-a: + - meta_content_scope: string.unquoted.heredoc.php.php7 + - match: (?x)(?=\s*{{heredocEscapeSequences}}) + set: [ + escape-a-variable-a, + escape-b + ] + - match: (?x)(?=\s*{{embeddedVariableStart}}) + set: [ + escape-b-variable-b, + variable-a + ] + + escape-a-variable-b: + - meta_content_scope: string.unquoted.heredoc.php.php7 + - match: (?x)(?=\s*{{heredocEscapeSequences}}) + set: [ + escape-b-variable-b, + escape-a + ] + - match: (?x)(?=\s*{{embeddedVariableStart}}) + set: [ + escape-a-variable-a, + variable-b + ] + + escape-b-variable-b: + - meta_content_scope: string.unquoted.heredoc.php.php7 + - match: (?x)(?=\s*{{heredocEscapeSequences}}) + set: [ + escape-a-variable-b, + escape-b + ] + - match: (?x)(?=\s*{{embeddedVariableStart}}) + set: [ + escape-b-variable-a, + variable-b + ] + + escape-a: + - match: (?x)\s*({{heredocEscapeSequences}}) + captures: + 1: constant.character.escape.a.php.php7 + pop: true + + escape-b: + - match: (?x)\s*({{heredocEscapeSequences}}) + captures: + 1: constant.character.escape.b.php.php7 + pop: true + + variable-a: + - meta_scope: variable.a.php.php7 + - include: ~/php/literal/string/embedded-variable + + variable-b: + - meta_scope: variable.b.php.php7 + - include: ~/php/literal/string/embedded-variable diff --git a/integration/syntaxes/src/php/literal/string/nowdoc.yml b/integration/syntaxes/src/php/literal/string/nowdoc.yml new file mode 100644 index 00000000..c1e8df02 --- /dev/null +++ b/integration/syntaxes/src/php/literal/string/nowdoc.yml @@ -0,0 +1,33 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - match: (?xi)\s*(<<<'({{commonIdentifier}})') + captures: + 1: punctuation.definition.string.begin.php.php7 + set: nowdoc-string + + nowdoc-string: + - meta_scope: string.unquoted.nowdoc.php.php7 + - match: ^(\2;) + captures: + 1: punctuation.definition.string.end.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/literal/string/single-quoted.yml b/integration/syntaxes/src/php/literal/string/single-quoted.yml new file mode 100644 index 00000000..b574564b --- /dev/null +++ b/integration/syntaxes/src/php/literal/string/single-quoted.yml @@ -0,0 +1,61 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + singleQuotedEscapeSequences: \\[\\'] + +contexts: + main: + - match: \s*(') + captures: + 1: >- + string.quoted.single.php.php7 + punctuation.definition.string.begin.php.php7 + with_prototype: + - match: \s*(') + captures: + 1: >- + string.quoted.single.php.php7 + punctuation.definition.string.end.php.php7 + pop: true + set: escape-a + + escape-a: + - meta_content_scope: string.quoted.single.php.php7 + - match: (?x)(?=\s*{{singleQuotedEscapeSequences}}) + set: [ + escape-b, + escape-a-match + ] + + escape-b: + - meta_content_scope: string.quoted.single.php.php7 + - match: (?x)(?=\s*{{singleQuotedEscapeSequences}}) + set: [ + escape-a, + escape-b-match + ] + + escape-a-match: + - match: (?x)\s*({{singleQuotedEscapeSequences}}) + captures: + 1: constant.character.escape.a.php.php7 + pop: true + + escape-b-match: + - match: (?x)\s*({{singleQuotedEscapeSequences}}) + captures: + 1: constant.character.escape.b.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/member-variable.yml b/integration/syntaxes/src/php/member-variable.yml new file mode 100644 index 00000000..fc53cc13 --- /dev/null +++ b/integration/syntaxes/src/php/member-variable.yml @@ -0,0 +1,40 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x) + (?= + (?: + (?> private + | protected + | public + )\s+ + )? + (?:static\s+)? + \s*\$ + ) + set: [ + expression, + declaration + ] + + declaration: + - include: ~/php/variable + - include: ~/php/modifier.no-pop + + expression: + - include: ~/php/expression diff --git a/integration/syntaxes/src/php/modifier.no-pop.yml b/integration/syntaxes/src/php/modifier.no-pop.yml new file mode 100644 index 00000000..90bb68ae --- /dev/null +++ b/integration/syntaxes/src/php/modifier.no-pop.yml @@ -0,0 +1,20 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?=\S) + push: + - include: ~/php/modifier diff --git a/integration/syntaxes/src/php/modifier.yml b/integration/syntaxes/src/php/modifier.yml new file mode 100644 index 00000000..244e768a --- /dev/null +++ b/integration/syntaxes/src/php/modifier.yml @@ -0,0 +1,33 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?xi)\s*\b + ((?> abstract + | const + | final + | global + | private + | protected + | public + | static + ))\b + captures: + 1: >- + storage.modifier.php.php7 + keyword.other.access.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/namespace/index.yml b/integration/syntaxes/src/php/namespace/index.yml new file mode 100644 index 00000000..363e2828 --- /dev/null +++ b/integration/syntaxes/src/php/namespace/index.yml @@ -0,0 +1,56 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?xi)\s*\b(namespace)(?!\\)\b + captures: + 1: >- + storage.type.php.php7 + keyword.namespace.php.php7 + set: declaration + + declaration: + - include: ~/php/namespace/name.no-pop + # Implicit body. + - match: \s*(;) + captures: + 1: punctuation.definition.namespace.body.begin.php.php7 + set: implicit-body + # Bracketed body. + - match: \s*(\{) + captures: + 1: punctuation.definition.namespace.body.begin.php.php7 + set: bracketed-body + + body-content: + - match: "" + push: + - include: ~/php/statement-and-expression + - match: "" + pop: true + + implicit-body: + - match: (?=\s*\bnamespace\b) + pop: true + - include: body-content + + bracketed-body: + - match: \s*(}) + captures: + 1: >- + punctuation.definition.namespace.body.end.php.php7 + pop: true + - include: body-content diff --git a/integration/syntaxes/src/php/namespace/name.no-pop.yml b/integration/syntaxes/src/php/namespace/name.no-pop.yml new file mode 100644 index 00000000..8b814382 --- /dev/null +++ b/integration/syntaxes/src/php/namespace/name.no-pop.yml @@ -0,0 +1,46 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + + namespacePath: | + (?> + (?: + ((?>\\|\b)) + ({{commonIdentifier}}) + (\\) + ({{commonIdentifier}}) + ) + | + (?: + ((?>\\|\b)) + ({{commonIdentifier}}) + ) + ) + +contexts: + main: + - match: (?xi)\s*({{namespacePath}}) + captures: + 1: namespace.path.php.php7 + 2: punctuation.definition.namespace.a.php.php7 + 3: entity.name.namespace.a.php.php7 + 4: punctuation.definition.namespace.b.php.php7 + 5: entity.name.namespace.b.php.php7 + 6: punctuation.definition.namespace.a.php.php7 + 7: entity.name.namespace.a.php.php7 diff --git a/integration/syntaxes/src/php/namespace/path.no-pop.yml b/integration/syntaxes/src/php/namespace/path.no-pop.yml new file mode 100644 index 00000000..a16f3a52 --- /dev/null +++ b/integration/syntaxes/src/php/namespace/path.no-pop.yml @@ -0,0 +1,48 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + + namespacePath: | + (?> + (?: + ((?>\\|\b)) + ({{commonIdentifier}}) + (\\) + ({{commonIdentifier}}) + (?=\\{{commonIdentifier}}) + ) + | + (?: + ((?>\\|\b)) + ({{commonIdentifier}}) + (?=\\{{commonIdentifier}}) + ) + ) + +contexts: + main: + - match: (?xi)\s*({{namespacePath}}) + captures: + 1: namespace.path.php.php7 + 2: punctuation.definition.namespace.a.php.php7 + 3: entity.name.namespace.a.php.php7 + 4: punctuation.definition.namespace.b.php.php7 + 5: entity.name.namespace.b.php.php7 + 6: punctuation.definition.namespace.a.php.php7 + 7: entity.name.namespace.a.php.php7 diff --git a/integration/syntaxes/src/php/new.yml b/integration/syntaxes/src/php/new.yml new file mode 100644 index 00000000..2711fb55 --- /dev/null +++ b/integration/syntaxes/src/php/new.yml @@ -0,0 +1,40 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +scope: ... + +contexts: + main: + - match: (?i)\s*\b(new)\b + scope: keyword.other.php.php7 + set: [ + optional-arguments, + type + ] + + optional-arguments: + - include: ~/php/function-call/arguments + - match: (?=\s*\S) + pop: true + + type: + - include: ~/php/type diff --git a/integration/syntaxes/src/php/operator/arithmetic.yml b/integration/syntaxes/src/php/operator/arithmetic.yml new file mode 100644 index 00000000..82c7b953 --- /dev/null +++ b/integration/syntaxes/src/php/operator/arithmetic.yml @@ -0,0 +1,44 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:----------------| + # | -- | Decrement. | + # | - | Subtraction. | + # | ++ | Increment. | + # | + | Addition. | + # | += | | + # | * | Multiplication. | + # | *= | | + # | / | Division. | + # | /= | | + # | % | Modulus. | + # | %= | | + main: + - match: | + (?x)\s* + ((?> -- + | -=? + | \+\+ + | \+=? + | \*\* + | \*=? + | /=? + | %=? + )) + captures: + 1: keyword.operator.arithmetic.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/operator/bitwise.yml b/integration/syntaxes/src/php/operator/bitwise.yml new file mode 100644 index 00000000..af9369d1 --- /dev/null +++ b/integration/syntaxes/src/php/operator/bitwise.yml @@ -0,0 +1,48 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:---------------------------------| + # | ~ | Bitwise not. | + # | ~= | Bitwise not assignment. | + # | & | Bitwise AND. | + # | &= | Bitwise AND assignment. | + # | | | Bitwise OR. | + # | |= | Bitwise OR assignment. | + # | xor | Bitwise XOR. | + # | ^ | Bitwise XOR. | + # | ^= | Bitwise XOR assignment. | + # | << | Left shift. | + # | <<= | Left shift assignment. | + # | >> | Right shift. | + # | >>= | Right shift assignment. | + # | >>> | Unsigned right shift. | + # | >>>= | Unsigned right shift assignment. | + main: + - match: | + (?x)\s* + ((?> xor + | ~=? + | &=? + | \|=? + | \^=? + | <<=? + | >>>=? + | >>=? + )) + captures: + 1: keyword.operator.bitwise.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/operator/comparison.yml b/integration/syntaxes/src/php/operator/comparison.yml new file mode 100644 index 00000000..11ac5844 --- /dev/null +++ b/integration/syntaxes/src/php/operator/comparison.yml @@ -0,0 +1,43 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:--------------------------| + # | === | Identical. | + # | == | Equal. | + # | !== | Not identical. | + # | != | Not equal. | + # | <> | Not equal. | + # | >= | Greater than or equal to. | + # | <=> | Spaceship. | + # | <= | Less than or equal to. | + # | > | Greater than. | + # | < | Less than. | + main: + - match: | + (?x)\s* + ((?> ===? + | !==? + | <> + | >= + | <=> + | <= + | >(?!>) + | <(?!<) + )) + captures: + 1: keyword.operator.comparison.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/operator/index.yml b/integration/syntaxes/src/php/operator/index.yml new file mode 100644 index 00000000..5140a1a7 --- /dev/null +++ b/integration/syntaxes/src/php/operator/index.yml @@ -0,0 +1,27 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/php/operator/other + - include: ~/php/operator/comparison + - include: ~/php/operator/logical + - include: ~/php/operator/bitwise + - include: ~/php/operator/arithmetic + - include: ~/php/operator/string + - match: \s*(=) + captures: + 1: keyword.operator.other.assignment.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/operator/logical.yml b/integration/syntaxes/src/php/operator/logical.yml new file mode 100644 index 00000000..dc18e845 --- /dev/null +++ b/integration/syntaxes/src/php/operator/logical.yml @@ -0,0 +1,43 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:------------| + # | and | | + # | or | | + # | && | And. | + # | || | Or. | + # | ! | Not. | + main: + - match: | + (?x)\s*\b + ((?> and + | or + ))\b + captures: + 1: >- + word.php.php7 + keyword.operator.logical.php.php7 + pop: true + - match: | + (?x)\s* + ((?> && + | \|\| + | ! + )) + captures: + 1: keyword.operator.logical.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/operator/other.yml b/integration/syntaxes/src/php/operator/other.yml new file mode 100644 index 00000000..26c1bdd3 --- /dev/null +++ b/integration/syntaxes/src/php/operator/other.yml @@ -0,0 +1,101 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + + constantIdentifier: | + [_[:upper:]] + [_[:upper:][:digit:]]* + +contexts: + # | Operator | Description | + # |:----------:|:--------------------| + # | as | | + # | instanceof | | + # | @ | Error suppression. | + # | -> | Member access. | + # | => | Key/value. | + # | :: | Scope resolution. | + # | ... | Argument unpacking. | + # | ?? | Null coalescing. | + # | ? | Ternary. | + main: + - match: (?xi)\s*\b(as)\b + captures: + 1: >- + word.php.php7 + keyword.operator.other.alias.php.php7 + pop: true + - match: (?xi)\s*\b(instanceof)\b + captures: + 1: >- + word.php.php7 + keyword.operator.relational.php.php7 + pop: true + - match: \s*(=>) + captures: + 1: keyword.operator.other.key-value.php.php7 + - match: \s*(@) + captures: + 1: keyword.operator.other.error.suppression.php.php7 + pop: true + - match: \s*(\.\.\.) + captures: + 1: keyword.operator.other.spread.php.php7 + pop: true + - match: \s*(->) + captures: + 1: keyword.operator.other.member-access.php.php7 + set: member-access + - match: \s*(::) + captures: + 1: keyword.operator.other.scope-resolution.php.php7 + set: scope-resolution + - match: \s*(\?\?) + captures: + 1: keyword.operator.other.php.php7 + pop: true + - match: \s*(\?) + captures: + 1: keyword.operator.other.ternary.js.fjsx15 + set: ternary-condition + + ternary-condition: + - match: \s*(:) + captures: + 1: keyword.operator.other.ternary.php.php7 + pop: true + - match: "" + push: + - match: (?=\s*:) + pop: true + - include: ~/php/statement-and-expression + + member-access: + - meta_content_scope: member.php.php7 + - include: ~/php/function-call/normal + - include: ~/php/constant + - include: ~/php/variable.no-dollar + + scope-resolution: + - match: \s*\b(class)\b + scope: keyword.other.php.php7 + pop: true + - include: ~/php/function-call + - include: ~/php/constant + - include: ~/php/variable diff --git a/integration/syntaxes/src/php/operator/string.yml b/integration/syntaxes/src/php/operator/string.yml new file mode 100644 index 00000000..5e5cc93a --- /dev/null +++ b/integration/syntaxes/src/php/operator/string.yml @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:---------------| + # | . | Concatenation. | + # | .= | Append. | + main: + - match: \s*(\.=?) + captures: + 1: keyword.operator.other.string.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/statement-and-expression.yml b/integration/syntaxes/src/php/statement-and-expression.yml new file mode 100644 index 00000000..b6bca164 --- /dev/null +++ b/integration/syntaxes/src/php/statement-and-expression.yml @@ -0,0 +1,108 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + expressionGroupBegin: | + \s*(\() + +contexts: + main: + # Open new expression group. + - match: | + (?xi) + {{expressionGroupBegin}} + captures: + 1: punctuation.definition.expression.group.a.begin.php.php7 + set: open-b-close-a + # Expression contents. + - include: sequence + + open-a-close-b: + # Open new expression group. + - match: | + (?xi) + {{expressionGroupBegin}} + captures: + 1: punctuation.definition.expression.group.a.begin.php.php7 + push: open-b-close-a + # Close current expression group. + - match: \s*(\)) + captures: + 1: punctuation.definition.expression.group.b.end.php.php7 + pop: true + # Expression contents. + - match: "" + push: + - include: sequence + - match: "" + pop: true + + open-b-close-a: + # Open new expression group. + - match: | + (?xi) + {{expressionGroupBegin}} + captures: + 1: punctuation.definition.expression.group.b.begin.php.php7 + push: open-a-close-b + # Close current expression group. + - match: \s*(\)) + captures: + 1: punctuation.definition.expression.group.a.end.php.php7 + pop: true + # Expression contents. + - match: "" + push: + - include: sequence + - match: "" + pop: true + + sequence: + - include: ~/php/terminator + - include: ~/php/comment + # Complex statements. + - include: ~/php/class + - include: ~/php/interface + - include: ~/php/trait + - include: ~/php/declare + - include: ~/php/namespace + - include: ~/php/function + - include: ~/php/closure + - include: ~/php/use + # Simple statements. + - include: ~/php/goto + - include: ~/php/statement/label + - include: ~/php/statement/hanging + - include: ~/php/statement/bodied + - include: ~/php/statement/simple + - include: ~/php/statement/other + # Other keywords. + - include: ~/php/modifier + - include: ~/php/new + # Expression. + - include: ~/php/array-access + - include: ~/php/literal + - include: ~/php/function-call + - include: ~/php/operator + # When it comes to constants and variables, there's no way to tell apart + # without an intellisense, so it’ll treat that anything that looks a + # uppercase variable as if it was a constant. + - include: ~/php/constant + # Some types can look like constants but we will give the power to the user + # to override types and in turn we get some predefined constants highlighted + # correctly.. + - include: ~/php/type + # Constant matching failed, so it could be a variable. + - include: ~/php/variable diff --git a/integration/syntaxes/src/php/statement/bodied.yml b/integration/syntaxes/src/php/statement/bodied.yml new file mode 100644 index 00000000..a0d38819 --- /dev/null +++ b/integration/syntaxes/src/php/statement/bodied.yml @@ -0,0 +1,94 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # Body only. + - match: | + (?x)\s* + ((?> do + | else + | finally + | try + ))\b + captures: + 1: keyword.control.php.php7 + set: body + # Header and body. + - match: | + (?x)\s*\b + ((?> catch + | if + | elseif + | for(?:each)? + | while + | switch + ))\b + captures: + 1: keyword.control.php.php7 + set: [ + body, + header + ] + + optional-header: + - match: (?=\s*;) + pop: true + - match: (?=\s*\() + set: header + + header: + - match: \s*(\() + captures: + 1: punctuation.definition.control.header.begin.php.php7 + set: header-content + + header-content: + - match: \s*(\)) + captures: + 1: punctuation.definition.control.header.end.php.php7 + pop: true + - match: "" + push: + - match: (?=\s*\)) + pop: true + - include: statement-and-expression + + terminator: + - match: \s*(;) + captures: + 1: keyword.other.terminator.php.php7 + pop: true + + body: + - match: \s*(\{) + captures: + 1: punctuation.definition.control.body.begin.php.php7 + set: body-content + - include: statement-and-expression + + body-content: + - match: \s*(}) + captures: + 1: punctuation.definition.control.body.end.php.php7 + pop: true + - match: "" + push: + - match: (?=\s*}) + pop: true + - include: statement-and-expression + + statement-and-expression: + - include: ~/php/statement-and-expression diff --git a/integration/syntaxes/src/php/statement/hanging.yml b/integration/syntaxes/src/php/statement/hanging.yml new file mode 100644 index 00000000..e2a5bde5 --- /dev/null +++ b/integration/syntaxes/src/php/statement/hanging.yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?> case + | default + ))\b + captures: + 1: keyword.control.php.php7 + set: operator + + operator: + - match: \s*(:) + captures: + 1: keyword.operator.other.php.php7 + pop: true + - match: "" + push: + - include: ~/php/statement-and-expression diff --git a/integration/syntaxes/src/php/statement/label.yml b/integration/syntaxes/src/php/statement/label.yml new file mode 100644 index 00000000..38a8f598 --- /dev/null +++ b/integration/syntaxes/src/php/statement/label.yml @@ -0,0 +1,93 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: | + (?xi) + (?> ^ + | (?<=;) + )\s* + ({{commonIdentifier}}) + (? clone + | die + | e(?>cho|val|xit) + | include(?:_once)? + | require(?:_once)? + ))\b + captures: + 1: keyword.other.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/statement/simple.yml b/integration/syntaxes/src/php/statement/simple.yml new file mode 100644 index 00000000..f4747599 --- /dev/null +++ b/integration/syntaxes/src/php/statement/simple.yml @@ -0,0 +1,133 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - include: break-continue + - include: yield + - match: | + (?x)\s* + ((?> return + | throw + ))\b + captures: + 1: keyword.control.flow-break.php.php7 + pop: true + - match: | + (?x)\s* + ((?> await + | default + ))\b + captures: + 1: keyword.control.php.php7 + pop: true + + break-continue: + - match: | + (?x)\s* + ((?> break + | continue + ))\b + captures: + 1: keyword.control.flow-break.php.php7 + set: optional-label + + optional-label: + - match: | + (?xi)\s* + ({{commonIdentifier}}) + (? \s*(from) + | \b + ) + captures: + 1: keyword.control.php.php7 + 2: keyword.control.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/terminator.yml b/integration/syntaxes/src/php/terminator.yml new file mode 100644 index 00000000..b3a30db4 --- /dev/null +++ b/integration/syntaxes/src/php/terminator.yml @@ -0,0 +1,21 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(;) + captures: + 1: keyword.other.terminator.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/trait.yml b/integration/syntaxes/src/php/trait.yml new file mode 100644 index 00000000..5f88cadb --- /dev/null +++ b/integration/syntaxes/src/php/trait.yml @@ -0,0 +1,62 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +hidden: true + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +scope: ... + +contexts: + main: + - match: (?xi)\s*\b(trait)(?!\\)\b + captures: + 1: >- + storage.type.php.php7 + keyword.declaration.trait.php.php7 + set: declaration + + comment: + - include: ~/php/comment.no-pop + + declaration: + - include: comment + # Body. + - match: \s*(\{) + captures: + 1: >- + punctuation.definition.trait.body.begin.php.php7 + set: body + # Trait’s name. + - match: (?xi)\s*({{commonIdentifier}}) + captures: + 1: entity.name.trait.php.php7 + + body: + - match: \s*(}) + captures: + 1: punctuation.definition.trait.body.end.php.php7 + pop: true + - include: body-content + + body-content: + - match: "" + push: + - include: ~/php/statement-and-expression + - match: "" + pop: true diff --git a/integration/syntaxes/src/php/type/index.yml b/integration/syntaxes/src/php/type/index.yml new file mode 100644 index 00000000..1526dbcd --- /dev/null +++ b/integration/syntaxes/src/php/type/index.yml @@ -0,0 +1,23 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/php/namespace/path.no-pop + - include: ~/php/type/support/core + - include: ~/php/type/support/class + - include: ~/php/type/support/exception + - include: ~/php/type/support/interface + - include: ~/php/type/normal diff --git a/integration/syntaxes/src/php/type/normal.yml b/integration/syntaxes/src/php/type/normal.yml new file mode 100644 index 00000000..20eacc59 --- /dev/null +++ b/integration/syntaxes/src/php/type/normal.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - match: | + (?xi)\s* + ((?>\\|\b)) + ( + {{commonIdentifier}} + )\b + captures: + 1: punctuation.definition.type.php.php7 + 2: entity.name.type.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/type/support/class.yml b/integration/syntaxes/src/php/type/support/class.yml new file mode 100644 index 00000000..e96a6ea4 --- /dev/null +++ b/integration/syntaxes/src/php/type/support/class.yml @@ -0,0 +1,70 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> ArrayIterator + | AppendIterator + | CachingIterator + | CallbackFilterIterator + | Closure + | DirectoryIterator + | EmptyIterator + | FilesystemIterator + | FilterIterator + | Generator + | GlobIterator + | InfiniteIterator + | IteratorIterator + | LimitIterator + | MultipleIterator + | NoRewindIterator + | ParentIterator + | Recursive + (?> ArrayIterator + | CachingIterator + | CallbackFilterIterator + | DirectoryIterator + | FilterIterator + | IteratorIterator + | RegexIterator + | TreeIterator + ) + | RegexIterator + | Spl + (?> DoublyLinkedList + | Stack + | Queue + | Heap + | MaxHeap + | MinHeap + | PriorityQueue + | FixedArray + | ObjectStorage + ) + ) + )\b + captures: + 1: >- + support.php.php7 + punctuation.definition.type.php.php7 + 2: >- + support.php.php7 + entity.name.type.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/type/support/core.yml b/integration/syntaxes/src/php/type/support/core.yml new file mode 100644 index 00000000..8f14c8f9 --- /dev/null +++ b/integration/syntaxes/src/php/type/support/core.yml @@ -0,0 +1,39 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> array + | callable + | bool + | float + | int + | parent + | string + | self + ) + )\b + captures: + 1: >- + support.php.php7 + punctuation.definition.type.php.php7 + 2: >- + support.php.php7 + entity.name.type.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/type/support/exception.yml b/integration/syntaxes/src/php/type/support/exception.yml new file mode 100644 index 00000000..98e07032 --- /dev/null +++ b/integration/syntaxes/src/php/type/support/exception.yml @@ -0,0 +1,48 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> Bad + (?> FunctionCallException + | MethodCallException + ) + | DomainException + | InvalidArgumentException + | LengthException + | LogicException + | OutOf + (?> BoundsException + | RangeException + ) + | OverflowException + | RangeException + | RuntimeException + | UnderflowException + | UnexpectedValueException + ) + )\b + captures: + 1: >- + support.php.php7 + punctuation.definition.type.php.php7 + 2: >- + support.php.php7 + entity.name.type.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/type/support/interface.yml b/integration/syntaxes/src/php/type/support/interface.yml new file mode 100644 index 00000000..13116f8a --- /dev/null +++ b/integration/syntaxes/src/php/type/support/interface.yml @@ -0,0 +1,40 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ((?>\\|\b)) + ( + (?> ArrayAccess + | Countable + | Iterator(?:Aggregate)? + | OuterIterator + | RecursiveIterator + | SeekableIterator + | Throwable + | Traversable + | Serializable + ) + )\b + captures: + 1: >- + support.php.php7 + punctuation.definition.type.php.php7 + 2: >- + support.php.php7 + entity.name.type.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/use.yml b/integration/syntaxes/src/php/use.yml new file mode 100644 index 00000000..c799184b --- /dev/null +++ b/integration/syntaxes/src/php/use.yml @@ -0,0 +1,99 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - match: (?i)\s*\b(use)(?!\\)\b + captures: + 1: keyword.import.php.php7 + set: declaration + + comment: + - include: ~/php/comment.no-pop + + terminator: + - include: ~/php/terminator + + declaration: + - include: comment + - include: terminator + - match: \s*(,) + captures: + 1: punctuation.definition.import.php.php7 + - match: (?=\s*\S) + push: [ + alias, + const-or-function + ] + + const-or-function: + - include: comment + - match: (?i)\s*\b(const)\b + captures: + 1: keyword.import.constant.php.php7 + set: namespaced-const + - match: (?i)\s*\b(function)\b + captures: + 1: keyword.import.function.php.php7 + set: namespaced-function + - match: (?=\s*\S) + set: namespace-or-type + + namespaced-const: + - include: comment + - include: ~/php/constant + + namespaced-function: + - include: comment + - include: ~/php/function/name + + namespace-or-type: + - include: ~/php/namespace/path.no-pop + # Target namespace or type. + - match: | + (?xi)\s* + ((?>\\|\b)) + ({{commonIdentifier}})\b + captures: + 1: punctuation.definition.ambiguous.php.php7 + 2: entity.name.ambiguous.php.php7 + pop: true + + target-type: + - include: comment + - include: ~/php/type + + alias: + - include: comment + - match: (?=\s*(?>,|;)) + pop: true + - match: (?i)\s*\b(as)\b + captures: + 1: keyword.import.alias.php.php7 + set: alias-name + + alias-name: + - include: comment + - match: (?=\s*;) + pop: true + - match: (?xi)\s*({{commonIdentifier}}) + captures: + 1: entity.name.alias.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/variable.no-dollar.yml b/integration/syntaxes/src/php/variable.no-dollar.yml new file mode 100644 index 00000000..1b7f09b3 --- /dev/null +++ b/integration/syntaxes/src/php/variable.no-dollar.yml @@ -0,0 +1,28 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - match: | + (?xi) + \b({{commonIdentifier}})\b + captures: + 1: entity.name.variable.php.php7 + pop: true diff --git a/integration/syntaxes/src/php/variable.yml b/integration/syntaxes/src/php/variable.yml new file mode 100644 index 00000000..2040dc66 --- /dev/null +++ b/integration/syntaxes/src/php/variable.yml @@ -0,0 +1,64 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_[:alpha:]] + [_[:alnum:]]* + +contexts: + main: + - include: ~/php/namespace/path.no-pop + - include: support-variable + - include: common-variable + + support-variable: + - match: | + (?x)\s* + \B(\$)( + (?> argc + | argv + | php_errormsg + | http_response_header + | this + | GLOBALS + | _ + (?> SERVER + | GET + | POST + | FILES + | REQUEST + | SESSION + | COOKIE + ) + ) + )\b + captures: + 1: >- + support.php.php7 + punctuation.definition.variable.begin.php.php7 + 2: >- + support.php.php7 + entity.name.variable.php.php7 + pop: true + + common-variable: + - match: | + (?xi)\s* + \B(\$)({{commonIdentifier}})\b + captures: + 1: punctuation.definition.variable.begin.php.php7 + 2: entity.name.variable.php.php7 + pop: true diff --git a/integration/syntaxes/src/scss/attribute.yml b/integration/syntaxes/src/scss/attribute.yml new file mode 100644 index 00000000..ae3e7fa6 --- /dev/null +++ b/integration/syntaxes/src/scss/attribute.yml @@ -0,0 +1,221 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_\-[:alpha:]] + [_\-[:alnum:]]* + + pseudoClasses: | + (?> active + | any(?:-link)? + | checked + | default + | dir + | disabled + | empty + | enabled + | first-child + | first-of-type + | first + | focus + | fullscreen + | global + | hover + | in-range + | indeterminate + | invalid + | lang + | last-child + | last-of-type + | left + | link + | local + | not + | nth-child + | nth-last-child + | nth-last-of-type + | nth-of-type + | only-child + | only-of-type + | optional + | out-of-range + | read-only + | read-write + | required + | right + | root + | scope + | target + | valid + | visited + ) + + pseudoClassesOrElement: | + (?> : + | {{pseudoClasses}} + ) + +contexts: + main: + - include: extension + - include: normal-attribute + - include: unreconized-attribute + + extension: + - match: | + (?xi) + \s* + ( + -{{commonIdentifier}} + ) + \s*(:) + (?! + {{pseudoClassesOrElement}} + ) + captures: + 0: extension.scss.scss3 + 1: entity.name.attribute.scss.scss3 + 2: keyword.operator.other.association.scss.scss3 + set: value + + normal-attribute: + - match: | + (?xi) + \s* + ( + (?> align-content + | align-items + | animation + | background-color + | background-image + | background-size + | background + | border-collapse + | border-color + | border-radius + | border-spacing + | border + | bottom + | box-shadow + | box-sizing + | content + | color + | cursor + | display + | fill + | flex-basis + | flex-direction + | flex-flow + | flex-grow + | flex-shrink + | flex-wrap + | flex + | float + | font-family + | font-size + | font-style + | font-weight + | font + | height + | justify-content + | left + | letter-spacing + | line-height + | margin-bottom + | margin-left + | margin-right + | margin-top + | margin + | max-height + | max-width + | min-height + | min-width + | opacity + | orientation + | overflow + | outline + | padding-bottom + | padding-left + | padding-right + | padding-top + | padding + | pointer-events + | position + | right + | src + | stroke-width + | stroke + | text-align + | text-decoration + | text-transform + | top + | transform-origin + | transform + | transition-timing-function + | transition-duration + | transition + | type + | vertical-align + | unicode-range + | white-space + | width + | z-index + ) + ) + \s*(:) + (?! + {{pseudoClassesOrElement}} + ) + captures: + 0: support.scss.scss3 + 1: entity.name.attribute.scss.scss3 + 2: keyword.operator.other.association.scss.scss3 + set: value + + unreconized-attribute: + - match: | + (?xi) + \s* + ( + {{commonIdentifier}} + ) + \s*(:) + (?! + {{pseudoClassesOrElement}} + ) + captures: + 1: entity.name.attribute.scss.scss3 + 2: keyword.operator.other.association.scss.scss3 + set: value + + value: + - match: | + (?x) + (?=\s* + (?> ; + | \) + | } + ) + ) + pop: true + - match: "" + push: + - include: expression + - match: "" + pop: true + + expression: + - include: ~/scss/expression diff --git a/integration/syntaxes/src/scss/comment.yml b/integration/syntaxes/src/scss/comment.yml new file mode 100644 index 00000000..5978555c --- /dev/null +++ b/integration/syntaxes/src/scss/comment.yml @@ -0,0 +1,54 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(\/\/) + captures: + 1: punctuation.comment.begin.scss.scss3 + set: line + - match: \s*(\/\*) + captures: + 1: punctuation.comment.begin.scss.scss3 + set: block + + line: + - meta_scope: comment.line.scss.scss3 + - include: email + - include: link + - match: $ + pop: true + + block: + - meta_scope: comment.block.scss.scss3 + - include: email + - include: link + - match: \s*(\*\/) + captures: + 1: punctuation.comment.end.scss.scss3 + set: + # Used to fix the block comment indentation settings. + # https://forum.sublimetext.com/t/everything-you-n-ever-wanted-to-know-about-indentation-in-st3/26207/6 + - match: \s*$\n? + scope: meta.block-end.scss.scss3 + pop: true + - match: '' + pop: true + + link: + - include: ~/shared/link + + email: + - include: ~/shared/email diff --git a/integration/syntaxes/src/scss/constant.yml b/integration/syntaxes/src/scss/constant.yml new file mode 100644 index 00000000..7baf1c15 --- /dev/null +++ b/integration/syntaxes/src/scss/constant.yml @@ -0,0 +1,287 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + constantIdentifier: | + [$_\-[:upper:]] + [$_\-[:upper:][:digit:]]* + +contexts: + main: + - include: support-color-constant + - include: support-constant + - include: common-constant + + common-constant: + - match: | + (?x) + (\$) + ( + {{constantIdentifier}} + (?> [$\-]\B + | [_[:upper:][:digit:]]\b + ) + ) + captures: + 0: constant.scss.scss3 + 1: punctuation.definition.constant.begin.scss.scss3 + 2: entity.name.constant.scss.scss3 + pop: true + + support-constant: + - match: | + (?x) + (?> absolute + | alternate + | all + | at + | auto + | baseline + | block + | bold + | border-box + | bottom + | button + | center + | checkbox + | content-box + | collapse + | column(?:-reverse)? + | contain + | cover + | dashed + | disabled + | dotted + | ease + | ellipsis + | ellipse + | false + | fixed + | flex-start + | flex-end + | flex + | forwards + | hidden + | infinite + | inline-block + | inline-flex + | inline-grid + | inline-table + | inline + | inherit + | initial + | italic + | landscape + | left + | list-item + | middle + | no-repeat + | none + | normal + | nowrap + | number + | only + | pointer + | print + | projection + | radio + | relative + | repeat + | reset + | right + | row(?:-reverse)? + | run-in + | screen + | search + | space-arround + | space-between + | speech + | solid + | submit + | sub + | super + | table-caption + | table-cell + | table-column(?:-group)? + | table-footer-group + | table-header-group + | table-row(?:-group)? + | table + | text-bottom + | text-top + | top + | transparent + | true + | tv + | visible + | uppercase + ) + scope: >- + support.scss.scss3 + entity.name.constant.scss.scss3 + pop: true + + support-color-constant: + - match: | + (?xi) + (?> aliceblue + | antiquewhite + | aqua + | aquamarine + | azure + | beige + | bisque + | black + | blanchedalmond + | blue + | blueviolet + | brown + | burlywood + | cadetblue + | chartreuse + | chocolate + | coral + | cornflowerblue + | cornsilk + | crimson + | cyan + | dark + (?> blue + | cyan + | goldenrod + | gray + | grey + | green + | khaki + | magenta + | olivegreen + | orange + | orchid + | red + | salmon + | seagreen + | slateblue + | slategray + | slategrey + | turquoise + | violet + ) + | deeppink + | deepskyblue + | dimgray + | dimgrey + | dodgerblue + | firebrick + | floralwhite + | forestgreen + | fuchsia + | gainsboro + | ghostwhite + | gold(?:enrod)? + | gr[ae]y + | green(?:yellow)? + | honeydew + | hotpink + | indianred + | indigo + | ivory + | khaki + | lavender(?:blush)? + | lawngreen + | lemonchiffon + | light + (?> blue + | coral + | cyan + | goldenrodyellow + | gray + | grey + | green + | pink + | salmon + | seagreen + | skyblue + | slategray + | slategrey + | steelblue + | yellow + ) + | lime(?:green)? + | linen + | magenta + | maroon + | medium + (?> aquamarine + | blue + | orchid + | purple + | seagreen + | slateblue + | springgreen + | turquoise + | violetred + ) + | midnightblue + | mintcream + | mistyrose + | moccasin + | navajowhite + | navy + | oldlace + | olive(?:drab)? + | orange(?:red)? + | orchid + | palegoldenrod + | palegreen + | paleturquoise + | palevioletred + | papayawhip + | peachpuff + | peru + | pink + | plum + | powderblue + | purple + | rebeccapurple + | red + | rosybrown + | royalblue + | saddlebrown + | salmon + | sandybrown + | seagreen + | seashell + | sienna + | silver + | skyblue + | slateblue + | slategr[ae]y + | snow + | springgreen + | steelblue + | tan + | teal + | thistle + | tomato + | turquoise + | violet + | wheat + | white(?:smoke)? + | yellow(?:green)? + ) + scope: >- + support.scss.scss3 + entity.name.constant.color.scss.scss3 + pop: true diff --git a/integration/syntaxes/src/scss/expression.yml b/integration/syntaxes/src/scss/expression.yml new file mode 100644 index 00000000..2cce337a --- /dev/null +++ b/integration/syntaxes/src/scss/expression.yml @@ -0,0 +1,79 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + expressionGroupBegin: | + (? , + | \) + ) + ) + pop: true + - include: value + + value: + - match: | + (?xi) + \s*(\${{commonIdentifier}}) + \s*(:) + captures: + 1: >- + parameter.scss.scss3 + entity.name.variable.scss.scss3 + 2: keyword.operator.other.association.scss.scss3 + - include: ~/scss/statement-and-expression diff --git a/integration/syntaxes/src/scss/function-call/index.yml b/integration/syntaxes/src/scss/function-call/index.yml new file mode 100644 index 00000000..17995512 --- /dev/null +++ b/integration/syntaxes/src/scss/function-call/index.yml @@ -0,0 +1,57 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_\-[:alpha:]] + [$_\-[:alnum:]]* + +contexts: + main: + - match: | + (?xi) + (?= + \s*{{commonIdentifier}} + \s*\( + ) + set: [ + arguments, + name + ] + + name: + # Support identifier. + - match: | + (?x) + \s*( + (?> constructor + | super + ) + )\b + captures: + 1: >- + support.scss.scss3 + entity.name.function.scss.scss3 + pop: true + # Identifier. + - match: | + (?xi) + \s*({{commonIdentifier}}) + captures: + 1: entity.name.function.scss.scss3 + pop: true + + arguments: + - include: ~/scss/function-call/arguments diff --git a/integration/syntaxes/src/scss/function/index.yml b/integration/syntaxes/src/scss/function/index.yml new file mode 100644 index 00000000..26d49489 --- /dev/null +++ b/integration/syntaxes/src/scss/function/index.yml @@ -0,0 +1,64 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_\-[:alpha:]] + [$_\-[:alnum:]]* + +contexts: + main: + - match: | + (?xi) + \s*(@function)\b + captures: + 0: storage.type.scss.scss3 + 1: keyword.declaration.function.scss.scss3 + set: [ + body, + optional-parameters, + name + ] + + name: + - match: | + (?xi) + \s*({{commonIdentifier}}) + captures: + 1: entity.name.function.scss.scss3 + pop: true + + optional-parameters: + - match: (?=\s*{) + pop: true + - include: ~/scss/function/parameters + + body: + - match: \s*({) + scope: punctuation.definition.function.body.begin.scss.scss3 + set: body-content + + body-content: + - match: \s*(}) + captures: + 1: punctuation.definition.function.body.end.scss.scss3 + pop: true + - match: "" + push: + - match: (?=\s*}) + pop: true + - include: ~/scss/attribute + - include: ~/scss/selector + - include: ~/scss/statement-and-expression diff --git a/integration/syntaxes/src/scss/function/parameter.yml b/integration/syntaxes/src/scss/function/parameter.yml new file mode 100644 index 00000000..242e4128 --- /dev/null +++ b/integration/syntaxes/src/scss/function/parameter.yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_\-[:alpha:]] + [$_\-[:alnum:]]* + +contexts: + main: + - match: | + (?xi) + ( + \${{commonIdentifier}} + (?> [$\-]\B + | [_[:alnum:]]\b + ) + ) + captures: + 0: function.parameter.scss.scss3 + 1: entity.name.variable.scss.scss3 + pop: true diff --git a/integration/syntaxes/src/scss/function/parameters.yml b/integration/syntaxes/src/scss/function/parameters.yml new file mode 100644 index 00000000..8878d950 --- /dev/null +++ b/integration/syntaxes/src/scss/function/parameters.yml @@ -0,0 +1,54 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_\-[:alpha:]] + [$_\-[:alnum:]]* + +contexts: + main: + - match: \s*(\() + captures: + 1: punctuation.definition.function.parameters.begin.scss.scss3 + set: parameters + + parameters: + - match: \s*(\)) + captures: + 1: punctuation.definition.function.parameters.end.scss.scss3 + pop: true + - match: \s*(\,) + captures: + 1: punctuation.definition.function.parameters.scss.scss3 + - match: "" + push: + - match: | + (?x) + (?=\s* + (?> , + | \) + ) + ) + pop: true + # Default value. + - match: \s*(:) + scope: keyword.other.association.scss.scss3 + set: value + # Parameter. + - include: ~/scss/function/parameter + + value: + - include: ~/scss/statement-and-expression diff --git a/integration/syntaxes/src/scss/index.yml b/integration/syntaxes/src/scss/index.yml new file mode 100644 index 00000000..93c6c31d --- /dev/null +++ b/integration/syntaxes/src/scss/index.yml @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +name: SCSS (Naomi) +scope: source.scss + +file_extensions: + - scss + +contexts: + main: + - include: ~/scss/selector + - include: ~/scss/statement-and-expression diff --git a/integration/syntaxes/src/scss/interpolation.yml b/integration/syntaxes/src/scss/interpolation.yml new file mode 100644 index 00000000..179cdb5d --- /dev/null +++ b/integration/syntaxes/src/scss/interpolation.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(#{) + captures: + 1: keyword.operator.other.interpolation.begin.scss.scss3 + set: value + + value: + - match: \s*(}) + captures: + 1: keyword.operator.other.interpolation.end.scss.scss3 + pop: true + - match: "" + push: + - include: ~/scss/statement-and-expression + - match: "" + pop: true diff --git a/integration/syntaxes/src/scss/keyword.yml b/integration/syntaxes/src/scss/keyword.yml new file mode 100644 index 00000000..66cb9c12 --- /dev/null +++ b/integration/syntaxes/src/scss/keyword.yml @@ -0,0 +1,33 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + # Other keywords. + - match: | + (?x)\s* + ( + (?> !default + | !important + | !optional + | from + | if + | in + | through + ) + )\b + captures: + 1: keyword.other.scss.scss3 + pop: true diff --git a/integration/syntaxes/src/scss/literal/color.yml b/integration/syntaxes/src/scss/literal/color.yml new file mode 100644 index 00000000..cb700f7f --- /dev/null +++ b/integration/syntaxes/src/scss/literal/color.yml @@ -0,0 +1,37 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + hex: | + [0-9a-f] + +contexts: + main: + - match: | + (?xi) + (\#) + (?> ({{hex}}{{hex}}) ({{hex}}{{hex}}) ({{hex}}{{hex}}) + | ({{hex}}) ({{hex}}) ({{hex}}) + ) + captures: + 0: constant.color.scss.scss3 + 1: punctuation.definition.color.begin.scss.scss3 + 2: constant.color.red.scss.scss3 + 3: constant.color.green.scss.scss3 + 4: constant.color.blue.scss.scss3 + 5: constant.color.red.scss.scss3 + 6: constant.color.green.scss.scss3 + 7: constant.color.blue.scss.scss3 + pop: true diff --git a/integration/syntaxes/src/scss/literal/index.yml b/integration/syntaxes/src/scss/literal/index.yml new file mode 100644 index 00000000..e31f461a --- /dev/null +++ b/integration/syntaxes/src/scss/literal/index.yml @@ -0,0 +1,22 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/scss/literal/string/double-quoted + - include: ~/scss/literal/string/single-quoted + - include: ~/scss/literal/color + - include: ~/scss/literal/number + - include: ~/scss/literal/string/unquoted diff --git a/integration/syntaxes/src/scss/literal/number.yml b/integration/syntaxes/src/scss/literal/number.yml new file mode 100644 index 00000000..2c7f21aa --- /dev/null +++ b/integration/syntaxes/src/scss/literal/number.yml @@ -0,0 +1,83 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + literalDecimal: | + [0-9]+ + + literalFloat: | + (?> [0-9]*[.]{{literalDecimal}} + | {{literalDecimal}}[.][0-9]* + ) + + scientificNotation: | + ( + (?> {{literalFloat}} + | {{literalDecimal}} + ) + [e][+-]? + {{literalDecimal}} + ) + +contexts: + main: + - include: float + - include: integer + + float: + - match: (?xi){{scientificNotation}} + scope: constant.numeric.float.scientific.scss.scss3 + set: unit + - match: (?x){{literalFloat}} + scope: constant.numeric.float.scss.scss3 + set: unit + + integer: + - match: "0b[01]+" + scope: constant.numeric.binary.scss.scss3 + set: unit + - match: "0o[0-7]+" + scope: constant.numeric.octal.scss.scss3 + set: unit + - match: "(?i)0[x][0-9a-f]+" + scope: constant.numeric.hex.scss.scss3 + set: unit + - match: "[1-9][0-9]*|0" + scope: constant.numeric.decimal.scss.scss3 + set: unit + + unit: + - match: | + (?x)\s* + (?> % + | cm + | deg + | e[mx] + | in + | mm + | p[ctx] + | rem + | s + | v + (?> h + | max + | min + | w + ) + ) + scope: keyword.other.unit.scss.scss3 + pop: true + - match: "" + pop: true diff --git a/integration/syntaxes/src/scss/literal/string/double-quoted.yml b/integration/syntaxes/src/scss/literal/string/double-quoted.yml new file mode 100644 index 00000000..059b79c8 --- /dev/null +++ b/integration/syntaxes/src/scss/literal/string/double-quoted.yml @@ -0,0 +1,55 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + hexEscapedChar: | + [a-f0-9]+ + + doubleQuotedEscapeSequences: | + \\ + (?> ["\\acd] + | {{hexEscapedChar}} + ) + +contexts: + main: + - match: \" + scope: >- + string.quoted.double.scss.scss3 + punctuation.definition.string.begin.scss.scss3 + with_prototype: + - match: (?- + string.quoted.double.scss.scss3 + punctuation.definition.string.end.scss.scss3 + pop: true + set: escape-a + + trap: + - meta_content_scope: context.trap + + escape-a: + - meta_content_scope: string.quoted.double.scss.scss3 + - match: (?xi){{doubleQuotedEscapeSequences}} + scope: constant.character.escape.a.scss.scss3 + set: escape-b + + escape-b: + - meta_content_scope: string.quoted.double.scss.scss3 + - match: (?xi){{doubleQuotedEscapeSequences}} + scope: constant.character.escape.b.scss.scss3 + set: escape-a diff --git a/integration/syntaxes/src/scss/literal/string/single-quoted.yml b/integration/syntaxes/src/scss/literal/string/single-quoted.yml new file mode 100644 index 00000000..565f9568 --- /dev/null +++ b/integration/syntaxes/src/scss/literal/string/single-quoted.yml @@ -0,0 +1,55 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + hexEscapedChar: | + [a-f0-9]+ + + singleQuotedEscapeSequences: | + \\ + (?> ['\\acd] + | {{hexEscapedChar}} + ) + +contexts: + main: + - match: \' + scope: >- + string.quoted.single.scss.scss3 + punctuation.definition.string.begin.scss.scss3 + with_prototype: + - match: (?- + string.quoted.single.scss.scss3 + punctuation.definition.string.end.scss.scss3 + pop: true + set: escape-a + + trap: + - meta_content_scope: context.trap + + escape-a: + - meta_content_scope: string.quoted.single.scss.scss3 + - match: (?xi){{singleQuotedEscapeSequences}} + scope: constant.character.escape.a.scss.scss3 + set: escape-b + + escape-b: + - meta_content_scope: string.quoted.single.scss.scss3 + - match: (?xi){{singleQuotedEscapeSequences}} + scope: constant.character.escape.b.scss.scss3 + set: escape-a diff --git a/integration/syntaxes/src/scss/literal/string/unquoted.yml b/integration/syntaxes/src/scss/literal/string/unquoted.yml new file mode 100644 index 00000000..f49fd4aa --- /dev/null +++ b/integration/syntaxes/src/scss/literal/string/unquoted.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x) + \S.*? + (?= + (?> \s + | , + | ; + | \) + | \] + | \} + | $ + ) + ) + scope: string.unquoted.scss.scss3 + pop: true diff --git a/integration/syntaxes/src/scss/mixin/index.yml b/integration/syntaxes/src/scss/mixin/index.yml new file mode 100644 index 00000000..ed3da29f --- /dev/null +++ b/integration/syntaxes/src/scss/mixin/index.yml @@ -0,0 +1,62 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_\-[:alpha:]] + [$_\-[:alnum:]]* + +contexts: + main: + - match: | + (?xi) + \s*(@mixin)\b + captures: + 0: storage.type.scss.scss3 + 1: keyword.declaration.mixin.scss.scss3 + set: [ + body, + optional-parameters, + name + ] + + name: + - match: | + (?xi) + \s*({{commonIdentifier}}) + captures: + 1: entity.name.mixin.scss.scss3 + pop: true + + optional-parameters: + - match: (?=\s*{) + pop: true + - include: ~/scss/mixin/parameters + + body: + - match: \s*({) + scope: punctuation.definition.mixin.body.begin.scss.scss3 + set: body-content + + body-content: + - match: \s*(}) + scope: punctuation.definition.mixin.body.end.scss.scss3 + - match: "" + push: + - match: (?=\s*}) + pop: true + - include: ~/scss/attribute + - include: ~/scss/selector + - include: ~/scss/statement-and-expression diff --git a/integration/syntaxes/src/scss/mixin/parameters.yml b/integration/syntaxes/src/scss/mixin/parameters.yml new file mode 100644 index 00000000..0722b14c --- /dev/null +++ b/integration/syntaxes/src/scss/mixin/parameters.yml @@ -0,0 +1,49 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(\() + captures: + 1: punctuation.definition.mixin.parameters.begin.scss.scss3 + set: parameters + + parameters: + - match: \s*(\)) + captures: + 1: punctuation.definition.mixin.parameters.end.scss.scss3 + pop: true + - match: \s*(\,) + captures: + 1: punctuation.definition.mixin.parameters.scss.scss3 + - match: "" + push: + - match: | + (?x) + (?=\s* + (?> , + | \) + ) + ) + pop: true + # Default value. + - match: \s*(:) + scope: keyword.other.association.scss.scss3 + set: value + # Parameter. + - include: ~/scss/function/parameter + + value: + - include: ~/scss/statement-and-expression diff --git a/integration/syntaxes/src/scss/operator/arithmetic.yml b/integration/syntaxes/src/scss/operator/arithmetic.yml new file mode 100644 index 00000000..9851c7c3 --- /dev/null +++ b/integration/syntaxes/src/scss/operator/arithmetic.yml @@ -0,0 +1,37 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:----------------| + # | - | Subtraction. | + # | + | Addition. | + # | * | Multiplication. | + # | / | Division. | + # | % | Modulus. | + main: + - match: | + (?x)\s* + ( + (?> - + | \+ + | \* + | / + | % + ) + ) + captures: + 1: keyword.operator.arithmetic.scss.scss3 + pop: true diff --git a/integration/syntaxes/src/scss/operator/comparison.yml b/integration/syntaxes/src/scss/operator/comparison.yml new file mode 100644 index 00000000..9cd44e92 --- /dev/null +++ b/integration/syntaxes/src/scss/operator/comparison.yml @@ -0,0 +1,39 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:--------------------------| + # | == | Loose equality. | + # | != | Not equal. | + # | >= | Greater than or equal to. | + # | <= | Less than or equal to. | + # | > | Greater than. | + # | < | Less than. | + main: + - match: | + (?x)\s* + ( + (?> == + | != + | >= + | <= + | >(?!>) + | <(?!<) + ) + ) + captures: + 1: keyword.operator.comparison.scss.scss3 + pop: true diff --git a/integration/syntaxes/src/scss/operator/index.yml b/integration/syntaxes/src/scss/operator/index.yml new file mode 100644 index 00000000..a4ef4c54 --- /dev/null +++ b/integration/syntaxes/src/scss/operator/index.yml @@ -0,0 +1,21 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/scss/operator/comparison + - include: ~/scss/operator/logical + - include: ~/scss/operator/arithmetic + - include: ~/scss/operator/other diff --git a/integration/syntaxes/src/scss/operator/logical.yml b/integration/syntaxes/src/scss/operator/logical.yml new file mode 100644 index 00000000..94a590be --- /dev/null +++ b/integration/syntaxes/src/scss/operator/logical.yml @@ -0,0 +1,44 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + # | Operator | Description | + # |:--------:|:------------| + # | && | And. | + # | || | Or. | + # | ! | Not. | + main: + - match: | + (?x)\s* + ( + (?> and + | or + | not + ) + )\b + captures: + 1: keyword.operator.logical.word.scss.scss3 + pop: true + - match: | + (?x)\s* + ( + (?> && + | \|\| + | ! + ) + ) + captures: + 1: keyword.operator.logical.scss.scss3 + pop: true diff --git a/integration/syntaxes/src/scss/operator/other.yml b/integration/syntaxes/src/scss/operator/other.yml new file mode 100644 index 00000000..02ee23f6 --- /dev/null +++ b/integration/syntaxes/src/scss/operator/other.yml @@ -0,0 +1,21 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(,) + captures: + 1: keyword.operator.other.comma.js.fjsx15 + pop: true diff --git a/integration/syntaxes/src/scss/selector/attribute.yml b/integration/syntaxes/src/scss/selector/attribute.yml new file mode 100644 index 00000000..51bacafe --- /dev/null +++ b/integration/syntaxes/src/scss/selector/attribute.yml @@ -0,0 +1,142 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_\-[:alpha:]] + [_\-[:alnum:]]* + +contexts: + main: + - match: \s*(\[) + captures: + 1: punctuation.definition.selector.begin.scss.scss3 + set: attributes + + attributes: + - match: \s*(\]) + captures: + 1: punctuation.definition.selector.end.scss.scss3 + set: trap + - match: "" + push: + - match: (?=\s*\]) + pop: true + - include: attribute + - include: operator + + trap: + - include: ~/scss/selector/trap + + attribute: + - match: | + (?xi)\s* + ( + (?> animation + | background-color + | background-image + | background-size + | background + | border-collapse + | border-color + | border-radius + | border-spacing + | border + | bottom + | box-shadow + | box-sizing + | checked + | color + | controls + | cursor + | disabled + | display + | fill + | float + | font-family + | font-size + | font-style + | font-weight + | font + | height + | hidden + | left + | letter-spacing + | line-height + | margin-bottom + | margin-left + | margin-right + | margin-top + | margin + | max-height + | max-width + | min-height + | min-width + | opacity + | overflow + | padding-bottom + | padding-left + | padding-right + | padding-top + | padding + | position + | right + | src + | stroke-width + | stroke + | text-align + | text-decoration + | text-transform + | title + | top + | transform-origin + | transform + | transition + | type + | vertical-align + | width + | z-index + ) + ) + captures: + 0: support.scss.scss3 + 1: entity.name.attribute.scss.scss3 + pop: true + + operator: + - match: | + (?x)\s* + ( + (?> = + | ~= + | \|= + | ^= + | \$= + | \*= + ) + ) + captures: + 1: keyword.operator.other.scss.scss3 + set: value + + value: + - match: (?=\s*\]) + pop: true + - match: "" + push: + - include: ~/scss/statement-and-expression + - match: "" + pop: true + diff --git a/integration/syntaxes/src/scss/selector/class.yml b/integration/syntaxes/src/scss/selector/class.yml new file mode 100644 index 00000000..3aae78ee --- /dev/null +++ b/integration/syntaxes/src/scss/selector/class.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_\-[:alpha:]] + [_\-[:alnum:]]* + +contexts: + main: + - match: | + (?xi)\s* + (\.)({{commonIdentifier}})? + captures: + 1: punctuation.definition.selector.class.scss.scss3 + 2: entity.name.selector.class.scss.scss3 + set: trap + + trap: + - include: ~/scss/selector/trap diff --git a/integration/syntaxes/src/scss/selector/id.yml b/integration/syntaxes/src/scss/selector/id.yml new file mode 100644 index 00000000..c6ff7ceb --- /dev/null +++ b/integration/syntaxes/src/scss/selector/id.yml @@ -0,0 +1,33 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_\-[:alpha:]] + [_\-[:alnum:]]* + +contexts: + main: + - match: | + (?xi)\s* + (\#)(?!{) + ({{commonIdentifier}})? + captures: + 1: punctuation.definition.selector.id.scss.scss3 + 2: entity.name.selector.id.scss.scss3 + set: trap + + trap: + - include: ~/scss/selector/trap diff --git a/integration/syntaxes/src/scss/selector/index.yml b/integration/syntaxes/src/scss/selector/index.yml new file mode 100644 index 00000000..b81878fb --- /dev/null +++ b/integration/syntaxes/src/scss/selector/index.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - include: ~/scss/selector/interpolation + - include: ~/scss/selector/operator + - include: ~/scss/selector/keyframe + - include: ~/scss/selector/id + - include: ~/scss/selector/placeholder + - include: ~/scss/selector/class + - include: ~/scss/selector/pseudo-class + - include: ~/scss/selector/pseudo-element + - include: ~/scss/selector/attribute + # Tag selectors. + - include: ~/scss/selector/tag/embedded + - include: ~/scss/selector/tag/form + - include: ~/scss/selector/tag/sectioning-root + - include: ~/scss/selector/tag/sectioning + - include: ~/scss/selector/tag/other diff --git a/integration/syntaxes/src/scss/selector/interpolation.yml b/integration/syntaxes/src/scss/selector/interpolation.yml new file mode 100644 index 00000000..8c98aa19 --- /dev/null +++ b/integration/syntaxes/src/scss/selector/interpolation.yml @@ -0,0 +1,35 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(#{) + captures: + 1: keyword.operator.other.interpolation.begin.scss.scss3 + set: value + + value: + - match: \s*(}) + captures: + 1: keyword.operator.other.interpolation.end.scss.scss3 + set: trap + - match: "" + push: + - include: ~/scss/statement-and-expression + - match: "" + pop: true + + trap: + - include: ~/scss/selector/trap diff --git a/integration/syntaxes/src/scss/selector/keyframe.yml b/integration/syntaxes/src/scss/selector/keyframe.yml new file mode 100644 index 00000000..bd86be50 --- /dev/null +++ b/integration/syntaxes/src/scss/selector/keyframe.yml @@ -0,0 +1,26 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ([0-9]{1,3}%) + captures: + 1: entity.name.selector.keyframe.scss.scss3 + set: trap + + trap: + - include: ~/scss/selector/trap diff --git a/integration/syntaxes/src/scss/selector/operator.yml b/integration/syntaxes/src/scss/selector/operator.yml new file mode 100644 index 00000000..e720e811 --- /dev/null +++ b/integration/syntaxes/src/scss/selector/operator.yml @@ -0,0 +1,44 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(\,) + captures: + 1: keyword.operator.other.comma.scss.scss3 + set: trap + - match: \s*(&)(?!&) + captures: + 1: keyword.operator.other.selector.inherit.css.css3 + set: trap + - match: \s*(\*) + captures: + 1: keyword.operator.other.selector.all.css.css3 + set: trap + - match: \s*(\+) + captures: + 1: keyword.operator.other.selector.adjacent.css.css3 + set: trap + - match: \s*(>) + captures: + 1: keyword.operator.other.selector.direct.css.css3 + set: trap + - match: \s*(~) + captures: + 1: keyword.operator.other.selector.sibling.css.css3 + set: trap + + trap: + - include: ~/scss/selector/trap diff --git a/integration/syntaxes/src/scss/selector/placeholder.yml b/integration/syntaxes/src/scss/selector/placeholder.yml new file mode 100644 index 00000000..b2d52550 --- /dev/null +++ b/integration/syntaxes/src/scss/selector/placeholder.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_\-[:alpha:]] + [_\-[:alnum:]]* + +contexts: + main: + - match: | + (?xi)\s* + (%)({{commonIdentifier}})\b + captures: + 1: punctuation.definition.selector.placeholder.scss.scss3 + 2: entity.name.selector.placeholder.scss.scss3 + set: trap + + trap: + - include: ~/scss/selector/trap diff --git a/integration/syntaxes/src/scss/selector/pseudo-class/arguments.yml b/integration/syntaxes/src/scss/selector/pseudo-class/arguments.yml new file mode 100644 index 00000000..713af208 --- /dev/null +++ b/integration/syntaxes/src/scss/selector/pseudo-class/arguments.yml @@ -0,0 +1,42 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(\() + captures: + 1: punctuation.definition.selector.pseudo-class.arguments.begin.scss.scss3 + set: arguments + + arguments: + - match: \s*(\)) + captures: + 1: punctuation.definition.selector.pseudo-class.arguments.end.scss.scss3 + pop: true + - match: \s*(\,) + captures: + 1: punctuation.definition.selector.pseudo-class.arguments.scss.scss3 + - match: "" + push: + - match: | + (?x) + (?=\s* + (?> , + | \) + ) + ) + pop: true + - include: ~/scss/attribute + - include: ~/scss/selector diff --git a/integration/syntaxes/src/scss/selector/pseudo-class/index.yml b/integration/syntaxes/src/scss/selector/pseudo-class/index.yml new file mode 100644 index 00000000..34c90576 --- /dev/null +++ b/integration/syntaxes/src/scss/selector/pseudo-class/index.yml @@ -0,0 +1,103 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_\-[:alpha:]] + [_\-[:alnum:]]* + +contexts: + main: + - include: extension + - include: normal + + extension: + - match: | + (?xi) + \s* + (:-)({{commonIdentifier}}) + captures: + 0: extension.scss.scss3 + 1: punctuation.definition.selector.pseudo-class.scss.scss3 + 2: entity.name.selector.pseudo-class.scss.scss3 + set: trap + + normal: + - match: | + (?xi)\s* + (:) + ( + (?> active + | any(?:-link)? + | checked + | default + | dir + | disabled + | empty + | enabled + | first-child + | first-of-type + | first + | focus + | fullscreen + | global + | hover + | in-range + | indeterminate + | invalid + | lang + | last-child + | last-of-type + | left + | link + | local + | not + | nth-child + | nth-last-child + | nth-last-of-type + | nth-of-type + | only-child + | only-of-type + | optional + | out-of-range + | read-only + | read-write + | required + | right + | root + | scope + | target + | valid + | visited + ) + )\b + captures: + 1: punctuation.definition.selector.pseudo-class.scss.scss3 + 2: entity.name.selector.pseudo-class.scss.scss3 + set: optional-arguments + + optional-arguments: + - match: (?=\s*\() + set: [ + trap, + arguments + ] + - include: trap + + arguments: + - include: ~/scss/selector/pseudo-class/arguments + + trap: + - include: ~/scss/selector/trap diff --git a/integration/syntaxes/src/scss/selector/pseudo-element.yml b/integration/syntaxes/src/scss/selector/pseudo-element.yml new file mode 100644 index 00000000..7cdb290c --- /dev/null +++ b/integration/syntaxes/src/scss/selector/pseudo-element.yml @@ -0,0 +1,70 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_\-[:alpha:]] + [_\-[:alnum:]]* + +contexts: + main: + - include: extension + - include: pseudo-element + + extension: + - match: | + (?xi) + \s* + (::-)({{commonIdentifier}}) + captures: + 0: extension.scss.scss3 + 1: punctuation.definition.selector.pseudo-element.scss.scss3 + 2: entity.name.selector.pseudo-element.scss.scss3 + set: trap + + pseudo-element: + # Old. + - match: | + (?xi)\s* + (:) + ( + (?> after + | before + ) + )\b + captures: + 1: punctuation.definition.selector.pseudo-element.scss.scss3 + 2: entity.name.selector.pseudo-element.scss.scss3 + set: trap + # New. + - match: | + (?xi)\s* + (::) + ( + (?> after + | backdrop + | before + | first-letter + | first-line + | selection + ) + )\b + captures: + 1: punctuation.definition.selector.pseudo-element.scss.scss3 + 2: entity.name.selector.pseudo-element.scss.scss3 + set: trap + + trap: + - include: ~/scss/selector/trap diff --git a/integration/syntaxes/src/scss/selector/tag/embedded.yml b/integration/syntaxes/src/scss/selector/tag/embedded.yml new file mode 100644 index 00000000..178355b4 --- /dev/null +++ b/integration/syntaxes/src/scss/selector/tag/embedded.yml @@ -0,0 +1,37 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ( + (?> audio + | canvas + | embed + | i(?>frame|mg) + | math + | object + | svg + | video + ) + )\b + (?!\s*\() + captures: + 1: entity.name.selector.tag.embedded.scss.scss3 + set: trap + + trap: + - include: ~/scss/selector/trap diff --git a/integration/syntaxes/src/scss/selector/tag/form.yml b/integration/syntaxes/src/scss/selector/tag/form.yml new file mode 100644 index 00000000..9c2e4d83 --- /dev/null +++ b/integration/syntaxes/src/scss/selector/tag/form.yml @@ -0,0 +1,39 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ( + (?> button + | form + | input + | l + (?> abel + | egend + ) + | option + | select + | textarea + ) + )\b + (?!\s*\() + captures: + 1: entity.name.selector.tag.form.scss.scss3 + set: trap + + trap: + - include: ~/scss/selector/trap diff --git a/integration/syntaxes/src/scss/selector/tag/other.yml b/integration/syntaxes/src/scss/selector/tag/other.yml new file mode 100644 index 00000000..92048c2e --- /dev/null +++ b/integration/syntaxes/src/scss/selector/tag/other.yml @@ -0,0 +1,32 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [_\-[:alpha:]] + [_\-[:alnum:]]* + +contexts: + main: + - match: | + (?x) + \s*({{commonIdentifier}})\b + (?!\s*\() + captures: + 1: entity.name.selector.tag.scss.scss3 + set: trap + + trap: + - include: ~/scss/selector/trap diff --git a/integration/syntaxes/src/scss/selector/tag/sectioning-root.yml b/integration/syntaxes/src/scss/selector/tag/sectioning-root.yml new file mode 100644 index 00000000..d1b90502 --- /dev/null +++ b/integration/syntaxes/src/scss/selector/tag/sectioning-root.yml @@ -0,0 +1,34 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ( + (?> b + (?>lockquote|ody) + | fi + (?>eldset|gure) + | td + ) + )\b + (?!\s*\() + captures: + 1: entity.name.selector.tag.sectioning.root.scss.scss3 + set: trap + + trap: + - include: ~/scss/selector/trap diff --git a/integration/syntaxes/src/scss/selector/tag/sectioning.yml b/integration/syntaxes/src/scss/selector/tag/sectioning.yml new file mode 100644 index 00000000..473cd5d0 --- /dev/null +++ b/integration/syntaxes/src/scss/selector/tag/sectioning.yml @@ -0,0 +1,33 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?x)\s* + ( + (?> a + (?>rticle|side) + | nav + | section + ) + )\b + (?!\s*\() + captures: + 1: entity.name.selector.tag.sectioning.scss.scss3 + set: trap + + trap: + - include: ~/scss/selector/trap diff --git a/integration/syntaxes/src/scss/selector/trap.yml b/integration/syntaxes/src/scss/selector/trap.yml new file mode 100644 index 00000000..b49951cf --- /dev/null +++ b/integration/syntaxes/src/scss/selector/trap.yml @@ -0,0 +1,51 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: "" + set: selectors + + selectors: + - match: | + (?x) + (?=\s* + (?> ; + | \) + ) + ) + pop: true + - match: \s*({) + captures: + 1: punctuation.definition.body.begin.scss.scss3 + set: body + - match: \s*(,) + captures: + 1: keyword.operator.other.comma.scss.scss3 + - include: ~/scss/keyword + - include: ~/scss/selector + + body: + - match: \s*(}) + captures: + 1: punctuation.definition.body.end.scss.scss3 + pop: true + - match: "" + push: + - match: (?=\s*}) + pop: true + - include: ~/scss/attribute + - include: ~/scss/selector + - include: ~/scss/statement-and-expression diff --git a/integration/syntaxes/src/scss/statement-and-expression.yml b/integration/syntaxes/src/scss/statement-and-expression.yml new file mode 100644 index 00000000..7b736733 --- /dev/null +++ b/integration/syntaxes/src/scss/statement-and-expression.yml @@ -0,0 +1,86 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + expressionGroupBegin: | + (? each + | for + | media + ) + )\b + captures: + 1: keyword.control.scss.scss3 + set: [ + body, + free-header-content + ] + - match: | + (?x) + \s* + (@ + (?> else + | font-face + | if + | keyframes + ) + )\b + captures: + 1: keyword.control.scss.scss3 + set: [ + body, + header + ] + + header: + - match: \s*\( + scope: punctuation.definition.control.header.begin.scss.scss3 + set: enveloped-header-content + - match: "" + set: free-header-content + + free-header-content: + - match: (?=\s*{) + pop: true + - match: "" + push: + - include: ~/scss/statement-and-expression + - match: "" + pop: true + + enveloped-header-content: + - match: \s*\) + scope: punctuation.definition.control.header.end.scss.scss3 + set: header + - match: "" + push: + - match: (?=\)) + pop: true + - include: ~/scss/statement-and-expression + + body: + - match: \s*({) + captures: + 1: punctuation.definition.control.body.begin.scss.scss3 + set: body-content + - include: ~/scss/statement-and-expression + + body-content: + - match: \s*(}) + captures: + 1: punctuation.definition.control.body.end.scss.scss3 + pop: true + - match: "" + push: + - match: (?=\s*}) + pop: true + - include: ~/scss/attribute + - include: ~/scss/selector + - include: ~/scss/statement-and-expression diff --git a/integration/syntaxes/src/scss/statement/simple.yml b/integration/syntaxes/src/scss/statement/simple.yml new file mode 100644 index 00000000..5bf632dc --- /dev/null +++ b/integration/syntaxes/src/scss/statement/simple.yml @@ -0,0 +1,97 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_\-[:alpha:]] + [$_\-[:alnum:]]* + +contexts: + main: + - match: | + (?x) + \s*(@ + (?> content + | return + ) + )\b + captures: + 1: keyword.control.other.scss.scss3 + set: value + # Extend. + - match: | + (?x) + \s* + (@extend)\b + captures: + 0: storage.modifier.scss.scss3 + 1: keyword.control.extend.scss.scss3 + set: value-with-selectors + # Import. + - match: | + (?x) + \s*(@import)\b + captures: + 1: keyword.control.import.scss.scss3 + set: value + # Include. + - match: | + (?x) + \s*(@include)\b + captures: + 1: keyword.control.include.scss.scss3 + set: include-value + + trap: + - include: ~/scss/selector/trap + + statement-and-expression: + - include: ~/scss/statement-and-expression + + include-value: + # Mixin. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + (?=\s*(?>$|\{)) + captures: + 1: entity.name.mixin.scss.scss3 + set: trap + # Other values. + - include: value + + value: + - match: (?=\s*\{) + set: trap + - include: ~/scss/terminator + - match: "" + push: + - match: | + (?x) + (?=\s*;) + pop: true + - include: statement-and-expression + + value-with-selectors: + - include: ~/scss/terminator + - match: "" + push: + - match: | + (?x) + (?=\s*;) + pop: true + - include: ~/scss/attribute + - include: ~/scss/selector + - include: statement-and-expression diff --git a/integration/syntaxes/src/scss/terminator.yml b/integration/syntaxes/src/scss/terminator.yml new file mode 100644 index 00000000..811dcaa7 --- /dev/null +++ b/integration/syntaxes/src/scss/terminator.yml @@ -0,0 +1,21 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: \s*(;) + captures: + 1: keyword.other.terminator.scss.scss3 + pop: true diff --git a/integration/syntaxes/src/scss/variable-declaration.yml b/integration/syntaxes/src/scss/variable-declaration.yml new file mode 100644 index 00000000..25e139fd --- /dev/null +++ b/integration/syntaxes/src/scss/variable-declaration.yml @@ -0,0 +1,46 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_\-[:alpha:]] + [$_\-[:alnum:]]* + +contexts: + main: + - match: | + (?xi) + \s*(\${{commonIdentifier}}) + \s*(:) + captures: + 1: >- + declaration.scss.scss3 + entity.name.variable.scss.scss3 + 2: punctuation.binding.scss.scss3 + set: value + + value: + - include: terminator + - match: "" + push: + - match: (?=\s*;) + pop: true + - include: expression + + terminator: + - include: ~/scss/terminator + + expression: + - include: ~/scss/expression diff --git a/integration/syntaxes/src/scss/variable.yml b/integration/syntaxes/src/scss/variable.yml new file mode 100644 index 00000000..75baa809 --- /dev/null +++ b/integration/syntaxes/src/scss/variable.yml @@ -0,0 +1,46 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +variables: + commonIdentifier: | + [$_\-[:alpha:]] + [$_\-[:alnum:]]* + +contexts: + main: + # Single character. + - match: | + (?xi)\s* + ( + \$ + (?> [$\-]\B + | [_[:alnum:]]\b + ) + ) + captures: + 1: entity.name.variable.scss.scss3 + pop: true + # Two or more characters + - match: | + (?xi)\s* + ( + \${{commonIdentifier}} + (?> [$\-]\B + | [_[:alnum:]]\b + ) + ) + captures: + 1: entity.name.variable.scss.scss3 + pop: true diff --git a/integration/syntaxes/src/shared/email.no-pop.yml b/integration/syntaxes/src/shared/email.no-pop.yml new file mode 100644 index 00000000..b3dd00f0 --- /dev/null +++ b/integration/syntaxes/src/shared/email.no-pop.yml @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?xi) + (?> ([.[:alnum:]]+@[.[:alnum:]]+)\s + | (<[.[:alnum:]]+@[.[:alnum:]]+>) + ) + captures: + 1: entity.email + 2: entity.email diff --git a/integration/syntaxes/src/shared/email.yml b/integration/syntaxes/src/shared/email.yml new file mode 100644 index 00000000..9c8073d6 --- /dev/null +++ b/integration/syntaxes/src/shared/email.yml @@ -0,0 +1,25 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?xi)\s* + (?> ([.[:alnum:]]+@[.[:alnum:]]+)\s + | (<[.[:alnum:]]+@[.[:alnum:]]+>) + ) + captures: + 1: entity.email + 2: entity.email diff --git a/integration/syntaxes/src/shared/link.no-pop.yml b/integration/syntaxes/src/shared/link.no-pop.yml new file mode 100644 index 00000000..a59cafaa --- /dev/null +++ b/integration/syntaxes/src/shared/link.no-pop.yml @@ -0,0 +1,20 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: (?i)([[:alnum:]]+://\S+)\s + captures: + 1: entity.link diff --git a/integration/syntaxes/src/shared/link.yml b/integration/syntaxes/src/shared/link.yml new file mode 100644 index 00000000..44d777c1 --- /dev/null +++ b/integration/syntaxes/src/shared/link.yml @@ -0,0 +1,22 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +contexts: + main: + - match: | + (?xi)\s* + ([[:alnum:]]+://\S+)\s + captures: + 1: entity.link diff --git a/naomi.sublime-commands b/naomi.sublime-commands deleted file mode 100644 index 638023f9..00000000 --- a/naomi.sublime-commands +++ /dev/null @@ -1,12 +0,0 @@ -[{ - "caption": "Naomi: Run syntax tests", - "command": "naomi_run_syntax_tests" -},{ - "caption": "Naomi: Toggle JS/JSX Comment", - "command": "naomi_toggle_jsx_comment", - "args": { "block": false } -},{ - "caption": "Naomi: Toggle JS/JSX Block Comment", - "command": "naomi_toggle_jsx_comment", - "args": { "block": true } -}] diff --git a/naomi.sublime-project b/naomi.sublime-project deleted file mode 100644 index 5003a9af..00000000 --- a/naomi.sublime-project +++ /dev/null @@ -1,13 +0,0 @@ -{ - "folders": [{ - "follow_symlinks": true, - "path": "." - }], - "settings": { - "default_line_ending": "unix", - "ensure_new_line_at_eof_on_save": true, - "tab_size": 2, - "translate_tabs_to_spaces": true, - "trim_trailing_white_space_on_save": true - } -} diff --git a/plugin/commands/RunSyntaxTests.py b/plugin/commands/RunSyntaxTests.py deleted file mode 100644 index f5f7f8b5..00000000 --- a/plugin/commands/RunSyntaxTests.py +++ /dev/null @@ -1,62 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -from ..window import OutputPanel -from sublime import packages_path -from sublime_api import run_syntax_test -from sublime_plugin import WindowCommand -import os - - -class NaomiRunSyntaxTestsCommand(WindowCommand): - def __init__(self, sublime_window): - self.sublime_window = sublime_window - - def run(self): - totalFiles = 0 - totalAssertions = 0 - totalFailedAssertions = 0 - testsPath = packages_path() + '/Naomi/tests/syntaxes' - - self.outputPanel = OutputPanel(self.sublime_window, {'name': 'naomi'}) - self.outputPanel.show() - self.outputPanel.append('Naomi: Running syntax tests...') - - # Find the test files and run them. - for path, directories, files in os.walk(testsPath): - for file in files: - # Get the full path to the file. - target = os.path.join(path, file) - # Remove anything before "Packages/Naomi". - target = target[target.index('Packages/Naomi'):] - # Run the tests. - assertionsFound, messagesFound = run_syntax_test(target) - # Print the error messages and update the counters. - if messagesFound != '': - for message in messagesFound: - self.outputPanel.append(message) - totalFailedAssertions += 1 - totalFiles += 1 - totalAssertions += assertionsFound - - if totalFailedAssertions < 1: - self.outputPanel.append( - 'Success: %d assertion(s) in %d file(s).' % ( - totalAssertions, totalFiles - ) - ) - else: - self.outputPanel.append( - 'Error: %d/%d assertion(s) in %d file(s) failed.' % ( - totalFailedAssertions, totalAssertions, totalFiles - ) - ) diff --git a/plugin/commands/ToggleJsxComment.py b/plugin/commands/ToggleJsxComment.py deleted file mode 100644 index e7c27a0c..00000000 --- a/plugin/commands/ToggleJsxComment.py +++ /dev/null @@ -1,286 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -from Naomi.plugin.region import ( - expand_partial_comments_with_jsx, - expand_partial_lines, - generate_comment_punctuation_region, - generate_jsjsx_comment_punctuation_region, - scan_reverse, - search_non_whitespace, - trim_region -) -from Naomi.plugin.region.scan.predicates import ( - has_scope_predicate, - not_predicate -) -from Naomi.plugin.view import ( - is_comment, is_whitespace, - is_jsx_open_brace, - is_jsx_close_brace -) -from sublime import Region -from sublime_plugin import TextCommand -import sys - - -def can_comment(view, region): - region = region.begin() - scopes = view.scope_name(region) - - while 'string' in scopes: - region = region - 1 - - if region < 0: - return False - - if view.substr(region) == '\n': - return False - - if 'punctuation.definition.string.begin' not in scopes: - return True - return True - - -def comment_block(view, edit, region): - begin = region.begin() - end = region.end() - empty_line = False - - # Added to ensure that the cursor won’t be moved after the comment. - if begin == end: - view.replace(edit, Region(end), '!') - empty_line = True - - comment_type = resolve_required_comment_type(view, begin) - - if comment_type == 'jsx': - if empty_line: - view.insert(edit, end + 1, ' */}') - view.erase(edit, Region(end, end + 1)) - else: - view.insert(edit, end, ' */}') - view.insert(edit, begin, "{/* ") - else: - if empty_line: - view.insert(edit, end + 1, ' */') - view.erase(edit, Region(end, end + 1)) - else: - view.insert(edit, end, ' */') - view.insert(edit, begin, "/* ") - - -def comment_lines(view, edit, region): - lines = view.lines(region) - - # Calculate the margin. - margin = sys.maxsize - for line in lines: - non_whitespace_pos = search_non_whitespace(view, line) - line_begin = line.begin() - margin = min( - non_whitespace_pos - line_begin, - margin - ) - - # Analyse the type of comment that must be used for the entire block. - first_line = lines[0] - comment_type = resolve_required_comment_type(view, first_line.begin()) - - # Comment. - for line in reversed(lines): - begin = line.begin() + margin - end = max(line.end(), begin) - empty_line = False - - # Added to ensure that the cursor won’t be moved after the comment. - if begin == end: - view.replace(edit, Region(end), '!') - empty_line = True - - if comment_type == 'jsx': - # JSX comment. - if empty_line: - view.insert(edit, end + 1, ' */}') - view.erase(edit, Region(end, end + 1)) - else: - view.insert(edit, end, ' */}') - view.insert(edit, begin, "{/* ") - else: - # Normal JS comment. - view.insert(edit, begin, "// ") - if empty_line: - view.erase(edit, Region(begin + 3, begin + 4)) - - -def must_comment(view, region): - """ Returns true if the region must be commented or not. """ - non_whitespace_pos = search_non_whitespace( - view, region, stop_on_line_feed=False - ) - - # The entire line is blank, a comment must be inserted in the region. - if is_whitespace(view, non_whitespace_pos): - return True - - # If it is the JSX open brace, we just need to check the next character. - if is_jsx_open_brace(view, non_whitespace_pos): - non_whitespace_pos += 1 - - # If the cursor is at a comment, it means that the user wants to remove it. - return not is_comment(view, non_whitespace_pos) - - -def resolve_required_comment_type(view, offset): - """ - Returns the comment type that must be applied calculed at the offset. - """ - scopes = view.scope_name(offset) - - unfenced_scopes = ['source.jsx', 'punctuation.definition.tag.begin'] - unfenced_tag = all(x in scopes for x in unfenced_scopes) and \ - 'meta.jsx-fence' not in scopes - - meta_tag_scopes = ['source.jsx', 'meta.tag'] - meta_tag = all(x in scopes for x in meta_tag_scopes) - - comment_type = 'js' - if unfenced_tag or ('source.jsx' in scopes and not meta_tag): - comment_type = 'jsx' - - return comment_type - - -def uncomment_region(view, edit, region): - begin = region.begin() - end = region.end() - 1 - - # We will loop backwards, this means that it will hit the closing - # punctuation for block comments first. - i = end + 1 - while i > begin: - i -= 1 - scopes = view.scope_name(i) - - # Not a punctuation, ignore it. - if 'punctuation.definition.comment' not in scopes: - continue - - # Found the second forward slash for the “// ” comment. - if 'comment.line' in scopes: - punctuation_region = generate_comment_punctuation_region(view, i) - view.erase(edit, punctuation_region) - i = punctuation_region.begin() - continue - - # We found the beginning of the block comment first, this means that - # there’s no end to it and we can easily remove it. It can be “/* ”, - # “/** ”, “{/* ” or “{/** ”. - if 'punctuation.definition.comment.begin' in scopes: - punctuation_region = generate_jsjsx_comment_punctuation_region( - view, i - ) - - view.erase(edit, punctuation_region) - i = punctuation_region.begin() - continue - - # We are looping backwards, so it is expected to find the closing - # punctuation first which can be “ */” or “ */}”. - possible_jsx_comment = False - if i < view.size() and is_jsx_close_brace(view, i + 1): - possible_jsx_comment = True - - closing_punctuation_region = generate_comment_punctuation_region( - view, i - ) - - # Move the cursor 1 character after the beginning punctuation. - i = scan_reverse(view, i, not_predicate(has_scope_predicate( - 'punctuation.definition.comment.begin' - ))) - - open_punctuation_region = generate_comment_punctuation_region( - view, i - 1 - ) - - # Correct the regions to include the JSX braces if necessary. - if possible_jsx_comment: - if is_jsx_open_brace(view, open_punctuation_region.begin() - 1): - open_punctuation_region = Region( - open_punctuation_region.begin() - 1, - open_punctuation_region.end() - ) - closing_punctuation_region = Region( - closing_punctuation_region.begin(), - closing_punctuation_region.end() + 1 - ) - - view.erase(edit, closing_punctuation_region) - view.erase(edit, open_punctuation_region) - - # Move the cursor to the beginning of the block to “consume” it. - i = open_punctuation_region.begin() - - -class NaomiToggleJsxCommentCommand(TextCommand): - """ Actual command to toggle the comment lines and blocks. """ - def __init__(self, view): - self.view = view - - def run(self, edit, block): - view = self.view - - # Expand regions. - expanded_regions = [] - for region in self.view.sel(): - region = expand_partial_comments_with_jsx(view, region) - - if block: - region = trim_region(view, region) - else: - region = expand_partial_lines(view, region) - region = expand_partial_comments_with_jsx(view, region) - - expanded_regions.append(region) - - # Consolidate regions. - consolidated_regions = [] - previous_region = None - - for region in expanded_regions: - if previous_region is None: - previous_region = region - continue - - if previous_region.intersects(region): - previous_region.cover(region) - continue - - consolidated_regions.append(previous_region) - previous_region = region - - consolidated_regions.append(previous_region) - - # Toggle comments. - for region in reversed(consolidated_regions): - if not must_comment(view, region): - uncomment_region(view, edit, region) - continue - - if not can_comment(view, region): - continue - - if block: - comment_block(view, edit, region) - else: - comment_lines(view, edit, region) diff --git a/plugin/commands/__init__.py b/plugin/commands/__init__.py deleted file mode 100644 index bf72dbf4..00000000 --- a/plugin/commands/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. diff --git a/plugin/region/__init__.py b/plugin/region/__init__.py deleted file mode 100644 index 12430c86..00000000 --- a/plugin/region/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -from .expand import ( - expand, - expand_by_scope, - expand_partial_comments, - expand_partial_comments_with_jsx, - expand_partial_lines -) -from .generate import ( - generate_comment_punctuation_region, - generate_jsjsx_comment_punctuation_region, - generate_region_for_scope -) -from .scan import ( - scan, - scan_reverse, - search_non_whitespace, - search_non_whitespace_reverse -) -from .trim import trim_region - -__all__ = [ - expand, - expand_by_scope, - expand_partial_comments, - expand_partial_comments_with_jsx, - expand_partial_lines, - generate_comment_punctuation_region, - generate_jsjsx_comment_punctuation_region, - generate_region_for_scope, - scan, - scan_reverse, - search_non_whitespace, - search_non_whitespace_reverse, - trim_region -] diff --git a/plugin/region/expand.py b/plugin/region/expand.py deleted file mode 100644 index c73b3333..00000000 --- a/plugin/region/expand.py +++ /dev/null @@ -1,135 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -from Naomi.plugin.region.scan import ( - scan, - scan_reverse -) -from Naomi.plugin.region.scan.predicates import ( - all_predicate, - has_scope_predicate, - is_comment_predicate, - is_comment_begin_predicate, - is_comment_end_predicate, - not_predicate -) -from Naomi.plugin.view import ( - is_comment, - is_comment_begin, - is_jsx_open_brace, - is_jsx_close_brace, - search_scope -) -from sublime import Region - - -def expand(view, region, predicate): - begin = scan_reverse(view, region.begin(), predicate) - end = scan(view, region.end(), predicate) - return Region(begin, end) - - -def expand_by_scope(view, region, scope): - def __predicate(view, offset): - scopes = view.scope_name(offset) - return scope in scopes - return expand(view, region, __predicate) - - -def expand_partial_comments(view, region): - begin = region.begin() - end = region.end() - - # When the cursor is at the punctuation, we need to move it to the edges of - # the punctuation which will simplify the expansion. - begin_scope = search_scope( - view, begin, 'punctuation\.definition\.comment\.\w+' - ) - - if begin_scope is not None: - begin = scan_reverse(view, begin, has_scope_predicate(begin_scope)) - if begin_scope == 'punctuation.definition.comment.end': - begin -= 1 - elif begin > 0: - begin_scope = view.scope_name(begin) - begin_char = view.substr(begin) - # If the region begins at a line feed and it is not a comment, the - # previous character could be the end of a single line comment. - if begin_char == '\n' and 'comment' not in begin_scope: - previous_scope = view.scope_name(begin - 1) - # The previous char was indeed a single comment, we will move the - # region’s beginning to allow the expansion algorithm to catch it. - if 'comment.line' in previous_scope: - begin -= 1 - - if end == begin and is_comment_begin(view, end): - end = scan(view, end, is_comment_begin_predicate()) + 1 - else: - end_scope = search_scope( - view, end - 1, 'punctuation\.definition\.comment\.\w+' - ) - if end_scope is not None: - end = scan(view, end, has_scope_predicate(end_scope)) - - # Expand to the left. - begin = scan_reverse(view, begin, all_predicate([ - is_comment_predicate(), - not_predicate(is_comment_end_predicate()) - ])) - - # Expand to the right. - end = scan(view, end, all_predicate([ - is_comment_predicate(), - not_predicate(is_comment_begin_predicate()) - ])) - - return Region(begin, end) - - -def expand_partial_comments_with_jsx(view, region): - begin = region.begin() - end = region.end() - - if is_jsx_open_brace(view, begin) and is_comment(view, begin + 1): - begin += 1 - - if is_jsx_close_brace(view, begin) and is_comment(view, begin - 1): - begin -= 1 - - if is_jsx_open_brace(view, end - 1): - end += 1 - - if end < begin: - end = begin - - return expand_partial_comments(view, Region(begin, end)) - - -def expand_partial_lines(view, region): - def __predicate(view, offset): - char = view.substr(offset) - return char != '\n' - - begin = region.begin() - end = region.end() - - if region.size() < 1: - end = scan(view, end, __predicate) - return Region(begin, end) - - if view.substr(begin) == '\n' and view.substr(begin - 1) != '\n': - begin -= 1 - - begin = scan_reverse(view, begin, __predicate) - end = scan(view, end - 1, __predicate) + 1 - - return Region(begin, end) diff --git a/plugin/region/generate.py b/plugin/region/generate.py deleted file mode 100644 index 2312cea2..00000000 --- a/plugin/region/generate.py +++ /dev/null @@ -1,73 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -from Naomi.plugin.region.expand import expand_by_scope -from Naomi.plugin.view import ( - is_jsx_open_brace, - is_jsx_close_brace, - search_scope -) -from sublime import Region - - -ANY_COMMENT_SCOPE = 'punctuation\.definition\.comment\.\w+' -COMMENT_SCOPE = 'punctuation.definition.comment' -COMMENT_BEGIN_SCOPE = 'punctuation.definition.comment.begin' -COMMENT_END_SCOPE = 'punctuation.definition.comment.end' - - -def generate_comment_punctuation_region( - view, offset, include_one_whitespace=True -): - result = generate_region_for_scope(view, offset, ANY_COMMENT_SCOPE) - begin = result.begin() - end = result.end() - scopes = view.scope_name(begin) - - if COMMENT_BEGIN_SCOPE in scopes: - next_char = view.substr(end) - if next_char.isspace() and next_char != '\n': - if COMMENT_SCOPE not in view.scope_name(end + 1): - end += 1 - - if COMMENT_END_SCOPE in scopes: - previous_char = view.substr(begin - 1) - if previous_char.isspace() and previous_char != '\n': - if COMMENT_SCOPE not in view.scope_name(begin - 2): - begin -= 1 - - return Region(begin, end) - - -def generate_jsjsx_comment_punctuation_region( - view, offset, include_one_whitespace=True -): - result = generate_comment_punctuation_region( - view, offset, include_one_whitespace - ) - - begin = result.begin() - end = result.end() - - if is_jsx_open_brace(view, begin - 1): - begin -= 1 - if is_jsx_close_brace(view, end + 1): - end += 1 - - return Region(begin, end) - - -def generate_region_for_scope(view, offset, scope_pattern): - scope = search_scope(view, offset, scope_pattern) - if scope is None: - return None - return expand_by_scope(view, Region(offset), scope) diff --git a/plugin/region/scan/__init__.py b/plugin/region/scan/__init__.py deleted file mode 100644 index 20e3ef27..00000000 --- a/plugin/region/scan/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -from .functions import ( - scan, - scan_reverse, - search_non_whitespace, - search_non_whitespace_reverse -) - -__all__ = [ - scan, - scan_reverse, - search_non_whitespace, - search_non_whitespace_reverse -] diff --git a/plugin/region/scan/functions.py b/plugin/region/scan/functions.py deleted file mode 100644 index e8b5c4d7..00000000 --- a/plugin/region/scan/functions.py +++ /dev/null @@ -1,86 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - - -def scan(view, offset, predicate, limit=-1): - if not predicate(view, offset): - return offset - - if limit < 1: - limit = view.size() - 1 - - while True: - offset += 1 - if offset > limit: - offset = limit - break - - if not predicate(view, offset): - break - - return offset - - -def scan_reverse(view, offset, predicate, limit=-1): - if not predicate(view, offset): - return offset - - if limit < 0: - limit = 0 - - while True: - offset -= 1 - if offset < limit: - offset = limit - break - - if not predicate(view, offset): - offset += 1 - break - - return offset - - -def search_non_whitespace(view, region, stop_on_line_feed=False): - def __predicate(view, offset): - char = view.substr(offset) - if stop_on_line_feed and char == '\n': - return False - return char.isspace() - - begin = region.begin() - end = region.end() - - if end < begin: - end = begin - - return scan(view, begin, __predicate, end) - - -def search_non_whitespace_reverse(view, region, stop_on_line_feed=False): - def __predicate(view, offset): - char = view.substr(offset) - if stop_on_line_feed and char == '\n': - return False - return char.isspace() - - begin = region.begin() - end = region.end() - 1 - - if end < begin: - end = begin - - result = scan_reverse(view, end, __predicate, begin) - if view.substr(result).isspace(): - result -= 1 - - return result diff --git a/plugin/region/scan/predicates.py b/plugin/region/scan/predicates.py deleted file mode 100644 index 08db6bd7..00000000 --- a/plugin/region/scan/predicates.py +++ /dev/null @@ -1,73 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - - -def all_predicate(predicates): - def __predicate(view, offset): - for predicate in predicates: - if not predicate(view, offset): - return False - return True - return __predicate - - -def any_predicate(predicates): - def __predicate(view, offset): - for predicate in predicates: - if predicate(view, offset): - return True - return False - return __predicate - - -def has_scope_predicate(scope): - def __predicate(view, offset): - scopes = view.scope_name(offset) - return scope in scopes - return __predicate - - -def has_all_scopes_predicate(target_scopes): - def __predicate(view, offset): - scopes = view.scope_name(offset) - return all(x in scopes for x in target_scopes) - return __predicate - - -def has_any_scope_predicate(target_scopes): - def __predicate(view, offset): - scopes = view.scope_name(offset) - return any(x in scopes for x in target_scopes) - return __predicate - - -def is_comment_predicate(): - comment_scopes = ['comment.block', 'comment.line'] - return has_any_scope_predicate(comment_scopes) - - -def is_comment_begin_predicate(): - return has_scope_predicate('punctuation.definition.comment.begin') - - -def is_comment_end_predicate(): - return has_scope_predicate('punctuation.definition.comment.end') - - -def not_comment_predicate(): - return not_predicate(is_comment_predicate()) - - -def not_predicate(predicate): - def __predicate(view, offset): - return not predicate(view, offset) - return __predicate diff --git a/plugin/region/trim.py b/plugin/region/trim.py deleted file mode 100644 index 9274a0b0..00000000 --- a/plugin/region/trim.py +++ /dev/null @@ -1,33 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -from Naomi.plugin.region.scan import ( - search_non_whitespace, - search_non_whitespace_reverse -) -from sublime import Region - - -def trim_region(view, region): - # The region is already collapsed. - if region.size() < 1: - return region - - begin = search_non_whitespace(view, region) - end = search_non_whitespace_reverse(view, region) + 1 - - # The entire line is empty. - if end < begin: - begin = end - end = begin - - return Region(begin, end) diff --git a/plugin/view.py b/plugin/view.py deleted file mode 100644 index 17b0b8ef..00000000 --- a/plugin/view.py +++ /dev/null @@ -1,74 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -import re - - -def has_any_scope(view, offset, target_scopes): - scopes = view.scope_name(offset) - return any(x in scopes for x in target_scopes) - - -def has_all_scopes(view, offset, target_scopes): - scopes = view.scope_name(offset) - return all(x in scopes for x in target_scopes) - - -def is_comment(view, offset): - comment_scopes = ['comment.block', 'comment.line'] - scopes = view.scope_name(offset) - return any(x in scopes for x in comment_scopes) - - -def is_comment_begin(view, offset): - return 'punctuation.definition.comment.begin' in view.scope_name(offset) - - -def is_comment_end(view, offset): - return 'punctuation.definition.comment.end' in view.scope_name(offset) - - -def is_jsx_open_brace(view, offset): - open_brace_scopes = [ - 'source.jsx', - 'punctuation.definition.template-expression.begin' - ] - scopes = view.scope_name(offset) - return all(x in scopes for x in open_brace_scopes) - - -def is_jsx_close_brace(view, offset): - close_brace_scopes = [ - 'source.jsx', - 'punctuation.definition.template-expression.end' - ] - scopes = view.scope_name(offset) - return all(x in scopes for x in close_brace_scopes) - - -def is_offset_valid(view, offset): - return 0 <= offset <= view.size() - 1 - - -def is_whitespace(view, offset): - return view.substr(offset).isspace() - - -def not_comment(view, offset): - return not is_comment(view, offset) - - -def search_scope(view, offset, pattern): - """ Returns the string that matches the pattern. """ - scopes = view.scope_name(offset) - matched = re.search(pattern, scopes) - return None if matched is None else matched.group(0) diff --git a/plugin/window/OutputPanel.py b/plugin/window/OutputPanel.py deleted file mode 100644 index 030ceed7..00000000 --- a/plugin/window/OutputPanel.py +++ /dev/null @@ -1,41 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - - -class OutputPanel(object): - def __init__(self, sublime_window, settings): - self.sublime_window = sublime_window - self.settings = settings - - self.settings.setdefault('line_numbers', True) - self.settings.setdefault('word_wrap', False) - - self.__create_panel() - self.__configure_panel() - - def append(self, text): - self.panel.run_command('append', {'characters': text + '\n'}) - - def show(self): - name = self.settings['name'] - self.sublime_window.run_command( - 'show_panel', {'panel': 'output.' + name} - ) - - def __configure_panel(self): - panel_settings = self.panel.settings() - for key, value in self.settings.items(): - panel_settings.set(key, value) - - def __create_panel(self): - name = self.settings['name'] - self.panel = self.sublime_window.create_output_panel(name) diff --git a/plugin/window/__init__.py b/plugin/window/__init__.py deleted file mode 100644 index bf72dbf4..00000000 --- a/plugin/window/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. diff --git a/preferences/indentation-comment.YAML-tmPreferences b/preferences/indentation-comment.YAML-tmPreferences deleted file mode 100644 index fecd88c2..00000000 --- a/preferences/indentation-comment.YAML-tmPreferences +++ /dev/null @@ -1,23 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: Comment’s indentation -scope: comment, comment.block -settings: - preserveIndent: false - increaseIndentPattern: "" - decreaseIndentPattern: "" - bracketIndentNextLinePattern: "" - disableIndentNextLinePattern: "" - unIndentedLinePattern: "." diff --git a/preferences/indentation-comment.tmPreferences b/preferences/indentation-comment.tmPreferences deleted file mode 100644 index 85a1b966..00000000 --- a/preferences/indentation-comment.tmPreferences +++ /dev/null @@ -1,25 +0,0 @@ - - - - - name - Comment’s indentation - scope - comment - settings - - bracketIndentNextLinePattern - - decreaseIndentPattern - - disableIndentNextLinePattern - - increaseIndentPattern - - preserveIndent - - unIndentedLinePattern - . - - - diff --git a/preferences/indentation-fence-correction.YAML-tmPreferences b/preferences/indentation-fence-correction.YAML-tmPreferences deleted file mode 100644 index 8b50503b..00000000 --- a/preferences/indentation-fence-correction.YAML-tmPreferences +++ /dev/null @@ -1,18 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: Fence indentation correction -scope: meta.line-fence.comment, meta.block-fence.comment -settings: - unIndentedLinePattern: "." diff --git a/preferences/indentation-fence-correction.tmPreferences b/preferences/indentation-fence-correction.tmPreferences deleted file mode 100644 index 5296ca4e..00000000 --- a/preferences/indentation-fence-correction.tmPreferences +++ /dev/null @@ -1,15 +0,0 @@ - - - - - name - Fence indentation correction - scope - meta.line-fence.comment, meta.block-fence.comment - settings - - unIndentedLinePattern - . - - - diff --git a/preferences/js/comment-toggle.YAML-tmPreferences b/preferences/js/comment-toggle.YAML-tmPreferences deleted file mode 100644 index f2d440d7..00000000 --- a/preferences/js/comment-toggle.YAML-tmPreferences +++ /dev/null @@ -1,24 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: JS’s comment toggle -scope: source.js -settings: - shellVariables: - - name: TM_COMMENT_START - value: "// " - - name: TM_COMMENT_START_2 - value: "/* " - - name: TM_COMMENT_END_2 - value: " */" diff --git a/preferences/js/comment-toggle.tmPreferences b/preferences/js/comment-toggle.tmPreferences deleted file mode 100644 index 15353f38..00000000 --- a/preferences/js/comment-toggle.tmPreferences +++ /dev/null @@ -1,34 +0,0 @@ - - - - - name - JS’s comment toggle - scope - source.js - settings - - shellVariables - - - name - TM_COMMENT_START - value - // - - - name - TM_COMMENT_START_2 - value - /* - - - name - TM_COMMENT_END_2 - value - */ - - - - - diff --git a/preferences/js/indentation/main.YAML-tmPreferences b/preferences/js/indentation/main.YAML-tmPreferences deleted file mode 100644 index 9380db19..00000000 --- a/preferences/js/indentation/main.YAML-tmPreferences +++ /dev/null @@ -1,42 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: JS’s indentation -scope: source.js - (comment, string) -settings: - preserveIndent: false - increaseIndentPattern: | - (?x)^ - .* - (?> \{ - | \[ - | \( - ) - \s*$ - decreaseIndentPattern: | - (?x)^ - \s* - (?> \} - | \] - | \) - ) - bracketIndentNextLinePattern: | - (?x)^\s* - (?> do - | else - | for - | if - )\b - disableIndentNextLinePattern: "" - unIndentedLinePattern: "" diff --git a/preferences/js/indentation/main.tmPreferences b/preferences/js/indentation/main.tmPreferences deleted file mode 100644 index d4ec3b10..00000000 --- a/preferences/js/indentation/main.tmPreferences +++ /dev/null @@ -1,44 +0,0 @@ - - - - - name - JS’s indentation - scope - source.js - (comment, string) - settings - - bracketIndentNextLinePattern - (?x)^\s* -(?> do - | else - | for - | if -)\b - - decreaseIndentPattern - (?x)^ -\s* -(?> \} - | \] - | \) -) - - disableIndentNextLinePattern - - increaseIndentPattern - (?x)^ -.* -(?> \{ - | \[ - | \( -) -\s*$ - - preserveIndent - - unIndentedLinePattern - - - - diff --git a/preferences/js/indentation/while.YAML-tmPreferences b/preferences/js/indentation/while.YAML-tmPreferences deleted file mode 100644 index 4daea46a..00000000 --- a/preferences/js/indentation/while.YAML-tmPreferences +++ /dev/null @@ -1,20 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -# This is necessary because “while” is also used in “do...while” loops. -name: JS’s indentation for while loops -scope: source.js meta.loop.while - (comment, string) -settings: - bracketIndentNextLinePattern: | - (?x)^\s*while\b diff --git a/preferences/js/indentation/while.tmPreferences b/preferences/js/indentation/while.tmPreferences deleted file mode 100644 index 8c2183e3..00000000 --- a/preferences/js/indentation/while.tmPreferences +++ /dev/null @@ -1,16 +0,0 @@ - - - - - name - JS’s indentation for while loops - scope - source.js meta.loop.while - (comment, string) - settings - - bracketIndentNextLinePattern - (?x)^\s*while\b - - - - diff --git a/preferences/js/symbol/arrow-function.YAML-tmPreferences b/preferences/js/symbol/arrow-function.YAML-tmPreferences deleted file mode 100644 index d7abda0c..00000000 --- a/preferences/js/symbol/arrow-function.YAML-tmPreferences +++ /dev/null @@ -1,19 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: Symbol - JS’s arrow function -scope: source.js meta.declaration.function.arrow -settings: - showInSymbolList: 1 - symbolTransformation: "/^\\s*/\U000027a1 /" diff --git a/preferences/js/symbol/arrow-function.tmPreferences b/preferences/js/symbol/arrow-function.tmPreferences deleted file mode 100644 index 64c37b06..00000000 --- a/preferences/js/symbol/arrow-function.tmPreferences +++ /dev/null @@ -1,17 +0,0 @@ - - - - - name - Symbol - JS’s arrow function - scope - source.js meta.declaration.function.arrow - settings - - showInSymbolList - 1 - symbolTransformation - /^\s*/➡ / - - - diff --git a/preferences/js/symbol/class.YAML-tmPreferences b/preferences/js/symbol/class.YAML-tmPreferences deleted file mode 100644 index 778e7e11..00000000 --- a/preferences/js/symbol/class.YAML-tmPreferences +++ /dev/null @@ -1,19 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: Symbol - JS’s classes -scope: source.js meta.declaration.class -settings: - showInSymbolList: 1 - symbolTransformation: "/class\\s+/\U0001f534 /" diff --git a/preferences/js/symbol/class.tmPreferences b/preferences/js/symbol/class.tmPreferences deleted file mode 100644 index d77257eb..00000000 --- a/preferences/js/symbol/class.tmPreferences +++ /dev/null @@ -1,17 +0,0 @@ - - - - - name - Symbol - JS’s Classes - scope - source.js meta.declaration.class - settings - - showInSymbolList - 1 - symbolTransformation - /class\s+/🔴 / - - - diff --git a/preferences/js/symbol/function.YAML-tmPreferences b/preferences/js/symbol/function.YAML-tmPreferences deleted file mode 100644 index 2c5c6752..00000000 --- a/preferences/js/symbol/function.YAML-tmPreferences +++ /dev/null @@ -1,19 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: Symbol - JS’s function -scope: source.js meta.declaration.function -settings: - showInSymbolList: 1 - symbolTransformation: "/^\\s*(?:function\\s+)?/\U0001f530 /" diff --git a/preferences/js/symbol/function.tmPreferences b/preferences/js/symbol/function.tmPreferences deleted file mode 100644 index a7fa2939..00000000 --- a/preferences/js/symbol/function.tmPreferences +++ /dev/null @@ -1,17 +0,0 @@ - - - - - name - Symbol - JS’s function - scope - source.js meta.declaration.function - settings - - showInSymbolList - 1 - symbolTransformation - /^\s*(?:function\s+)?/🔰 / - - - diff --git a/preferences/js/symbol/method.YAML-tmPreferences b/preferences/js/symbol/method.YAML-tmPreferences deleted file mode 100644 index 0cc56f2a..00000000 --- a/preferences/js/symbol/method.YAML-tmPreferences +++ /dev/null @@ -1,19 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: Symbol - JS’s method -scope: source.js meta.declaration.function.method -settings: - showInSymbolList: 1 - symbolTransformation: "/^\\s*/\U0001f537 /" diff --git a/preferences/js/symbol/method.tmPreferences b/preferences/js/symbol/method.tmPreferences deleted file mode 100644 index 4efd7079..00000000 --- a/preferences/js/symbol/method.tmPreferences +++ /dev/null @@ -1,17 +0,0 @@ - - - - - name - Symbol - JS’s method - scope - source.js meta.declaration.function.method - settings - - showInSymbolList - 1 - symbolTransformation - /^\s*/🔷 / - - - diff --git a/preferences/jsx/comment-toggle.YAML-tmPreferences b/preferences/jsx/comment-toggle.YAML-tmPreferences deleted file mode 100644 index 5bcee633..00000000 --- a/preferences/jsx/comment-toggle.YAML-tmPreferences +++ /dev/null @@ -1,22 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: JSX’s comment toggle -scope: source.jsx -settings: - shellVariables: - - name: TM_COMMENT_START - value: "" - - name: TM_COMMENT_END - value: "" diff --git a/preferences/jsx/comment-toggle.tmPreferences b/preferences/jsx/comment-toggle.tmPreferences deleted file mode 100644 index 5a204ecd..00000000 --- a/preferences/jsx/comment-toggle.tmPreferences +++ /dev/null @@ -1,28 +0,0 @@ - - - - - name - JSX’s comment toggle - scope - source.jsx - settings - - shellVariables - - - name - TM_COMMENT_START - value - - - - name - TM_COMMENT_END - value - - - - - - diff --git a/preferences/jsx/indentation.YAML-tmPreferences b/preferences/jsx/indentation.YAML-tmPreferences deleted file mode 100644 index 35db94a5..00000000 --- a/preferences/jsx/indentation.YAML-tmPreferences +++ /dev/null @@ -1,34 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: JSX’s indentation -scope: source.jsx -settings: - increaseIndentPattern: | - (?x) - ^\s* - < - (?> '(?:\'|[^'])*?' - | "(?:\"|[^"])*?" - | `(?:\`|[^`])*?` - | [^/'"`] - )* - >? - \s*$ - decreaseIndentPattern: | - (?x) - ^\s* - (?> /> - | - - - - name - JSX’s indentation - scope - source.jsx - settings - - decreaseIndentPattern - (?x) -^\s* -(?> /> - | </ -) - - increaseIndentPattern - (?x) -^\s* -< -(?> '(?:\'|[^'])*?' - | "(?:\"|[^"])*?" - | `(?:\`|[^`])*?` - | [^/'"`] -)* ->? -\s*$ - - - - diff --git a/preferences/jsx/symbol/components.YAML-tmPreferences b/preferences/jsx/symbol/components.YAML-tmPreferences deleted file mode 100644 index f8b941e7..00000000 --- a/preferences/jsx/symbol/components.YAML-tmPreferences +++ /dev/null @@ -1,19 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: Symbol - JSX’s components -scope: source.jsx entity.name.tag.component - meta.tag.close -settings: - showInSymbolList: 1 - symbolTransformation: "//\U0001f3f7 /" diff --git a/preferences/jsx/symbol/components.tmPreferences b/preferences/jsx/symbol/components.tmPreferences deleted file mode 100644 index 429e1136..00000000 --- a/preferences/jsx/symbol/components.tmPreferences +++ /dev/null @@ -1,17 +0,0 @@ - - - - - name - Symbol - JSX’s components - scope - source.jsx entity.name.tag.component - meta.tag.close - settings - - showInSymbolList - 1 - symbolTransformation - //🏷 / - - - diff --git a/preferences/mql/comment.YAML-tmPreferences b/preferences/mql/comment.YAML-tmPreferences deleted file mode 100644 index fea36f73..00000000 --- a/preferences/mql/comment.YAML-tmPreferences +++ /dev/null @@ -1,24 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: MQL’s comments -scope: source.mql -settings: - shellVariables: - - name: TM_COMMENT_START - value: "// " - - name: TM_COMMENT_START_2 - value: "/* " - - name: TM_COMMENT_END_2 - value: " */" diff --git a/preferences/mql/comment.tmPreferences b/preferences/mql/comment.tmPreferences deleted file mode 100644 index 9066a498..00000000 --- a/preferences/mql/comment.tmPreferences +++ /dev/null @@ -1,34 +0,0 @@ - - - - - name - MQL’s comments - scope - source.mql - settings - - shellVariables - - - name - TM_COMMENT_START - value - // - - - name - TM_COMMENT_START_2 - value - /* - - - name - TM_COMMENT_END_2 - value - */ - - - - - diff --git a/preferences/mql/indentation/block.YAML-tmPreferences b/preferences/mql/indentation/block.YAML-tmPreferences deleted file mode 100644 index 71521fb0..00000000 --- a/preferences/mql/indentation/block.YAML-tmPreferences +++ /dev/null @@ -1,53 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: MQL’s block indentation settings -scope: source.mql -settings: - preserveIndent: false - increaseIndentPattern: | - (?x) - (?> ^\s* - (?> case - | private - | protected - | public - ) - | ^.* - (?> \{ - | \[ - | \( - )\s*$ - ) - decreaseIndentPattern: | - (?x) - ^\s* - (?> case - | private - | protected - | public - | } - | ] - | \) - ) - bracketIndentNextLinePattern: | - (?x) - ^\s* - (?> case - | else - | for - | if - | switch - | while - )\b diff --git a/preferences/mql/indentation/comment-block.YAML-tmPreferences b/preferences/mql/indentation/comment-block.YAML-tmPreferences deleted file mode 100644 index 12411827..00000000 --- a/preferences/mql/indentation/comment-block.YAML-tmPreferences +++ /dev/null @@ -1,25 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: MQL’s comment indentation settings -scope: >- - source.mql comment.block, - source.mql meta.block-end -settings: - preserveIndent: true - increaseIndentPattern: "" - decreaseIndentPattern: "" - bracketIndentNextLinePattern: "" - disableIndentNextLinePattern: "" - unIndentedLinePattern: . diff --git a/preferences/mql/indentation/comment-line.YAML-tmPreferences b/preferences/mql/indentation/comment-line.YAML-tmPreferences deleted file mode 100644 index 7739851f..00000000 --- a/preferences/mql/indentation/comment-line.YAML-tmPreferences +++ /dev/null @@ -1,24 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: MQL’s comment line indentation settings -scope: >- - source.mql comment.line -settings: - preserveIndent: false - increaseIndentPattern: "" - decreaseIndentPattern: "" - bracketIndentNextLinePattern: "" - disableIndentNextLinePattern: "" - unIndentedLinePattern: "" diff --git a/preferences/php/comment.YAML-tmPreferences b/preferences/php/comment.YAML-tmPreferences deleted file mode 100644 index 080ee637..00000000 --- a/preferences/php/comment.YAML-tmPreferences +++ /dev/null @@ -1,24 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: PHP’s comment -scope: source.php -settings: - shellVariables: - - name: TM_COMMENT_START - value: "// " - - name: TM_COMMENT_START_2 - value: "/* " - - name: TM_COMMENT_END_2 - value: " */" diff --git a/preferences/php/indentation/block.YAML-tmPreferences b/preferences/php/indentation/block.YAML-tmPreferences deleted file mode 100644 index 9da67ada..00000000 --- a/preferences/php/indentation/block.YAML-tmPreferences +++ /dev/null @@ -1,40 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: PHP’s block indentation settings -scope: source.php -settings: - preserveIndent: false - increaseIndentPattern: | - (?x) - ^.* - (?> \{ - | \[ - | \( - )\s*$ - decreaseIndentPattern: | - (?x) - ^\s* - (?> } - | ] - | \) - ) - bracketIndentNextLinePattern: | - (?x) - ^\s* - (?> else - | for - | if - | while - )\b diff --git a/preferences/php/indentation/comment.YAML-tmPreferences b/preferences/php/indentation/comment.YAML-tmPreferences deleted file mode 100644 index fc8da11c..00000000 --- a/preferences/php/indentation/comment.YAML-tmPreferences +++ /dev/null @@ -1,25 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: PHP’s comment indentation settings -scope: >- - source.php comment, - source.php meta.block-end -settings: - preserveIndent: true - increaseIndentPattern: "" - decreaseIndentPattern: "" - bracketIndentNextLinePattern: "" - disableIndentNextLinePattern: "" - unIndentedLinePattern: . diff --git a/preferences/scss/comment.YAML-tmPreferences b/preferences/scss/comment.YAML-tmPreferences deleted file mode 100644 index 6c865f03..00000000 --- a/preferences/scss/comment.YAML-tmPreferences +++ /dev/null @@ -1,24 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: SCSS’s comment -scope: source.scss -settings: - shellVariables: - - name: TM_COMMENT_START - value: "// " - - name: TM_COMMENT_START_2 - value: "/* " - - name: TM_COMMENT_END_2 - value: " */" diff --git a/preferences/scss/comment.tmPreferences b/preferences/scss/comment.tmPreferences deleted file mode 100644 index 6707094a..00000000 --- a/preferences/scss/comment.tmPreferences +++ /dev/null @@ -1,34 +0,0 @@ - - - - - name - SCSS’s comment - scope - source.scss - settings - - shellVariables - - - name - TM_COMMENT_START - value - // - - - name - TM_COMMENT_START_2 - value - /* - - - name - TM_COMMENT_END_2 - value - */ - - - - - diff --git a/preferences/scss/indentation/block.YAML-tmPreferences b/preferences/scss/indentation/block.YAML-tmPreferences deleted file mode 100644 index 26670b07..00000000 --- a/preferences/scss/indentation/block.YAML-tmPreferences +++ /dev/null @@ -1,40 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: SCSS’s block indentation settings -scope: source.scss -settings: - preserveIndent: false - increaseIndentPattern: | - (?x) - ^.* - (?> \{ - | \[ - | \( - )\s*$ - decreaseIndentPattern: | - (?x) - ^\s* - (?> } - | ] - | \) - ) - bracketIndentNextLinePattern: | - (?x) - ^\s*@ - (?> else - | for - | if - | while - )\b diff --git a/preferences/scss/indentation/comment.YAML-tmPreferences b/preferences/scss/indentation/comment.YAML-tmPreferences deleted file mode 100644 index 7938970c..00000000 --- a/preferences/scss/indentation/comment.YAML-tmPreferences +++ /dev/null @@ -1,25 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmPreferences - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -name: SCSS’s comment indentation settings -scope: >- - source.scss comment, - source.scss meta.block-end -settings: - preserveIndent: true - increaseIndentPattern: "" - decreaseIndentPattern: "" - bracketIndentNextLinePattern: "" - disableIndentNextLinePattern: "" - unIndentedLinePattern: . diff --git a/schemes/candyman/_annotation.scss b/schemes/candyman/_annotation.scss index 1472b598..986f3ec9 100644 --- a/schemes/candyman/_annotation.scss +++ b/schemes/candyman/_annotation.scss @@ -15,12 +15,11 @@ .punctuation.definition { foreground: $purple-a100; } -// .meta.group { -// .punctuation { -// &.section.group, -// &.separator.comma { -// foreground: $purple-a100; -// } -// } -// } + + // .punctuation { + // &.section.group, + // &.separator.comma { + // foreground: $purple-a100; + // } + // } } diff --git a/schemes/candyman/_comment.scss b/schemes/candyman/_comment.scss index 40387756..34b1e85d 100644 --- a/schemes/candyman/_comment.scss +++ b/schemes/candyman/_comment.scss @@ -13,4 +13,5 @@ .comment, .comment .punctuation.definition { foreground: $blue-gray-500; + background: rgba($blue-gray-500, .05); } diff --git a/schemes/candyman/_console.scss b/schemes/candyman/_console.scss index fee9ee50..8f9585c8 100644 --- a/schemes/candyman/_console.scss +++ b/schemes/candyman/_console.scss @@ -20,57 +20,11 @@ foreground: $green-a400; background: rgba($green-a400, .05); fontStyle: italic; -// &.error { -// foreground: $pink-a200; -// } - -// &.info { -// foreground: $teal-a400; -// } - -// &.log { -// foreground: $brown-200; -// } - -// &.warn { -// foreground: $deep-orange-a100; -// } } -// .meta.function-call.console { -// &.error .meta.group { -// .punctuation { -// &.section.group, -// &.separator.comma { -// foreground: $red-300; -// } -// } -// } - -// &.info .meta.group { -// .punctuation { -// &.section.group, -// &.separator.comma { -// foreground: $teal-300; -// } -// } -// } - -// &.log .meta.group { -// .punctuation { -// &.section.group, -// &.separator.comma { -// foreground: $brown-200; -// } -// } -// } - -// &.warn .meta.group { -// .punctuation { -// &.section.group, -// &.separator.comma { -// foreground: $deep-orange-300; -// } -// } +// .meta.function-call.console .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $green-a400; // } // } diff --git a/schemes/candyman/_constant.scss b/schemes/candyman/_constant.scss index bbc73777..21c0b63f 100644 --- a/schemes/candyman/_constant.scss +++ b/schemes/candyman/_constant.scss @@ -24,6 +24,13 @@ foreground: $deep-orange-a100; } +.constant.other.color { + foreground: $red-300; + .punctuation.definition.constant { + foreground: rgba($red-300, .5); + } +} + .constant.numeric { foreground: $amber-300; @@ -53,11 +60,6 @@ } } -.constant.other.color , -.punctuation.definition.constant { - foreground: $deep-purple-200; -} - .support.constant { foreground: $purple-a100; fontStyle: none; diff --git a/schemes/candyman/_css.scss b/schemes/candyman/_css.scss index f51056a2..b2eb5f68 100644 --- a/schemes/candyman/_css.scss +++ b/schemes/candyman/_css.scss @@ -11,13 +11,27 @@ // the License. .source.css { + // Tag selector. + .entity.name.tag { + foreground: $brown-200; + } + + // Class selector. + .entity.other.attribute-name.class { + foreground: $light-green-300; + + .punctuation { + foreground: rgba($light-green-300, .7); + } + } + // Attribute inside the attribute selector. .entity.other.attribute-name { - foreground: $purple-a100; + foreground: $deep-purple-200; } - .meta.attribute.builtin - .entity.other.attribute-name { + // Pseudo class. + .entity.other.pseudo-class { foreground: $purple-a100; } diff --git a/schemes/candyman/_destructuring.scss b/schemes/candyman/_destructuring.scss index 3a91e4ed..bf76a334 100644 --- a/schemes/candyman/_destructuring.scss +++ b/schemes/candyman/_destructuring.scss @@ -14,7 +14,7 @@ // &.section.brackets, // &.section.block, // &.separator.comma { -// foreground: $deep-orange-300; +// foreground: $gray-0; // fontStyle: italic bold; // } // } diff --git a/schemes/candyman/_flow.scss b/schemes/candyman/_flow.scss index 55e13740..5030ee57 100644 --- a/schemes/candyman/_flow.scss +++ b/schemes/candyman/_flow.scss @@ -17,37 +17,37 @@ } } -.punctuation.section.generic.begin, -.punctuation.section.generic.end { - &.flow { - // foreground: $deep-purple-200; - foreground: $light-green-400; - } +.storage.type.function.arrow.flow { + foreground: $brown-200; } -.punctuation.binding, -.punctuation.section.brackets.begin, -.punctuation.section.brackets.end { - &.flow { - foreground: $purple-a100; - } -} +// .punctuation.section.generic.begin, +// .punctuation.section.generic.end { +// &.flow { +// foreground: $light-green-400; +// } +// } -.punctuation.section.block.begin, -.punctuation.section.block.end { - &.flow { - foreground: $amber-a100; - } -} +// .punctuation.binding, +// .punctuation.section.brackets.begin, +// .punctuation.section.brackets.end { +// &.flow { +// foreground: $purple-a100; +// } +// } -.punctuation.separator.comma, -.punctuation.section.group.begin, -.punctuation.section.group.end { - &.flow { - foreground: $brown-200; - } -} +// .punctuation.section.block.begin, +// .punctuation.section.block.end { +// &.flow { +// foreground: $light-green-400; +// } +// } + +// .punctuation.separator.comma, +// .punctuation.section.group.begin, +// .punctuation.section.group.end { +// &.flow { +// foreground: $brown-200; +// } +// } -.string.unquoted.flow { - foreground: $brown-200; -} diff --git a/schemes/candyman/_function.scss b/schemes/candyman/_function.scss index 2a1c45eb..aa791c3d 100644 --- a/schemes/candyman/_function.scss +++ b/schemes/candyman/_function.scss @@ -14,15 +14,10 @@ .variable.function, .storage.type.function.arrow { foreground: $light-blue-a200; - fontStyle: bold; -} - -.storage.type.function.arrow.flow { - foreground: $brown-200; } -.variable.function { - fontStyle: none; +.entity.name.function { + fontStyle: bold; } .support.function { @@ -31,22 +26,20 @@ } .support.function.jest.matcher { - foreground: rgba($pink-a100, 1); + foreground: $pink-a100; } .variable.parameter { foreground: $amber-a100; } -// .meta.function { -// .punctuation.section.block { -// foreground: $light-blue-a200; -// } -// } - -// .meta.function.parameters .punctuation { -// &.section.group, -// &.separator.comma { -// foreground: $light-blue-a200; +// .meta.function, +// .meta.function-call { +// .punctuation { +// &.section.block, +// &.section.group, +// &.separator.comma { +// foreground: $light-blue-a200; +// } // } // } diff --git a/schemes/candyman/_generic.scss b/schemes/candyman/_generic.scss index dfdcab6b..0fe88dad 100644 --- a/schemes/candyman/_generic.scss +++ b/schemes/candyman/_generic.scss @@ -10,10 +10,6 @@ // License for the specific language governing permissions and limitations under // the License. -.variable.parameter.generic { - foreground: $pink-a200; -} - .punctuation.section.generic { foreground: $brown-200; } diff --git a/schemes/candyman/_markup.scss b/schemes/candyman/_markup.scss index 4205db3a..1e5711b9 100644 --- a/schemes/candyman/_markup.scss +++ b/schemes/candyman/_markup.scss @@ -24,6 +24,18 @@ foreground: $orange-300; } +// Attribute assignment. +.punctuation.separator.key-value.html { + foreground: $brown-200; +} + +.source.jsx { + // Interpolation “{}” inside JSX tags. + .punctuation.definition.template-expression { + foreground: $brown-200; + } +} + // Character reference. .constant.character.entity { foreground: $pink-a100; @@ -82,7 +94,7 @@ .meta.attribute.data .entity.other.attribute-name { foreground: $blue-grey-100; - fontStyle: italic; + fontStyle: italic bold; } // CDATA/DOCTYPE/JSX Component tag. diff --git a/schemes/candyman/_object.scss b/schemes/candyman/_object.scss index e7a20aac..332d01cb 100644 --- a/schemes/candyman/_object.scss +++ b/schemes/candyman/_object.scss @@ -10,23 +10,21 @@ // License for the specific language governing permissions and limitations under // the License. -// .meta.object-literal .punctuation { +// .meta.object-literal .meta.block .punctuation { // &.section.block, -// &.separator.comma, +// &.separator.comma { +// foreground: $light-green-400; +// } + +// &.section.brackets, // &.separator.key-value { -// foreground: $green-300; +// foreground: $purple-a100; // } // } .meta.object-literal.key { .string.unquoted { - foreground: $green-300; + foreground: $brown-200; background: $blue-gray-900; } } - -// .meta.object-literal.key.computed { -// .punctuation.section.brackets { -// foreground: $green-300; -// } -// } diff --git a/schemes/candyman/_punctuation.scss b/schemes/candyman/_punctuation.scss index 76bace16..5188ed5d 100644 --- a/schemes/candyman/_punctuation.scss +++ b/schemes/candyman/_punctuation.scss @@ -15,12 +15,8 @@ &.terminator { foreground: $green-a400; } -} -// .punctuation { -// &.section.block, -// &.section.group, -// &.separator.key-value { -// foreground: $blue-gray-200; -// } -// } + &.section.generic { + foreground: $brown-200; + } +} diff --git a/schemes/candyman/_string.scss b/schemes/candyman/_string.scss index 7ea805c6..1b450b24 100644 --- a/schemes/candyman/_string.scss +++ b/schemes/candyman/_string.scss @@ -21,7 +21,7 @@ .string.regexp { foreground: $teal-400; - background: $blue-gray-900; + background: rgba($teal-400, .1); .punctuation.definition.string { foreground: $teal-400; @@ -34,5 +34,5 @@ } .punctuation.definition.string { - foreground: rgba($pink-a200, .5); + foreground: $pink-a200; } diff --git a/schemes/candyman/_type.scss b/schemes/candyman/_type.scss index 9891b446..72f6d721 100644 --- a/schemes/candyman/_type.scss +++ b/schemes/candyman/_type.scss @@ -10,8 +10,7 @@ // License for the specific language governing permissions and limitations under // the License. -.entity.name, -.entity.other { +.entity.name { foreground: $amber-a100; } @@ -31,3 +30,9 @@ .support.type.object { foreground: $deep-purple-a100; } + +// .meta.class .punctuation { +// &.section.block { +// foreground: $amber-a100; +// } +// } diff --git a/schemes/candyman/_variable.scss b/schemes/candyman/_variable.scss index 7416900f..566c1184 100644 --- a/schemes/candyman/_variable.scss +++ b/schemes/candyman/_variable.scss @@ -25,7 +25,7 @@ foreground: $purple-a100; &.prototype { - foreground: $deep-orange-a100; + foreground: $gray-300; } } diff --git a/schemes/candyman/old.scss b/schemes/candyman/old.scss deleted file mode 100644 index 85ce79cc..00000000 --- a/schemes/candyman/old.scss +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -@import 'old/html'; -@import 'old/js'; -@import 'old/json'; -@import 'old/jsx'; -@import 'old/markup'; -@import 'old/md'; -@import 'old/mql'; -@import 'old/scss'; diff --git a/schemes/candyman/old/_html.scss b/schemes/candyman/old/_html.scss deleted file mode 100644 index c0901684..00000000 --- a/schemes/candyman/old/_html.scss +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -@import "html/embedded"; -@import "html/form"; -@import "html/other"; -@import "html/sectioning"; -@import "html/sectioning-root"; -@import "html/style"; diff --git a/schemes/candyman/old/_js.scss b/schemes/candyman/old/_js.scss deleted file mode 100644 index 99221851..00000000 --- a/schemes/candyman/old/_js.scss +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -@import "js/flowtype/module"; -@import "js/flowtype/operator"; -@import "js/flowtype/punctuation"; - -@import "js/decorator"; -@import "js/destructuring"; -@import "js/eslint"; -@import "js/export"; -@import "js/import"; -@import "js/operator"; diff --git a/schemes/candyman/old/_json.scss b/schemes/candyman/old/_json.scss deleted file mode 100644 index 9c072955..00000000 --- a/schemes/candyman/old/_json.scss +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -@import "json/operator"; -@import "json/level1"; -@import "json/level2"; -@import "json/level3"; -@import "json/level4"; -@import "json/level5"; -@import "json/level6"; -@import "json/level7"; diff --git a/schemes/candyman/old/_jsx.scss b/schemes/candyman/old/_jsx.scss deleted file mode 100644 index 8a3b4d42..00000000 --- a/schemes/candyman/old/_jsx.scss +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -@import "jsx/component"; -@import "jsx/operator"; diff --git a/schemes/candyman/old/_markup.scss b/schemes/candyman/old/_markup.scss deleted file mode 100644 index 875b8119..00000000 --- a/schemes/candyman/old/_markup.scss +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -@import "markup/attribute"; -@import "markup/cdata"; -@import "markup/data-attribute"; -@import "markup/doctype"; -@import "markup/operator"; -@import "markup/prolog"; diff --git a/schemes/candyman/old/_md.scss b/schemes/candyman/old/_md.scss deleted file mode 100644 index 5620746c..00000000 --- a/schemes/candyman/old/_md.scss +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -@import "md/code-block"; -@import "md/header"; diff --git a/schemes/candyman/old/_mql.scss b/schemes/candyman/old/_mql.scss deleted file mode 100644 index ce0fce3e..00000000 --- a/schemes/candyman/old/_mql.scss +++ /dev/null @@ -1,13 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -@import "mql/property"; diff --git a/schemes/candyman/old/_scss.scss b/schemes/candyman/old/_scss.scss deleted file mode 100644 index 677be290..00000000 --- a/schemes/candyman/old/_scss.scss +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -@import "scss/selector/base"; -@import "scss/selector/class"; -@import "scss/selector/id"; -@import "scss/selector/placeholder"; -@import "scss/selector/tag"; - -@import "scss/attribute"; -@import "scss/mixin"; -@import "scss/operator"; -@import "scss/punctuation"; -@import "scss/unit"; -@import "scss/variable"; diff --git a/schemes/candyman/old/html/_embedded.scss b/schemes/candyman/old/html/_embedded.scss deleted file mode 100644 index 6c917f95..00000000 --- a/schemes/candyman/old/html/_embedded.scss +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.tag.embedded { - .entity.name.tag { - foreground: $cyan-300; - } - - .punctuation.definition.tag { - foreground: rgba($cyan-300, .7); - } -} diff --git a/schemes/candyman/old/html/_form.scss b/schemes/candyman/old/html/_form.scss deleted file mode 100644 index 2290b019..00000000 --- a/schemes/candyman/old/html/_form.scss +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.tag.form { - .entity.name.tag { - foreground: $amber-100; - } - - .punctuation.definition.tag { - foreground: rgba($amber-100, .7); - } -} diff --git a/schemes/candyman/old/html/_other.scss b/schemes/candyman/old/html/_other.scss deleted file mode 100644 index 591d577f..00000000 --- a/schemes/candyman/old/html/_other.scss +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.tag { - foreground: $brown-200; -} - -.punctuation.definition.tag { - foreground: rgba($brown-200, .7); -} diff --git a/schemes/candyman/old/html/_sectioning-root.scss b/schemes/candyman/old/html/_sectioning-root.scss deleted file mode 100644 index 50c823dd..00000000 --- a/schemes/candyman/old/html/_sectioning-root.scss +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.tag.sectioning.root { - .entity.name.tag { - foreground: $purple-200; - } - - .punctuation.definition.tag { - foreground: rgba($purple-200, .7); - } -} diff --git a/schemes/candyman/old/html/_sectioning.scss b/schemes/candyman/old/html/_sectioning.scss deleted file mode 100644 index deeff89a..00000000 --- a/schemes/candyman/old/html/_sectioning.scss +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.tag.sectioning { - .entity.name.tag { - foreground: $pink-200; - } - - .punctuation.definition.tag { - foreground: rgba($pink-200, .7); - } -} diff --git a/schemes/candyman/old/html/_style.scss b/schemes/candyman/old/html/_style.scss deleted file mode 100644 index fdc23cee..00000000 --- a/schemes/candyman/old/html/_style.scss +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.tag.style { - .entity.name.tag { - foreground: $deep-orange-300; - } - - .punctuation.definition.tag { - foreground: rgba($deep-orange-300, .7); - } -} diff --git a/schemes/candyman/old/js/_decorator.scss b/schemes/candyman/old/js/_decorator.scss deleted file mode 100644 index 1ddf9aec..00000000 --- a/schemes/candyman/old/js/_decorator.scss +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.decorator, -.punctuation.definition.decorator { - foreground: $deep-purple-200; -} diff --git a/schemes/candyman/old/js/_destructuring.scss b/schemes/candyman/old/js/_destructuring.scss deleted file mode 100644 index ecc6f25f..00000000 --- a/schemes/candyman/old/js/_destructuring.scss +++ /dev/null @@ -1,28 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.destructuring { - .keyword, - .keyword.operator.other.association, - .punctuation.definition, - .punctuation.definition.array, - .punctuation.definition.object, - .punctuation.definition.property { - foreground: $gray-0; - } - - .object.property { - .entity.name.variable { - foreground: $gray-0; - } - } -} diff --git a/schemes/candyman/old/js/_eslint.scss b/schemes/candyman/old/js/_eslint.scss deleted file mode 100644 index b0b1c9b2..00000000 --- a/schemes/candyman/old/js/_eslint.scss +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.eslint { - .keyword.other, - .punctuation.definition { - foreground: $brown-200; - } -} - -.entity.name.eslint-rule { - foreground: $deep-purple-200; -} diff --git a/schemes/candyman/old/js/_export.scss b/schemes/candyman/old/js/_export.scss deleted file mode 100644 index 3c646359..00000000 --- a/schemes/candyman/old/js/_export.scss +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.export { - .entity.name.aliased, - .entity.name.ambiguous { - foreground: $brown-200; - } -} - -.punctuation.definition.export { - foreground: $gray-0; -} diff --git a/schemes/candyman/old/js/_import.scss b/schemes/candyman/old/js/_import.scss deleted file mode 100644 index e8ab8f0c..00000000 --- a/schemes/candyman/old/js/_import.scss +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.import { - .entity.name.aliased, - .entity.name.ambiguous { - foreground: $brown-200; - } -} - -.punctuation.definition.import { - foreground: $gray-0; -} diff --git a/schemes/candyman/old/js/_operator.scss b/schemes/candyman/old/js/_operator.scss deleted file mode 100644 index 92603c54..00000000 --- a/schemes/candyman/old/js/_operator.scss +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.keyword.operator.other { - &.generator { - foreground: $deep-purple-200; - } - - &.rest, - &.spread { - foreground: $gray-0; - } -} diff --git a/schemes/candyman/old/js/flowtype/_module.scss b/schemes/candyman/old/js/flowtype/_module.scss deleted file mode 100644 index 00c58b72..00000000 --- a/schemes/candyman/old/js/flowtype/_module.scss +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.flowtype { - .entity.name.module { - foreground: $light-green-300; - } -} diff --git a/schemes/candyman/old/js/flowtype/_operator.scss b/schemes/candyman/old/js/flowtype/_operator.scss deleted file mode 100644 index 4471be05..00000000 --- a/schemes/candyman/old/js/flowtype/_operator.scss +++ /dev/null @@ -1,64 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.flowtype { - .keyword.operator.other { - &.association, - &.cast, - &.contravariant, - &.covariant, - &.existential, - &.intersection, - &.nullable, - &.optional, - &.rest, - &.union { - foreground: $brown-200; - } - } - - .word { - .keyword.operator.other { - foreground: $pink-a100; - } - } - - .keyword.operator.other.utility { - foreground: $pink-a100; - } - - .comment { - .keyword.operator.other { - &.association, - &.cast, - &.contravariant, - &.covariant, - &.existential, - &.intersection, - &.nullable, - &.optional, - &.union { - foreground: rgba($brown-200, .7); - } - } - - .keyword.operator.other.utility { - foreground: rgba($pink-a100, .7); - } - - .word { - .keyword.operator.other { - foreground: rgba($pink-a100, .7); - } - } - } -} diff --git a/schemes/candyman/old/js/flowtype/_punctuation.scss b/schemes/candyman/old/js/flowtype/_punctuation.scss deleted file mode 100644 index 6b1299b3..00000000 --- a/schemes/candyman/old/js/flowtype/_punctuation.scss +++ /dev/null @@ -1,71 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.flowtype { - .punctuation.definition { - &.array, - &.array.begin, - &.array.end, - &.cast.begin, - &.cast.end, - &.function.parameters.begin, - &.function.parameters.end, - &.function.parameters, - &.function.result, - &.module.body.begin, - &.module.body.end, - &.nullable.begin, - &.nullable.end, - &.object.begin, - &.object.end, - &.object, - &.template.arguments.begin, - &.template.arguments, - &.template.parameters.begin, - &.template.parameters.end, - &.template.parameters, - &.template.arguments.end { - foreground: $brown-200; - } - } - - .comment.block { - .punctuation.definition { - foreground: rgba($brown-200, .7); - - &.array, - &.array.begin, - &.array.end, - &.cast.begin, - &.cast.end, - &.function.parameters.begin, - &.function.parameters.end, - &.function.parameters, - &.function.result, - &.module.body.begin, - &.module.body.end, - &.nullable.begin, - &.nullable.end, - &.object.begin, - &.object.end, - &.object, - &.template.arguments.begin, - &.template.arguments, - &.template.parameters.begin, - &.template.parameters.end, - &.template.parameters, - &.template.arguments.end { - foreground: rgba($brown-200, .7); - } - } - } -} diff --git a/schemes/candyman/old/json/_level1.scss b/schemes/candyman/old/json/_level1.scss deleted file mode 100644 index 4014090e..00000000 --- a/schemes/candyman/old/json/_level1.scss +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.level-1 { - .punctuation.definition.object.json, - .punctuation.definition.object.begin.json, - .punctuation.definition.object.end.json { - foreground: $purple-200; - } - - .string { - foreground: $cyan-300; - } - - .punctuation.definition.string { - foreground: rgba($cyan-300, .5); - } -} diff --git a/schemes/candyman/old/json/_level2.scss b/schemes/candyman/old/json/_level2.scss deleted file mode 100644 index d3bd80c7..00000000 --- a/schemes/candyman/old/json/_level2.scss +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.level-2 { - .punctuation.definition.object.json, - .punctuation.definition.object.begin.json, - .punctuation.definition.object.end.json { - foreground: $cyan-300; - } - - .string { - foreground: $light-green-400; - } - - .punctuation.definition.string { - foreground: rgba($light-green-300, .5); - } -} diff --git a/schemes/candyman/old/json/_level3.scss b/schemes/candyman/old/json/_level3.scss deleted file mode 100644 index 57e6b9a4..00000000 --- a/schemes/candyman/old/json/_level3.scss +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.level-3 { - .punctuation.definition.object.json, - .punctuation.definition.object.begin.json, - .punctuation.definition.object.end.json { - foreground: $light-green-400; - } - - .string { - foreground: $teal-300; - } - - .punctuation.definition.string { - foreground: rgba($teal-300, .7); - } -} diff --git a/schemes/candyman/old/json/_level4.scss b/schemes/candyman/old/json/_level4.scss deleted file mode 100644 index 5f99a720..00000000 --- a/schemes/candyman/old/json/_level4.scss +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.level-4 { - .punctuation.definition.object.json, - .punctuation.definition.object.begin.json, - .punctuation.definition.object.end.json { - foreground: $teal-300; - } - - .string { - foreground: $deep-orange-200; - } - - .punctuation.definition.string { - foreground: rgba($deep-orange-200, .5); - } -} diff --git a/schemes/candyman/old/json/_level5.scss b/schemes/candyman/old/json/_level5.scss deleted file mode 100644 index 1c738fdd..00000000 --- a/schemes/candyman/old/json/_level5.scss +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.level-5 { - .punctuation.definition.object.json, - .punctuation.definition.object.begin.json, - .punctuation.definition.object.end.json { - foreground: $deep-orange-200; - } - - .string { - foreground: $amber-200; - } - - .punctuation.definition.string { - foreground: rgba($amber-200, .5); - } -} diff --git a/schemes/candyman/old/json/_level6.scss b/schemes/candyman/old/json/_level6.scss deleted file mode 100644 index 794cae1b..00000000 --- a/schemes/candyman/old/json/_level6.scss +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.level-6 { - .punctuation.definition.object.json, - .punctuation.definition.object.begin.json, - .punctuation.definition.object.end.json { - foreground: $amber-200; - } - - .string { - foreground: $pink-200; - } - - .punctuation.definition.string { - foreground: rgba($pink-200, .5); - } -} diff --git a/schemes/candyman/old/json/_level7.scss b/schemes/candyman/old/json/_level7.scss deleted file mode 100644 index 484733f3..00000000 --- a/schemes/candyman/old/json/_level7.scss +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.level-7 { - .punctuation.definition.object.json, - .punctuation.definition.object.begin.json, - .punctuation.definition.object.end.json { - foreground: $pink-200; - } - - .string { - foreground: $purple-200; - } - - .punctuation.definition.string { - foreground: rgba($purple-200, .5); - } -} diff --git a/schemes/candyman/old/json/_operator.scss b/schemes/candyman/old/json/_operator.scss deleted file mode 100644 index 10c138f6..00000000 --- a/schemes/candyman/old/json/_operator.scss +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.keyword.operator.other.association.json { - foreground: $gray-0; -} diff --git a/schemes/candyman/old/jsx/_component.scss b/schemes/candyman/old/jsx/_component.scss deleted file mode 100644 index b22b8ead..00000000 --- a/schemes/candyman/old/jsx/_component.scss +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.component.jsx { - .entity.name.tag { - foreground: $amber-200; - } - - .punctuation.definition.tag { - foreground: rgba($amber-200, .7); - } -} diff --git a/schemes/candyman/old/jsx/_operator.scss b/schemes/candyman/old/jsx/_operator.scss deleted file mode 100644 index 1cd1cc4b..00000000 --- a/schemes/candyman/old/jsx/_operator.scss +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.source.jsx { - .keyword.operator { - foreground: rgba($purple-200, .7); - } -} diff --git a/schemes/candyman/old/markup/_attribute.scss b/schemes/candyman/old/markup/_attribute.scss deleted file mode 100644 index 38174c9a..00000000 --- a/schemes/candyman/old/markup/_attribute.scss +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.attribute { - foreground: $light-green-400; -} diff --git a/schemes/candyman/old/markup/_cdata.scss b/schemes/candyman/old/markup/_cdata.scss deleted file mode 100644 index 56ba3fcc..00000000 --- a/schemes/candyman/old/markup/_cdata.scss +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.section.cdata { - foreground: $pink-a100; - - .entity.name { - foreground: $pink-a100; - } - - .punctuation.definition { - foreground: rgba($pink-a100, .7); - } -} diff --git a/schemes/candyman/old/markup/_data-attribute.scss b/schemes/candyman/old/markup/_data-attribute.scss deleted file mode 100644 index a7284598..00000000 --- a/schemes/candyman/old/markup/_data-attribute.scss +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.data-attribute { - foreground: $gray-0; -} diff --git a/schemes/candyman/old/markup/_doctype.scss b/schemes/candyman/old/markup/_doctype.scss deleted file mode 100644 index 15df47e4..00000000 --- a/schemes/candyman/old/markup/_doctype.scss +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.declaration.doctype { - foreground: $pink-a100; - - .entity.name { - foreground: $pink-a100; - } - - .punctuation.definition.declaration { - foreground: rgba($pink-a100, .7); - } -} diff --git a/schemes/candyman/old/markup/_operator.scss b/schemes/candyman/old/markup/_operator.scss deleted file mode 100644 index 9c019a7c..00000000 --- a/schemes/candyman/old/markup/_operator.scss +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.text.html { - .keyword.operator { - foreground: rgba($purple-200, .7); - } -} diff --git a/schemes/candyman/old/markup/_prolog.scss b/schemes/candyman/old/markup/_prolog.scss deleted file mode 100644 index 3693684e..00000000 --- a/schemes/candyman/old/markup/_prolog.scss +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.instruction.prolog { - foreground: $pink-a100; - - .entity.name { - foreground: $pink-a100; - } - - .punctuation.definition.instruction { - foreground: rgba($pink-a100, .7); - } -} diff --git a/schemes/candyman/old/md/_code-block.scss b/schemes/candyman/old/md/_code-block.scss deleted file mode 100644 index a440e989..00000000 --- a/schemes/candyman/old/md/_code-block.scss +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.punctuation.definition.code-block { - foreground: $pink-a100; -} diff --git a/schemes/candyman/old/md/_header.scss b/schemes/candyman/old/md/_header.scss deleted file mode 100644 index b320feaa..00000000 --- a/schemes/candyman/old/md/_header.scss +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.level-1 { - .entity.name.header, - .punctuation.definition.header { - foreground: $purple-200; - } -} - -.level-2 { - .entity.name.header, - .punctuation.definition.header { - foreground: $cyan-300; - } -} - -.level-3 { - .entity.name.header, - .punctuation.definition.header { - foreground: $light-green-400; - } -} - -.level-4 { - .entity.name.header, - .punctuation.definition.header { - foreground: $teal-300; - } -} - -.level-5 { - .entity.name.header, - .punctuation.definition.header { - foreground: $deep-orange-200; - } -} - -.level-6 { - .entity.name.header, - .punctuation.definition.header { - foreground: $amber-200; - } -} diff --git a/schemes/candyman/old/mql/_property.scss b/schemes/candyman/old/mql/_property.scss deleted file mode 100644 index 8ea7af9e..00000000 --- a/schemes/candyman/old/mql/_property.scss +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.support -.entity.name.property.mql { - foreground: $deep-orange-a100; -} - diff --git a/schemes/candyman/old/scss/_attribute.scss b/schemes/candyman/old/scss/_attribute.scss deleted file mode 100644 index accb3a80..00000000 --- a/schemes/candyman/old/scss/_attribute.scss +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.source.css, -.source.scss { - .support { - .entity.name.attribute { - foreground: $light-green-300; - } - } - - .extension { - .entity.name.attribute { - foreground: $gray-300; - } - } -} diff --git a/schemes/candyman/old/scss/_mixin.scss b/schemes/candyman/old/scss/_mixin.scss deleted file mode 100644 index 95c126f1..00000000 --- a/schemes/candyman/old/scss/_mixin.scss +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.mixin, -.punctuation.definition.mixin { - foreground: $light-blue-300; -} diff --git a/schemes/candyman/old/scss/_operator.scss b/schemes/candyman/old/scss/_operator.scss deleted file mode 100644 index b5cf5103..00000000 --- a/schemes/candyman/old/scss/_operator.scss +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.source.scss { - .keyword.operator.other.comma, - .keyword.operator.other.association, - .keyword.other.terminator { - foreground: $gray-0; - } -} diff --git a/schemes/candyman/old/scss/_punctuation.scss b/schemes/candyman/old/scss/_punctuation.scss deleted file mode 100644 index 5801a16e..00000000 --- a/schemes/candyman/old/scss/_punctuation.scss +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.source.scss { - .punctuation.definition.body { - foreground: $gray-0; - } -} diff --git a/schemes/candyman/old/scss/_unit.scss b/schemes/candyman/old/scss/_unit.scss deleted file mode 100644 index cad19a38..00000000 --- a/schemes/candyman/old/scss/_unit.scss +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -source.scss { - .keyword.modifier.unit { - foreground: $deep-orange-a100; - } -} diff --git a/schemes/candyman/old/scss/_variable.scss b/schemes/candyman/old/scss/_variable.scss deleted file mode 100644 index 961236c4..00000000 --- a/schemes/candyman/old/scss/_variable.scss +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.source.scss { - .declaration .entity.name.variable { - foreground: $brown-200; - } -} diff --git a/schemes/candyman/old/scss/selector/_base.scss b/schemes/candyman/old/scss/selector/_base.scss deleted file mode 100644 index 09ffe979..00000000 --- a/schemes/candyman/old/scss/selector/_base.scss +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.selector { - foreground: $pink-a100; -} - -.punctuation.definition.selector { - foreground: rgba($pink-a100, .5); -} - -.extension { - .entity.name.selector { - foreground: $gray-300; - } - - .punctuation.definition.selector { - foreground: rgba($gray-300, .7); - } -} diff --git a/schemes/candyman/old/scss/selector/_class.scss b/schemes/candyman/old/scss/selector/_class.scss deleted file mode 100644 index d39fce5a..00000000 --- a/schemes/candyman/old/scss/selector/_class.scss +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.selector.class { - foreground: $cyan-300; -} - -.punctuation.definition.selector.class { - foreground: rgba($cyan-300, .7); -} diff --git a/schemes/candyman/old/scss/selector/_id.scss b/schemes/candyman/old/scss/selector/_id.scss deleted file mode 100644 index 609dd3d4..00000000 --- a/schemes/candyman/old/scss/selector/_id.scss +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.selector.id { - foreground: $pink-400; -} - -.punctuation.definition.selector.id { - foreground: rgba($pink-400, .7); -} diff --git a/schemes/candyman/old/scss/selector/_placeholder.scss b/schemes/candyman/old/scss/selector/_placeholder.scss deleted file mode 100644 index 98864f87..00000000 --- a/schemes/candyman/old/scss/selector/_placeholder.scss +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.selector.placeholder { - foreground: $orange-200; -} - -.punctuation.definition.selector.placeholder { - foreground: rgba($orange-200, .5); -} diff --git a/schemes/candyman/old/scss/selector/_tag.scss b/schemes/candyman/old/scss/selector/_tag.scss deleted file mode 100644 index aca40520..00000000 --- a/schemes/candyman/old/scss/selector/_tag.scss +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.selector.tag { - foreground: $brown-200; -} diff --git a/schemes/candyman/old/shared/_alias.scss b/schemes/candyman/old/shared/_alias.scss deleted file mode 100644 index 3bd072eb..00000000 --- a/schemes/candyman/old/shared/_alias.scss +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.alias { - foreground: $amber-100; -} diff --git a/schemes/candyman/old/shared/_ambiguous.scss b/schemes/candyman/old/shared/_ambiguous.scss deleted file mode 100644 index e67b55fb..00000000 --- a/schemes/candyman/old/shared/_ambiguous.scss +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.ambiguous { - foreground: $amber-100; -} diff --git a/schemes/candyman/old/shared/_array.scss b/schemes/candyman/old/shared/_array.scss deleted file mode 100644 index b2a6d54e..00000000 --- a/schemes/candyman/old/shared/_array.scss +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.type.array, -.punctuation.definition.array { - foreground: $deep-orange-a100; -} - -.punctuation.definition.array.access { - foreground: $orange-a100; -} diff --git a/schemes/candyman/old/shared/_block-cursor.scss b/schemes/candyman/old/shared/_block-cursor.scss deleted file mode 100644 index 020ea94c..00000000 --- a/schemes/candyman/old/shared/_block-cursor.scss +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.block-cursor { - foreground: $blue-grey-900; - background: $light-green-a200; -} diff --git a/schemes/candyman/old/shared/_cast.scss b/schemes/candyman/old/shared/_cast.scss deleted file mode 100644 index 46c3a66a..00000000 --- a/schemes/candyman/old/shared/_cast.scss +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.keyword.operator.cast, -.punctuation.definition.cast { - foreground: $brown-200; -} diff --git a/schemes/candyman/old/shared/_class.scss b/schemes/candyman/old/shared/_class.scss deleted file mode 100644 index edcab0c6..00000000 --- a/schemes/candyman/old/shared/_class.scss +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.class, -.punctuation.definition.class { - foreground: $light-green-300; -} - -.support { - .entity.name.class { - foreground: $deep-orange-a100; - } -} diff --git a/schemes/candyman/old/shared/_color.scss b/schemes/candyman/old/shared/_color.scss deleted file mode 100644 index f876c2b3..00000000 --- a/schemes/candyman/old/shared/_color.scss +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.punctuation.definition.color { - foreground: rgba($orange-200, .5); -} - -.constant.color { - foreground: $orange-200; -} - diff --git a/schemes/candyman/old/shared/_comment.scss b/schemes/candyman/old/shared/_comment.scss deleted file mode 100644 index 870ce4bc..00000000 --- a/schemes/candyman/old/shared/_comment.scss +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment, -.comment .punctuation.definition { - foreground: $blue-gray-500; -} - -.comment .entity { - &.email, - &.link { - foreground: $blue-gray-300; - } -} - diff --git a/schemes/candyman/old/shared/_constant.scss b/schemes/candyman/old/shared/_constant.scss deleted file mode 100644 index 4c412ba5..00000000 --- a/schemes/candyman/old/shared/_constant.scss +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.constant, -.punctuation.definition.constant { - foreground: $purple-200; -} - -.support { - .entity.name.constant { - foreground: $deep-orange-a100; - } -} diff --git a/schemes/candyman/old/shared/_datetime.scss b/schemes/candyman/old/shared/_datetime.scss deleted file mode 100644 index e677c564..00000000 --- a/schemes/candyman/old/shared/_datetime.scss +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.punctuation.definition.datetime { - foreground: rgba($orange-200, .5); -} - -.constant.datetime { - foreground: $orange-200; -} - diff --git a/schemes/candyman/old/shared/_embedded-expression.scss b/schemes/candyman/old/shared/_embedded-expression.scss deleted file mode 100644 index ca689ac6..00000000 --- a/schemes/candyman/old/shared/_embedded-expression.scss +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.keyword.operator.other.embedded-expression { - foreground: rgba($purple-200, .7); -} diff --git a/schemes/candyman/old/shared/_enumeration.scss b/schemes/candyman/old/shared/_enumeration.scss deleted file mode 100644 index e5721031..00000000 --- a/schemes/candyman/old/shared/_enumeration.scss +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.enum, -.punctuation.definition.enum { - foreground: $light-green-300; -} diff --git a/schemes/candyman/old/shared/_function.scss b/schemes/candyman/old/shared/_function.scss deleted file mode 100644 index 164c1f4b..00000000 --- a/schemes/candyman/old/shared/_function.scss +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.function.call { - .entity.name.variable { - foreground: $light-blue-300; - } -} - -.entity.name.function, -.keyword.operator.other.computed-function, -.punctuation.definition.function { - foreground: $light-blue-300; -} - -.support { - .entity.name.function, - .keyword.operator.other.computed-function, - .punctuation.definition.function { - foreground: $deep-orange-a100; - } -} - -.function.parameter { - .entity.name.variable, - .punctuation.definition.variable { - foreground: $orange-200; - } -} diff --git a/schemes/candyman/old/shared/_gitgutter.scss b/schemes/candyman/old/shared/_gitgutter.scss deleted file mode 100644 index 9bb1816e..00000000 --- a/schemes/candyman/old/shared/_gitgutter.scss +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.markup.deleted.git_gutter { - foreground: $red-300; -} - -.markup.inserted.git_gutter { - foreground: $light-green-300; -} - -.markup.changed.git_gutter { - foreground: $deep-orange-a100; -} - -.markup.ignored.git_gutter { - foreground: $cyan-300; -} - -.markup.untracked.git_gutter { - foreground: $gray-0; -} diff --git a/schemes/candyman/old/shared/_interface.scss b/schemes/candyman/old/shared/_interface.scss deleted file mode 100644 index 8fbabffc..00000000 --- a/schemes/candyman/old/shared/_interface.scss +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.interface, -.punctuation.definition.interface { - foreground: $light-green-300; -} - -.support { - .entity.name.interface { - foreground: $deep-orange-a100; - } -} diff --git a/schemes/candyman/old/shared/_keyword.scss b/schemes/candyman/old/shared/_keyword.scss deleted file mode 100644 index 158305cc..00000000 --- a/schemes/candyman/old/shared/_keyword.scss +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.keyword { - foreground: $pink-a100; -} - -.storage.modifier { - foreground: $deep-purple-200; - .keyword, - .keyword.operator { - foreground: $deep-purple-200; - } -} - -.storage.type { - foreground: $deep-purple-200; - .keyword { - foreground: $deep-purple-200; - } -} diff --git a/schemes/candyman/old/shared/_label.scss b/schemes/candyman/old/shared/_label.scss deleted file mode 100644 index c920a6f9..00000000 --- a/schemes/candyman/old/shared/_label.scss +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.label, -.punctuation.definition.label { - foreground: $gray-0; -} diff --git a/schemes/candyman/old/shared/_namespace.scss b/schemes/candyman/old/shared/_namespace.scss deleted file mode 100644 index f050302b..00000000 --- a/schemes/candyman/old/shared/_namespace.scss +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.namespace { - foreground: $brown-200; -} - -.punctuation.definition.namespace { - foreground: rgba($brown-200, .5); -} diff --git a/schemes/candyman/old/shared/_number.scss b/schemes/candyman/old/shared/_number.scss deleted file mode 100644 index 0231831d..00000000 --- a/schemes/candyman/old/shared/_number.scss +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.constant.numeric { - foreground: $orange-200; - - &.float { - foreground: $purple-200; - } - - &.binary { - foreground: $cyan-300; - } - - &.octal { - foreground: $lime-300; - } - - &.hex { - foreground: $gray-300; - } -} diff --git a/schemes/candyman/old/shared/_object.scss b/schemes/candyman/old/shared/_object.scss deleted file mode 100644 index 2afdf4ef..00000000 --- a/schemes/candyman/old/shared/_object.scss +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.punctuation.definition.object { - foreground: $light-green-300; -} - -.object { - .keyword.operator { - foreground: $light-green-300; - } - - &.property { - .entity.name.variable { - foreground: $brown-200; - } - } -} diff --git a/schemes/candyman/old/shared/_operator.scss b/schemes/candyman/old/shared/_operator.scss deleted file mode 100644 index 2a6a84dc..00000000 --- a/schemes/candyman/old/shared/_operator.scss +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.keyword { - &.operator { - foreground: $green-a200; - } -} - -.word { - .keyword.operator { - foreground: $pink-a100; - } -} diff --git a/schemes/candyman/old/shared/_preprocessor.scss b/schemes/candyman/old/shared/_preprocessor.scss deleted file mode 100644 index cf9c981a..00000000 --- a/schemes/candyman/old/shared/_preprocessor.scss +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.keyword.preprocessor { - foreground: $orange-200; -} diff --git a/schemes/candyman/old/shared/_punctuation.scss b/schemes/candyman/old/shared/_punctuation.scss deleted file mode 100644 index 8991a6e1..00000000 --- a/schemes/candyman/old/shared/_punctuation.scss +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.punctuation.definition { - foreground: $amber-100; -} - -.punctuation.other.property.access { - foreground: $light-green-300; -} - -.punctuation.definition.block, -.punctuation.definition.control { - foreground: $pink-a100; -} - -.punctuation.definition.extend-list.separator, -.punctuation.definition.implement-list.separator { - foreground: $purple-200; -} diff --git a/schemes/candyman/old/shared/_regex.scss b/schemes/candyman/old/shared/_regex.scss deleted file mode 100644 index 4932714f..00000000 --- a/schemes/candyman/old/shared/_regex.scss +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.string.unquoted.regex, -.string.unquoted.regex .punctuation.definition { - foreground: $teal-400; -} diff --git a/schemes/candyman/old/shared/_string.scss b/schemes/candyman/old/shared/_string.scss deleted file mode 100644 index 55605106..00000000 --- a/schemes/candyman/old/shared/_string.scss +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.string { - foreground: $red-300; - - .punctuation.definition { - foreground: rgba($red-300, .5); - } -} - -.constant.character { - foreground: $red-300; -} - -.constant.character.escape.a { - foreground: $cyan-200; -} - -.constant.character.escape.b { - foreground: $light-green-300; -} - -.string .variable { - &.a { - .entity.name.variable, - .punctuation.definition.variable, - .keyword.operator { - foreground: $purple-200; - } - } - - &.b { - .entity.name.variable, - .punctuation.definition.variable, - .keyword.operator { - foreground: $pink-300; - } - } - - .array.key { - foreground: $brown-300; - } -} diff --git a/schemes/candyman/old/shared/_structure.scss b/schemes/candyman/old/shared/_structure.scss deleted file mode 100644 index 8d7c99b8..00000000 --- a/schemes/candyman/old/shared/_structure.scss +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.struct, -.punctuation.definition.struct { - foreground: $light-green-300; -} - -.support { - .entity.name.struct { - foreground: $deep-orange-a100; - } -} diff --git a/schemes/candyman/old/shared/_template.scss b/schemes/candyman/old/shared/_template.scss deleted file mode 100644 index e2b63eb0..00000000 --- a/schemes/candyman/old/shared/_template.scss +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.punctuation.definition.template { - foreground: $brown-200; -} diff --git a/schemes/candyman/old/shared/_trait.scss b/schemes/candyman/old/shared/_trait.scss deleted file mode 100644 index b934fa78..00000000 --- a/schemes/candyman/old/shared/_trait.scss +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.trait, -.punctuation.definition.trait { - foreground: $light-green-300; -} - -.support { - .entity.name.trait { - foreground: $deep-orange-a100; - } -} diff --git a/schemes/candyman/old/shared/_type.scss b/schemes/candyman/old/shared/_type.scss deleted file mode 100644 index f826c862..00000000 --- a/schemes/candyman/old/shared/_type.scss +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.type, -.punctuation.definition.type { - foreground: $light-green-300; -} - -.support { - .entity.name.type, - .punctuation.definition.type { - foreground: $deep-orange-a100; - } -} diff --git a/schemes/candyman/old/shared/_unknown.scss b/schemes/candyman/old/shared/_unknown.scss deleted file mode 100644 index 8a62a15c..00000000 --- a/schemes/candyman/old/shared/_unknown.scss +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.unknown { - foreground: $amber-100; -} diff --git a/schemes/candyman/old/shared/_variable.scss b/schemes/candyman/old/shared/_variable.scss deleted file mode 100644 index b1662d65..00000000 --- a/schemes/candyman/old/shared/_variable.scss +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.entity.name.variable, -.punctuation.definition.variable { - foreground: $gray-400; - fontStyle: none; -} - -.support { - .entity.name.variable, - .punctuation.definition.variable { - foreground: $deep-orange-a100; - } -} diff --git a/schemes/candyman/old/shared/docblock/_alias.scss b/schemes/candyman/old/shared/docblock/_alias.scss deleted file mode 100644 index 822a8c6e..00000000 --- a/schemes/candyman/old/shared/docblock/_alias.scss +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .entity.name.alias { - foreground: rgba($amber-100, .7); - } -} diff --git a/schemes/candyman/old/shared/docblock/_class.scss b/schemes/candyman/old/shared/docblock/_class.scss deleted file mode 100644 index bb91d2a5..00000000 --- a/schemes/candyman/old/shared/docblock/_class.scss +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .entity.name.class, - .punctuation.definition.class { - foreground: rgba($light-green-300, .7); - } - - .support { - .entity.name.class { - foreground: rgba($deep-orange-a100, .7); - } - } -} diff --git a/schemes/candyman/old/shared/docblock/_constant.scss b/schemes/candyman/old/shared/docblock/_constant.scss deleted file mode 100644 index 671b4146..00000000 --- a/schemes/candyman/old/shared/docblock/_constant.scss +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .entity.name.constant, - .punctuation.definition.constant { - foreground: rgba($purple-200, .7); - } -} - -.comment .support { - .entity.name.constant, - .punctuation.definition.constant { - foreground: rgba($deep-orange-a100, .7); - } -} diff --git a/schemes/candyman/old/shared/docblock/_function.scss b/schemes/candyman/old/shared/docblock/_function.scss deleted file mode 100644 index 4c9738ea..00000000 --- a/schemes/candyman/old/shared/docblock/_function.scss +++ /dev/null @@ -1,34 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .entity.name.function, - .punctuation.definition.function { - foreground: rgba($light-blue-300, .7); - } -} - -.comment .support { - .entity.name.function, - .punctuation.definition.function { - foreground: rgba($deep-orange-a100, .7); - } -} - -.comment { - .function.parameter { - .entity.name.variable, - .punctuation.definition.variable { - foreground: rgba($orange-200, .7); - } - } -} diff --git a/schemes/candyman/old/shared/docblock/_import.scss b/schemes/candyman/old/shared/docblock/_import.scss deleted file mode 100644 index 23fa52a2..00000000 --- a/schemes/candyman/old/shared/docblock/_import.scss +++ /dev/null @@ -1,32 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .entity.name.namespace { - foreground: rgba($brown-200, .7); - } - - .punctuation.definition.namespace { - foreground: rgba($brown-200, .4); - } - - .import { - .entity.name.aliased, - .entity.name.ambiguous { - foreground: rgba($brown-200, .7); - } - } - - .punctuation.definition.import { - foreground: rgba($gray-0, .7); - } -} diff --git a/schemes/candyman/old/shared/docblock/_interface.scss b/schemes/candyman/old/shared/docblock/_interface.scss deleted file mode 100644 index dd2a9e34..00000000 --- a/schemes/candyman/old/shared/docblock/_interface.scss +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .entity.name.interface, - .punctuation.definition.interface { - foreground: rgba($light-green-300, .7); - } - - .support { - .entity.name.interface { - foreground: rgba($deep-orange-a100, .7); - } - } -} diff --git a/schemes/candyman/old/shared/docblock/_keyword.scss b/schemes/candyman/old/shared/docblock/_keyword.scss deleted file mode 100644 index 63981bf6..00000000 --- a/schemes/candyman/old/shared/docblock/_keyword.scss +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .keyword, - .punctuation.definition.keyword { - foreground: rgba($pink-a100, .7); - } -} diff --git a/schemes/candyman/old/shared/docblock/_modifier.scss b/schemes/candyman/old/shared/docblock/_modifier.scss deleted file mode 100644 index f097b6a4..00000000 --- a/schemes/candyman/old/shared/docblock/_modifier.scss +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .statement.modifier, - .storage.modifier, - .storage.type { - .keyword, - .keyword.operator, - .keyword.operator.other { - foreground: rgba($deep-purple-200, .7); - } - } -} diff --git a/schemes/candyman/old/shared/docblock/_namespace.scss b/schemes/candyman/old/shared/docblock/_namespace.scss deleted file mode 100644 index 7d419104..00000000 --- a/schemes/candyman/old/shared/docblock/_namespace.scss +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .entity.name.namespace { - foreground: rgba($brown-200, .7); - } - - .punctuation.definition.namespace { - foreground: rgba($brown-200, .4); - } -} diff --git a/schemes/candyman/old/shared/docblock/_number.scss b/schemes/candyman/old/shared/docblock/_number.scss deleted file mode 100644 index 9e1f7967..00000000 --- a/schemes/candyman/old/shared/docblock/_number.scss +++ /dev/null @@ -1,33 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”), .7) you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .constant.numeric { - foreground: rgba($orange-200, .7); - - &.float { - foreground: rgba($purple-200, .7); - } - - &.binary { - foreground: rgba($cyan-300, .7); - } - - &.octal { - foreground: rgba($lime-300, .7); - } - - &.hex { - foreground: rgba($gray-300, .7); - } - } -} diff --git a/schemes/candyman/old/shared/docblock/_operator.scss b/schemes/candyman/old/shared/docblock/_operator.scss deleted file mode 100644 index 37b54875..00000000 --- a/schemes/candyman/old/shared/docblock/_operator.scss +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment .keyword { - &.operator { - foreground: rgba($green-a200, .7); - } - - &.operator.other.word { - foreground: rgba($pink-a100, .7); - } -} diff --git a/schemes/candyman/old/shared/docblock/_punctuation.scss b/schemes/candyman/old/shared/docblock/_punctuation.scss deleted file mode 100644 index 7a3051c2..00000000 --- a/schemes/candyman/old/shared/docblock/_punctuation.scss +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .punctuation.definition.expression.group.a { - foreground: rgba($amber-100, .7); - } - - .punctuation.definition.expression.group.b { - foreground: rgba($brown-200, .7); - } - - .punctuation.definition.control { - foreground: rgba($pink-a100, .7); - } -} diff --git a/schemes/candyman/old/shared/docblock/_string.scss b/schemes/candyman/old/shared/docblock/_string.scss deleted file mode 100644 index 30f9db85..00000000 --- a/schemes/candyman/old/shared/docblock/_string.scss +++ /dev/null @@ -1,33 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .string { - foreground: rgba($red-300, .7); - - .punctuation.definition { - foreground: rgba($red-300, .7); - } - } - - .constant.character { - foreground: rgba($red-300, .7); - } - - .constant.character.escape.a { - foreground: rgba($cyan-200, .7); - } - - .constant.character.escape.b { - foreground: rgba($light-green-300, .7); - } -} diff --git a/schemes/candyman/old/shared/docblock/_structure.scss b/schemes/candyman/old/shared/docblock/_structure.scss deleted file mode 100644 index 5243c666..00000000 --- a/schemes/candyman/old/shared/docblock/_structure.scss +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .entity.name.struct, - .punctuation.definition.struct { - foreground: rgba($light-green-300, .7); - } - - .support { - .entity.name.struct { - foreground: rgba($deep-orange-a100, .7); - } - } -} diff --git a/schemes/candyman/old/shared/docblock/_type.scss b/schemes/candyman/old/shared/docblock/_type.scss deleted file mode 100644 index 495b5caa..00000000 --- a/schemes/candyman/old/shared/docblock/_type.scss +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .entity.name.type, - .punctuation.definition.type { - foreground: rgba($light-green-300, .7); - } -} - -.comment .support { - .entity.name.type, - .punctuation.definition.type { - foreground: rgba($deep-orange-a100, .7); - } -} diff --git a/schemes/candyman/old/shared/docblock/_variable.scss b/schemes/candyman/old/shared/docblock/_variable.scss deleted file mode 100644 index 55cf8d70..00000000 --- a/schemes/candyman/old/shared/docblock/_variable.scss +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -.comment { - .entity.name.variable, - .punctuation.definition.variable { - foreground: rgba($gray-400, .7); - } -} - -.comment .support { - .entity.name.variable, - .punctuation.definition.variable { - foreground: rgba($deep-orange-a100, .7); - } -} diff --git a/schemes/candyman/util/_palette.scss b/schemes/candyman/util/_palette.scss index c27187e1..b8b2939d 100644 --- a/schemes/candyman/util/_palette.scss +++ b/schemes/candyman/util/_palette.scss @@ -28,7 +28,6 @@ $amber-a400: #ffc400; $amber-a700: #ffab00; $amber: $amber-500; - $blue-50: #e3f2fd; $blue-100: #bbdefb; $blue-200: #90caf9; @@ -69,7 +68,6 @@ $blue-grey-800: #37474f; $blue-grey-900: #263238; $blue-grey: $blue-grey-500; - $brown-50: #efebe9; $brown-100: #d7ccc8; $brown-200: #bcaaa4; @@ -240,7 +238,6 @@ $lime-a400: #c6ff00; $lime-a700: #aeea00; $lime: $lime-500; - $orange-50: #fff3e0; $orange-100: #ffe0b2; $orange-200: #ffcc80; diff --git a/syntaxes/css3/combinator.sublime-syntax b/syntaxes/css3/combinator.sublime-syntax deleted file mode 100644 index 162acd42..00000000 --- a/syntaxes/css3/combinator.sublime-syntax +++ /dev/null @@ -1,38 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \+ - scope: punctuation.separator.combinator.sibling.direct.css.css3 - set: optional-selector-expression - - match: ~ - scope: punctuation.separator.combinator.sibling.css.css3 - set: optional-selector-expression - - match: \> - scope: punctuation.separator.combinator.child.css.css3 - set: optional-selector-expression - - optional-selector-expression: - - match: (?=[,{]) - pop: true - - match: (?=\S) - set: selector-expression - - selector-expression: - - include: Packages/Naomi/syntaxes/css3/selector-expression.sublime-syntax diff --git a/syntaxes/css3/comment.no-pop.sublime-syntax b/syntaxes/css3/comment.no-pop.sublime-syntax deleted file mode 100644 index 190b1f93..00000000 --- a/syntaxes/css3/comment.no-pop.sublime-syntax +++ /dev/null @@ -1,23 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?=/\*) - push: - - include: Packages/Naomi/syntaxes/css3/comment.sublime-syntax diff --git a/syntaxes/css3/comment.sublime-syntax b/syntaxes/css3/comment.sublime-syntax deleted file mode 100644 index d1bfd011..00000000 --- a/syntaxes/css3/comment.sublime-syntax +++ /dev/null @@ -1,21 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/css3/comment/block.sublime-syntax diff --git a/syntaxes/css3/comment/block.sublime-syntax b/syntaxes/css3/comment/block.sublime-syntax deleted file mode 100644 index c2548ca3..00000000 --- a/syntaxes/css3/comment/block.sublime-syntax +++ /dev/null @@ -1,37 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: /\* - scope: punctuation.definition.comment.begin.css.css3 - set: block - - block: - - meta_scope: comment.block.css.css3 - - include: email-no-pop - - include: link-no-pop - - match: \*/ - scope: punctuation.definition.comment.end.css.css3 - pop: true - - email-no-pop: - - include: Packages/Naomi/syntaxes/shared/email.no-pop.sublime-syntax - - link-no-pop: - - include: Packages/Naomi/syntaxes/shared/link.no-pop.sublime-syntax diff --git a/syntaxes/css3/constant.sublime-syntax b/syntaxes/css3/constant.sublime-syntax deleted file mode 100644 index 0e1aee4c..00000000 --- a/syntaxes/css3/constant.sublime-syntax +++ /dev/null @@ -1,274 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: color - - include: other - - color: - - match: | - (?xi) - (?> aliceblue - | antiquewhite - | aqua - | aquamarine - | azure - | beige - | bisque - | black - | blanchedalmond - | blue - | blueviolet - | brown - | burlywood - | cadetblue - | chartreuse - | chocolate - | coral - | cornflowerblue - | cornsilk - | crimson - | cyan - | dark - (?> blue - | cyan - | goldenrod - | gray - | grey - | green - | khaki - | magenta - | olivegreen - | orange - | orchid - | red - | salmon - | seagreen - | slateblue - | slategray - | slategrey - | turquoise - | violet - ) - | deeppink - | deepskyblue - | dimgray - | dimgrey - | dodgerblue - | firebrick - | floralwhite - | forestgreen - | fuchsia - | gainsboro - | ghostwhite - | gold(?:enrod)? - | gr[ae]y - | green(?:yellow)? - | honeydew - | hotpink - | indianred - | indigo - | ivory - | khaki - | lavender(?:blush)? - | lawngreen - | lemonchiffon - | light - (?> blue - | coral - | cyan - | goldenrodyellow - | gray - | grey - | green - | pink - | salmon - | seagreen - | skyblue - | slategray - | slategrey - | steelblue - | yellow - ) - | lime(?:green)? - | linen - | magenta - | maroon - | medium - (?> aquamarine - | blue - | orchid - | purple - | seagreen - | slateblue - | springgreen - | turquoise - | violetred - ) - | midnightblue - | mintcream - | mistyrose - | moccasin - | navajowhite - | navy - | oldlace - | olive(?:drab)? - | orange(?:red)? - | orchid - | palegoldenrod - | palegreen - | paleturquoise - | palevioletred - | papayawhip - | peachpuff - | peru - | pink - | plum - | powderblue - | purple - | rebeccapurple - | red - | rosybrown - | royalblue - | saddlebrown - | salmon - | sandybrown - | seagreen - | seashell - | sienna - | silver - | skyblue - | slateblue - | slategr[ae]y - | snow - | springgreen - | steelblue - | tan - | teal - | thistle - | tomato - | turquoise - | violet - | wheat - | white(?:smoke)? - | yellow(?:green)? - )\b - (?!-) - scope: support.constant.color.css.css3 - pop: true - - other: - - match: | - (?x) - (?> a4 - | absolute - | alternate - | all - | at - | auto-fill - | auto-fit - | auto - | baseline - | block - | bold - | border-box - | bottom - | button - | center - | checkbox - | content-box - | collapse - | column(?:-reverse)? - | contain - | cover - | dashed - | disabled - | dotted - | ease - (?:-(?>in|out))? - | ellipsis - | ellipse - | false - | fixed - | flex-start - | flex-end - | flex - | forwards - | hidden - | grid - | infinite - | inline-block - | inline-flex - | inline-grid - | inline-table - | inline - | inherit - | initial - | italic - | landscape - | left - | lining-nums - | list-item - | middle - | no-repeat - | none - | normal - | nowrap - | number - | only - | pointer - | print - | projection - | radio - | relative - | repeat - | reset - | right - | row(?:-reverse)? - | run-in - | screen - | search - | small-caps - | solid - | space-arround - | space-between - | speech - | sub - | submit - | system-ui - | super - | table-caption - | table-cell - | table-column(?:-group)? - | table-footer-group - | table-header-group - | table-row(?:-group)? - | table - | text-bottom - | text-top - | top - | transparent - | true - | tv - | visible - | uppercase - )\b - (?!-) - scope: support.constant.property-value.css.css3 - pop: true diff --git a/syntaxes/css3/custom-media-identifier.sublime-syntax b/syntaxes/css3/custom-media-identifier.sublime-syntax deleted file mode 100644 index 7f5e9d54..00000000 --- a/syntaxes/css3/custom-media-identifier.sublime-syntax +++ /dev/null @@ -1,29 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - customMedia: (--)([_[:alnum:]\-]*) - -contexts: - main: - - match: (?i){{customMedia}} - captures: - 0: support.type.custom-media.css.css3 - 1: punctuation.definition.custom-media.css.css3 - 2: support.type.custom-media.name.css.css3 - pop: true diff --git a/syntaxes/css3/feature-query-list.sublime-syntax b/syntaxes/css3/feature-query-list.sublime-syntax deleted file mode 100644 index 92b71c55..00000000 --- a/syntaxes/css3/feature-query-list.sublime-syntax +++ /dev/null @@ -1,57 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: "" - set: [ - meta-query-list, - delimiter, - meta-query, - query - ] - - delimiter: - - match: \, - scope: punctuation.separator.comma.css.css3 - push: [ meta-query, optional-query ] - - include: else-pop - - else-pop: - - match: (?=\S) - pop: true - - meta-query: - - meta_content_scope: meta.feature-query.css.css3 - - include: pop-now - - meta-query-list: - - meta_content_scope: meta.feature-query-list.css.css3 - - include: pop-now - - optional-query: - - match: (?=[,;()\[\]{}]) - pop: true - - include: query - - pop-now: - - match: "" - pop: true - - query: - - include: Packages/Naomi/syntaxes/css3/optional-feature-query.sublime-syntax diff --git a/syntaxes/css3/feature-query.sublime-syntax b/syntaxes/css3/feature-query.sublime-syntax deleted file mode 100644 index f877c9ef..00000000 --- a/syntaxes/css3/feature-query.sublime-syntax +++ /dev/null @@ -1,75 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: comment-no-pop - - include: logical-operator - - match: "" - set: [ optional-tail, head ] - - close-group: - - meta_scope: meta.group.css.css3 - - match: \) - scope: punctuation.section.group.end.j.fjsx15 - pop: true - - match: (?=\S) - push: - - include: logical-operator - - match: "" - set: [ meta-value, optional-value, delimiter, property ] - - comment-no-pop: - - include: Packages/Naomi/syntaxes/css3/comment.no-pop.sublime-syntax - - delimiter: - - include: Packages/Naomi/syntaxes/css3/ruleset/block-content.sublime-syntax#delimiter - - else-pop: - - match: (?=\S) - pop: true - - head: - - include: comment-no-pop - - include: open-group - - logical-operator: - - match: (?>and|not|or|only)\b - scope: keyword.operator.word.logical.feature-query.css.css3 - set: optional-feature-query - - meta-value: - - include: Packages/Naomi/syntaxes/css3/ruleset/block-content.sublime-syntax#meta-value - - open-group: - - match: \( - scope: punctuation.section.group.begin.css.css3 - set: close-group - - optional-feature-query: - - include: Packages/Naomi/syntaxes/css3/optional-feature-query.sublime-syntax - - optional-tail: - - include: logical-operator - - include: else-pop - - optional-value: - - include: Packages/Naomi/syntaxes/css3/ruleset/block-content.sublime-syntax#optional-value - - property: - - include: Packages/Naomi/syntaxes/css3/ruleset/block-content.sublime-syntax#property diff --git a/syntaxes/css3/function-call.sublime-syntax b/syntaxes/css3/function-call.sublime-syntax deleted file mode 100644 index 2f86116d..00000000 --- a/syntaxes/css3/function-call.sublime-syntax +++ /dev/null @@ -1,187 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* - -contexts: - main: - - include: calc - - include: domain - - include: regexp - - include: url-and-url-prefix - - include: var - - include: other - - include: fallback - - arg-begin: - - match: \( - scope: punctuation.section.group.begin.css.css3 - pop: true - - arg-close: - - match: \) - scope: punctuation.section.group.close.css.css3 - pop: true - - arguments: - - include: Packages/Naomi/syntaxes/css3/function-call/arguments.sublime-syntax - - calc: - - match: calc(?=\s*\() - scope: support.function.css.css3 - set: [ meta, calc-arg-close, arg-begin ] - - calc-arg-close: - - include: comma-no-pop - - include: arg-close - - match: (?=\S) - push: [ calc-optional-tail, calc-optional-head ] - - calc-close-group: - - match: \) - scope: punctuation.section.group.end.css.css3 - pop: true - - calc-optional-head: - # Group begin. - - match: \( - scope: punctuation.section.group.begin.css.css3 - push: [ - meta-group, - calc-close-group, - calc-optional-tail, - calc-optional-head - ] - # Value. - - include: Packages/Naomi/syntaxes/css3/value.sublime-syntax - - include: else-pop - - calc-optional-tail: - - match: "[+\\-*/]" - scope: keyword.operator.arithmetic.css.css3 - set: calc-optional-head - - include: else-pop - - comma-no-pop: - - match: \, - scope: punctuation.separator.comma.css.css3 - - domain: - - match: domain(?=\s*\() - scope: support.function.domain.css.css3 - set: [ meta, arg-close, url-argument, arg-begin ] - - else-pop: - - match: (?=\S) - pop: true - - fallback: - - match: | - (?xi) - (?= - {{cssIdentifier}} - \s*\( - ) - set: [ meta, arguments, identifier ] - - identifier: - - match: (?xi){{cssIdentifier}} - scope: variable.function.css.css3 - pop: true - - meta: - - meta_scope: >- - meta.function-call.css.css3 - meta.group.css.css3 - - include: pop-now - - meta-group: - - meta_scope: meta.group.css.css3 - - include: pop-now - - optional-var-value: - - include: Packages/Naomi/syntaxes/css3/property.sublime-syntax#custom - - include: Packages/Naomi/syntaxes/css3/value.sublime-syntax - - include: else-pop - - other: - - match: | - (?x) - (?> attr - | blur - | cubic-bezier - | format - | gray - | hsla? - | hwb - | image-set - | linear-gradient - | polygon - | radial-gradient - | repeating-(?>linear|radial)-gradient - | repeat - | rotate - | rgba? - ) - (?=\s*\() - scope: support.function.css.css3 - set: [ meta, arguments ] - - pop-now: - - match: "" - pop: true - - quoted-string: - - include: Packages/Naomi/syntaxes/css3/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/literal/string/single-quoted.sublime-syntax - - regexp: - - match: regexp(?=\s*\() - scope: support.function.regexp.css.css3 - set: [ meta, arg-close, quoted-string, arg-begin ] - - url-and-url-prefix: - - match: url-prefix(?=\s*\() - scope: support.function.url-prefix.css.css3 - set: [ meta, arg-close, url-argument, arg-begin ] - - match: url(?=\s*\() - scope: support.function.url.css.css3 - set: [ meta, arg-close, url-argument, arg-begin ] - - url-argument: - - match: (?=\)) - pop: true - - include: quoted-string - - match: | - (?x) - (?> \\["'()\s] - | [^"'()\s] - ) - scope: string.unquoted.css.css3 - - var: - - match: var(?=\s*\() - scope: support.function.regexp.css.css3 - set: [ meta, var-arg-close, arg-begin ] - - var-arg-close: - - include: comma-no-pop - - include: arg-close - - match: (?=\S) - push: optional-var-value diff --git a/syntaxes/css3/function-call/arguments.sublime-syntax b/syntaxes/css3/function-call/arguments.sublime-syntax deleted file mode 100644 index ebb989fd..00000000 --- a/syntaxes/css3/function-call/arguments.sublime-syntax +++ /dev/null @@ -1,36 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \( - scope: punctuation.section.group.begin.css.css3 - set: delimiter - - delimiter: - - meta_scope: meta.group.css.css3 - - match: \) - scope: punctuation.section.group.end.css.css3 - pop: true - - match: \, - scope: punctuation.separtor.comma.css.css3 - - match: (?=\S) - push: value - - value: - - include: Packages/Naomi/syntaxes/css3/value.sublime-syntax diff --git a/syntaxes/css3/keyframe-block-list.sublime-syntax b/syntaxes/css3/keyframe-block-list.sublime-syntax deleted file mode 100644 index 3a735880..00000000 --- a/syntaxes/css3/keyframe-block-list.sublime-syntax +++ /dev/null @@ -1,47 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \{ - scope: punctuation.section.block.begin.css.css3 - set: [ meta-block-list, block-list-end ] - - block-identifier: - - match: (?>from|to) - scope: keyword.keyframe-selector.css.css3 - pop: true - - include: Packages/Naomi/syntaxes/css3/literal/number.sublime-syntax - - block-list-end: - - match: \} - scope: punctuation.section.block.end.css.css3 - pop: true - - match: (?=\S) - push: [ ruleset-block, block-identifier ] - - meta-block-list: - - meta_scope: meta.block-list.css.css3 - - include: pop-now - - pop-now: - - match: "" - pop: true - - ruleset-block: - - include: Packages/Naomi/syntaxes/css3/ruleset/block.sublime-syntax diff --git a/syntaxes/css3/literal/color.sublime-syntax b/syntaxes/css3/literal/color.sublime-syntax deleted file mode 100644 index c7ea8dbd..00000000 --- a/syntaxes/css3/literal/color.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - hex: "[0-9a-f]" - -contexts: - main: - # RGB - - match: (?i)(\#)({{hex}}{3}|{{hex}}{6})\b - scope: constant.other.color.rgb-value.css - captures: - 1: punctuation.definition.constant.css - pop: true - # RGBA. - - match: (?i)(\#)({{hex}}{4}|{{hex}}{8})\b - scope: constant.other.color.rgba-value.css - captures: - 1: punctuation.definition.constant.css - pop: true diff --git a/syntaxes/css3/literal/number.sublime-syntax b/syntaxes/css3/literal/number.sublime-syntax deleted file mode 100644 index e169d40f..00000000 --- a/syntaxes/css3/literal/number.sublime-syntax +++ /dev/null @@ -1,115 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - literalDecimal: "[0-9]+" - - literalFloat: | - [+-]? - (?> [0-9]*[.]{{literalDecimal}} - | {{literalDecimal}}[.][0-9]+ - ) - - scientificNotation: | - (?> {{literalFloat}} - | [+-]?{{literalDecimal}} - ) - [e][+-]? - {{literalDecimal}} - - angleUnits: (?>deg|grad|rad|turn) - - # Hz, kHz - frequencyUnits: (?>k?Hz) - - relativeLengthUnits: | - # cap, ch - (?> c(?>ap|h) - # em, ex - | e[mx] - | fr - | ic - | lh - # rem, rlh - | r(?>em|lh) - # vb, vh, vi, vmax, vmin, vw - | v(?>[bhiw]|m(?>ax|in)) - | x - ) - - absoluteLengthUnits: | - (?> cm - | in - | mm - # pc, pt, px - | p[ctx] - | q - ) - - resolutionUnits: dp(?>i|cm|px) - - timeUnits: (?>s|ms) - - unit: | - (?> % - | {{absoluteLengthUnits}}\b - | {{relativeLengthUnits}}\b - | {{angleUnits}}\b - | {{resolutionUnits}}\b - | {{timeUnits}}\b - | {{frequencyUnits}}\b - ) - -contexts: - main: - - include: float - - include: integer - - float: - - match: (?xi){{scientificNotation}}({{unit}})? - captures: - 0: constant.numeric.float.scientific.css.css3 - 1: keyword.other.unit.css.css3 - pop: true - - match: (?xi){{literalFloat}}({{unit}})? - captures: - 0: constant.numeric.float.css.css3 - 1: keyword.other.unit.css.css3 - pop: true - - integer: - - match: (?xi)-?0b[01]+({{unit}})? - captures: - 0: constant.numeric.binary.css.css3 - 1: keyword.other.unit.css.css3 - pop: true - - match: (?xi)-?0[0-7]+({{unit}})? - captures: - 0: constant.numeric.octal.css.css3 - 1: keyword.other.unit.css.css3 - pop: true - - match: (?xi)-?0[x][0-9a-f]+({{unit}})? - captures: - 0: constant.numeric.hex.css.css3 - 1: keyword.other.unit.css.css3 - pop: true - - match: (?xi)(?:-?[1-9][0-9]*|0)({{unit}})? - captures: - 0: constant.numeric.decimal.css.css3 - 1: keyword.other.unit.css.css3 - pop: true diff --git a/syntaxes/css3/literal/ratio.sublime-syntax b/syntaxes/css3/literal/ratio.sublime-syntax deleted file mode 100644 index 2f92d482..00000000 --- a/syntaxes/css3/literal/ratio.sublime-syntax +++ /dev/null @@ -1,27 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: ([0-9]+)\s*(/)\s*([0-9]) - captures: - 0: constant.numeric.ratio.css.css3 - 1: constant.numeric.decimal.css.css3 - 2: keyword.operator.arithmetic.ratio.css.css3 - 3: constant.numeric.decimal.css.css3 - pop: true diff --git a/syntaxes/css3/literal/string/double-quoted.sublime-syntax b/syntaxes/css3/literal/string/double-quoted.sublime-syntax deleted file mode 100644 index d49ddb49..00000000 --- a/syntaxes/css3/literal/string/double-quoted.sublime-syntax +++ /dev/null @@ -1,29 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \" - scope: punctuation.definition.string.begin.css.css3 - set: string - - string: - - meta_scope: string.quoted.double.css.css3 - - match: \" - scope: punctuation.definition.string.end.css.css3 - pop: true diff --git a/syntaxes/css3/literal/string/single-quoted.sublime-syntax b/syntaxes/css3/literal/string/single-quoted.sublime-syntax deleted file mode 100644 index 55a5e34f..00000000 --- a/syntaxes/css3/literal/string/single-quoted.sublime-syntax +++ /dev/null @@ -1,29 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \' - scope: punctuation.definition.string.begin.css.css3 - set: string - - string: - - meta_scope: string.quoted.single.css.css3 - - match: \' - scope: punctuation.definition.string.end.css.css3 - pop: true diff --git a/syntaxes/css3/literal/string/unquoted.sublime-syntax b/syntaxes/css3/literal/string/unquoted.sublime-syntax deleted file mode 100644 index 8b54f83b..00000000 --- a/syntaxes/css3/literal/string/unquoted.sublime-syntax +++ /dev/null @@ -1,23 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?!--)[_[:alnum:]\-]+ - scope: string.unquoted.css.css3 - pop: true diff --git a/syntaxes/css3/media-query-feature-expression.sublime-syntax b/syntaxes/css3/media-query-feature-expression.sublime-syntax deleted file mode 100644 index 999458dc..00000000 --- a/syntaxes/css3/media-query-feature-expression.sublime-syntax +++ /dev/null @@ -1,81 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: comment-no-pop - - match: "" - set: [ optional-tail, head ] - - comment-no-pop: - - include: Packages/Naomi/syntaxes/css3/comment.no-pop.sublime-syntax - - custom-property: - - include: Packages/Naomi/syntaxes/css3/custom-media-identifier.sublime-syntax - - else-pop: - - match: (?=\S) - pop: true - - head: - - include: comment-no-pop - - include: custom-property - - match: | - (?x) - ((?> any-(?>pointer|hover) - | aspect-ratio - | color(?:-(?>gamut|index))? - | device-(?>aspect-ratio|height|width) - | display-mode - | grid - | height - | hover - | inverted-colors - | light-level - | max-(?>height|width) - | min-(?>height|width) - | orientation - | overflow-(?>block|inline) - | pointer - | resolution - | scan - | scripting - | update - | width - )) - (?:\s*(:))? - captures: - 1: support.type.media-feature.css.css3 - 2: punctuation.separator.key-value.css.css3 - pop: true - - include: value - - optional-tail: - - include: comment-no-pop - - match: | - (?x) - (?> <> - | <=? - | >=? - ) - scope: keyword.operator.comparison.css.css3 - set: head - - include: else-pop - - value: - - include: Packages/Naomi/syntaxes/css3/value.sublime-syntax diff --git a/syntaxes/css3/media-query-list.sublime-syntax b/syntaxes/css3/media-query-list.sublime-syntax deleted file mode 100644 index f67962a5..00000000 --- a/syntaxes/css3/media-query-list.sublime-syntax +++ /dev/null @@ -1,54 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: "" - set: [ - meta-query-list, - delimiter, - meta-query, - query - ] - - delimiter: - # Escape. - - match: (?=[;{]) - pop: true - # Delimiter. - - match: \, - scope: punctuation.separator.comma.css.css3 - push: [ meta-query, optional-query ] - - meta-query: - - meta_content_scope: meta.media-query.css.css3 - - include: pop-now - - meta-query-list: - - meta_content_scope: meta.media-query-list.css.css3 - - include: pop-now - - optional-query: - - include: Packages/Naomi/syntaxes/css3/optional-media-query.sublime-syntax - - pop-now: - - match: "" - pop: true - - query: - - include: Packages/Naomi/syntaxes/css3/media-query.sublime-syntax diff --git a/syntaxes/css3/media-query.sublime-syntax b/syntaxes/css3/media-query.sublime-syntax deleted file mode 100644 index 554dedbb..00000000 --- a/syntaxes/css3/media-query.sublime-syntax +++ /dev/null @@ -1,86 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: comment-no-pop - - include: logical-operator - - match: "" - set: [ optional-tail, head ] - - close-group: - - meta_scope: meta.group.css.css3 - - match: \) - scope: punctuation.section.group.end.js.fjsx15 - pop: true - - match: (?=\S) - push: - - include: logical-operator - - include: feature-expression - - comment-no-pop: - - include: Packages/Naomi/syntaxes/css3/comment.no-pop.sublime-syntax - - else-pop: - - match: (?=\S) - pop: true - - feature-expression: - - include: Packages/Naomi/syntaxes/css3/media-query-feature-expression.sublime-syntax - - head: - - include: comment-no-pop - - include: type - - include: open-group - - logical-operator: - - match: (?>and|not|or|only)\b - scope: keyword.operator.word.logical.media-query.css.css3 - set: optional-media-query - - open-group: - - match: \( - scope: punctuation.section.group.begin.css.css3 - set: close-group - - optional-media-query: - - include: Packages/Naomi/syntaxes/css3/optional-media-query.sublime-syntax - - optional-tail: - - include: comment-no-pop - - include: logical-operator - - include: else-pop - - type: - # Media type. - - match: | - (?x) - (?> all - | aural - | braille - | embossed - | handheld - | print - | projection - | screen - | speech - | tty - | tv - )\b - scope: support.constant.media.css.css3 - pop: true diff --git a/syntaxes/css3/optional-feature-query.sublime-syntax b/syntaxes/css3/optional-feature-query.sublime-syntax deleted file mode 100644 index 2fc78289..00000000 --- a/syntaxes/css3/optional-feature-query.sublime-syntax +++ /dev/null @@ -1,29 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: expression-escape - - match: (?=\S) - set: - - include: Packages/Naomi/syntaxes/css3/feature-query.sublime-syntax - - expression-escape: - - match: (?=[,;:)\]}]) - pop: true - diff --git a/syntaxes/css3/optional-media-query-list.sublime-syntax b/syntaxes/css3/optional-media-query-list.sublime-syntax deleted file mode 100644 index 2b24f708..00000000 --- a/syntaxes/css3/optional-media-query-list.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: expression-escape - - match: (?=\S) - set: - - include: Packages/Naomi/syntaxes/css3/media-query-list.sublime-syntax - - expression-escape: - - match: (?=[,;:)\[\]{}]) - pop: true diff --git a/syntaxes/css3/optional-media-query.sublime-syntax b/syntaxes/css3/optional-media-query.sublime-syntax deleted file mode 100644 index d965478c..00000000 --- a/syntaxes/css3/optional-media-query.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: expression-escape - - match: (?=\S) - set: - - include: Packages/Naomi/syntaxes/css3/media-query.sublime-syntax - - expression-escape: - - match: (?=[,;:)\]{}]) - pop: true diff --git a/syntaxes/css3/optional-page-selector-list.sublime-syntax b/syntaxes/css3/optional-page-selector-list.sublime-syntax deleted file mode 100644 index 54e23c68..00000000 --- a/syntaxes/css3/optional-page-selector-list.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: expression-escape - - match: (?=\S) - set: - - include: Packages/Naomi/syntaxes/css3/page-selector-list.sublime-syntax - - expression-escape: - - match: (?=[,;)\[\]{}]) - pop: true diff --git a/syntaxes/css3/optional-value.sublime-syntax b/syntaxes/css3/optional-value.sublime-syntax deleted file mode 100644 index 359dcbeb..00000000 --- a/syntaxes/css3/optional-value.sublime-syntax +++ /dev/null @@ -1,25 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?=[,;()\[\]{}]) - pop: true - - match: (?=\S) - set: - - include: Packages/Naomi/syntaxes/css3/value.sublime-syntax diff --git a/syntaxes/css3/page-selector-list.sublime-syntax b/syntaxes/css3/page-selector-list.sublime-syntax deleted file mode 100644 index 33480cd1..00000000 --- a/syntaxes/css3/page-selector-list.sublime-syntax +++ /dev/null @@ -1,71 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* - -contexts: - main: - - match: "" - set: [ - meta-selector-list, - delimiter, - meta-selector, - selector - ] - - delimiter: - - match: \, - scope: punctuation.separator.comma.css.css3 - push: [ meta-selector, optional-selector ] - - include: else-pop - - else-pop: - - match: (?=\S) - pop: true - - meta-selector: - - meta_content_scope: meta.page-selector.css.css3 - - include: pop-now - - meta-selector-list: - - meta_content_scope: meta.page-selector-list.css.css3 - - include: pop-now - - optional-selector: - - match: (?=[,;()\[\]{}]) - pop: true - - include: selector - - pop-now: - - match: "" - pop: true - - selector: - # Named page. - - match: | - (?xi) - {{cssIdentifier}}\b - scope: entity.name.page.css.css3 - # Pseudo class. - - match: (:)((?>blank|first|left|recto|right|verso)) - captures: - 1: punctuation.definition.entity.css.css3 - 2: entity.other.pseudo-class.css.css3 - pop: true - - include: else-pop diff --git a/syntaxes/css3/page/block-content.sublime-syntax b/syntaxes/css3/page/block-content.sublime-syntax deleted file mode 100644 index 12a55481..00000000 --- a/syntaxes/css3/page/block-content.sublime-syntax +++ /dev/null @@ -1,91 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* - -contexts: - main: - - match: | - (?x) - (@) - ((?> bottom - (?:- - (?> center - | left(?:-corner)? - | right(?:-corner)? - ) - )? - | left - (?:-(?>bottom|corner|middle|top))? - | right - (?:-(?>bottom|corner|middle|top))? - | top - (?:- - (?> center - | left(?:-corner)? - | right(?:-corner)? - ) - )? - )) - captures: - 1: punctuation.definition.keyword.css.css3 - 2: keyword.control.at-rule.css.css3 - set: [ meta-margin-box, margin-box-content ] - # Properties. - - match: | - (?xi) - (?={{cssIdentifier}}) - set: [ delimiter, property ] - - comment-no-pop: - - include: Packages/Naomi/syntaxes/css3/comment.no-pop.sublime-syntax - - delimiter: - - include: comment-no-pop - - match: ":" - scope: punctuation.separator.key-value.css.css3 - set: [ meta-property-value, optional-value-no-pop ] - - margin-box-content: - - include: Packages/Naomi/syntaxes/css3/ruleset/block.sublime-syntax - - meta-margin-box: - - meta_scope: meta.margin-box.css.css3 - - include: pop-now - - meta-property-value: - - meta_scope: meta.property-value.css.css3 - - include: pop-now - - optional-value-no-pop: - - match: (?=[;()\[\]{}]) - pop: true - - match: \, - scope: punctuation.separator.sequence.css.css3 - - match: (?=\S) - push: - - include: Packages/Naomi/syntaxes/css3/value.sublime-syntax - - pop-now: - - match: "" - pop: true - - property: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/css3/property.sublime-syntax diff --git a/syntaxes/css3/page/block.sublime-syntax b/syntaxes/css3/page/block.sublime-syntax deleted file mode 100644 index f5cc2bb2..00000000 --- a/syntaxes/css3/page/block.sublime-syntax +++ /dev/null @@ -1,45 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \{ - scope: punctuation.section.property-list.begin.css.css3 - set: delimiter - - comment-no-pop: - - include: Packages/Naomi/syntaxes/css3/comment.no-pop.sublime-syntax - - delimiter: - - meta_scope: >- - meta.at-rule.page.body.css.css3 - meta.property-list.css.css3 - - include: comment-no-pop - # Close. - - match: \} - scope: punctuation.section.property-list.end.css.css3 - pop: true - # Delimiter. - - match: ; - scope: punctuation.terminator.css.css3 - # Actual rules. - - match: "" - push: - - include: Packages/Naomi/syntaxes/css3/ruleset/block-content.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/css3/property.sublime-syntax b/syntaxes/css3/property.sublime-syntax deleted file mode 100644 index 5b1a3576..00000000 --- a/syntaxes/css3/property.sublime-syntax +++ /dev/null @@ -1,787 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* - - customProperty: (--)([_[:alnum:]\-]*) - - coreProperties: | - (?> additive-symbols - # align-content, align-items, align-self - | align-(?>content|items|self) - | alignment-baseline - | all - | animation - (?:- - # animation-delay - (?> delay - # anmation-direction - | direction - # animation-duration - | duration - # animation-fill-mode - | fill-mode - # aniation-iteration-count - | iteration-count - # aniamtion-name - | name - # animation-play-state - | play-state - # animation-timing-functin - | timing-function - ) - )? - | appearance - | azimuth - | background - (?:- - # background-attachment - (?> attachment - # background-blend-mode - | blend-mode - # background-clip - | clip - # background-color - | color - # background-image, background-image-transform - | image(?:-transform)? - # background-origin - | origin - # background-position - | position - # background-repeat - | repeat - # background-size - | size - ) - )? - | baseline-shift - | block- - # block-size - (?> size - # block-step - | step - # block-step-align, block-step-insert, block-steap-round, - # block-step-size - (?:-(?>align|insert|round|size))? - ) - # bookmark-label, bookmark-level, bookmark-state - | bookmark-(?>label|level|state) - | border - (?:- - # border-block - (?> block - (?:- - # border-block-color - (?> color - # border-block-end, border-block-end-color, - # border-block-end-style, border-block-end-width - | end(?:-(?>color|style|width))? - # border-block-start, border-block-start-color, - # border-block-start-style, border-block-start-width - | start(?:-(?>color|style|width))? - # border-block-style - | style - # border-block-width - | width - ) - )? - # border-bottom - | bottom - (?:- - # border-bottom-color - (?> color - # border-bottom-left-radius - | left-radius - # border-bottom-right-radius - | right-radius - # border-bottom-style - | style - # border-bottom-width - | width - ) - )? - # border-boundary - | boundary - # border-collapse - | collapse - # border-color - | color - # border-image - | image - (?:- - # border-image-outset - (?> outset - # border-image-repeat - | repeat - # border-image-slice - | slice - # border-image-source - | source - # border-image-transform - | transform - # border-image-width - | width - ) - )? - # border-inline - | inline - (?:- - # border-inline-color - (?> color - # border-inline-end, border-inline-end-color, - # border-inline-end-style, border-inline-end-width - | end(?:-(?>color|style|width))? - # border-inline-start, border-inline-start-color, - # border-inline-start-style, border-inline-start-width - | start(?:-(?>color|style|width))? - # border-inline-style - | style - # border-inline-width - | width - ) - )? - # border-left - | left - (?:- - # border-left-color - (?> color - # border-left-style - | style - # border-left-width - | width - ) - )? - # border-right - | right - (?:- - # border-right-color - (?> color - # border-right-style - | style - # border-right-width - | width - ) - )? - # border-radius - | radius - # border-style - | style - # border-spacing - | spacing - # border-top - | top - (?:- - # border-top-color - (?> color - # border-top-left-radius - | left-radius - # border-top-right-radius - | right-radius - # border-top-style - | style - # border-top-width - | width - ) - )? - # border-width - | width - ) - )? - | bottom - # box-decoration-break, box-shadow, box-sizing, box-snap - | box-(?>decoration-break|shadow|sizing|snap) - # break-after, break-before, break-inside - | break(?:-(?>after|before|inside))? - | caption-side - # caret, caret-color, caret-shape - | caret(?:-(?>color|shape))? - | chains - | clear - # clip, clip-path, clip-rule - | clip(?:-(?>path|rule))? - # color, color-adjust, color-interpolation-filters - | color(?:-(?>adjust|interpolation-filters))? - | column - # colums - (?> s - | - - # column-count - (?> count - # column-fill - | fill - # column-gap - | gap - # column-rule, column-rule-color, column-rule-style, - # column-rule-width - | rule(?:-(?>color|style|width))? - # column-span - | span - # column-width - | width - ) - ) - | contain - | content - | continue - # counter-increment, counter-reset, counter-set - | counter(?:-(?>increment|reset|set)) - # cue, cue-after, cue-before - | cue(?:-(?>after|before))? - | cursor - | direction - | display - | dominant-baseline - | elevation - | empty-cells - | fallback - | fill - (?:- - # fill-break - (?> break - # fill-color - | color - # fill-image - | image - # fill-opacity - | opacity - # fill-origin - | origin - # fill-position - | position - # fill-repeat - | repeat - # fill-rule - | rule - # fill-size - | size - ) - )? - | filter - # flex, flex-basis, flex-direction, flex-flow, flex-grow, flex-shrink, - # flex-wrap - | flex(?:-(?>basis|direction|flow|grow|shrink|wrap))? - # float, float-defer, float-offset, float-reference - | float(?:-(?>defer|offset|reference))? - # flood-color, flood-opacity - | flood-(?>color|opacity) - # flow, flow-from, flow-into - | flow(?:-(?>from|into))? - | font - (?:- - # font-family - (?> family - # font-feature-settings - | feature-settings - # font-kerning - | kerning - # font-language-override - | language-override - # font-max-size - | max-size - # font-min-size - | min-size - # font-optical-sizing - | optical-sizing - # font-pallete - | palette - # font-presentation - | presentation - # font-size, font-size-adjust - | size(?:-adjust)? - # font-stretch - | stretch - # font-style - | style - # font-synthesis - | synthesis - # font-variant - | variant - (?:- - # font-variant-alternates - (?> alternates - # font-variant-caps - | caps - # font-variant-asian - | east-asian - # font-variant-ligatures - | ligatures - # font-variant-numeric - | numeric - # font-variant-position - | position - ) - )? - # font-variation-settings - | variation-settings - # font-weight - | weight - ) - )? - # footnote-display, footnote-policy - | footnote-(?>display|policy) - | gap - | glyph-orientation-vertical - | hanging-punctuation - | height - | hyphenate- - # hyphenate-character - (?> character - # hyphenate-limit-chars, hyphenate-limit-last, hyphenate-limit-lines, - # hyphenate-limit-zone - | limit-(?>chars|last|lines|zone) - ) - | hyphens - # image-orientation, image-resolution - | image(?:-(?>orientation|resolution)) - # initial-letter, initial-align, initial-wrap - | initial-letter(?:-(?>align|wrap))? - | inline-size - | inset - (?:- - # inset-block-end, inset-block-start - (?> block(?:-(?>end|start))? - # inset-inline-end, inset-inline-start - | inline(?:-(?>end|start))? - ) - )? - | isolation - # justify-content, justify-items, justify-self - | justify-(?>content|items|self) - | left - | letter-spacing - | lighting-color - # line-break, line-grid, line-height, line-height-step, line-snap - | line-(?>break|grid|height(?:-step)?|snap) - | list-style - (?:- - # list-style-image - (?> image - # list-style-position - | position - # list-style-type - | type - ) - )? - | margin - (?:- - # margin-block-end, margin-block-start - (?> block(?:-(?>end|start))? - # margin-bottom - | bottom - # margin-inline-end, margin-inline-start - | inline(?:-(?>end|start))? - # margin-left - | left - # margin-right - | right - # margin-top - | top - ) - )? - | marker - (?:- - # marker-end - (?> end - # marker-knockout-left, marker-knockout-right - | knockout-(?>left|right) - # marker-mid - | mid - # marker-pattern - | pattern - # marker-segment - | segment - # marker-side - | side - # marker-start - | start - ) - )? - # marquee-direction, marquee-loop, marquee-speed, marquee-style - | marquee-(?>direction|loop|speed|style) - | mask - (?:- - # mask-border - (?> border - (?:- - # mask-border-mode - (?> mode - # mask-border-outset - | outset - # mask-border-repeat - | repeat - # mask-border-slice - | slice - # mask-border-source - | source - # mask-border-width - | width - ) - )? - # mask-clip - | clip - # mask-composite - | composite - # mask-image - | image - # mask-mode - | mode - # mask-origin - | origin - # mask-position - | position - # mask-repeat - | repeat - # mask-size - | size - # mask-type - | type - ) - )? - # max-block-size, max-height, max-inline-size, max-lines, max-width, max-zoom - | max-(?>block-size|height|inline-size|lines|width|zoom) - # min-block-size, min-height, min-inline-size, min-width, min-zoom - | min-(?>block-size|height|inline-size|width|zoom) - | mix-blend-mode - # nav-down, nav-left, nav-right, nav-up - | nav-(?>down|left|right|up) - | negative - # object-fit, object-position - | object-(?>fit|position) - | offset - (?:- - # offset-after - (?> after - # offset-anchor - | anchor - # offset-before - | before - # offset-distance - | distance - # offset-end - | end - # offset-path - | path - # offset-position - | position - # offset-rotate - | rotate - # offset-start - | start - ) - )? - | opacity - | order - | orphans - | orientation - | overflow - (?:- - # overflow-style - (?> style - # overflow-wrap - | wrap - # overflow-x - | x - # overflow-y - | y - ) - )? - | outline - (?:- - # outline-color - (?> color - # outline-offset - | offset - # outline-style - | style - # outline-width - | width - ) - )? - | pad - (?:ding - (?:- - # padding-block, padding-block-end, padding-block-start - (?> block(?:-(?>end|start))? - # padding-bottom - | bottom - # padding-inline, padding-inline-end, padding-inline-start - | inline(?:-(?>end|start))? - # padding-left - | left - # padding-right - | right - # padding-top - | top - ) - )? - )? - # page, page-break-after, page-break-before, page-break-inside - | page(?:-break-(?>after|before|inside))? - # pause, pause-after, pause-before - | pause(?:-(?>after|before))? - # pitch, pitch-range - | pitch(?:-range)? - # place-content, place-items, place-self - | place-(?>content|items|self) - | play-during - | position - | pointer-events - | prefix - | presentation-level - | quotes - | range - | region-fragment - | resize - # rest, rest-after, rest-before - | rest(?:-(?>after|before))? - | richness - | right - # rotation, rotation-point - | rotation(?:-point)? - | row-gap - # ruby-align, ruby-merge, ruby-position - | ruby-(?>align|merge|position) - | running - | scroll- - (?> behavior - | margin - (?:- - # scroll-margin-block, scroll-margin-block-end, - # scroll-margin-block-start - (?> block(?:-(?>end|start))? - # scroll-margin-bottom - | bottom - # scroll-margin-inline, scroll-margin-inline-end, - # scroll-margin-inline-start - | inline(?:-(?>end|start))? - # scroll-margin-left - | left - # scroll-margin-right - | right - # scroll-margin-top - | top - ) - )? - ) - | scroll-padding - (?:- - # scroll-padding-block, scroll-padding-block-end, - # scroll-padding-block-start - (?> block(?:-(?>end|start))? - # scroll-padding-bottom - | bottom - # scroll-padding-inline, scroll-padding-inline-end, - # scroll-padding-inline-start - | inline(?:-(?>end|start))? - # scroll-padding-left - | left - # scroll-padding-right - | right - # scroll-padding-top - | top - ) - )? - # scroll-snap-align, scroll-snap-stop, scroll-snap-type - | scroll-snap-(?>align|stop|type) - | scrollbar-gutter - # shape-inside, shape-image-threshold, shape-margin, shape-outside - | shape-(?>inside|image-threshold|margin|outside) - | size - | speak - (?:- - # speak-as - (?> as - # speak-header - | header - # speak-numeral - | numeral - # speak-punctuation - | punctuation - ) - )? - | speech-rate - | src - | stress - | string-set - | stroke - (?:- - # stroke-align, stroke-alignment - (?> align(?:ment)? - # stroke-break - | break - # stroke-color - | color - | dash - # stroke-dash-corner, stroke-dash-justify - (?> -(?>corner|justify) - # stroke-dashadjust - | adjust - # stroke-array - | array - # stroke-corner - | corner - # stroke-offset - | offset - ) - # stroke-image - | image - # stroke-linecap, stroke-linejoin - | line(?>cap|join) - # stroke-miterlimit - | miterlimit - # stroke-opacity - | opacity - # stroke-origin - | origin - # stroke-position - | position - # stroke-repeat - | repeat - # stroke-size - | size - # stroke-width - | width - ) - )? - # symbols, system, suffix - | s(?>ymbols|ystem|uffix) - | tab-size - | table-layout - | text- - # text-align, text-align-all, text-align-last - (?> align(?:-(?>all|last))? - # text-combine-upright - | combine-upright - # text-decoration - | decoration - # text-decoration-color, text-decoration-line, text-decoration-skip - # text-decoration-style - (?:-(?>color|line|skip|style))? - # text-emphasis - | emphasis - # text-emphasis-color, text-emphasis-position, text-emphasis-style - (?:-(?>color|position|style))? - # text-indent - | indent - # text-justify - | justify - # text-orientation - | orientation - # text-overflow - | overflow - # text-shadow - | shadow - # text-space-collapse, text-space-trim - | space-(?>collapse|trim) - # text-spacing - | spacing - # text-transform - | transform - # text-underline-position - | underline-position - # text-wrap - | wrap - ) - | top - # transform, transform-box, transform-origin - | transform(?:-(?>box|origin))? - # transition, transition-delay, transition-duration, transition-property, - # transition-timing-function - | transition(?:-(?>delay|duration|property|timing-function))? - | unicode-bidi - | user-select - | vertical-align - | visibility - | voice- - # voice-balance - (?> balance - # voice-duration - | duration - # voice-family - | family - # voice-pitch - | pitch - # voice-range - | range - # voice-rate - | rate - # voice-stress - | stress - # voice-volume - | volume - ) - | volume - | white-space - | widows - | width - | will-change - # word-break, word-spacing, word-wrap - | word-(?>break|spacing|wrap) - | wrap- - # wrap-after - (?> after - # wrap-before - | before - # wrap-flow - | flow - # wrap-inside - | inside - # wrap-through - | through - ) - | writing-mode - # z-index, zoom - | z(?>-index|oom) - ) - -contexts: - main: - - include: core - - include: custom - - include: prefixed - - include: other - - core: - - match: (?xi){{coreProperties}} - scope: support.type.property-name.css.css3 - pop: true - - custom: - - match: (?i){{customProperty}} - captures: - 0: support.type.custom-property.css.css3 - 1: punctuation.definition.custom-property.css.css3 - 2: support.type.custom-property.name.css.css3 - pop: true - - prefixed: - - match: | - (?xi) - (-(?>moz|ms|o|webkit)-) - ({{coreProperties}}) - captures: - 1: support.type.vendor-prefix.css.css3 - 2: support.type.property-name.css.css3 - pop: true - - other: - - match: (?i){{cssIdentifier}} - scope: variable.other.type.property-name.css.css3 - pop: true diff --git a/syntaxes/css3/ruleset.sublime-syntax b/syntaxes/css3/ruleset.sublime-syntax deleted file mode 100644 index c74c513b..00000000 --- a/syntaxes/css3/ruleset.sublime-syntax +++ /dev/null @@ -1,33 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: "" - set: [ meta, block, selector-list ] - - block: - - include: Packages/Naomi/syntaxes/css3/ruleset/block.sublime-syntax - - meta: - - meta_scope: meta.rule-set.css.css3 - - match: "" - pop: true - - selector-list: - - include: Packages/Naomi/syntaxes/css3/ruleset/selector-list.sublime-syntax diff --git a/syntaxes/css3/ruleset/block-content.sublime-syntax b/syntaxes/css3/ruleset/block-content.sublime-syntax deleted file mode 100644 index 0a3f0bca..00000000 --- a/syntaxes/css3/ruleset/block-content.sublime-syntax +++ /dev/null @@ -1,178 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* - - customProperty: --[_[:alnum:]\-]+ - -contexts: - main: - - include: comment-no-pop - - match: (?=\}) - pop: true - # Custom property. - - match: | - (?xi) - (?= - {{customProperty}} - \s*: - ) - set: [ possible-set, property ] - # Grid-template. - - match: | - (?x) - # grid-template, grid-template-areas, grid-template-columns, - # grid-template-rows - grid-template(?:-(?>areas|columns|rows))? - (?=\s*:) - scope: support.type.property-name.css.css3 - set: [ meta-value, optional-grid-template-value, delimiter ] - # Grid. - - match: | - (?x) - grid - (?:- - # grid-area - (?> area - # grid-auto-coolums, grid-auto-flow, grid-auto-rows - | auto(?:-(?>columns|flow|rows)) - # grid-column, grid-column-end, grid-column-start - | column(?:-(?>end|start))? - # grid-gap - | gap - # grid-row, grid-row-end, grid-row-start - | row(?:-(?>end|start))? - ) - )? - (?=\s*:) - scope: support.type.property-name.css.css3 - set: [ meta-value, optional-grid-value, delimiter ] - # property: value. - - match: | - (?xi) - (?= - {{cssIdentifier}} - \s*: - ) - set: [ meta-value, optional-value, delimiter, property ] - # Nesting. - - match: (?=\S) - set: - - include: Packages/Naomi/syntaxes/css3/statement.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/ruleset.sublime-syntax - - comment-no-pop: - - include: Packages/Naomi/syntaxes/css3/comment.no-pop.sublime-syntax - - delimiter: - - include: comment-no-pop - - match: ":" - scope: punctuation.separator.key-value.css.css3 - pop: true - - grid-line-name: - - match: | - (?xi) - {{cssIdentifier}} - scope: variable.other.grid-line.css.css3 - pop: true - - meta-value: - - meta_scope: meta.property-value.css.css3 - - include: pop-now - - named-grid-line-declaration: - - meta_scope: meta.named-grid-line.css.css3 - - include: comment-no-pop - - match: \] - scope: punctuation.definition.bracket.end.css.css3 - pop: true - - match: (?=\S) - push: grid-line-name - - optional-grid-value: - - include: comment-no-pop - - match: (?=[`;()\]{}]) - pop: true - - match: (?=\S) - push: - - include: start-end-ratio - - include: value-separator - - match: span\b(?!-) - scope: keyword.operator.word.css.css3 - pop: true - - include: grid-line-name - - include: Packages/Naomi/syntaxes/css3/value.sublime-syntax - - optional-grid-template-value: - - include: comment-no-pop - - match: (?=[`;()\]{}]) - pop: true - # Named lines - - match: \[ - scope: punctuation.definition.bracket.begin.css.css3 - push: named-grid-line-declaration - # Other values. - - match: (?=\S) - push: - - include: start-end-ratio - - include: value-separator - - include: Packages/Naomi/syntaxes/css3/value.sublime-syntax - - optional-value: - - include: comment-no-pop - - match: (?=[`;()\[\]{}]) - pop: true - - match: (?=\S) - push: - - include: value-separator - - include: Packages/Naomi/syntaxes/css3/value.sublime-syntax - - possible-set: - - include: comment-no-pop - - match: ":" - scope: punctuation.separator.key-value.css.css3 - set: [ meta-value, set-or-optional-value ] - - pop-now: - - match: "" - pop: true - - property: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/css3/property.sublime-syntax - - ruleset-block: - - include: Packages/Naomi/syntaxes/css3/ruleset/block.sublime-syntax - - start-end-ratio: - - match: / - scope: keyword.operator.arithmetic.ratio.css.css3 - pop: true - - set-or-optional-value: - - include: comment-no-pop - - match: (?=\{) - set: ruleset-block - - include: optional-value - - value-separator: - - match: \, - scope: punctuation.separator.sequence.css.css3 - pop: true diff --git a/syntaxes/css3/ruleset/block.sublime-syntax b/syntaxes/css3/ruleset/block.sublime-syntax deleted file mode 100644 index cfde0ea3..00000000 --- a/syntaxes/css3/ruleset/block.sublime-syntax +++ /dev/null @@ -1,43 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \{ - scope: punctuation.section.property-list.begin.css.css3 - set: delimiter - - comment-no-pop: - - include: Packages/Naomi/syntaxes/css3/comment.no-pop.sublime-syntax - - delimiter: - - meta_scope: meta.property-list.css.css3 - - include: comment-no-pop - # Close. - - match: \} - scope: punctuation.section.property-list.end.css.css3 - pop: true - # Delimiter. - - match: ; - scope: punctuation.terminator.css.css3 - # Actual rules. - - match: "" - push: - - include: Packages/Naomi/syntaxes/css3/ruleset/block-content.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/css3/ruleset/selector-list.sublime-syntax b/syntaxes/css3/ruleset/selector-list.sublime-syntax deleted file mode 100644 index 3c8c823c..00000000 --- a/syntaxes/css3/ruleset/selector-list.sublime-syntax +++ /dev/null @@ -1,49 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: "" - set: [ - meta-selector-list, - delimiter, - meta-selector, - selector-expression - ] - - delimiter: - # Escape. - - match: (?=[;{]) - pop: true - # Delimiter. - - match: \, - scope: punctuation.separator.comma.css.css3 - push: [ meta-selector, selector-expression ] - - meta-selector: - - meta_content_scope: meta.selector.css.css3 - - match: "" - pop: true - - meta-selector-list: - - meta_content_scope: meta.selector-list.css.css3 - - match: "" - pop: true - - selector-expression: - - include: Packages/Naomi/syntaxes/css3/selector-expression.sublime-syntax diff --git a/syntaxes/css3/selector-expression-as-arguments.sublime-syntax b/syntaxes/css3/selector-expression-as-arguments.sublime-syntax deleted file mode 100644 index 16672a81..00000000 --- a/syntaxes/css3/selector-expression-as-arguments.sublime-syntax +++ /dev/null @@ -1,34 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \( - scope: punctuation.section.group.begin.css.css3 - set: close - - close: - - meta_scope: meta.group.css.css3 - - match: \) - scope: punctuation.section.group.end.css.css3 - pop: true - - match: (?=\S) - push: expression - - expression: - - include: Packages/Naomi/syntaxes/css3/selector-expression.sublime-syntax diff --git a/syntaxes/css3/selector-expression.sublime-syntax b/syntaxes/css3/selector-expression.sublime-syntax deleted file mode 100644 index ab697703..00000000 --- a/syntaxes/css3/selector-expression.sublime-syntax +++ /dev/null @@ -1,71 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* - -contexts: - main: - - match: "" - set: [ optional-tail, head ] - - head: - # Namespace prefix. - - match: | - (?xi) - (?> ({{cssIdentifier}}) - | (\*) - ) - \s*(\|) - captures: - 0: meta.namespace-prefix.css.css3 - 1: variable.other.namespace-prefix.css.css3 - 2: keyword.other.namespace-wildcard.css.css3 - 3: punctuation.separator.key-value.css.css3 - # Some pseudo elements still allow the CSS2 syntax and could be confused with - # a pseudo class, to prevent that, we try to match the pseudo element first. - - include: Packages/Naomi/syntaxes/css3/selector/pseudo-element.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/selector/pseudo-class.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/selector/ampersand.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/selector/attribute.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/selector/custom.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/selector/id.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/selector/class.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/selector/type.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/selector/universal.sublime-syntax - - optional-tail: - - include: Packages/Naomi/syntaxes/css3/comment.no-pop.sublime-syntax - # Escape. - - match: (?=[,;(){}]) - pop: true - # Operators. - - include: Packages/Naomi/syntaxes/css3/combinator.sublime-syntax - # Attribute. - - match: (?=\[) - push: - - include: Packages/Naomi/syntaxes/css3/selector/attribute.sublime-syntax - # Pseudo element, class and custom selector. - - match: (?=:) - push: - - include: Packages/Naomi/syntaxes/css3/selector/pseudo-element.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/selector/pseudo-class.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/selector/custom.sublime-syntax - # Loop. - - match: (?=\S) - push: head diff --git a/syntaxes/css3/selector/ampersand.sublime-syntax b/syntaxes/css3/selector/ampersand.sublime-syntax deleted file mode 100644 index 1bdef4ef..00000000 --- a/syntaxes/css3/selector/ampersand.sublime-syntax +++ /dev/null @@ -1,23 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \& - scope: entity.name.tag.wildcard.parent.css.css3 - pop: true diff --git a/syntaxes/css3/selector/attribute.sublime-syntax b/syntaxes/css3/selector/attribute.sublime-syntax deleted file mode 100644 index cbf1bee4..00000000 --- a/syntaxes/css3/selector/attribute.sublime-syntax +++ /dev/null @@ -1,57 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \[ - scope: punctuation.section.brackets.begin.css.css3 - set: [ meta, close, optional-operator, attribute ] - - attribute: - - include: Packages/Naomi/syntaxes/html5/attribute/builtin.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/attribute/data.sublime-syntax - # Other attributes with escaping. - - match: | - (?xi) - (?> [_[:alpha:]\-] - | \\\S - )+ - scope: entity.other.attribute-name.css.css3 - pop: true - - close: - - match: \] - scope: punctuation.section.brackets.end.css.css3 - pop: true - - match: (?=\S) - push: value - - meta: - - meta_scope: meta.attribute-selector.css.css3 - - match: "" - pop: true - - optional-operator: - - match: "[~|^$*]?=" - scope: keyword.operator.attribute-selector.css.css3 - set: value - - match: (?=\S) - pop: true - - value: - - include: Packages/Naomi/syntaxes/css3/value.sublime-syntax diff --git a/syntaxes/css3/selector/class.sublime-syntax b/syntaxes/css3/selector/class.sublime-syntax deleted file mode 100644 index 74eb927d..00000000 --- a/syntaxes/css3/selector/class.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* - -contexts: - main: - - match: (?xi)(\.)({{cssIdentifier}}) - captures: - 0: entity.other.attribute-name.class.css.cs3 - 1: punctuation.definition.entity.css.css3 - pop: true diff --git a/syntaxes/css3/selector/custom.sublime-syntax b/syntaxes/css3/selector/custom.sublime-syntax deleted file mode 100644 index 7721d966..00000000 --- a/syntaxes/css3/selector/custom.sublime-syntax +++ /dev/null @@ -1,29 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - customSelector: (:--)([_[:alnum:]\-]*) - -contexts: - main: - - match: (?i){{customSelector}} - captures: - 0: support.type.custom-selector.css.css3 - 1: punctuation.definition.custom-selector.css.css3 - 2: support.type.custom-selector.name.css.css3 - pop: true diff --git a/syntaxes/css3/selector/id.sublime-syntax b/syntaxes/css3/selector/id.sublime-syntax deleted file mode 100644 index 02372449..00000000 --- a/syntaxes/css3/selector/id.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* - -contexts: - main: - - match: (?xi)(\#)({{cssIdentifier}}) - captures: - 0: entity.other.attribute-name.id.css.cs3 - 1: punctuation.definition.entity.css.css3 - pop: true diff --git a/syntaxes/css3/selector/nth/arguments.sublime-syntax b/syntaxes/css3/selector/nth/arguments.sublime-syntax deleted file mode 100644 index 1e0ed532..00000000 --- a/syntaxes/css3/selector/nth/arguments.sublime-syntax +++ /dev/null @@ -1,34 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \( - scope: punctuation.section.group.begin.css.css3 - set: close - - close: - - meta_scope: meta.group.css.css3 - - match: \) - scope: punctuation.section.group.end.css.css3 - pop: true - - match: (?=\S) - push: expression - - expression: - - include: Packages/Naomi/syntaxes/css3/selector/nth/expression.sublime-syntax diff --git a/syntaxes/css3/selector/nth/expression.sublime-syntax b/syntaxes/css3/selector/nth/expression.sublime-syntax deleted file mode 100644 index da6905b2..00000000 --- a/syntaxes/css3/selector/nth/expression.sublime-syntax +++ /dev/null @@ -1,54 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # It is possible to have an operator in the beginning of the expression. - - include: operator - # Complex expression. - - match: (?=\S) - set: [ optional-tail, head ] - - head: - - match: (?>even|odd)\b - scope: keyword.other.pseudo-class.css.css3 - pop: true - # Numbers. - - match: -?[1-9][0-9]*|0 - scope: constant.numeric.decimal.css.css3 - pop: true - - match: n\b - scope: keyword.other.unit.css.css3 - pop: true - - operator: - - match: "[+-]" - scope: keyword.operator.arithmetic.css.css3 - set: main - # “of [selector]” clause. - - match: of\b - scope: keyword.operator.word.of.css.css3 - set: selector-expression - - optional-tail: - - include: operator - - match: (?=\S) - pop: true - - selector-expression: - - include: Packages/Naomi/syntaxes/css3/selector-expression.sublime-syntax diff --git a/syntaxes/css3/selector/pseudo-class.sublime-syntax b/syntaxes/css3/selector/pseudo-class.sublime-syntax deleted file mode 100644 index 2e4ac9bd..00000000 --- a/syntaxes/css3/selector/pseudo-class.sublime-syntax +++ /dev/null @@ -1,119 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* - - corePseudoClasses: | - (?> active - # any, any-link - | any(?:-link)? - | checked - | default - | disabled - | empty - | enabled - # first, first-child, first-of-type - | first(?:-(?>child|of-type))? - | fullscreen - | focus - | hover - | indeterminate - | in-range - | invalid - | last-(?>child|of-type) - | left - | link - # only-child, only-of-type - | only-(?>child|of-type) - | optional - | out-of-range - # read-only, read-write - | read-(?>only|write) - | required - | right - | root - | scope - | target - | valid - | visited - ) - -contexts: - main: - - include: expected-pseudo-classes - - include: matches - - include: not - - include: nth-child - - include: nth-of-type - - include: fallback - - expected-pseudo-classes: - - match: (?xi)(:){{corePseudoClasses}} - captures: - 0: entity.other.pseudo-class.css.cs3 - 1: punctuation.definition.entity.css.css3 - pop: true - - fallback: - - match: (?xi)(:){{cssIdentifier}} - captures: - 0: variable.other.pseudo-class.css.cs3 - 1: punctuation.definition.entity.css.css3 - pop: true - - matches: - - match: (\:)matches(?=\s*\() - captures: - 0: entity.other.pseudo-class.css.cs3 - 1: punctuation.definition.entity.css.css3 - set: selector-expression-as-arguments - - not: - - match: (\:)not(?=\s*\() - captures: - 0: entity.other.pseudo-class.css.cs3 - 1: punctuation.definition.entity.css.css3 - set: selector-expression-as-arguments - - match: (\:)not\b - captures: - 0: entity.other.pseudo-class.css.cs3 - 1: punctuation.definition.entity.css.css3 - pop: true - - nth-arguments: - - include: Packages/Naomi/syntaxes/css3/selector/nth/arguments.sublime-syntax - - nth-child: - # nth-child, nth-last-child - - match: (\:)nth(?:-last)?-child\b - captures: - 0: entity.other.pseudo-class.css.cs3 - 1: punctuation.definition.entity.css.css3 - set: nth-arguments - - nth-of-type: - # nth-of-type, nth-last-of-type - - match: (\:)nth(?:-last)?-of-type\b - captures: - 0: entity.other.pseudo-class.css.cs3 - 1: punctuation.definition.entity.css.css3 - set: nth-arguments - - selector-expression-as-arguments: - - include: Packages/Naomi/syntaxes/css3/selector-expression-as-arguments.sublime-syntax diff --git a/syntaxes/css3/selector/pseudo-element.sublime-syntax b/syntaxes/css3/selector/pseudo-element.sublime-syntax deleted file mode 100644 index 9d011cff..00000000 --- a/syntaxes/css3/selector/pseudo-element.sublime-syntax +++ /dev/null @@ -1,61 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* - -contexts: - main: - - include: css2 - - include: other - - include: fallback - - css2: - # after, before, first-letter, first-line, - - match: (?xi)(::?)(?>after|before|first-(?>letter|line))\b - captures: - 0: entity.other.pseudo-element.class.css.cs3 - 1: punctuation.definition.entity.css.css3 - pop: true - - cue-arguments: - - match: \( - scope: punctuation - - match: (?=\S) - - fallback: - - match: (?xi)(::){{cssIdentifier}} - captures: - 0: variable.other.pseudo-element.class.css.cs3 - 1: punctuation.definition.entity.css.css3 - pop: true - - other: - - match: (::)cue(?=\s*\() - captures: - 0: entity.other.pseudo-element.class.css.cs3 - 1: punctuation.definition.entity.css.css3 - set: selector-expression-as-arguments - - match: (?xi)(::)(?>backdrop|cue|selection)\b - captures: - 0: entity.other.pseudo-element.class.css.cs3 - 1: punctuation.definition.entity.css.css3 - pop: true - - selector-expression-as-arguments: - - include: Packages/Naomi/syntaxes/css3/selector-expression-as-arguments.sublime-syntax diff --git a/syntaxes/css3/selector/type.sublime-syntax b/syntaxes/css3/selector/type.sublime-syntax deleted file mode 100644 index e3aef8e7..00000000 --- a/syntaxes/css3/selector/type.sublime-syntax +++ /dev/null @@ -1,177 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* - - tags: | - (?> a - # abbr - (?> bbr - # address - | ddress - # area - | rea - # article - | rticle - # aside - | side - # audio - | udio - )? - | b - # base - (?> ase - # bdi, bdo - | d[io] - # blockquote - | lockquote - # body - | ody - # br - | r - # button - | utton - )? - # canvas, caption - | ca(?>nvas|ption) - | cite - | code - # col, colgroup - | col(?:group)? - # data, datalist - | data(?:list)? - | dd - | del - | details - | dfn - | dialog - | div - # dl, dt - | d[lt] - # em, embed - | em(?:bed)? - | fieldset - | figcaption - | figure - | footer - | form - | h[1-6] - # head, header - | head(?:er)? - | hgroup - | hr - | html - | i - # iframe - (?> frame - # img - | mg - # input - | nput - # ins - | ns - )? - | kbd - | label - | legend - # li, link - | li(?:nk)? - # main, map, mark - | ma(?>in|p|rk) - # meta, meter - | met(?>a|er) - | nav - | nextid - | noscript - | object - | ol - # optgroup, option - | opt(?>group|ion) - | output - | p - # param - (?> aram - # picture - | icture - # pre - | re - # progress - | rogress - )? - | q - # rp, rt, rtc - | r(?>p|tc?) - | ruby - | s - # sup - (?> amp - # script - | cript - # section - | ection - # select - | elect - # slot - | lot - # small - | mall - # source - | ource - # span - | pan - # strong - | trong - # style - | tyle - # sub - | ub - # summary - | ummary - # sup - | up - )? - | table - | tbody - | td - | template - | textarea - | tfoot - # th, thead - | th(?:ead)? - # time, title - | ti(?>me|tle) - # tr, track - | tr(?:ack)? - # u, ul - | ul? - | var - | video - | wbr - ) - -contexts: - main: - # HTML5 tags. - - match: (?xi){{tags}}\b - scope: entity.name.tag.css.cs3 - pop: true - # Other tags. - - match: (?xi){{cssIdentifier}}\b - scope: variable.other.tag.css.cs3 - pop: true diff --git a/syntaxes/css3/selector/universal.sublime-syntax b/syntaxes/css3/selector/universal.sublime-syntax deleted file mode 100644 index 18e248d4..00000000 --- a/syntaxes/css3/selector/universal.sublime-syntax +++ /dev/null @@ -1,23 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \* - scope: entity.name.tag.wildcard.css.css3 - pop: true diff --git a/syntaxes/css3/statement.sublime-syntax b/syntaxes/css3/statement.sublime-syntax deleted file mode 100644 index 43514ff5..00000000 --- a/syntaxes/css3/statement.sublime-syntax +++ /dev/null @@ -1,288 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - cssIdentifier: (?!--)[_[:alpha:]\-][_[:alnum:]\-]* - -contexts: - main: - - include: apply - - include: empty-statement - - include: charset - - include: conditional-group-rules - - include: counter-style - - include: custom-media - - include: custom-selector - - include: font-face - - include: keyframes - - include: namespace - - include: nest - - include: import - - include: page - - include: viewport - - apply: - - match: (@)apply\b - captures: - 0: keyword.control.at-rule.apply.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ meta-apply, custom-property ] - - charset: - - match: (@)charset\b - captures: - 0: keyword.control.at-rule.charset.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ meta-charset, double-quoted-string ] - - conditional-group-body: - - include: Packages/Naomi/syntaxes/css3/ruleset/block.sublime-syntax - - conditional-group-rules: - - match: (@)document\b - captures: - 0: keyword.control.at-rule.document.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ meta-document, conditional-group-body, url-list ] - - match: (@)media\b - captures: - 0: keyword.control.at-rule.media.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ meta-media, conditional-group-body, optional-media-query-list ] - - match: (@)supports\b - captures: - 0: keyword.control.at-rule.supports.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ meta-supports, conditional-group-body, feature-query-list ] - - counter-style: - - match: (@)counter-style\b - captures: - 0: keyword.control.at-rule.counter-style.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ meta-counter-style, ruleset-block, counter-style-name ] - - counter-style-name: - - match: | - (?xi) - {{cssIdentifier}} - scope: entity.other.counter-style.css.css3 - pop: true - - custom-media: - - match: (@)custom-media\b - captures: - 0: keyword.control.at-rule.media.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ - meta-custom-media, - optional-media-query-list, - custom-media-identifier - ] - - custom-media-identifier: - - include: Packages/Naomi/syntaxes/css3/custom-media-identifier.sublime-syntax - - custom-selector: - - match: (@)custom-selector\b - captures: - 0: keyword.control.at-rule.media.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ - meta-custom-selector, - selector-list, - custom-selector-identifier - ] - - custom-selector-identifier: - - include: Packages/Naomi/syntaxes/css3/selector/custom.sublime-syntax - - custom-property: - - include: Packages/Naomi/syntaxes/css3/property.sublime-syntax#custom - - double-quoted-string: - - include: Packages/Naomi/syntaxes/css3/literal/string/double-quoted.sublime-syntax - - empty-statement: - - match: ; - scope: punctuation.terminator.css.css3 - pop: true - - feature-query-list: - - include: Packages/Naomi/syntaxes/css3/feature-query-list.sublime-syntax - - font-face: - - match: (@)font-face\b - captures: - 0: keyword.control.at-rule.font-face.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ meta-font-face, ruleset-block ] - - import: - - match: (@)import-normalize\b - captures: - 0: keyword.control.at-rule.import.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: meta-import - - match: (@)import\b - captures: - 0: keyword.control.at-rule.import.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ meta-import, optional-media-query-list, string-or-url ] - - keyframe-block-list: - - include: Packages/Naomi/syntaxes/css3/keyframe-block-list.sublime-syntax - - keyframe-name: - - match: | - (?xi) - {{cssIdentifier}} - scope: entity.other.animation-name.css.css3 - pop: true - - keyframes: - - match: (@)keyframes\b - captures: - 0: keyword.control.at-rule.keyframes.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ meta-keyframes, keyframe-block-list, keyframe-name ] - - meta-apply: - - meta_scope: meta.at-rule.apply.css.css3 - - include: pop-now - - meta-charset: - - meta_scope: meta.at-rule.charset.css.css3 - - include: pop-now - - meta-counter-style: - - meta_scope: meta.at-rule.counter-style.css.css3 - - include: pop-now - - meta-custom-media: - - meta_scope: meta.at-rule.custom-media.css.css3 - - include: pop-now - - meta-custom-selector: - - meta_scope: meta.at-rule.custom-selector.css.css3 - - include: pop-now - - meta-document: - - meta_scope: meta.at-rule.document.css.css3 - - include: pop-now - - meta-font-face: - - meta_scope: meta.at-rule.font-face.css.css3 - - include: pop-now - - meta-import: - - meta_scope: meta.at-rule.import.css.css3 - - include: pop-now - - meta-keyframes: - - meta_scope: meta.at-rule.keyframes.css.css3 - - include: pop-now - - meta-media: - - meta_scope: meta.at-rule.media.css.css3 - - include: pop-now - - meta-namespace: - - meta_scope: meta.at-rule.namespace.css.css3 - - include: pop-now - - meta-nest: - - meta_scope: meta.at-rule.nest.css.css3 - - include: pop-now - - meta-page: - - meta_scope: meta.at-rule.page.css.css3 - - include: pop-now - - meta-supports: - - meta_scope: meta.at-rule.supports.css.css3 - - include: pop-now - - meta-viewport: - - meta_scope: meta.at-rule.viewport.css.css3 - - include: pop-now - - namespace: - - match: (@)namespace\b - captures: - 0: keyword.control.at-rule.namespace.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ meta-namespace, string-or-url, optional-namespace-prefix ] - - nest: - - match: (@)nest\b - captures: - 0: keyword.control.at-rule.nest.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ meta-nest, ruleset-block, selector-list ] - - optional-media-query-list: - - include: Packages/Naomi/syntaxes/css3/optional-media-query-list.sublime-syntax - - optional-namespace-prefix: - - match: | - (?xi) - {{cssIdentifier}}\b - (?!\s*\() - scope: entity.name.namespace.css.css3 - pop: true - - match: (?=\S) - pop: true - - optional-page-selector: - - include: Packages/Naomi/syntaxes/css3/optional-page-selector-list.sublime-syntax - - page: - - match: (@)page\b - captures: - 0: keyword.control.at-rule.page.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ meta-page, page-block, optional-page-selector ] - - page-block: - - include: Packages/Naomi/syntaxes/css3/page/block.sublime-syntax - - pop-now: - - match: "" - pop: true - - ruleset-block: - - include: Packages/Naomi/syntaxes/css3/ruleset/block.sublime-syntax - - selector-list: - - include: Packages/Naomi/syntaxes/css3/ruleset/selector-list.sublime-syntax - - string-or-url: - - include: Packages/Naomi/syntaxes/css3/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/function-call.sublime-syntax - - viewport: - - match: (@)viewport\b - captures: - 0: keyword.control.at-rule.viewport.css.css3 - 1: punctuation.definition.keyword.css.css3 - set: [ meta-viewport, ruleset-block ] - - url-list: - - include: Packages/Naomi/syntaxes/css3/url-list.sublime-syntax diff --git a/syntaxes/css3/url-list.sublime-syntax b/syntaxes/css3/url-list.sublime-syntax deleted file mode 100644 index 7915c7ec..00000000 --- a/syntaxes/css3/url-list.sublime-syntax +++ /dev/null @@ -1,53 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: "" - set: [ - meta-url-list, - delimiter, - url - ] - - comment-no-pop: - - include: Packages/Naomi/syntaxes/css3/comment.no-pop.sublime-syntax - - delimiter: - - include: comment-no-pop - # Escape. - - match: (?=\{) - pop: true - # Delimiter. - - match: \, - scope: punctuation.separator.comma.css.css3 - push: [ optional-url ] - - meta-url-list: - - meta_content_scope: meta.document.url-list.css.css3 - - match: "" - pop: true - - optional-url: - - include: comment-no-pop - - match: (?=[,;()\[\]{}]) - pop: true - - include: url - - url: - - include: Packages/Naomi/syntaxes/css3/function-call.sublime-syntax diff --git a/syntaxes/css3/value-no-unquoted-string.sublime-syntax b/syntaxes/css3/value-no-unquoted-string.sublime-syntax deleted file mode 100644 index 460a7b8a..00000000 --- a/syntaxes/css3/value-no-unquoted-string.sublime-syntax +++ /dev/null @@ -1,30 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: "!important\\b" - scope: keyword.other.important.css.css3 - pop: true - - include: Packages/Naomi/syntaxes/css3/literal/color.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/literal/ratio.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/function-call.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/constant.sublime-syntax diff --git a/syntaxes/css3/value.sublime-syntax b/syntaxes/css3/value.sublime-syntax deleted file mode 100644 index 41242cc8..00000000 --- a/syntaxes/css3/value.sublime-syntax +++ /dev/null @@ -1,22 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/css3/value-no-unquoted-string.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/literal/string/unquoted.sublime-syntax diff --git a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax deleted file mode 100644 index 56f79369..00000000 --- a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax +++ /dev/null @@ -1,157 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - genericArguments: | - (< - (?> {{string}} - | \g<-1> - | [^<>] - )* - >) - - parameters: | - (\( - (?> {{string}} - | \g<-1> - | [^()] - )* - \)) - - flowOperators: | - (?> &(?!\s*&) - | \|(?!\s*\|) - ) - - string: | - (?> '(?:\'|[^'])*?' - | "(?:\"|[^"])*?" - | `(?:\`|[^`])*?` - ) - - flowObject: | - (\{ - (?> {{string}} - | \g<-1> - | [^{}] - )* - }) - - simpleFlowType: | - (?> {{string}} - | {{flowObject}} - | [$_[:alpha:]][$_[:alnum:].]* - ) - (?:\s*{{genericArguments}})? - (?:\s*\[\s*\])? - - flowFunction: | - ( - {{parameters}} - \s*=>\s* - (?> (?:\?\s*){{simpleFlowType}} - | \g<-1> - ) - ) - - complexType: | - (?:\?\s*)? - ( - (?> {{simpleFlowType}} - | {{flowFunction}} - | \g<-1> - ) - ) - - multipleTypes: | - ( - (?> \s*{{flowOperators}} - | \s*{{complexType}} - | \g<-1> - )+ - ) - - flowComment: /\*\s*:.*?\*/ - - type: | - (?> {{flowComment}} - | \:\s*{{multipleTypes}} - ) - - normalArrowFunction: | - (?:async\b\s*)? - (?:{{genericArguments}}\s*)? - {{parameters}} - (?:\s*{{type}})? - \s*=> - - singleParameterArrowFunction: | - (?:async\b\s+)? - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=> - - anyArrowFunction: | - (?> {{normalArrowFunction}} - | {{singleParameterArrowFunction}} - ) - - normalArrowFunctionAssignedToVariable: | - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=\s* - {{normalArrowFunction}} - - singleParameterArrowFunctionAssignedToVariable: | - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=\s* - {{singleParameterArrowFunction}} - - anyArrowFunctionAssignedToVariable: | - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=\s* - (?> {{normalArrowFunction}} - | {{singleParameterArrowFunction}} - ) - -contexts: - main: - # Normal arrow function. - - match: | - (?xi) - (?={{normalArrowFunction}}) - push: normal-arrow-function - # Single parameter. - - match: | - (?xi) - (?={{singleParameterArrowFunction}}) - push: single-parameter-arrow-function - - normal-arrow-function: - - meta_scope: meta.function.js.fjsx15 - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax#normal-arrow-function - - single-parameter-arrow-function: - - meta_scope: meta.function.js.fjsx15 - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax#single-parameter-arrow-function diff --git a/syntaxes/fjsx15/arrow-function.sublime-syntax b/syntaxes/fjsx15/arrow-function.sublime-syntax deleted file mode 100644 index bf8c7e83..00000000 --- a/syntaxes/fjsx15/arrow-function.sublime-syntax +++ /dev/null @@ -1,162 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - genericArguments: | - (< - (?> {{string}} - | \g<-1> - | [^<>] - )* - >) - - parameters: | - (\( - (?> {{string}} - | \g<-1> - | [^()] - )* - \)) - - flowOperators: | - (?> &(?!\s*&) - | \|(?!\s*\|) - ) - - string: | - (?> '(?:\'|[^'])*?' - | "(?:\"|[^"])*?" - | `(?:\`|[^`])*?` - ) - - flowObject: | - (\{ - (?> {{string}} - | \g<-1> - | [^{}] - )* - }) - - simpleFlowType: | - (?> {{string}} - | {{flowObject}} - | [$_[:alpha:]][$_[:alnum:].]* - ) - (?:\s*{{genericArguments}})? - (?:\s*\[\s*\])? - - flowFunction: | - ( - {{parameters}} - \s*=>\s* - (?> (?:\?\s*){{simpleFlowType}} - | \g<-1> - ) - ) - - complexType: | - (?:\?\s*)? - ( - (?> {{simpleFlowType}} - | {{flowFunction}} - | \g<-1> - ) - ) - - multipleTypes: | - ( - (?> \s*{{flowOperators}} - | \s*{{complexType}} - | \g<-1> - )+ - ) - - flowComment: /\*\s*:.*?\*/ - - type: | - (?> {{flowComment}} - | \:\s*{{multipleTypes}} - ) - - normalArrowFunction: | - (?:async\b\s*)? - (?:{{genericArguments}}\s*)? - {{parameters}} - (?:\s*{{type}})? - \s*=> - - singleParameterArrowFunction: | - (?:async\b\s+)? - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=> - - anyArrowFunction: | - (?> {{normalArrowFunction}} - | {{singleParameterArrowFunction}} - ) - - normalArrowFunctionAssignedToVariable: | - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=\s* - {{normalArrowFunction}} - - singleParameterArrowFunctionAssignedToVariable: | - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=\s* - {{singleParameterArrowFunction}} - - anyArrowFunctionAssignedToVariable: | - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=\s* - (?> {{normalArrowFunction}} - | {{singleParameterArrowFunction}} - ) - -contexts: - main: - # Normal arrow function. - - match: | - (?xi) - (?={{normalArrowFunction}}) - set: normal-arrow-function - # Single parameter. - - match: | - (?xi) - (?={{singleParameterArrowFunction}}) - set: single-parameter-arrow-function - - normal-arrow-function: - - meta_scope: meta.function.js.fjsx15 - - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax - - single-parameter-arrow-function: - - meta_scope: meta.function.js.fjsx15 - - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax diff --git a/syntaxes/fjsx15/arrow-function/body.sublime-syntax b/syntaxes/fjsx15/arrow-function/body.sublime-syntax deleted file mode 100644 index 60f2f6cd..00000000 --- a/syntaxes/fjsx15/arrow-function/body.sublime-syntax +++ /dev/null @@ -1,52 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: => - scope: storage.type.function.arrow.js.fjsx15 - set: possible-multi-statement-body - - close-body: - - meta_scope: >- - meta.function.js.fjsx15 - meta.block.js.fjsx15 - - match: \} - scope: punctuation.section.block.end.js.fjsx15 - set: optional-expression-tail - - match: "" - push: optional-statement-or-expression - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - optional-expression-tail: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax#optional-tail - - optional-statement-or-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-statement-or-expression.sublime-syntax - - possible-multi-statement-body: - - include: comment-no-pop - - match: \{ - scope: punctuation.section.block.begin.js.fjsx15 - set: close-body - - include: optional-expression diff --git a/syntaxes/fjsx15/async.no-pop.sublime-syntax b/syntaxes/fjsx15/async.no-pop.sublime-syntax deleted file mode 100644 index f218d7da..00000000 --- a/syntaxes/fjsx15/async.no-pop.sublime-syntax +++ /dev/null @@ -1,22 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: async\b - scope: storage.modifier.async.js.fjsx15 diff --git a/syntaxes/fjsx15/class.sublime-syntax b/syntaxes/fjsx15/class.sublime-syntax deleted file mode 100644 index 48d1d09c..00000000 --- a/syntaxes/fjsx15/class.sublime-syntax +++ /dev/null @@ -1,91 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: class\b - scope: storage.type.class.js.fjsx15 - set: declaration - - body: - - include: Packages/Naomi/syntaxes/fjsx15/class/body.sublime-syntax - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - declaration: - - meta_scope: meta.declaration.class.js.fjsx15 - - include: comment-no-pop - # Body. - - match: (?=\{) - set: body - # Generic parameters. - - match: (?=<) - push: generic-arguments - # Interfaces. - - match: implements\b - scope: storage.modifier.js.fjsx15 - push: [ - optional-target-class-or-namespace, - optional-generic-arguments, - target-class-or-namespace - ] - # Extensions. - - match: extends\b - scope: storage.modifier.extends.js.fjsx15 - push: [ - optional-generic-arguments, - target-class-or-namespace - ] - # Identifier. - - match: (?xi){{commonIdentifier}} - scope: entity.name.class.js.fjsx15 - - generic-arguments: - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax - - optional-generic-arguments: - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax - - match: "" - pop: true - - optional-target-class-or-namespace: - - match: \, - scope: punctuation.definition.implement-list.separator.js.fjsx15 - set: [ - optional-target-class-or-namespace, - optional-generic-arguments, - target-class-or-namespace - ] - - match: (?=\{) - pop: true - - target-class-or-namespace: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/flow1/namespace-path.no-pop.sublime-syntax - - match: (?xi){{commonIdentifier}} - scope: entity.other.inherited-class.js.fjsx15 - pop: true - - type-expression: - - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax deleted file mode 100644 index b9c45f3d..00000000 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ /dev/null @@ -1,56 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: comment-no-pop - - match: \{ - scope: punctuation.section.block.begin.js.fjsx15 - set: [ body-end, statement-or-expression ] - - body-end: - - meta_scope: >- - meta.class.js.fjsx15 - meta.block.js.fjsx15 - - include: comment-no-pop - - match: (?>(,)|(;)) - captures: - 1: punctuation.separator.comma.js.fjsx15 - 2: punctuation.terminator.js.fjsx15 - push: statement-or-expression - - match: \} - scope: punctuation.section.block.end.js.fjsx15 - pop: true - - match: (?=\S) - push: statement-or-expression - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - statement-or-expression: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class/modifier.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/indexer.sublime-syntax - - match: (?=\S) - pop: true diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax deleted file mode 100644 index 9f42e1e9..00000000 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ /dev/null @@ -1,136 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - indexer: | - (\[ - (?> {{string}} - | \g<-1> - | [^\[\]] - )* - \]) - - methodIdentifier: | - (?> {{string}} - | {{indexer}} - | {{commonIdentifier}} - ) - - genericParameters: | - (< - (?> {{string}} - | \g<-1> - | [^<>] - )* - >) - - string: | - (?> '(?:\'|[^'])*?' - | "(?:\"|[^"])*?" - | `(?:\`|[^`])*?` - ) - -contexts: - main: - # Method without identifier. - - match: (?=\() - set: declaration - # Normal method. - - match: | - (?xi) - (?= - {{methodIdentifier}} - \s*{{genericParameters}}? - \s*\( - ) - set: declaration - - body: - - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - computed-identifier-end: - - match: \] - scope: punctuation.definition.function.identifier.end.js.fjsx15 - pop: true - - declaration: - - meta_scope: >- - meta.declaration.function.method.js.fjsx15 - meta.function.js.fjsx15 - - include: comment-no-pop - # Body. - - match: (?=\{) - set: body - # Generic parameters. - - match: (?=<) - push: generic-arguments - # Parameters. - - match: (?=\() - push: parameters - # Support identifier. - - match: constructor\b - scope: entity.name.function.constructor.js.fjsx15 - set: [ - optional-support-body, - support-parameters - ] - # Identifier. - - match: (?xi){{commonIdentifier}} - scope: entity.name.function.js.fjsx15 - # Computed identifier. - - match: \[ - scope: punctuation.definition.function.identifier.begin.js.fjsx15 - push: [ computed-identifier-end, optional-expression ] - # String identifiers - - match: (?=['"`]) - push: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - include: else-pop - - else-pop: - - match: (?=\S) - pop: true - - generic-arguments: - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax - - optional-body: - - include: body - - include: else-pop - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - optional-support-body: - - include: body - - include: else-pop - - parameters: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax - - support-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/class/modifier.sublime-syntax b/syntaxes/fjsx15/class/modifier.sublime-syntax deleted file mode 100644 index 5ac79ecb..00000000 --- a/syntaxes/fjsx15/class/modifier.sublime-syntax +++ /dev/null @@ -1,56 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # static - - match: static\b(?!\s*(?>[:,=(]|$)) - scope: storage.modifier.js.fjsx15 - set: modifier-trap - # private - - match: \#(?!\s*(?>[:,=(]|$)) - scope: storage.modifier.js.fjsx15 - set: modifier-trap - # async - - match: async\b(?!\s*(?>[:,=(]|$)) - scope: storage.modifier.js.fjsx15 - set: modifier-trap - # get/set - - match: (?>get|set)\b(?!\s*(?>[:,=(]|$)) - scope: storage.modifier.js.fjsx15 - set: modifier-trap - # generator - - match: \*(?!\s*(?>[:,=(]|$)) - scope: storage.modifier.js.fjsx15 - set: modifier-trap - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - method-declaration: - - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax#declaration - - modifier-trap: - - include: main - - match: (?=\S) - set: property-or-method - - property-or-method: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax diff --git a/syntaxes/fjsx15/class/property.sublime-syntax b/syntaxes/fjsx15/class/property.sublime-syntax deleted file mode 100644 index b51121d6..00000000 --- a/syntaxes/fjsx15/class/property.sublime-syntax +++ /dev/null @@ -1,53 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax#function-assigned-to-variable - - match: (?xi)(?={{commonIdentifier}}) - set: [ - optional-type-and-value, - identifier - ] - - associated-type: - - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax - - identifier: - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - optional-type-and-value: - - match: \? - scope: keyword.operator.other.optional.flow - # Type. - - match: (?=:) - push: associated-type - # Value. - - match: (?==) - set: optional-expression - - match: (?=\S) - pop: true diff --git a/syntaxes/fjsx15/comment.no-pop.sublime-syntax b/syntaxes/fjsx15/comment.no-pop.sublime-syntax deleted file mode 100644 index 3d4d0c6a..00000000 --- a/syntaxes/fjsx15/comment.no-pop.sublime-syntax +++ /dev/null @@ -1,23 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?=/(?>/|\*)) - push: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax diff --git a/syntaxes/fjsx15/comment.sublime-syntax b/syntaxes/fjsx15/comment.sublime-syntax deleted file mode 100644 index 7f2f21fd..00000000 --- a/syntaxes/fjsx15/comment.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/flow1/prolog.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/comment.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/comment/eslint.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/comment/docblock.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/comment/block.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/comment/line.sublime-syntax diff --git a/syntaxes/fjsx15/comment/block.sublime-syntax b/syntaxes/fjsx15/comment/block.sublime-syntax deleted file mode 100644 index 812828a9..00000000 --- a/syntaxes/fjsx15/comment/block.sublime-syntax +++ /dev/null @@ -1,48 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: /\* - scope: punctuation.definition.comment.begin.js.fjsx15 - set: block - - block: - - meta_scope: comment.block.js.fjsx15 - # Used to correct indentation. - - match: $\n? - scope: meta.line-fence.comment.js.fjsx15 - # Contents. - - include: email-no-pop - - include: link-no-pop - - match: \*/ - scope: punctuation.definition.comment.end.js.fjsx15 - set: block-fence - - block-fence: - - match: \s*$\n? - scope: meta.block-fence.comment.js.fjsx15 - pop: true - - match: "" - pop: true - - email-no-pop: - - include: Packages/Naomi/syntaxes/shared/email.no-pop.sublime-syntax - - link-no-pop: - - include: Packages/Naomi/syntaxes/shared/link.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/comment/docblock.sublime-syntax b/syntaxes/fjsx15/comment/docblock.sublime-syntax deleted file mode 100644 index 1555fa52..00000000 --- a/syntaxes/fjsx15/comment/docblock.sublime-syntax +++ /dev/null @@ -1,48 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: /\*\*(?!/) - scope: punctuation.definition.comment.begin.js.fjsx15 - set: block - - block: - - meta_scope: comment.block.documentation.js.fjsx15 - # Used to correct indentation. - - match: $\n? - scope: meta.line-fence.comment.js.fjsx15 - # Contents. - - include: email-no-pop - - include: link-no-pop - - match: \*/ - scope: punctuation.definition.comment.end.js.fjsx15 - set: block-fence - - block-fence: - - match: \s*$\n? - scope: meta.block-fence.comment.js.fjsx15 - pop: true - - match: "" - pop: true - - email-no-pop: - - include: Packages/Naomi/syntaxes/shared/email.no-pop.sublime-syntax - - link-no-pop: - - include: Packages/Naomi/syntaxes/shared/link.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/comment/eslint.sublime-syntax b/syntaxes/fjsx15/comment/eslint.sublime-syntax deleted file mode 100644 index b93b5efe..00000000 --- a/syntaxes/fjsx15/comment/eslint.sublime-syntax +++ /dev/null @@ -1,59 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # Line. - - match: \/\/(?=\s*eslint) - scope: punctuation.definition.comment.begin.js.fjsx15 - set: line - # Block. - - match: \/\*(?=\s*eslint) - scope: punctuation.definition.comment.begin.js.fjsx15 - set: block - - line: - - include: enable-disable - - match: \s*$ - pop: true - - block: - - include: enable-disable - - match: \*/ - scope: punctuation.definition.comment.end.js.fjsx15 - pop: true - - enable-disable: - - match: (?i)eslint-(?>enable|disable)(?:-line)? - scope: keyword.other.js.fjsx15 - push: rules-loop - - rules-loop: - - match: (?=(?>$|\*\/)) - pop: true - # Delimiter. - - match: \, - scope: punctuation.separator.comma.js.fjsx15 - # Rule. - - match: | - (?xi) - ( - [$_[:alpha:]] - [$_\-/[:alnum:]]* - ) - scope: variable.other.eslint.rule.js.fjsx15 diff --git a/syntaxes/fjsx15/comment/line.sublime-syntax b/syntaxes/fjsx15/comment/line.sublime-syntax deleted file mode 100644 index 03a0332b..00000000 --- a/syntaxes/fjsx15/comment/line.sublime-syntax +++ /dev/null @@ -1,41 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: // - scope: punctuation.definition.comment.begin.js.fjsx15 - set: line - - no-pop: - - match: // - scope: punctuation.definition.comment.begin.js.fjsx15 - push: line - - line: - - meta_scope: comment.line.js.fjsx15 - - include: email-no-pop - - include: link-no-pop - - match: \n - pop: true - - email-no-pop: - - include: Packages/Naomi/syntaxes/shared/email.no-pop.sublime-syntax - - link-no-pop: - - include: Packages/Naomi/syntaxes/shared/link.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/constant.sublime-syntax b/syntaxes/fjsx15/constant.sublime-syntax deleted file mode 100644 index fc1d17c4..00000000 --- a/syntaxes/fjsx15/constant.sublime-syntax +++ /dev/null @@ -1,63 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - constantIdentifier: | - [$_[:upper:]] - [$_[:upper:][:digit:]]* - -contexts: - main: - - include: object - - include: normal - - object: - - match: | - (?x) - (\#)? - ({{constantIdentifier}}) - (?=\s*\??\.) - captures: - 1: storage.modifier.js.fjsx15 - 2: variable.other.object.constant.js.fjsx15 - pop: true - - normal: - # Single character. - - match: | - (?x) - (\#)? - ([_[:upper:]])\b - captures: - 1: storage.modifier.js.fjsx15 - 2: variable.other.constant.js.fjsx15 - pop: true - # Two or more characters. - - match: | - (?x) - (\#)? - ( - {{constantIdentifier}} - (?> \$\B - | [_[:upper:][:digit:]]\b - ) - ) - captures: - 1: storage.modifier.js.fjsx15 - 2: variable.other.constant.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/core.sublime-syntax b/syntaxes/fjsx15/core.sublime-syntax deleted file mode 100644 index 47a13313..00000000 --- a/syntaxes/fjsx15/core.sublime-syntax +++ /dev/null @@ -1,606 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - arrayFunctions: | - (?> from - | isArray - )\b - - dateFunctions: | - (?> [gs]et - (?> Date - | Day - | FullYear - | Hours - | Milliseconds - | Minutes - | Month - | Seconds - | Time(?>ZoneOffset) - | UTC - (?> Date - | Day - | FullYear - | Hours - | Milliseconds - | minutes - | Month - | Seconds - ) - ) - | now - | parse - | to - (?> DateString - | GMTString - | ISOString - | JSON - | Locale - (?> DateString - | Format - | String - | TimeString - ) - | Source - | String - | TimeString - | UTCString - | valueOf - ) - | UTC - )\b - - globalFunctions: | - (?> decodeURI(?:Component)? - | encodeURI(?:Component)? - | eval - | is(?>Finite|NaN) - | parse(?>Float|Int) - )\b - - jsonFunctions: | - (?> parse - | stringify - )\b - - mathFunctions: | - (?> abs - | acosh? - | asinh? - | atan(?>2|h)? - | cbrt - | ceil - | clz32 - | cosh? - | exp - | exp(?:m1)? - | floor - | fround - | hypot - | imul - | log(?>10|1p|2)? - | max - | min - | pow - | random - | round - | sign - | sinh? - | sqrt - | tanh? - | trunc - )\b - - objectFunctions: | - (?> assign - | create - | definePropert(?>ies|y) - | freeze - | getOwnProperty(?>Descriptors?|Names|Symbols) - | getPrototypeOf - | is(?>Extensible|Frozen|Sealed)? - | keys - | preventExtensions - | seal - | setPrototypeOf - )\b - - stringFunctions: | - (?> from(?>CharCode|CodePoint) - | char(?>At|CodeAt) - | codePointAt - | concat - | endsWith - | includes - | indexOf - | lastIndexOf - | localeCompare - | match - | normalize - | pad(?>End|start) - | repeat - | replace - | search - | slice - | split - | substr(?:ing)? - | to - (?> Locale(?>Lower|Upper) - | LowerCase - | String - | UpperCase - ) - | trim(?>Left|Right)? - | valueOf - | raw - )\b - - symbolFunctions: | - (?> for - | KeyFor - )\b - -contexts: - main: - - include: console - # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects - - include: constants - - include: variables - - include: functions - - include: function-properties - - include: import-properties - - include: fundamental-objects - - include: numbers-and-dates - - include: text-processing - - include: indexed-collections - - include: keyed-collections - - include: structured-data - - include: control-abstraction-objects - - include: reflection - - include: internationalization - - include: web-assembly - - array-property-or-function: - # Function call. - - match: (?x){{arrayFunctions}}(?=\s*\() - scope: support.function.js.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{arrayFunctions}} - scope: support.function.js.fjsx15 - pop: true - - include: other-property-or-function - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - - console: - - match: (console)\s*(\.) - captures: - 1: support.type.object.console.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - set: console-property-or-function - - console-property-or-function: - # error - - match: error(?=\s*\() - scope: support.function.console.error.js.fjsx15 - set: [ - console-error-meta-scope, - arguments - ] - - match: error\b - scope: support.function.console.error.js.fjsx15 - pop: true - # info - - match: info(?=\s*\() - scope: support.function.console.info.js.fjsx15 - set: [ - console-info-meta-scope, - arguments - ] - - match: info\b - scope: support.function.console.info.js.fjsx15 - pop: true - # log - - match: log(?=\s*\() - scope: support.function.console.log.js.fjsx15 - set: [ - console-log-meta-scope, - arguments - ] - - match: log\b - scope: support.function.console.log.js.fjsx15 - pop: true - # warn - - match: warn(?=\s*\() - scope: support.function.console.warn.js.fjsx15 - set: [ - console-warn-meta-scope, - arguments - ] - - match: warn\b - scope: support.function.console.warn.js.fjsx15 - pop: true - - include: other-property-or-function - - console-error-meta-scope: - - meta_scope: meta.function-call.console.error.js.fjsx15 - - include: pop-now - - console-info-meta-scope: - - meta_scope: meta.function-call.console.info.js.fjsx15 - - include: pop-now - - console-log-meta-scope: - - meta_scope: meta.function-call.console.log.js.fjsx15 - - include: pop-now - - console-warn-meta-scope: - - meta_scope: meta.function-call.console.warn.js.fjsx15 - - include: pop-now - - constants: - - match: | - (?x) - (?> (false) - | (Infinity) - | (NaN) - | (null) - | (true) - | (undefined) - )\b - captures: - 1: constant.language.boolean.false.js.fjsx15 - 2: constant.language.infinity.js.fjsx15 - 3: constant.language.nan.js.fjsx15 - 4: constant.language.null.js.fjsx15 - 5: constant.language.boolean.true.js.fjsx15 - 6: constant.language.undefined.js.fjsx15 - pop: true - - control-abstraction-objects: - - match: | - (?x) - (?> Generator(?:Function)? - | Promise - )\b - scope: support.type.object.js.fjsx15 - pop: true - - date-property-or-function: - # Function call. - - match: (?x){{dateFunctions}}(?=\s*\() - scope: support.function.js.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{dateFunctions}} - scope: support.function.js.fjsx15 - pop: true - - include: other-property-or-function - - else-pop: - - match: (?=\S) - pop: true - - function-call-meta-scope: - - meta_scope: meta.function-call.js.fjsx15 - - include: pop-now - - functions: - # Function call. - - match: (?x){{globalFunctions}}(?=\s*\() - scope: support.function.js.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{globalFunctions}} - scope: support.function.js.fjsx15 - pop: true - - fundamental-objects: - - match: (Object)\s*(\.) - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - set: object-property-or-function - - match: (Symbol)\s*(\.) - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - set: symbol-property-or-function - - match: | - (?x) - (?> Boolean - | Error - | EvalError - | Function - | InternalError - | Object - | RangeError - | ReferenceError - | Symbol - | SyntaxError - | TypeError - | URIError - )\b - scope: support.type.object.js.fjsx15 - pop: true - - function-properties: - - match: | - (?x) - (function) - \s*(\.) - \s*(sent) - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.variable.js.fsjx15 - pop: true - - import-properties: - - match: | - (?x) - (import) - \s*(\.) - \s*(meta) - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.variable.js.fsjx15 - pop: true - - indexed-collections: - - match: (Array)\s*(\.) - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - set: array-property-or-function - - match: | - (?x) - (?> Array - | Float(?>32|64)Array - | Int(?>8|16|32)Array - | Uint(?>8|16|32)Array - | Uint8ClampedArray - )\b - scope: support.type.object.js.fjsx15 - pop: true - - internationalization: - - match: | - (?x) - (Intl)\b - (?: - \s*(\.)\s* - ((?> Collator - | DateTimeFormat - | NumberFormat - ))\b - )? - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.type.js.fsjx15 - pop: true - - json-property-or-function: - # Function call. - - match: (?x){{jsonFunctions}}(?=\s*\() - scope: support.function.js.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{jsonFunctions}} - scope: support.function.js.fjsx15 - pop: true - - include: other-property-or-function - - keyed-collections: - - match: | - (?x) - (?> Map - | Set - | Weak(?>Map|Set) - )\b - scope: support.type.object.js.fjsx15 - pop: true - - math-property-or-function: - # Function call. - - match: (?x){{mathFunctions}}(?=\s*\() - scope: support.function.js.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{mathFunctions}} - scope: support.function.js.fjsx15 - pop: true - # Constants. - - match: | - (?x) - (?> E - | LN(?>10|2) - | LOG(?>10E|2E) - | PI - | SQRT(?>1_2|2) - )\b - scope: support.constant.js.fjsx15 - pop: true - - include: other-property-or-function - - numbers-and-dates: - - match: (Date)\s*(\.) - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - set: date-property-or-function - - match: (Math)\s*(\.) - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - set: math-property-or-function - - match: | - (?x) - (?> Date - | Math - | Number - )\b - scope: support.type.object.js.fjsx15 - pop: true - - object-property-or-function: - # Function call. - - match: (?x){{objectFunctions}}(?=\s*\() - scope: support.function.js.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{objectFunctions}} - scope: support.function.js.fjsx15 - pop: true - - include: other-property-or-function - - other-property-or-function: - - include: Packages/Naomi/syntaxes/fjsx15/operator/other.sublime-syntax#other-property-or-function - - reflection: - - match: | - (?x) - (?> Proxy - | Reflect - )\b - scope: support.type.object.js.fjsx15 - pop: true - - string-property-or-function: - # Function call. - - match: (?x){{stringFunctions}}(?=\s*\() - scope: support.function.js.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{stringFunctions}} - scope: support.function.js.fjsx15 - pop: true - - include: other-property-or-function - - structured-data: - - match: (JSON)\s*(\.) - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - set: json-property-or-function - - match: | - (?x) - (?> ArrayBuffer - | DataView - | JSON - )\b - scope: support.type.object.js.fjsx15 - pop: true - - symbol-property-or-function: - # Function call. - - match: (?x){{symbolFunctions}}(?=\s*\() - scope: support.function.js.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{symbolFunctions}} - scope: support.function.js.fjsx15 - pop: true - - include: other-property-or-function - - text-processing: - - match: (String)\s*(\.) - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - set: string-property-or-function - - match: | - (?x) - (?> RegExp - | String - )\b - scope: support.type.object.js.fjsx15 - pop: true - - pop-now: - - match: "" - pop: true - - variables: - # super() - - match: super(?=\s*\() - scope: variable.language.super.js.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Other variables. - - match: prototype\b - scope: variable.language.prototype.js.fjsx15 - pop: true - - match: super\b - scope: variable.language.super.js.fjsx15 - pop: true - - match: this\b - scope: variable.language.this.js.fjsx15 - pop: true - - web-assembly: - - match: | - (?x) - (WebAssembly)\b - (?: - \s*(\.)\s* - ((?> CompileError - | Instance - | LinkError - | Memory - | Module - | RuntimeError - | Table - ))\b - )? - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.type.js.fsjx15 - pop: true diff --git a/syntaxes/fjsx15/decorator.sublime-syntax b/syntaxes/fjsx15/decorator.sublime-syntax deleted file mode 100644 index 827548ff..00000000 --- a/syntaxes/fjsx15/decorator.sublime-syntax +++ /dev/null @@ -1,61 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - decoratorIdentifier: | - [$._[:alpha:]] - [$._[:alnum:]]* - -contexts: - main: - - match: (?xi)(@)(?={{decoratorIdentifier}}) - scope: punctuation.definition.annotation.js.fjsx15 - set: [ - meta, - decorator-identifier - ] - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - decorator-identifier: - # With arguments. - - match: (?xi){{decoratorIdentifier}}(?=\s*\() - scope: variable.annotation.js.fjsx15 - set: [ - possible-chain, - arguments - ] - # Without arguments. - - match: (?xi){{decoratorIdentifier}} - scope: variable.annotation.js.fjsx15 - set: possible-chain - - meta: - - meta_scope: meta.annotation.js.fjsx15 - - match: "" - pop: true - - # The decorator might be followed by a chain of function calls and we want to - # to highlight them as decorators too. - possible-chain: - - match: \. - scope: punctuation.definition.decorator.chain.js.fjsx15 - set: decorator-identifier - - match: (?=\S) - pop: true diff --git a/syntaxes/fjsx15/destructuring.sublime-syntax b/syntaxes/fjsx15/destructuring.sublime-syntax deleted file mode 100644 index ff7ca775..00000000 --- a/syntaxes/fjsx15/destructuring.sublime-syntax +++ /dev/null @@ -1,59 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - string: | - (?> '(?:\'|[^'])*?' - | "(?:\"|[^"])*?" - | `(?:\`|[^`])*?` - ) - -contexts: - main: - # Array. - - match: | - (?x) - (?= - (\[ - (?> {{string}} - | \g<-1> - | [^\[\]] - )* - \]) - \s*= - ) - set: destructuring-array - # Object. - - match: | - (?x) - (?= - (\{ - (?> {{string}} - | \g<-1> - | [^\{\}] - )* - \}) - \s*= - ) - set: destructuring-object - - destructuring-array: - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - - destructuring-object: - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax diff --git a/syntaxes/fjsx15/destructuring/array.sublime-syntax b/syntaxes/fjsx15/destructuring/array.sublime-syntax deleted file mode 100644 index bc20e030..00000000 --- a/syntaxes/fjsx15/destructuring/array.sublime-syntax +++ /dev/null @@ -1,55 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \[ - scope: punctuation.section.brackets.begin.js.fjsx15 - set: [ - delimiters, - optional-expression, - optional-type, - optional-variable - ] - - delimiters: - - meta_scope: meta.binding.destructuring.sequence.js.fjsx15 - - match: \, - scope: punctuation.separator.comma.js.fjsx15 - push: [ - optional-expression, - optional-type, - optional-variable - ] - - match: \] - scope: punctuation.section.brackets.end.js.fjsx15 - pop: true - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - optional-type: - - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax - - optional-variable: - - match: (?=[,)\]}]) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax#variable-or-constant diff --git a/syntaxes/fjsx15/destructuring/object.sublime-syntax b/syntaxes/fjsx15/destructuring/object.sublime-syntax deleted file mode 100644 index 9c55d73a..00000000 --- a/syntaxes/fjsx15/destructuring/object.sublime-syntax +++ /dev/null @@ -1,54 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \{ - scope: punctuation.section.block.begin.js.fjsx15 - set: delimiters - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - default-value: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - delimiters: - - meta_scope: meta.binding.destructuring.mapping.js.fjsx15 - - include: comment-no-pop - - match: \, - scope: punctuation.separator.comma.js.fjsx15 - - match: \} - scope: punctuation.section.block.end.js.fjsx15 - pop: true - # Rest operator. - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax - # Default value. - - match: (?==) - push: default-value - # Property. - - match: (?=\S) - set: property-or-variable - - property-or-variable: - - include: comment-no-pop - - match: (?=[,)\]}]) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object/property.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax diff --git a/syntaxes/fjsx15/destructuring/object/property.sublime-syntax b/syntaxes/fjsx15/destructuring/object/property.sublime-syntax deleted file mode 100644 index e50d41cc..00000000 --- a/syntaxes/fjsx15/destructuring/object/property.sublime-syntax +++ /dev/null @@ -1,110 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - # String property name. - - match: (?=(?>'|"|`)) - set: [ - optional-bind, - meta-key, - string - ] - # Computed property name. - - match: \[ - scope: punctuation.section.brackets.begin.js.fjsx15 - set: [ - optional-bind, - meta-computed-key, - computed-property-end, - optional-expression - ] - # Normal property with an bind. - - match: (?xi)({{commonIdentifier}})(?=\s*:) - scope: string.unquoted.js.fjsx15 - set: [ - optional-bind, - meta-key - ] - # Simple variable or constant. - - match: "" - set: [ object-destructuring-delimiters, variable-or-constant ] - - bind: - - meta_scope: meta.binding.destructuring.mapping.js.fjsx15 - - include: comment-no-pop - - match: (?=\)) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax#variable-or-constant - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - computed-property-end: - - match: \] - scope: punctuation.section.brackets.end.js.fjsx15 - pop: true - - meta-computed-key: - - meta_scope: meta.binding.destructuring.mapping.key.computed.js.fjsx15 - - include: pop-now - - meta-destructuring: - - meta_scope: meta.binding.destructuring.mapping.js.fjsx15 - - include: pop-now - - meta-key: - # The object literal meta scope is necessary to allow color schemes to make - # object destructuring keys similar to object literals. - - meta_scope: >- - meta.binding.destructuring.mapping.key.js.fjsx15 - meta.object-literal.key.js.fjsx15 - - include: pop-now - - object-destructuring-delimiters: - - meta_scope: meta.binding.destructuring.mapping.js.fjsx15 - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax#delimiters - - optional-bind: - - match: ":" - scope: punctuation.binding.js.fjsx15 - push: bind - - match: (?=\S) - set: object-destructuring-delimiters - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - pop-now: - - match: "" - pop: true - - string: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - variable-or-constant: - - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax#variable-or-constant diff --git a/syntaxes/fjsx15/export.sublime-syntax b/syntaxes/fjsx15/export.sublime-syntax deleted file mode 100644 index dcbddbdb..00000000 --- a/syntaxes/fjsx15/export.sublime-syntax +++ /dev/null @@ -1,116 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: export\b - scope: keyword.control.import-export.export.js.fjsx15 - set: possible-statement-or-expression - - alias: - - match: as\b - scope: keyword.control.import-export.as.js.fjsx15 - set: alias-name - - alias-name: - - match: (?xi){{commonIdentifier}} - scope: variable.other.readwrite.js.fjsx15 - pop: true - - close-block: - - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#close-block - - delimiter: - - match: \, - scope: punctuation.separator.comma.js.fjsx15 - push: optional-target - # From. - - include: origin - - include: else-pop - - else-pop: - - match: (?=\S) - pop: true - - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - optional-alias: - - match: (?=as\b) - set: alias - - include: else-pop - - optional-target: - - match: (?=(?>[,}]|from)) - pop: true - # Type. - - include: Packages/Naomi/syntaxes/flow1/type-export.sublime-syntax - # Aliased all. - - match: \*(?=\s*as\b) - scope: keyword.control.import-export.star.js.fjsx15 - set: alias - # All. - - match: \* - scope: keyword.control.import-export.star.js.fjsx15 - pop: true - # Multiple targets. - - match: \{ - scope: punctuation.section.block.begin.js.fjsx15 - set: [ - close-block, - delimiter, - optional-target - ] - # default. - - match: default\b - scope: keyword.control.import-export.default.js.fjsx15 - set: optional-alias - # Aliased. - - match: (?xi){{commonIdentifier}}(?=\s+as\b) - scope: variable.other.readwrite.js.fjsx15 - set: alias - # Simple. - - match: (?xi){{commonIdentifier}} - scope: variable.other.readwrite.js.fjsx15 - pop: true - - origin: - - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#origin - - possible-statement-or-expression: - - match: (?=(?>[*{]|type(?:of)?)) - set: [ delimiter, optional-target ] - # Default from. - - match: default\b(?=\s+from\b) - scope: keyword.control.import-export.default.js.fjsx15 - set: origin - # Default statements and expressions. - - match: default\b - scope: keyword.control.import-export.default.js.fjsx15 - set: expression - # Other statements. - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - # Renamed default. - - match: (?xi){{commonIdentifier}} - scope: variable.other.readwrite.js.fjsx15 - set: origin diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax deleted file mode 100644 index a678d615..00000000 --- a/syntaxes/fjsx15/expression.sublime-syntax +++ /dev/null @@ -1,158 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: comment-no-pop - - include: shared-main - # Start of the expression. - - match: (?=\S) - set: [ optional-tail, head ] - - close-group: - - match: \) - scope: punctuation.section.group.end.js.fjsx15 - pop: true - - comma: - - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - do-expression: - - match: do\b - scope: keyword.control.do-expression.js.fjsx15 - set: [ meta-do-expression, do-expression-body-begin ] - - do-expression-body-begin: - - match: \{ - scope: punctuation.section.block.begin.js.fjsx15 - set: do-expression-body-end - - do-expression-body-end: - - match: \} - scope: punctuation.section.block.end.js.fjsx15 - pop: true - - match: (?=\S) - push: statement-or-expression - - function-call: - - include: comment-no-pop - - include: main - - function-call-meta-scope: - - meta_scope: meta.function-call.js.fjsx15 - - match: "" - pop: true - - globals: - - include: Packages/Naomi/syntaxes/fjsx15/node-js.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/jest.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/web.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax - - head: - - include: comment-no-pop - - include: do-expression - - include: globals - - include: Packages/Naomi/syntaxes/fjsx15/jsx1.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function-expression.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax#function-assigned-to-variable - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - # Open new expression group. - - match: \( - scope: punctuation.section.group.begin.js.fjsx15 - set: open-group - - meta-do-expression: - - meta_scope: meta.do-expression.js.fjsx15 - - match: "" - pop: true - - open-group: - - meta_scope: meta.group.js.fjsx15 - - include: comment-no-pop - # Close the current expression group. - - include: close-group - # Type cast. - - match: (?=:) - set: [ close-group, type-cast ] - # Other expressions. - - match: (?=\S) - push: - - include: shared-main - # Start of the expression. - - match: "" - set: [ optional-tail, head ] - - optional-tail: - - include: comment-no-pop - # Function call. - - match: (?=\() - push: [ - function-call-meta-scope, - function-call - ] - # Property access. - - match: (?=\[) - push: property-access - # Other operators. At this point, operators will have a higher priority than - # regex literals. - - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax - # Anything else not expected. - - match: (?=\S) - pop: true - - property-access: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - - regex-literal: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax - - shared-main: - - include: comma - # At this stage, regex literals will have a higher priority than operators. - - match: (?=/) - set: [ optional-tail, regex-literal ] - # Arrow functions need to be detected before expression groups. - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax - # At this point is possible to predict JSX tags before operators because - # there’s no left operand for a "<" operator to be valid. - - include: Packages/Naomi/syntaxes/fjsx15/jsx1-early.sublime-syntax - # Prevent floating point being highlighted as a dot operator followed by an - # integer. - - match: (?=\.\d) - set: - - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax - # Detect operators as soon as possible. - - include: Packages/Naomi/syntaxes/fjsx15/operator.sublime-syntax - - statement-or-expression: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - type-cast: - - include: Packages/Naomi/syntaxes/flow1/cast.sublime-syntax diff --git a/syntaxes/fjsx15/function-call.sublime-syntax b/syntaxes/fjsx15/function-call.sublime-syntax deleted file mode 100644 index 21d8c624..00000000 --- a/syntaxes/fjsx15/function-call.sublime-syntax +++ /dev/null @@ -1,103 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - comment: /\*.*?\*/ - - genericArguments: | - (< - (?> {{string}} - | \g<-1> - | [^<>] - )* - >) - - string: | - (?> '(?:\'|[^'])*?' - | "(?:\"|[^"])*?" - | `(?:\`|[^`])*?` - ) - -contexts: - main: - # Generic function call. - - match: | - (?xi) - (?= - (?:\#\s*)? - {{commonIdentifier}} - \s*{{genericArguments}} - \s*(\?\.)? - \s*\( - ) - set: [ - meta, - arguments, - generic-arguments, - identifier, - optional-modifier - ] - # Simple function call. - - match: | - (?xi) - (?= - (?:\#\s*)? - {{commonIdentifier}} - (?:\s*{{comment}})? - \s*(\?\.)? - \s*\( - ) - set: [ - meta, - arguments, - identifier, - optional-modifier - ] - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - - else-pop: - - match: (?=\S) - pop: true - - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - identifier: - - match: (?xi){{commonIdentifier}} - scope: variable.function.js.fjsx15 - pop: true - - generic-arguments: - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax - - meta: - - meta_scope: meta.function-call.js.fjsx15 - - match: "" - pop: true - - optional-modifier: - - match: \# - scope: storage.modifier.js.fjsx15 - - include: else-pop diff --git a/syntaxes/fjsx15/function-call/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/arguments.sublime-syntax deleted file mode 100644 index 27446204..00000000 --- a/syntaxes/fjsx15/function-call/arguments.sublime-syntax +++ /dev/null @@ -1,40 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \( - scope: punctuation.section.group.begin.js.fjsx15 - set: delimiter - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - delimiter: - - meta_scope: meta.group.js.fjsx15 - - include: comment-no-pop - - match: \) - scope: punctuation.section.group.end.js.fjsx15 - pop: true - - match: \, - scope: punctuation.separator.comma.js.fjsx15 - - match: (?=\S) - push: expression - - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/function-expression.sublime-syntax b/syntaxes/fjsx15/function-expression.sublime-syntax deleted file mode 100644 index 476bb789..00000000 --- a/syntaxes/fjsx15/function-expression.sublime-syntax +++ /dev/null @@ -1,80 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax#function-properties - - match: | - (?x) - (?= - (?:async\s+)? - function\b - ) - set: [ - declaration, - keyword - ] - - body: - - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - declaration: - - meta_scope: meta.function.js.fjsx15 - - include: comment-no-pop - # Body. - - match: (?=\{) - set: body - # Generic parameters. - - match: (?=<) - push: generic-arguments - # Parameters. - - match: (?=\() - push: parameters - # Identifier. - - match: | - (?xi) - (?:(\*)\s*)? - (?:({{commonIdentifier}}))? - captures: - 1: storage.modifier.js.fjsx15 - 2: entity.name.function.js.fjsx15 - - include: else-pop - - else-pop: - - match: (?=\S) - pop: true - - keyword: - - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - match: function\b - scope: storage.type.function.js.fjsx15 - pop: true - - generic-arguments: - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax - - parameters: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax deleted file mode 100644 index d0c6829a..00000000 --- a/syntaxes/fjsx15/function.sublime-syntax +++ /dev/null @@ -1,96 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax#function-properties - - match: | - (?x) - (?= - (?:async\s+)? - function\b - ) - set: [ - declaration, - keyword - ] - - body: - - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - declaration: - - meta_scope: >- - meta.declaration.function.js.fjsx15 - meta.function.js.fjsx15 - - include: comment-no-pop - # Body. - - match: (?=\{) - set: body - # Generic parameters. - - match: (?=<) - push: generic-arguments - # Parameters. - - match: (?=\() - set: [ - optional-body, - meta-declaration-scope, - parameters - ] - # Identifier. - - match: | - (?xi) - (?:(\*)\s*)? - (?:({{commonIdentifier}}))? - captures: - 1: storage.modifier.js.fjsx15 - 2: entity.name.function.js.fjsx15 - - include: else-pop - - else-pop: - - match: (?=\S) - pop: true - - generic-arguments: - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax - - keyword: - - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - match: function\b - scope: storage.type.function.js.fjsx15 - pop: true - - meta-declaration-scope: - - meta_scope: meta.declaration.function.js.fjsx15 - - match: "" - pop: true - - optional-body: - - match: (?=\{) - set: body - - include: else-pop - - parameters: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/function/body.sublime-syntax b/syntaxes/fjsx15/function/body.sublime-syntax deleted file mode 100644 index 0d47c6d1..00000000 --- a/syntaxes/fjsx15/function/body.sublime-syntax +++ /dev/null @@ -1,39 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \{ - scope: punctuation.section.block.begin.js.fjsx15 - set: [ - close-body, - optional-statement-or-expression - ] - - close-body: - - meta_scope: >- - meta.function.js.fjsx15 - meta.block.js.fjsx15 - - match: \} - scope: punctuation.section.block.end.js.fjsx15 - pop: true - - match: "" - push: optional-statement-or-expression - - optional-statement-or-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-statement-or-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax deleted file mode 100644 index a6bec653..00000000 --- a/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax +++ /dev/null @@ -1,57 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \[ - scope: punctuation.section.brackets.begin.js.fjsx15 - set: [ meta, delimiters, optional-parameter ] - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - delimiters: - - include: comment-no-pop - - match: \, - scope: punctuation.separator.comma.js.fjsx15 - push: optional-parameter - - match: \] - scope: punctuation.section.brackets.end.js.fjsx15 - set: optional-type-and-default-value - - meta: - - meta_scope: >- - meta.binding.destructuring.sequence.js.fjsx15 - meta.block.js.fjsx15 - - match: "" - pop: true - - optional-parameter: - - include: comment-no-pop - - match: (?=[,)\]}]) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax - - optional-type-and-default-value: - - match: (?=,) - pop: true - - include: Packages/Naomi/syntaxes/flow1/associated-type.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax deleted file mode 100644 index ee344505..00000000 --- a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax +++ /dev/null @@ -1,58 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \{ - scope: punctuation.section.block.begin.js.fjsx15 - set: [ meta, delimiters, optional-parameter ] - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - delimiters: - - include: comment-no-pop - - match: \, - scope: punctuation.separator.comma.js.fjsx15 - push: optional-parameter - - match: \} - scope: punctuation.section.block.end.js.fjsx15 - set: optional-type-and-default-value - - meta: - - meta_scope: >- - meta.binding.destructuring.mapping.js.fjsx15 - meta.block.js.fjsx15 - - match: "" - pop: true - - optional-parameter: - - include: comment-no-pop - - match: (?=[,)\]}]) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object/property.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax - - optional-type-and-default-value: - - match: (?=,) - pop: true - - include: Packages/Naomi/syntaxes/flow1/associated-type.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/destructuring/object/property.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/object/property.sublime-syntax deleted file mode 100644 index dc89520d..00000000 --- a/syntaxes/fjsx15/function/parameter/destructuring/object/property.sublime-syntax +++ /dev/null @@ -1,74 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - # String property name. - - match: (?=(?>'|"|`)) - set: [ - optional-alias, - string - ] - # Computed property name. - - match: \[ - scope: punctuation.definition.object.computed-property.begin.js.fjsx15 - set: [ - optional-alias, - computed-property-end, - optional-expression - ] - # Normal property with an alias. - - match: (?xi){{commonIdentifier}}(?=\s*:) - scope: meta.binding.destructuring.mapping.key.js.fjsx15 - set: optional-alias - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - computed-property-end: - - match: \] - scope: punctuation.definition.object.computed-property.end.js.fjsx15 - pop: true - - optional-alias: - - match: ":" - scope: punctuation.binding.js.fjsx15 - set: optional-parameter - - match: (?=\S) - pop: true - - optional-parameter: - - include: comment-no-pop - - match: (?=\)) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - string: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax deleted file mode 100644 index 8cf2218c..00000000 --- a/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: | - (?xi) - (?= - (?:\.{3})? - {{commonIdentifier}} - ) - push: parameter - - parameter: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax deleted file mode 100644 index a5b20891..00000000 --- a/syntaxes/fjsx15/function/parameter/simple.sublime-syntax +++ /dev/null @@ -1,139 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - genericArguments: | - (< - (?> {{string}} - | \g<-1> - | [^<>] - )* - >) - - parameters: | - (\( - (?> {{string}} - | \g<-1> - | [^()] - )* - \)) - - flowOperators: | - (?> &(?!\s*&) - | \|(?!\s*\|) - ) - - string: | - (?> '(?:\'|[^'])*?' - | "(?:\"|[^"])*?" - | `(?:\`|[^`])*?` - ) - - flowObject: | - (\{ - (?> {{string}} - | \g<-1> - | [^{}] - )* - }) - - simpleFlowType: | - (?> {{string}} - | {{flowObject}} - | [$_[:alpha:]][$_[:alnum:].]* - ) - (?:\s*{{genericArguments}})? - (?:\s*\[\s*\])? - - flowFunction: | - ( - {{parameters}} - \s*=>\s* - (?> (?:\?\s*){{simpleFlowType}} - | \g<-1> - ) - ) - - complexType: | - (?:\?\s*)? - ( - (?> {{simpleFlowType}} - | {{flowFunction}} - | \g<-1> - ) - ) - - multipleTypes: | - ( - (?> \s*{{flowOperators}} - | \s*{{complexType}} - | \g<-1> - )+ - ) - - flowComment: /\*\s*:.*?\*/ - - type: | - (?> {{flowComment}} - | \:\s*{{multipleTypes}} - ) - -contexts: - main: - # With default value. - - match: | - (?xi) - {{commonIdentifier}} - (?= - \s*\?? - \s*{{type}}? - (?:\s*/\*.*?\*/)? - \s*=(?!\s*>) - ) - scope: variable.parameter.function.js.fjsx15 - set: [ - optional-default-value, - optional-modifier-and-type - ] - # Normal parameter. - - match: (?xi){{commonIdentifier}} - scope: variable.parameter.function.js.fjsx15 - set: optional-modifier-and-type - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - optional-default-value: - - meta_scope: meta.function.parameter.optional.js.fjsx15 - - include: comment-no-pop - - match: (?=(?>[,;:)\]}]|=>)) - pop: true - - match: (?==) - push: expression - - optional-modifier-and-type: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/flow1/optional-modifier.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax b/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax deleted file mode 100644 index aa8418cb..00000000 --- a/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax +++ /dev/null @@ -1,25 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?=\() - push: parameters - - parameters: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters.sublime-syntax b/syntaxes/fjsx15/function/parameters.sublime-syntax deleted file mode 100644 index fc550dc0..00000000 --- a/syntaxes/fjsx15/function/parameters.sublime-syntax +++ /dev/null @@ -1,51 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \( - scope: punctuation.section.group.begin.js.fjsx15 - set: delimiters - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - delimiters: - - meta_scope: >- - meta.function.parameters.js.fjsx15 - meta.group.js.fjsx15 - - include: comment-no-pop - - match: \, - scope: punctuation.separator.comma.js.fjsx15 - - match: \) - scope: punctuation.section.group.end.js.fjsx15 - set: optional-return-type - # Rest. - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax - # Actual parameter. - - match: (?=\S) - push: parameter - - optional-return-type: - - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax - - parameter: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.sublime-syntax diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax deleted file mode 100644 index 2875984c..00000000 --- a/syntaxes/fjsx15/import.sublime-syntax +++ /dev/null @@ -1,135 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax#import-properties - # Dynamic import. - - match: import\b(?=\s*\() - scope: support.function.import.js.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Import the entire module. - - match: (?x)import\b(?=\s*(?>"|'|`)) - scope: keyword.control.import-export.import.js.fjsx15 - set: origin-path - # Other. - - match: (?x)import\b - scope: keyword.control.import-export.import.js.fjsx15 - set: [ - delimiter, - optional-target - ] - - alias: - - match: as\b - scope: keyword.control.import-export.as.js.fjsx15 - set: alias-name - - alias-name: - - match: (?xi){{commonIdentifier}} - scope: variable.other.readwrite.js.fjsx15 - pop: true - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - block-optional-target: - - include: comment-no-pop - - match: (?=(?>[,}])) - pop: true - - include: shared-optional-target - - close-block: - - match: \} - scope: punctuation.section.block.end.js.fjsx15 - pop: true - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - delimiter: - - include: comment-no-pop - - match: \, - scope: punctuation.separator.comma.js.fjsx15 - push: optional-target - # From. - - include: origin - - include: else-pop - - else-pop: - - match: (?=\S) - pop: true - - function-call-meta-scope: - - meta_scope: meta.function-call.js.fjsx15 - - match: "" - pop: true - - origin: - - include: comment-no-pop - - match: from\b - scope: keyword.control.import-export.origin.js.fjsx15 - set: origin-path - - origin-path: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - optional-target: - - include: comment-no-pop - - match: (?=(?>[,}]|from)) - pop: true - - include: shared-optional-target - - shared-optional-target: - # Type. - - include: Packages/Naomi/syntaxes/flow1/type-import.sublime-syntax - # Aliased All. - - match: \*(?=\s*as) - scope: keyword.control.import-export.star.js.fjsx15 - set: alias - # All. - - match: \* - scope: keyword.control.import-export.star.js.fjsx15 - pop: true - # Multiple targets. - - match: \{ - scope: punctuation.section.block.begin.js.fjsx15 - set: [ - close-block, - delimiter, - block-optional-target - ] - # Aliased. - - match: (?xi){{commonIdentifier}}(?=\s+as) - scope: variable.other.readwrite.js.fjsx15 - set: alias - # Simple. - - match: (?xi){{commonIdentifier}} - scope: variable.other.readwrite.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/jest.sublime-syntax b/syntaxes/fjsx15/jest.sublime-syntax deleted file mode 100644 index 14a04b22..00000000 --- a/syntaxes/fjsx15/jest.sublime-syntax +++ /dev/null @@ -1,194 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # jest. - - match: (jest)\s*(\.) - captures: - 1: support.type.object.jest.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - set: jest-property-or-function - # afterAll/Each, beforeAll/Each, describe, it, test. - - match: | - (?x) - (?> after(?>All|Each) - | before(?>All|Each) - | describe - | it - | test - )\b - (?= - (?> \.(?>each|only|skip) - | \s*\( - ) - ) - scope: support.function.jest.fn.js.fjsx15 - set: [ - meta-scope, - arguments, - optional-each-skip-only - ] - # expect - - match: expect\b - scope: support.function.jest.js.fjsx15 - set: expect-chain - - accessor-no-pop: - - match: \. - scope: punctuation.accessor.js.fjsx15 - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - - else-pop: - - match: (?=\S) - pop: true - - expect-chain: - - include: accessor-no-pop - # Expect arguments. - - match: (?=\s*\() - push: [ - meta-scope, - arguments - ] - # Other. - - match: (?>not|resolves|rejects)\b - scope: support.type.object.jest.matcher.other.js.fjsx15 - # Matchers. - - match: | - (?x) - to - (?> Be - (?> Called - | CloseTo - | Defined - | Falsy - | GreaterThan(?:OrEqual)? - | InstanceOf - | LessThan(?:OrEqual)? - | Null - | Truthy - | Undefined - )? - | Contain(?:Equal)? - | Equal - | Have - (?> Been - (?> Called(?>Times|With)? - | LastCalledWith - | NthCalledWith - ) - | LastReturnedWith - | NthReturnedWith - | Returned(?>Times|With)? - ) - | Have(?>Length|Property) - | Match(?:Object|(?:Inline)?Snapshot)? - | StrictEqual - | Throw(?:Error(?:Matching(?:Inline)?Snapshot)?)? - )\b - (?=\s*\() - scope: support.function.jest.matcher.fjsx15 - set: [ - matcher-meta-scope, - arguments - ] - # Other. - - match: | - (?x) - (?> addSnapshotSerializer - | any(?:thing)? - | array(?:Containing)? - | assertions - | extend - | hasAssertions - | objectContaining - | string(?>Containing|Matching) - )\b - (?=\s*\() - scope: support.function.jest.matcher.fjsx15 - set: [ - meta-scope, - arguments - ] - - include: else-pop - - jest-property-or-function: - - match: | - (?x) - (?> clearAllTimers - | disableAutomock - | enableAutomock - | fn - | isMockFunction - | genMockFromModule - | mock - | unmock - | doMock - | dontMock - | clearAllMocks - | resetAllMocks - | restoreAllMocks - | resetModules - | runAllTicks - | runAllTimers - | advanceTimersByTime - | runOnlyPendingTimers - | setMock - | setTimeout - | useFakeTimers - | useRealTimers - | spyOn - ) - (?=\s*\() - scope: support.function.jest.js.fjsx15 - set: [ - meta-scope, - arguments - ] - - include: else-pop - - matcher-meta-scope: - - meta_scope: meta.function-call.jest.matcher.js.fjsx15 - - include: pop-now - - meta-scope: - - meta_scope: meta.function-call.jest.js.fjsx15 - - include: pop-now - - optional-each-skip-only: - - include: accessor-no-pop - # each - - match: each\b - scope: support.function.jest.each.js.fjsx15 - pop: true - # only - - match: only\b - scope: support.function.jest.only.js.fjsx15 - pop: true - # skip - - match: skip\b - scope: support.function.jest.skip.js.fjsx15 - pop: true - - include: else-pop - - pop-now: - - match: "" - pop: true diff --git a/syntaxes/fjsx15/jsx1-early.sublime-syntax b/syntaxes/fjsx15/jsx1-early.sublime-syntax deleted file mode 100644 index df8408ed..00000000 --- a/syntaxes/fjsx15/jsx1-early.sublime-syntax +++ /dev/null @@ -1,36 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_.:[:alnum:]]* - -contexts: - main: - - match: (?xi)(?=<(?>\s*>|{{commonIdentifier}})) - set: [ meta, jsx ] - - jsx: - - include: Packages/Naomi/syntaxes/fjsx15/jsx1.sublime-syntax#jsx - - meta: - - clear_scopes: true - - meta_scope: source.jsx - - match: "" - pop: true diff --git a/syntaxes/fjsx15/jsx1.sublime-syntax b/syntaxes/fjsx15/jsx1.sublime-syntax deleted file mode 100644 index 11cdfaa9..00000000 --- a/syntaxes/fjsx15/jsx1.sublime-syntax +++ /dev/null @@ -1,38 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_.:[:alnum:]]* - -contexts: - main: - - match: (?xi)(?=<(?>\s*>|{{commonIdentifier}})) - set: [ meta, jsx ] - - jsx: - - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax#with-js-fence - - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax#with-js-fence - - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax#with-js-fence - - meta: - - clear_scopes: true - - meta_scope: source.jsx - - match: "" - pop: true diff --git a/syntaxes/fjsx15/literal.sublime-syntax b/syntaxes/fjsx15/literal.sublime-syntax deleted file mode 100644 index ad009ac3..00000000 --- a/syntaxes/fjsx15/literal.sublime-syntax +++ /dev/null @@ -1,29 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/styled-component.sublime-syntax - # - include: Packages/Naomi/syntaxes/fjsx15/literal/string/polymer-template.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax diff --git a/syntaxes/fjsx15/literal/array.sublime-syntax b/syntaxes/fjsx15/literal/array.sublime-syntax deleted file mode 100644 index addf9705..00000000 --- a/syntaxes/fjsx15/literal/array.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \[ - scope: punctuation.section.brackets.begin.js.fjsx15 - set: [ delimiters, optional-expression ] - - delimiters: - - meta_scope: meta.sequence.js.fjsx15 - - match: \] - scope: punctuation.section.brackets.end.js.fjsx15 - pop: true - - match: \, - scope: punctuation.separator.comma.js.fjsx15 - push: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/literal/number.sublime-syntax b/syntaxes/fjsx15/literal/number.sublime-syntax deleted file mode 100644 index 6f2f40b6..00000000 --- a/syntaxes/fjsx15/literal/number.sublime-syntax +++ /dev/null @@ -1,76 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - literalDecimal: | - [0-9][0-9_]* - - literalFloat: | - (?> [0-9]*[.]{{literalDecimal}} - | {{literalDecimal}}[.][0-9]* - ) - - scientificNotation: | - ( - (?> {{literalFloat}} - | {{literalDecimal}} - ) - [e][+-]? - {{literalDecimal}} - ) - -contexts: - main: - - include: float - - include: integer - - float: - - match: (?xi){{scientificNotation}} - scope: constant.numeric.float.scientific.js.fjsx15 - pop: true - - match: (?x){{literalFloat}} - scope: constant.numeric.float.js.fjsx15 - pop: true - - integer: - - match: (?i)(0b)([01_]+) - captures: - 1: >- - constant.numeric.binary.js.fjsx15 - punctuation.definition.numeric.js.fjsx15 - 2: constant.numeric.binary.js.fjsx15 - pop: true - - match: (?i)(0o)([0-7]+) - captures: - 1: >- - constant.numeric.octal.js.fjsx15 - punctuation.definition.numeric.js.fjsx15 - 2: constant.numeric.octal.js.fjsx15 - pop: true - - match: (?i)(0x)([0-9a-f_]+) - captures: - 1: >- - constant.numeric.hex.js.fjsx15 - punctuation.definition.numeric.js.fjsx15 - 2: constant.numeric.hex.js.fjsx15 - pop: true - - match: ([1-9][0-9_]*|0)(?:\s*(n))? - captures: - 1: constant.numeric.decimal.js.fjsx15 - 2: storage.type.numeric.bigint.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/literal/object.sublime-syntax b/syntaxes/fjsx15/literal/object.sublime-syntax deleted file mode 100644 index 37ba1e63..00000000 --- a/syntaxes/fjsx15/literal/object.sublime-syntax +++ /dev/null @@ -1,60 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \{ - scope: punctuation.section.block.begin.js.fjsx15 - set: delimiters - - anything-else: - - include: comment-no-pop - - match: (?=[,}]) - pop: true - # Spread. - - include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax - # Methods. - - include: Packages/Naomi/syntaxes/fjsx15/class/modifier.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - # Key. - - include: Packages/Naomi/syntaxes/fjsx15/literal/object/property.sublime-syntax - # Any other expression. - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - constant: - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - delimiters: - - meta_scope: >- - meta.object-literal.js.fjsx15 - meta.block.js.fjsx15 - - include: comment-no-pop - - match: \, - scope: punctuation.separator.comma.js.fjsx15 - - match: \} - scope: punctuation.section.block.end.js.fjsx15 - pop: true - # Anything else. - - match: (?=\S) - push: anything-else - - variable: - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax diff --git a/syntaxes/fjsx15/literal/object/property.sublime-syntax b/syntaxes/fjsx15/literal/object/property.sublime-syntax deleted file mode 100644 index 5c026423..00000000 --- a/syntaxes/fjsx15/literal/object/property.sublime-syntax +++ /dev/null @@ -1,294 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - constantIdentifier: | - [$_[:upper:]] - [$_[:upper:][:digit:]]* - - keyIdentifier: | - (?> {{string}} - | [$_[:alnum:]] - [$_[:alnum:]]* - ) - - indexer: | - (\[ - (?> {{string}} - | \g<-1> - | [^\[\]] - )* - \]) - - genericArguments: | - (< - (?> {{string}} - | \g<-1> - | [^<>] - )* - >) - - parameters: | - (\( - (?> {{string}} - | \g<-1> - | [^()] - )* - \)) - - flowOperators: | - (?> &(?!\s*&) - | \|(?!\s*\|) - ) - - string: | - (?> '(?:\'|[^'])*?' - | "(?:\"|[^"])*?" - | `(?:\`|[^`])*?` - ) - - flowObject: | - (\{ - (?> {{string}} - | \g<-1> - | [^{}] - )* - }) - - simpleFlowType: | - (?> {{string}} - | {{flowObject}} - | [$_[:alpha:]][$_[:alnum:].]* - ) - (?:\s*{{genericArguments}})? - (?:\s*\[\s*\])? - - flowFunction: | - ( - {{parameters}} - \s*=>\s* - (?> (?:\?\s*){{simpleFlowType}} - | \g<-1> - ) - ) - - complexType: | - (?:\?\s*)? - ( - (?> {{simpleFlowType}} - | {{flowFunction}} - | \g<-1> - ) - ) - - multipleTypes: | - ( - (?> \s*{{flowOperators}} - | \s*{{complexType}} - | \g<-1> - )+ - ) - - flowComment: /\*\s*:.*?\*/ - - type: | - (?> {{flowComment}} - | \:\s*{{multipleTypes}} - ) - - normalArrowFunction: | - (?:async\b\s*)? - (?:{{genericArguments}}\s*)? - {{parameters}} - (?:\s*{{type}})? - \s*=> - - singleParameterArrowFunction: | - (?:async\b\s+)? - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=> - - anyArrowFunction: | - (?> {{normalArrowFunction}} - | {{singleParameterArrowFunction}} - ) - - normalArrowFunctionAssignedToVariable: | - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=\s* - {{normalArrowFunction}} - - singleParameterArrowFunctionAssignedToVariable: | - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=\s* - {{singleParameterArrowFunction}} - - anyArrowFunctionAssignedToVariable: | - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=\s* - (?> {{normalArrowFunction}} - | {{singleParameterArrowFunction}} - ) - -contexts: - main: - # Function assigned to property. - - match: | - (?xi) - (?= - {{keyIdentifier}} - \s*:\s* - (?:async\b\s+)? - function\b - ) - set: [ - function-declaration, - meta-declaration-function, - function-keyword, - meta-key, - method-identifier - ] - # Single parameter arrow function assigned to property. - - match: | - (?xi) - (?= - {{keyIdentifier}} - \s*:\s* - {{singleParameterArrowFunction}} - ) - set: [ - arrow-function, - meta-key, - method-identifier - ] - # Arrow function assigned to property. - - match: | - (?xi) - (?= - {{keyIdentifier}} - \s*:\s* - {{normalArrowFunction}} - ) - set: [ - arrow-function, - meta-key, - method-identifier - ] - # Computed property name. - - match: \[ - scope: punctuation.section.brackets.begin.js.fjsx15 - set: [ - associated-value, - meta-computed-key, - computed-property-end, - optional-expression - ] - # Other keys. - - match: | - (?xi) - (?= - {{keyIdentifier}} - \s*: - ) - set: [ - associated-value, - meta-key, - any-key - ] - - any-key: - - include: string - - include: number - # TODO: The correct option in this case is to highlight keys as unquoted - # strings but some users will prefer the old behavior and so a configurable - # property is desired in this case. - - match: "[^:]*" - scope: string.unquoted.js.fjsx15 - pop: true - # - include: constant - # - include: variable - - arrow-function: - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax - - associated-value: - - match: ":" - scope: punctuation.separator.key-value.js.fjsx15 - set: optional-expression - - constant: - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - - computed-property-end: - - match: \] - scope: punctuation.section.brackets.end.js.fjsx15 - pop: true - - function-declaration: - - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax#declaration - - function-keyword: - - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax#keyword - - meta-computed-key: - - meta_scope: meta.object-literal.key.computed.js.fjsx15 - - include: pop-now - - meta-declaration-function: - - meta_scope: meta.declaration.function.js.fjsx15 - - include: pop-now - - meta-key: - - meta_scope: meta.object-literal.key.js.fjsx15 - - include: pop-now - - method-identifier: - - match: | - (?xi) - ({{keyIdentifier}}) - \s*(:) - captures: - 1: entity.name.function.js.fjsx15 - 2: punctuation.separator.key-value.js.fjsx15 - pop: true - - number: - - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - pop-now: - - match: "" - pop: true - - string: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - variable: - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax diff --git a/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax b/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax deleted file mode 100644 index 35aa34e8..00000000 --- a/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax +++ /dev/null @@ -1,55 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - hexEscapedChar: | - x[a-f0-9]{2} - - unicodeEscapedChar: | - (?> u[a-f0-9]{4} - | u\{[a-f0-9]+} - ) - - doubleQuotedEscapeSequences: | - \\ - (?> ["\\bfnrtv] - | {{hexEscapedChar}} - | {{unicodeEscapedChar}} - ) - -contexts: - main: - - match: \" - scope: punctuation.definition.string.begin.js.fjsx15 - set: string - - trap: - - meta_content_scope: context.trap - - string: - - meta_scope: string.quoted.double.js.fjsx15 - # New line trap. - - match: (?\\b|\^|\$) - scope: keyword.control.anchor.regexp.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/literal/string/regex/backref.sublime-syntax b/syntaxes/fjsx15/literal/string/regex/backref.sublime-syntax deleted file mode 100644 index 4a7eb85c..00000000 --- a/syntaxes/fjsx15/literal/string/regex/backref.sublime-syntax +++ /dev/null @@ -1,23 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \\[1-9][0-9]* - scope: keyword.other.back-reference.regexp.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/literal/string/regex/backslash.sublime-syntax b/syntaxes/fjsx15/literal/string/regex/backslash.sublime-syntax deleted file mode 100644 index 7d9629a2..00000000 --- a/syntaxes/fjsx15/literal/string/regex/backslash.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # Character classes/sets. - - match: (?i)\\[wsd]| - scope: constant.other.character-class.escape.backslash.regexp - pop: true - # Other escape sequences. - - match: | - (?x) - \\ - (?> c[A-Z] - | x[\da-fA-F]{2} - | u[\da-fA-F]{4} - | . - ) - scope: constant.character.escape.backslash.regexp.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/literal/string/regex/capturing-group.sublime-syntax b/syntaxes/fjsx15/literal/string/regex/capturing-group.sublime-syntax deleted file mode 100644 index 3506be31..00000000 --- a/syntaxes/fjsx15/literal/string/regex/capturing-group.sublime-syntax +++ /dev/null @@ -1,38 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \((?!\?) - scope: punctuation.definition.group.begin.regexp.js.fjsx15 - set: [ meta, close, regex-content ] - - close: - - match: \) - scope: punctuation.definition.group.end.regexp.js.fjsx15 - pop: true - - match: (?=\S) - push: regex-content - - meta: - - meta_scope: meta.group.regexp.js.fjsx15 - - match: "" - pop: true - - regex-content: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax#regex-content diff --git a/syntaxes/fjsx15/literal/string/regex/character-class.sublime-syntax b/syntaxes/fjsx15/literal/string/regex/character-class.sublime-syntax deleted file mode 100644 index d5c84137..00000000 --- a/syntaxes/fjsx15/literal/string/regex/character-class.sublime-syntax +++ /dev/null @@ -1,45 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \. - scope: constant.other.character-class.regexp.js.fjsx15 - pop: true - - match: ((\[)(\^)?) - captures: - 1: constant.other.character-class.regexp.js.fjsx15 - 2: punctuation.definition.character-class.begin.regexp.js.fjsx15 - 3: keyword.operator.negation.regexp.js.fjsx15 - set: close - - close: - - match: \] - scope: >- - constant.other.character-class.regexp.js.fjsx15 - punctuation.definition.character-class.end.regexp.js.fjsx15 - pop: true - - match: (?=\S) - push: content - - content: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex/character-class/range.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex/backslash.sublime-syntax - - match: . - scope: constant.other.character-class.regexp.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/literal/string/regex/character-class/range.sublime-syntax b/syntaxes/fjsx15/literal/string/regex/character-class/range.sublime-syntax deleted file mode 100644 index af6af3a7..00000000 --- a/syntaxes/fjsx15/literal/string/regex/character-class/range.sublime-syntax +++ /dev/null @@ -1,34 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - possibleRange: | - (?> \w - | \d - | \\ - (?> c[A-Z] - | x[\da-fA-F]{2} - | u[\da-fA-F]{4} - ) - ) - -contexts: - main: - - match: (?xi){{possibleRange}}-{{possibleRange}} - scope: constant.other.character-class.range.regexp.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/literal/string/regex/lookahead.sublime-syntax b/syntaxes/fjsx15/literal/string/regex/lookahead.sublime-syntax deleted file mode 100644 index 3a441102..00000000 --- a/syntaxes/fjsx15/literal/string/regex/lookahead.sublime-syntax +++ /dev/null @@ -1,38 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \(\?= - scope: punctuation.definition.group.assertion.begin.regexp.js.fjsx15 - set: [ meta, close, regex-content ] - - close: - - match: \) - scope: punctuation.definition.group.assertion.end.regexp.js.fjsx15 - pop: true - - match: (?=\S) - push: regex-content - - meta: - - meta_scope: meta.group.assertion.look-ahead.regexp.js.fjsx15 - - match: "" - pop: true - - regex-content: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax#regex-content diff --git a/syntaxes/fjsx15/literal/string/regex/negative-lookahead.sublime-syntax b/syntaxes/fjsx15/literal/string/regex/negative-lookahead.sublime-syntax deleted file mode 100644 index dd2981b1..00000000 --- a/syntaxes/fjsx15/literal/string/regex/negative-lookahead.sublime-syntax +++ /dev/null @@ -1,38 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \(\?! - scope: punctuation.definition.group.assertion.begin.regexp.js.fjsx15 - set: [ meta, close, regex-content ] - - close: - - match: \) - scope: punctuation.definition.group.assertion.end.regexp.js.fjsx15 - pop: true - - match: (?=\S) - push: regex-content - - meta: - - meta_scope: meta.group.assertion.look-ahead.negative.regexp.js.fjsx15 - - match: "" - pop: true - - regex-content: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax#regex-content diff --git a/syntaxes/fjsx15/literal/string/regex/non-capturing-group.sublime-syntax b/syntaxes/fjsx15/literal/string/regex/non-capturing-group.sublime-syntax deleted file mode 100644 index 5ad4be37..00000000 --- a/syntaxes/fjsx15/literal/string/regex/non-capturing-group.sublime-syntax +++ /dev/null @@ -1,38 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: "\\(\\?:" - scope: punctuation.definition.group.no-capture.begin.regexp.js.fjsx15 - set: [ meta, close, regex-content ] - - close: - - match: \) - scope: punctuation.definition.group.no-capture.end.regexp.js.fjsx15 - pop: true - - match: (?=\S) - push: regex-content - - meta: - - meta_scope: meta.group.regexp.js.fjsx15 - - match: "" - pop: true - - regex-content: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/regex.sublime-syntax#regex-content diff --git a/syntaxes/fjsx15/literal/string/regex/operator.sublime-syntax b/syntaxes/fjsx15/literal/string/regex/operator.sublime-syntax deleted file mode 100644 index 697faa86..00000000 --- a/syntaxes/fjsx15/literal/string/regex/operator.sublime-syntax +++ /dev/null @@ -1,23 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \| - scope: keyword.operator.or.regexp.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/literal/string/regex/quantifier.sublime-syntax b/syntaxes/fjsx15/literal/string/regex/quantifier.sublime-syntax deleted file mode 100644 index 86201c0a..00000000 --- a/syntaxes/fjsx15/literal/string/regex/quantifier.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # Operator quantifier. - - match: "[*+]?\\??" - scope: keyword.operator.quantifier.regexp.js.fjsx15 - pop: true - # Brace quantifier. - - match: | - (?x) - \{ - (?> \d+,\d+ - | \d+, - | \d+ - ) - } - scope: keyword.operator.quantifier.regexp - pop: true diff --git a/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax b/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax deleted file mode 100644 index 335739df..00000000 --- a/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax +++ /dev/null @@ -1,55 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - hexEscapedChar: | - x[a-f0-9]{2} - - unicodeEscapedChar: | - (?> u[a-f0-9]{4} - | u\{[a-f0-9]+} - ) - - singleQuotedEscapeSequences: | - \\ - (?> ['\\bfnrtv] - | {{hexEscapedChar}} - | {{unicodeEscapedChar}} - ) - -contexts: - main: - - match: \' - scope: punctuation.definition.string.begin.js.fjsx15 - set: string - - trap: - - meta_content_scope: context.trap - - string: - - meta_scope: string.quoted.single.js.fjsx15 - # New line trap. - - match: (? css - | injectGlobal - )) - (?=\s*`) - captures: - 1: support.function.styled-component.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: variable.other.component.js.fjsx15 - set: [ - meta-styled-component, - styled-component-begin - ] - - match: keyframes(?=\s*`) - scope: support.function.styled-component.js.fjsx15 - set: [ - meta-styled-component, - styled-component-begin-keyframes - ] - # Other functions. - - match: | - (?x) - ( - [[:upper:]] - [[:alnum:]]* - ) - (.) - (withComponent) - (?=\s*\() - captures: - 1: variable.other.component.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.styled-component.js.fjsx15 - set: [ - meta-styled-component, - optional-extend, - meta-function-call, - arguments - ] - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - - close: - - match: \` - scope: punctuation.definition.styled-component.end.js.fjsx15 - pop: true - - comment-no-pop: - - include: Packages/Naomi/syntaxes/css3/comment.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/comment/line.sublime-syntax#no-pop - - embedded-expression-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax#embedded-expression-no-pop - - keyframe-block-identifier: - - include: Packages/Naomi/syntaxes/css3/keyframe-block-list.sublime-syntax#block-identifier - - meta-function-call: - - meta_scope: meta.function-call.js.fjsx15 - - include: pop-now - - meta-styled-component: - - meta_scope: meta.styled-component.js.fjsx15 - - include: pop-now - - optional-extend: - - match: (\.)(extend)(?=`) - captures: - 1: punctuation.accessor.js.fjsx15 - 2: support.function.styled-component.js.fjsx15 - set: styled-component-begin - - pop-now: - - match: "" - pop: true - - ruleset-block: - - include: Packages/Naomi/syntaxes/css3/ruleset/block.sublime-syntax - - ruleset-block-content: - - include: Packages/Naomi/syntaxes/css3/ruleset/block-content.sublime-syntax - - shared-content: - # Close. - - match: (?=`) - set: close - # Terminator. - - match: ; - scope: punctuation.terminator.css.css3 - - styled-component-begin: - - match: (?=\() - set: arguments - - match: \` - scope: punctuation.definition.styled-component.begin.js.fjsx15 - with_prototype: - - include: embedded-expression-no-pop - set: styled-component-content - - styled-component-begin-keyframes: - - match: \` - scope: punctuation.definition.styled-component.begin.js.fjsx15 - with_prototype: - - include: embedded-expression-no-pop - set: styled-component-content-keyframes - - styled-component-content: - - clear_scopes: true - - meta_content_scope: source.css - - include: comment-no-pop - - include: shared-content - # Recover ruleset block. - - match: (?=\{) - push: ruleset-block - # Anything else. - - match: (?=\S) - push: ruleset-block-content - - styled-component-content-keyframes: - - clear_scopes: true - - meta_content_scope: source.css - - include: comment-no-pop - - include: shared-content - - match: (?=\S) - push: [ ruleset-block, keyframe-block-identifier ] diff --git a/syntaxes/fjsx15/literal/string/template.sublime-syntax b/syntaxes/fjsx15/literal/string/template.sublime-syntax deleted file mode 100644 index 4af4495b..00000000 --- a/syntaxes/fjsx15/literal/string/template.sublime-syntax +++ /dev/null @@ -1,75 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - hexEscapedChar: | - x[a-f0-9]{2} - - unicodeEscapedChar: | - (?> u[a-f0-9]{4} - | u\{[a-f0-9]+\} - ) - - escapeSequences: | - \\ - (?> [`\\$bfnrtv] - | {{hexEscapedChar}} - | {{unicodeEscapedChar}} - ) - -contexts: - main: - # Simple tag. - - match: (?xi){{commonIdentifier}}(?=\s*\`) - scope: entity.name.function.tag.js.fjsx15 - set: main - # Simple template string. - - match: \` - scope: punctuation.definition.string.begin.js.fjsx15 - with_prototype: - - include: embedded-expression-no-pop - set: - - meta_scope: string.template.js.fjsx15 - # Close. - - match: \` - scope: punctuation.definition.string.end.js.fjsx15 - pop: true - # Escape. - - match: (?xi){{escapeSequences}} - scope: constant.character.escape.js.fjsx15 - - close-embedded-expression: - - clear_scopes: true - - meta_scope: >- - source.js - meta.template-expression.js.fjsx15 - - match: \} - scope: punctuation.definition.template-expression.end.js.fjsx15 - pop: true - - embedded-content: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - embedded-expression-no-pop: - - match: \$\{ - scope: punctuation.definition.template-expression.begin.js.fjsx15 - push: [ close-embedded-expression, embedded-content ] diff --git a/syntaxes/fjsx15/node-js.sublime-syntax b/syntaxes/fjsx15/node-js.sublime-syntax deleted file mode 100644 index dcda898f..00000000 --- a/syntaxes/fjsx15/node-js.sublime-syntax +++ /dev/null @@ -1,147 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - globalFunctions: | - (?> (?>clear|set)Immediate - | require - )\b - - processFunctions: | - (?> abort - | chdir - | cpuUsage - | cwd - | disconnect - | emitWarning - | exit - # getegid, geteuid, getgid, getuid, getgroups - | get(?>e[gu]id|[gu]id|groups) - | hrtime - | initgroups - | kill - | memoryUsage - | nextTick - | send - # setegid, seteuid, setgid, setuid, setgroups - | set(?>e[gu]id|[gu]id|groups) - # umask, uptime - | u(?>mask|ptime) - )\b - -contexts: - main: - - include: global-constant - - include: global-function - # Module property or function. - - match: (module)\s*(\.) - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - set: module-property-or-function - # Proccess property or function. - - match: (process)\s*(\.) - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - set: process-property-or-function - # Just the global objects. - - match: (?>module|process)\b - scope: support.type.object.js.fjsx15 - pop: true - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - - else-pop: - - match: (?=\S) - pop: true - - function-call-meta-scope: - - meta_scope: meta.function-call.js.fjsx15 - - include: pop-now - - global-constant: - - match: __(?>dirname|filename)\b - scope: support.constant.js.fjsx15 - pop: true - - global-function: - # Function call. - - match: (?x){{globalFunctions}}(?=\s*\() - scope: support.function.js.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{globalFunctions}} - scope: support.function.js.fjsx15 - pop: true - - module-property-or-function: - # Properties. - - match: (?>default|exports|parent)\b - scope: support.variable.js.fjsx15 - pop: true - - include: other-property-or-function - - other-property-or-function: - - include: Packages/Naomi/syntaxes/fjsx15/operator/other.sublime-syntax#other-property-or-function - - pop-now: - - match: "" - pop: true - - process-property-or-function: - # Function call. - - match: (?x){{processFunctions}}(?=\s*\() - scope: support.function.js.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{processFunctions}} - scope: support.function.js.fjsx15 - pop: true - # Properties. - - match: | - (?x) - # arch, argv, argv0 - (?> ar(?>ch|gv0?) - | channel - | config - | connected - | env - # execArgv, execPath - | exec(?>Argv|Path) - | exitCode - | mainModule - | pid - | platform - | release - # stderr, stdin, stdout - | std(?>err|in|out) - | title - # version, versions - | versions? - )\b - scope: support.variable.js.fjsx15 - pop: true - - include: other-property-or-function diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax deleted file mode 100644 index ead8c709..00000000 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ /dev/null @@ -1,42 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # It is impossible to detect multiline arrow functions, but we can still - # detect its body as if it were an operator. - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax - # Position dependent operators. - - include: Packages/Naomi/syntaxes/fjsx15/operator/pipe.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/comparison.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax - # Position independent operators. - - include: Packages/Naomi/syntaxes/fjsx15/operator/arithmetic.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/await.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/bitwise.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/delete.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/in.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/logical.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/new.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/of.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/other.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/relational.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/shebang.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/typeof.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/void.sublime-syntax diff --git a/syntaxes/fjsx15/operator/arithmetic.sublime-syntax b/syntaxes/fjsx15/operator/arithmetic.sublime-syntax deleted file mode 100644 index cd1a9255..00000000 --- a/syntaxes/fjsx15/operator/arithmetic.sublime-syntax +++ /dev/null @@ -1,55 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:----------------| - # | -- | Decrement. | - # | - | Subtraction. | - # | ++ | Increment. | - # | + | Addition. | - # | += | | - # | * | Multiplication. | - # | *= | | - # | ** | Exponentiation. | - # | **= | | - # | / | Division. | - # | /= | | - # | % | Modulus. | - # | %= | | - main: - - match: | - (?x) - (?> -- - | \+\+ - ) - scope: keyword.operator.arithmetic.js.fjsx15 - pop: true - - match: | - (?x) - (?> -=? - | \+=? - | \*\*?=? - | /=? - | %=? - ) - scope: keyword.operator.arithmetic.js.fjsx15 - set: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/assignment.sublime-syntax b/syntaxes/fjsx15/operator/assignment.sublime-syntax deleted file mode 100644 index 7a65c434..00000000 --- a/syntaxes/fjsx15/operator/assignment.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \= - scope: keyword.operator.other.assignment.js.fjsx15 - set: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/await.sublime-syntax b/syntaxes/fjsx15/operator/await.sublime-syntax deleted file mode 100644 index b27ad317..00000000 --- a/syntaxes/fjsx15/operator/await.sublime-syntax +++ /dev/null @@ -1,32 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: await\b - scope: keyword.control.flow.await.js.fjsx15 - set: optional-expression - - just-pop: - - match: \s*(await)\b - captures: - 1: keyword.control.flow.await.js.fjsx15 - pop: true - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/bitwise.sublime-syntax b/syntaxes/fjsx15/operator/bitwise.sublime-syntax deleted file mode 100644 index 03130174..00000000 --- a/syntaxes/fjsx15/operator/bitwise.sublime-syntax +++ /dev/null @@ -1,51 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:---------------------------------| - # | ~ | Bitwise not. | - # | ~= | Bitwise not assignment. | - # | & | Bitwise AND. | - # | &= | Bitwise AND assignment. | - # | | | Bitwise OR. | - # | |= | Bitwise OR assignment. | - # | ^ | Bitwise XOR. | - # | ^= | Bitwise XOR assignment. | - # | << | Left shift. | - # | <<= | Left shift assignment. | - # | >> | Right shift. | - # | >>= | Right shift assignment. | - # | >>> | Unsigned right shift. | - # | >>>= | Unsigned right shift assignment. | - main: - - match: | - (?x) - (?> ~=? - | &(?!&)=? - | \|(?!\|)=? - | \^=? - | <<=? - | >>>=? - | >>=? - ) - scope: keyword.operator.bitwise.js.fjsx15 - set: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/comma.sublime-syntax b/syntaxes/fjsx15/operator/comma.sublime-syntax deleted file mode 100644 index b81498ac..00000000 --- a/syntaxes/fjsx15/operator/comma.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \, - scope: keyword.operator.comma.js.fjsx15 - set: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/comparison.sublime-syntax b/syntaxes/fjsx15/operator/comparison.sublime-syntax deleted file mode 100644 index 1212fb70..00000000 --- a/syntaxes/fjsx15/operator/comparison.sublime-syntax +++ /dev/null @@ -1,44 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:--------------------------| - # | == | Loose equality. | - # | === | Strict equality. | - # | != | Not equal. | - # | !== | Strict inequality. | - # | >= | Greater than or equal to. | - # | <= | Less than or equal to. | - # | > | Greater than. | - # | < | Less than. | - main: - - match: | - (?x) - (?> ===? - | !==? - | >= - | <= - | >(?!>) - | <(?!<) - ) - scope: keyword.operator.comparison.js.fjsx15 - set: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/delete.sublime-syntax b/syntaxes/fjsx15/operator/delete.sublime-syntax deleted file mode 100644 index 36a808b6..00000000 --- a/syntaxes/fjsx15/operator/delete.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: delete\b - scope: keyword.operator.word.delete.js.fjsx15 - set: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/in.sublime-syntax b/syntaxes/fjsx15/operator/in.sublime-syntax deleted file mode 100644 index a76aeba5..00000000 --- a/syntaxes/fjsx15/operator/in.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: in\b - scope: keyword.operator.word.in.js.fjsx15 - set: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/logical.sublime-syntax b/syntaxes/fjsx15/operator/logical.sublime-syntax deleted file mode 100644 index 717f2c97..00000000 --- a/syntaxes/fjsx15/operator/logical.sublime-syntax +++ /dev/null @@ -1,36 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:------------| - # | && | And. | - # | || | Or. | - # | ! | Not. | - main: - - match: | - (?x) - (?> && - | \|\| - | !!? - ) - scope: keyword.operator.logical.js.fjsx15 - set: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/new.sublime-syntax b/syntaxes/fjsx15/operator/new.sublime-syntax deleted file mode 100644 index 844aa52c..00000000 --- a/syntaxes/fjsx15/operator/new.sublime-syntax +++ /dev/null @@ -1,99 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - # Convetion. - classIdentifier: | - [$_[:upper:]] - [$_[:alnum:]]* - -contexts: - main: - # new.target - - match: (new)\s*(\.)\s*(target) - captures: - 1: support.type.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.constant.js.fjsx15 - pop: true - # Type after new. - - match: (?xi)new(?=\s+{{commonIdentifier}}) - scope: keyword.operator.word.new.js.fjsx15 - set: [ - optional-tail, - meta-instance-call-constructor-scope, - optional-arguments, - type - ] - # Any other expression after the keyword. - - match: (?i)new\b - scope: keyword.operator.word.new.js.fjsx15 - set: [ - optional-tail, - meta-instance-scope, - optional-expression - ] - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax#arguments - - else-pop: - - match: (?=\S) - pop: true - - meta-instance-call-constructor-scope: - - meta_scope: meta.instance.constructor.js.fjsx15 - - meta_content_scope: meta.function-call.constructor.js.fjsx15 - - include: pop-now - - meta-instance-scope: - - meta_scope: meta.instance.js.fjsx15 - - include: pop-now - - optional-arguments: - - match: (?=\() - set: arguments - - include: else-pop - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - optional-tail: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax#optional-tail - - pop-now: - - match: "" - pop: true - - type: - - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax - # Object before target property. - - match: (?xi)({{commonIdentifier}})\s*(\.) - captures: - 1: variable.other.object.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - # Class constructors. - - match: (?x){{classIdentifier}} - scope: variable.other.type.js.fjsx15 - pop: true - # Other expressions. - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/of.sublime-syntax b/syntaxes/fjsx15/operator/of.sublime-syntax deleted file mode 100644 index daa9d5de..00000000 --- a/syntaxes/fjsx15/operator/of.sublime-syntax +++ /dev/null @@ -1,27 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # Technically there’s no “of” operator, but this will simplify for loops. - - match: of\b - scope: keyword.operator.word.of.js.fjsx15 - set: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/other.sublime-syntax b/syntaxes/fjsx15/operator/other.sublime-syntax deleted file mode 100644 index aadee55a..00000000 --- a/syntaxes/fjsx15/operator/other.sublime-syntax +++ /dev/null @@ -1,75 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: yield\b - scope: keyword.control.flow.js.fjsx15 - set: [ optional-tail, yield-head ] - # | Operator | Description | - # |:----------:|:--------------------| - # | ... | Spread. | - # | :: | Bind. | - # | . | Accessor. | - # | ?. | Optional chain. | - # | ?? | Nullish coalescing. | - # | ? | Ternary. | - - match: \:{2} - scope: keyword.operator.bind.js.fjsx15 - set: optional-expression - - match: \?\? - scope: keyword.operator.nullish-coalescing.js.fjsx15 - set: optional-expression - - match: \?\. - scope: punctuation.accessor.optional-chain.js.fjsx15 - set: [ optional-tail, accessor-head ] - - match: \.(?!\.) - scope: punctuation.accessor.js.fjsx15 - set: [ optional-tail, accessor-head ] - - match: \? - scope: keyword.operator.ternary.js.fjsx15 - set: [ - ternary-else, - optional-expression - ] - - accessor-head: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax#function-assigned-to-variable - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - - # Used near accessor to highlight global functions and properties. - other-property-or-function: - - match: (?=\S) - set: [ optional-tail, accessor-head ] - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - optional-tail: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax#optional-tail - - ternary-else: - - match: ":" - scope: keyword.operator.ternary.js.fjsx15 - set: optional-expression - - yield-head: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax#head diff --git a/syntaxes/fjsx15/operator/pipe.sublime-syntax b/syntaxes/fjsx15/operator/pipe.sublime-syntax deleted file mode 100644 index a726cb70..00000000 --- a/syntaxes/fjsx15/operator/pipe.sublime-syntax +++ /dev/null @@ -1,57 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: \|> - scope: keyword.operator.pipe.js.fjsx15 - set: target - - else-pop: - - match: (?=\S) - pop: true - - target: - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax - # Await keyword. - - match: await\b - scope: keyword.control.flow.js.fjsx15 - set: function-identifier - # Simple identifier. - - match: | - (?xi) - (?= - {{commonIdentifier}}\s* - (?>\|>|$) - ) - set: function-identifier - - include: else-pop - - function-identifier: - # Simple function. - - match: (?xi){{commonIdentifier}} - scope: >- - meta.function-call.js.fjsx15 - variable.function.js.fjsx15 - pop: true - - include: else-pop diff --git a/syntaxes/fjsx15/operator/relational.sublime-syntax b/syntaxes/fjsx15/operator/relational.sublime-syntax deleted file mode 100644 index 78093ed1..00000000 --- a/syntaxes/fjsx15/operator/relational.sublime-syntax +++ /dev/null @@ -1,29 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: instanceof\b - scope: keyword.operator.word.instanceof.js.fjsx15 - set: optional-expression - - match: in\b - scope: keyword.operator.word.in.js.fjsx15 - set: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax b/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax deleted file mode 100644 index 3bbe981d..00000000 --- a/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax +++ /dev/null @@ -1,25 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?=\.{3}) - push: rest-operator - - rest-operator: - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.sublime-syntax diff --git a/syntaxes/fjsx15/operator/rest.sublime-syntax b/syntaxes/fjsx15/operator/rest.sublime-syntax deleted file mode 100644 index 8fef3573..00000000 --- a/syntaxes/fjsx15/operator/rest.sublime-syntax +++ /dev/null @@ -1,23 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \.{3} - scope: keyword.operator.rest.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/operator/shebang.sublime-syntax b/syntaxes/fjsx15/operator/shebang.sublime-syntax deleted file mode 100644 index 0780b154..00000000 --- a/syntaxes/fjsx15/operator/shebang.sublime-syntax +++ /dev/null @@ -1,22 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: ^#!.+$ - scope: keyword.operator.other.shebang.js.fjsx15 diff --git a/syntaxes/fjsx15/operator/spread.sublime-syntax b/syntaxes/fjsx15/operator/spread.sublime-syntax deleted file mode 100644 index 4bc415a2..00000000 --- a/syntaxes/fjsx15/operator/spread.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \.{3} - scope: keyword.operator.spread.js.fjsx15 - set: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/terminator.sublime-syntax b/syntaxes/fjsx15/operator/terminator.sublime-syntax deleted file mode 100644 index 0e814dca..00000000 --- a/syntaxes/fjsx15/operator/terminator.sublime-syntax +++ /dev/null @@ -1,34 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \; - scope: keyword.other.terminator.js.fjsx15 - set: statement-or-expression - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - statement-or-expression: - - include: main - - match: (?=[,:)\]}]) - pop: true - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/typeof.sublime-syntax b/syntaxes/fjsx15/operator/typeof.sublime-syntax deleted file mode 100644 index cfc31ecd..00000000 --- a/syntaxes/fjsx15/operator/typeof.sublime-syntax +++ /dev/null @@ -1,39 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - # Type after typeof. - - match: (?xi)(typeof)(?=\s+{{commonIdentifier}}) - scope: keyword.operator.word.typeof.js.fjsx15 - set: [ optional-tail, type ] - # Any other expression after the keyword. - - match: (?i)typeof\b - scope: keyword.operator.word.typeof.js.fjsx15 - set: optional-tail - - optional-tail: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax#optional-tail - - type: - - include: Packages/Naomi/syntaxes/fjsx15/operator/new.sublime-syntax#type diff --git a/syntaxes/fjsx15/operator/void.sublime-syntax b/syntaxes/fjsx15/operator/void.sublime-syntax deleted file mode 100644 index 1010c614..00000000 --- a/syntaxes/fjsx15/operator/void.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: void\b - scope: keyword.operator.word.void.js.fjsx15 - set: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/optional-expression.sublime-syntax b/syntaxes/fjsx15/optional-expression.sublime-syntax deleted file mode 100644 index ecb2712d..00000000 --- a/syntaxes/fjsx15/optional-expression.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: expression-escape - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - expression-escape: - - match: (?=[,;:)\]}]) - pop: true diff --git a/syntaxes/fjsx15/optional-statement-or-expression.sublime-syntax b/syntaxes/fjsx15/optional-statement-or-expression.sublime-syntax deleted file mode 100644 index 5f84ab67..00000000 --- a/syntaxes/fjsx15/optional-statement-or-expression.sublime-syntax +++ /dev/null @@ -1,25 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?=[)\]}]) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/fjsx15/prolog.sublime-syntax b/syntaxes/fjsx15/prolog.sublime-syntax deleted file mode 100644 index a74033df..00000000 --- a/syntaxes/fjsx15/prolog.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \'use strict';?$ - scope: keyword.other.prolog.strict.js.fjsx15 - pop: true - - match: \"use strict";?$ - scope: keyword.other.prolog.strict.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/property-access.sublime-syntax b/syntaxes/fjsx15/property-access.sublime-syntax deleted file mode 100644 index f1324aff..00000000 --- a/syntaxes/fjsx15/property-access.sublime-syntax +++ /dev/null @@ -1,34 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \[ - scope: punctuation.section.brackets.begin.js.fjsx15 - set: index - - index: - - meta_scope: meta.brackets.js.fjsx15 - - match: \] - scope: punctuation.section.brackets.end.js.fjsx15a - pop: true - - match: "" - push: optional-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/react-js.sublime-syntax b/syntaxes/fjsx15/react-js.sublime-syntax deleted file mode 100644 index d2a90d48..00000000 --- a/syntaxes/fjsx15/react-js.sublime-syntax +++ /dev/null @@ -1,202 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - componetnFunctions: | - (this) - \s*(\.)\s* - ((?> forceUpdate - | setState - ))\b - - propTypeFunctions: | - (?: - (React) - \s*(\.)\s* - )? - (PropTypes) - \s*(\.)\s* - ((?> arrayOf - | instanceOf - | oneOf(?:Type)? - | shape - ))\b - - reactFunctions: | - (React) - \s*(\.)\s* - ((?> createElement - | createFactory - | cloneElement - | isValidElement - ))\b - - reactDomFunctions: | - (ReactD[oO][mM]) - \s*(\.)\s* - ((?> findDOMNode - | render(?:ToS(?>taticMarkup|tring))? - | unmountComponentAtNode - ))\b - -contexts: - main: - - include: proptype-functions - - include: proptypes - - include: component-functions - - include: react-functions - - include: react-dom-functions - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - component-functions: - # Function call. - - match: (?x){{reactFunctions}}(?=\s*\() - captures: - 1: variable.language.this.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{reactFunctions}} - captures: - 1: variable.language.this.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.fjsx15 - pop: true - - function-call-meta-scope: - - meta_scope: meta.function-call.js.fjsx15 - - include: pop-now - - optional-property-type-and-value: - - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax#optional-type-and-value - - pop-now: - - match: "" - pop: true - - proptypes: - # Normal. - - match: | - (?x) - (?: - (React) - \s*(\.)\s* - )? - (PropTypes) - \s*(\.)\s* - ((?> any - | array - | bool - | element - | func - | node - | number - | object - | symbol - | string - ))\b - (?: - \s*(\.)\s* - (isRequired\b) - )? - captures: - 1: support.type.object.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.type.object.fjsx15 - 4: punctuation.accessor.js.fjsx15 - 5: support.type.object.fjsx15 - 6: punctuation.accessor.js.fjsx15 - 7: support.type.object.fjsx15 - pop: true - # “isRequired” after function call. - - match: | - (?x) - (?<=\)) - \s*(\.)\s* - (isRequired\b) - captures: - 1: punctuation.accessor.js.fjsx15 - 2: support.type.object.fjsx15 - pop: true - - proptype-functions: - # Function call. - - match: (?x){{propTypeFunctions}}(?=\s*\() - captures: - 1: support.type.object.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.type.object.fjsx15 - 4: punctuation.accessor.js.fjsx15 - 5: support.function.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{propTypeFunctions}} - captures: - 1: support.type.object.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.type.object.fjsx15 - 4: punctuation.accessor.js.fjsx15 - 5: support.function.fjsx15 - pop: true - - react-dom-functions: - # Function call. - - match: (?x){{reactDomFunctions}}(?=\s*\() - captures: - 1: support.type.object.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{reactDomFunctions}} - captures: - 1: support.type.object.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.fjsx15 - pop: true - - react-functions: - # Function call. - - match: (?x){{reactFunctions}}(?=\s*\() - captures: - 1: support.type.object.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{reactFunctions}} - captures: - 1: support.type.object.fjsx15 - 2: punctuation.accessor.js.fjsx15 - 3: support.function.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/statement.sublime-syntax b/syntaxes/fjsx15/statement.sublime-syntax deleted file mode 100644 index 9e598635..00000000 --- a/syntaxes/fjsx15/statement.sublime-syntax +++ /dev/null @@ -1,286 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - include: Packages/Naomi/syntaxes/flow1/declare.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/interface.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/type-aliasing.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax - - include: block - - include: break-continue - - include: debugger - - include: do-while - - include: empty - - include: for - - include: if-else - - include: label - - include: return - - include: switch-case - - include: throw - - include: try-catch-finally - - asi-checked-optional-expression: - - match: (?=\s*\n) - pop: true - - include: optional-expression - - block: - - match: \{ - scope: punctuation.section.block.begin.js.fjsx15 - set: block-end - - block-end: - - meta_scope: meta.block.js.fjsx15 - - match: \} - scope: punctuation.section.block.end.js.fjsx15 - pop: true - - match: "" - push: optional-statement-or-expression - - break-continue: - - match: | - (?xi) - (?>(break)|(continue))\b - (?:\s+({{commonIdentifier}}))? - captures: - 1: keyword.control.flow.break.js.fjsx15 - 2: keyword.control.flow.break.continue.js.fjsx15 - 3: entity.name.label.js.fjsx15 - pop: true - - colon: - - match: ":" - scope: punctuation.separator.js.fjsx15 - pop: true - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - debugger: - - match: debugger\b - scope: keyword.other.js.fjsx15 - pop: true - - do-while: - - match: do\b - scope: keyword.control.loop.js.fjsx15 - set: [ - meta-loop-do, - optional-while, - optional-statement-or-expression - ] - - match: while\b - scope: keyword.control.loop.js.fjsx15 - set: [ - meta-loop-while, - optional-statement-or-expression, - optional-expression - ] - - else-pop: - - match: (?=\S) - pop: true - - empty: - - match: \; - scope: punctuation.terminator.js.fjsx15 - pop: true - - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - for: - - match: for\b - scope: keyword.control.loop.js.fjsx15 - set: [ - meta-loop-for, - optional-statement-or-expression, - for-header, - optional-await - ] - - for-header: - - match: \( - scope: punctuation.section.group.begin.js.fjsx15 - set: [ meta-group, for-header-end ] - - for-header-end: - - match: \) - scope: punctuation.section.group.end.js.fjsx15 - pop: true - - match: (?=(?>const|let|var)) - push: statement-or-expression - - match: (?=\S) - push: - - include: empty - - include: expression - - if-else: - - match: if\b - scope: keyword.control.conditional.js.fjsx15 - set: [ - meta-conditional, - optional-statement-or-expression, - optional-expression - ] - - match: else\b - scope: keyword.control.conditional.js.fjsx15 - set: [ - meta-conditional, - optional-else-if - ] - - label: - - match: | - (?xi) - (?!default) - ({{commonIdentifier}}) - \s*(:) - captures: - 1: entity.name.label.js.fjsx15 - 2: punctuation.separator.js.fjsx15 - set: optional-statement-or-expression - - meta-group: - - meta_scope: meta.group.js.fjsx15 - - include: pop-now - - meta-conditional: - - meta_scope: meta.conditional.js.fjsx15 - - include: pop-now - - meta-loop-do: - - meta_scope: meta.loop.do.js.fjsx15 - - include: pop-now - - meta-loop-for: - - meta_scope: meta.loop.for.js.fjsx15 - - include: pop-now - - meta-loop-while: - - meta_scope: meta.loop.while.js.fjsx15 - - include: pop-now - - meta-switch: - - meta_scope: meta.switch.js.fjsx15 - - include: pop-now - - no-meta-if: - - match: if\b - scope: keyword.control.conditional.js.fjsx15 - set: [ - optional-statement-or-expression, - optional-expression - ] - - optional-await: - - include: Packages/Naomi/syntaxes/fjsx15/operator/await.sublime-syntax#just-pop - - include: else-pop - - optional-else-if: - - include: no-meta-if - - include: optional-statement-or-expression - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - optional-statement-or-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-statement-or-expression.sublime-syntax - - optional-while: - - include: comment-no-pop - - match: while\b - scope: keyword.control.loop.js.fjsx15 - set: optional-expression - - pop-now: - - match: "" - pop: true - - return: - - match: return\b - scope: keyword.control.flow.return.js.fjsx15 - set: asi-checked-optional-expression - - statement-or-expression: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - include: else-pop - - statement-or-expression-header: - - match: \( - scope: punctuation.section.group.begin.js.fjsx15 - set: [ - meta-group, - statement-or-expression-header-end - ] - - statement-or-expression-header-end: - - match: \) - scope: punctuation.section.group.end.js.fjsx15 - pop: true - - match: (?=\S) - push: statement-or-expression - - switch-case: - - match: switch\b - scope: keyword.control.switch.js.fjsx15 - set: [ - meta-switch, - optional-expression - ] - - match: case\b - scope: keyword.control.switch.js.fjsx15 - set: [ - colon, - optional-expression - ] - - match: default\b - scope: keyword.control.switch.js.fjsx15 - set: [ - colon, - optional-expression - ] - - throw: - - match: throw\b - scope: keyword.control.flow.break.throw.js.fjsx15 - set: asi-checked-optional-expression - - try-catch-finally: - - match: try\b - scope: keyword.control.trycatch.js.fjsx15 - pop: true - - match: catch\b - scope: keyword.control.trycatch.js.fjsx15 - set: optional-expression - - match: finally\b - scope: keyword.control.trycatch.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/type/arguments.sublime-syntax b/syntaxes/fjsx15/type/arguments.sublime-syntax deleted file mode 100644 index 96e37651..00000000 --- a/syntaxes/fjsx15/type/arguments.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \( - scope: punctuation.definition.type.arguments.begin.js.fjsx15 - set: arguments - - arguments: - - match: \) - scope: punctuation.definition.type.arguments.end.js.fjsx15 - pop: true - - match: \, - scope: punctuation.definition.type.arguments.js.fjsx15 - - match: "" - push: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/fjsx15/type/support/arguments.sublime-syntax b/syntaxes/fjsx15/type/support/arguments.sublime-syntax deleted file mode 100644 index 96e37651..00000000 --- a/syntaxes/fjsx15/type/support/arguments.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \( - scope: punctuation.definition.type.arguments.begin.js.fjsx15 - set: arguments - - arguments: - - match: \) - scope: punctuation.definition.type.arguments.end.js.fjsx15 - pop: true - - match: \, - scope: punctuation.definition.type.arguments.js.fjsx15 - - match: "" - push: - # - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/fjsx15/variable-declaration.sublime-syntax b/syntaxes/fjsx15/variable-declaration.sublime-syntax deleted file mode 100644 index 18a24f9f..00000000 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ /dev/null @@ -1,128 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - constantIdentifier: | - [$_[:upper:]] - [$_[:upper:][:digit:]]* - -contexts: - main: - - match: (?=(?>const|let|var)\b) - set: [ - optional-type-and-initial-value, - variable-or-constant, - keyword - ] - - associated-type: - - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - else-pop: - - match: (?=\S) - pop: true - - keyword: - - match: (?>const|let|var)\b - scope: storage.type.js.fjsx15 - pop: true - - optional-expression: - - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - - optional-type-and-initial-value: - - meta_scope: meta.declaration.variable.js.fjsx15 - - match: (?=:) - push: associated-type - - match: \, - scope: punctuation.separator.comma.js.fjsx15 - push: variable-or-constant - - match: (?==) - push: optional-expression - - include: else-pop - - optional-type: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax - - constant: - # Single character. - - match: | - (?x) - (\#)? - ([_[:upper:]])\b - captures: - 1: storage.modifier.js.fjsx15 - 2: variable.other.constant.js.fjsx15 - pop: true - # Two or more characters. - - match: | - (?x) - (\#)? - ( - {{constantIdentifier}} - (?> \$\B - | [_[:upper:][:digit:]]\b - ) - ) - captures: - 1: storage.modifier.js.fjsx15 - 2: variable.other.constant.js.fjsx15 - pop: true - - variable: - # Single character. - - match: | - (?xi) - (\#)? - ((?> \$\B - | [_[:alpha:]]\b - )) - captures: - 1: storage.modifier.js.fjsx15 - 2: variable.other.readwrite.js.fjsx15 - pop: true - # Two or more characters. - - match: | - (?xi) - (\#)? - ( - {{commonIdentifier}} - (?> \$\B - | [_[:alnum:]]\b - ) - ) - captures: - 1: storage.modifier.js.fjsx15 - 2: variable.other.readwrite.js.fjsx15 - pop: true - - variable-or-constant: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax#function-assigned-to-variable - - include: constant - - include: variable diff --git a/syntaxes/fjsx15/variable.sublime-syntax b/syntaxes/fjsx15/variable.sublime-syntax deleted file mode 100644 index 6fdbc159..00000000 --- a/syntaxes/fjsx15/variable.sublime-syntax +++ /dev/null @@ -1,258 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - genericArguments: | - (< - (?> {{string}} - | \g<-1> - | [^<>] - )* - >) - - parameters: | - (\( - (?> {{string}} - | \g<-1> - | [^()] - )* - \)) - - flowOperators: | - (?> &(?!\s*&) - | \|(?!\s*\|) - ) - - string: | - (?> '(?:\'|[^'])*?' - | "(?:\"|[^"])*?" - | `(?:\`|[^`])*?` - ) - - flowObject: | - (\{ - (?> {{string}} - | \g<-1> - | [^{}] - )* - }) - - simpleFlowType: | - (?> {{string}} - | {{flowObject}} - | [$_[:alpha:]][$_[:alnum:].]* - ) - (?:\s*{{genericArguments}})? - (?:\s*\[\s*\])? - - flowFunction: | - ( - {{parameters}} - \s*=>\s* - (?> (?:\?\s*){{simpleFlowType}} - | \g<-1> - ) - ) - - complexType: | - (?:\?\s*)? - ( - (?> {{simpleFlowType}} - | {{flowFunction}} - | \g<-1> - ) - ) - - multipleTypes: | - ( - (?> \s*{{flowOperators}} - | \s*{{complexType}} - | \g<-1> - )+ - ) - - flowComment: /\*\s*:.*?\*/ - - type: | - (?> {{flowComment}} - | \:\s*{{multipleTypes}} - ) - - normalArrowFunction: | - (?:async\b\s*)? - (?:{{genericArguments}}\s*)? - {{parameters}} - (?:\s*{{type}})? - \s*=> - - singleParameterArrowFunction: | - (?:async\b\s+)? - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=> - - anyArrowFunction: | - (?> {{normalArrowFunction}} - | {{singleParameterArrowFunction}} - ) - - normalArrowFunctionAssignedToVariable: | - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=\s* - {{normalArrowFunction}} - - singleParameterArrowFunctionAssignedToVariable: | - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=\s* - {{singleParameterArrowFunction}} - - anyArrowFunctionAssignedToVariable: | - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=\s* - (?> {{normalArrowFunction}} - | {{singleParameterArrowFunction}} - ) - -contexts: - main: - - include: object - - include: simple - - arrow-body: - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax - - assignment: - - match: = - scope: keyword.operator.assignment.js.fjsx15 - pop: true - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - function-assigned-to-variable: - # Normal arrow function assigned to variable. - - match: | - (?x) - (?={{normalArrowFunctionAssignedToVariable}}) - set: [ - normal-arrow-function, - assignment, - optional-type, - function-identifier - ] - # Single parameter arrow function assigned to variable. - - match: | - (?x) - (?={{singleParameterArrowFunctionAssignedToVariable}}) - set: [ - single-parameter-arrow-function, - assignment, - optional-type, - function-identifier - ] - # Function assigned to variable. - - match: | - (?x) - (?= - {{commonIdentifier}} - (?:\s*{{type}})? - \s*=\s* - (?:async\b\s+)? - function\s - ) - set: [ - function, - assignment, - optional-type, - function-identifier - ] - - function: - - meta_scope: >- - meta.declaration.function.js.fjsx15 - meta.function.js.fjsx15 - - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - - function-identifier: - - match: (?xi){{commonIdentifier}} - scope: entity.name.function.js.fjsx15 - pop: true - - normal-arrow-function: - - meta_scope: meta.declaration.function.arrow.js.fjsx15 - - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax - - match: (?==>) - set: arrow-body - - single-parameter-arrow-function: - - meta_scope: meta.declaration.function.arrow.js.fjsx15 - - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax - - match: (?==>) - set: arrow-body - - optional-type: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax - - object: - - match: | - (?xi) - (\#)? - ({{commonIdentifier}}) - (?=\s*\??\.) - captures: - 1: storage.modifier.js.fjsx15 - 2: variable.other.object.js.fjsx15 - pop: true - - simple: - # Single character. - - match: | - (?xi) - (\#)? - ((?> \$\B - | [_[:alpha:]]\b - )) - captures: - 1: storage.modifier.js.fjsx15 - 2: variable.other.readwrite.js.fjsx15 - pop: true - # Two or more characters. - - match: | - (?xi) - (\#)? - ( - {{commonIdentifier}} - (?> \$\B - | [_[:alnum:]]\b - ) - ) - captures: - 1: storage.modifier.js.fjsx15 - 2: variable.other.readwrite.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/web.sublime-syntax b/syntaxes/fjsx15/web.sublime-syntax deleted file mode 100644 index fec60589..00000000 --- a/syntaxes/fjsx15/web.sublime-syntax +++ /dev/null @@ -1,462 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - documentFunctions: | - (?> adoptNode - | close - | create - # createAttribute - (?> Attribute - # createCDATASection - | CDATASection - # createComment - | Comment - # createDocumentFragment - | DocumentFragment - # ccreateElement, reateElementNS - | Element(?:NS)? - # createExpression - | Event - # createExpression - | Expression - # createNodeIterator - | NodeIterator - # createNSResolver - | NSResolver - # createProcessingInstruction - | ProcessingInstruction - # createRange - | Range - # createTextNode - | TextNode - # createTreeWalker - | TreeWalker - ) - | elementFromPoint - | enableStyleSheetsForSet - | evaluate - | execCommand - | exitFullscreen - | getElement - # getElementById - (?> ById - | sBy - # getElementsByClassName - (?> ClassName - # getElementsByName - | Name - # getElementsByTagName, getElementsByTagNameNS - | TagName(?:NS)? - ) - ) - | getSelection - | hasFocus - | importNode - | open - | query - # queryCommand, queryCommandEnabled, queryCommandSupported - (?> Command(?>Enabled|Supported) - # querySelector, querySelectorAll - | Selector(?:All)? - ) - | releaseCapture - # write, writeln - | write(?:ln)? - )\b - - windowFunctions: | - (?> addEventListener - | alert - | atob - | blur - | btoa - # cancelAnimationFrame, cancelIddleCallback - | cancel(?>AnimationFrame|IdleCallback) - # clearInterval, clearTimeout - | clear(?>Interval|Timeout) - | close - | confirm - | convertPointFromNodeToPage - | createImageBitmap - | event - | fetch - | focus - | forward - | get - # getAttention - (?> Attention - # getComputedStyle - | ComputedStyle - # getDefaultComputedStyle - | DefaultComputedStyle - # getSelection - | Selection - ) - | home - | matchMedia - | minimize - # moveBy, moveTo - | move(?>By|To) - | open - | postMessage - | print - | prompt - # requestAnimationFrame, requestIdleCallback - | request(?>AnimationFrame|IdleCallback) - | removeEventListener - # resizeBy, resizeTo - | resize(?>By|To) - | restore - | routeEvent - | scroll - # scrollBy, scrollByPages - (?> By(?:Pages)? - # ScrollTo - | To - )? - # setInterval, setTimeout - | set(?>Interval|Timeout) - | sizeToContent - | stop - | updateCommands - )\b - -contexts: - main: - # Document property or function. - - match: (document)\s*(\.) - captures: - 1: support.type.object.dom.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - set: document-property-or-function - # Window property or function. - - match: (window)\s*(\.) - captures: - 1: support.type.object.dom.js.fjsx15 - 2: punctuation.accessor.js.fjsx15 - set: window-property-or-function - # Just the global objects. - - match: (?>document|window)\b - scope: support.type.object.dom.js.fjsx15 - pop: true - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax - - document-property-or-function: - # Function call. - - match: (?x){{documentFunctions}}(?=\s*\() - scope: support.function.js.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{documentFunctions}} - scope: support.function.js.fjsx15 - pop: true - # Properties. - - match: | - (?x) - (?> activeElement - | body - | characterSet - | childElementCount - | children - | compatMode - | currentScript - | defaultView - | designMode - | dir - | doctype - | documentElement - | documentURI - | documentURIObject - | domain - | embeds - | firstElementChild - | forms - | fullscreenElement - | fullscreenEnabled - | head - | hidden - | images - | implementation - | last - (?> ElementChild - | Modified - | StyleSheetSet - ) - | links - | location - | on - (?> abort - | animationcancel - | animationend - | blur - | change - | click - | close - | contextmenu - | dblclick - | error - | focus - | fullscreenchange - | fullscreenerror - | gotpointercapture - | input - | keydown - | keypress - | keyup - | load - | loadend - | loadstart - | lostpointercapture - | mousedown - | mousemove - | mouseout - | mouseover - | mouseup - | offline - | online - | pointercancel - | pointerdown - | pointerenter - | pointerleave - | pointermove - | pointerout - | pointerover - | pointerup - | reset - | resize - | scroll - | select - | submit - | transitioncancel - | transitionend - | visibilitychange - | wheel - ) - | plugins - | pointerLockElement - | popupNode - | preferredStyleSheetSet - | readyState - | referrer - | scripts - | scrollingElement - | selectedStyleSheetSet - | styleSheets - | styleSheetSets - | title - | tooltipNode - | URL - | visibilityState - )\b - scope: support.variable.js.fjsx15 - pop: true - # Bail. - - include: other-property-or-function - - function-call-meta-scope: - - meta_scope: meta.function-call.js.fjsx15 - - include: pop-now - - other-property-or-function: - - include: Packages/Naomi/syntaxes/fjsx15/operator/other.sublime-syntax#other-property-or-function - - pop-now: - - match: "" - pop: true - - window-property-or-function: - # Function call. - - match: (?x){{windowFunctions}}(?=\s*\() - scope: support.function.js.fjsx15 - set: [ - function-call-meta-scope, - arguments - ] - # Function reference. - - match: (?x){{windowFunctions}} - scope: support.function.js.fjsx15 - pop: true - # Properties. - - match: | - (?x) - (?> applicationCache - | caches - | closed - | console - | controllers - | crypto - | devicePixelRatio - | document - | frameElement - | frames - | fullScreen - | history - | indexedDB - # innerHeight, innerWidth - | inner(?>Height|Width) - | isSecureContext - | length - | localStorage - # location, locationbar - | location(?:bar)? - | menubar - | messageManager - | name - | navigator - | onabort - | onafterprint - | onanimation - # onanimationcancel - (?> cancel - # onanimationend - | end - # onanimationiteration - | iteration - ) - | onappinstalled - | onauxclick - | onbefore - # onbeforeinstallprompt - (?> installprompt - # onbeforeprint - | print - # onbeforeunload - | unload - ) - | onblur - | onchange - | onclick - | onclose - | oncontextmenu - | ondblclick - | ondevice - # ondevicelight - (?> light - # ondevicemotion - | motion - # ondeviceorientation - | orientation - # ondeviceorientationabsolute - | orientationabsolute - # ondevice$roximity - | proximity - ) - | onerror - | onfocus - # ongamepadconnected, ongamepaddisconnected - | ongamepad(?>connected|disconnected) - | ongotpointercapture - | onhashchange - | oninput - # onkeydown, onkeypress, onkeyup - | onkey(?>down|press|up) - | onlanguagechange - # onload, onloadend, onloadstart - | onload(?>end|start)? - | onlostpointercapture - | onmessage - | onmessageerror - # onmousedown, onmousemove, onmouseout, onmouseover, onmouseup - | onmouse(?>down|move|out|over|up) - | onpointer - # onpointercancel - (?> cancel - # onpointerenter - | enter - # onpointerleave - | leave - # onpointermove - | move - # onpointerout - | out - # onpointerover - | over - # onpointerup - | up - ) - | onpopstate - | onrejectionhandled - | onreset - | onresize - | onscroll - | onselect - | onselectionchange - | onselectstart - | onstorage - | onsubmit - # ontouchcancel, ontouchmove, ontouchstart - | ontouch(?>cancel|move|start) - # ontransitioncancel, ontransitionend - | ontransition(?>cancel|end) - | onunhandledrejection - | onunload - | onuserproximity - | onvrdisplay - # onvrdisplayactivate - (?> activate - # onvrdisplayblur - | blur - # onvrdisplayconnect - | connect - # onvrdisplaydeactivate - | deactivate - # onvrdisplaydisconnect - | disconnect - # onvrdisplayfocus - | focus - # onvrdisplaypresentchange - | presentchange - ) - | onwheel - | opener - | origin - # outerHeight, outerWidth - | outer(?>Height|Width) - | pageYOffset - | parent - | performance - | personalbar - # screen, screenX, screenY - | screen[XY]? - | scroll - # scrollbars - (?> bars - # scrollX, scrollY - | [XY] - ) - | self - | sessionStorage - | speechSynthesis - # status, statusbar - | status(?:bar)? - | toolbar - | top - | URL - | visualViewport - | window - )\b - scope: support.variable.js.fjsx15 - pop: true - # Bail. - - include: other-property-or-function diff --git a/syntaxes/flow1/associated-type.no-pop.sublime-syntax b/syntaxes/flow1/associated-type.no-pop.sublime-syntax deleted file mode 100644 index 517a9e94..00000000 --- a/syntaxes/flow1/associated-type.no-pop.sublime-syntax +++ /dev/null @@ -1,25 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?=:) - push: associated-type - - associated-type: - - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax diff --git a/syntaxes/flow1/associated-type.sublime-syntax b/syntaxes/flow1/associated-type.sublime-syntax deleted file mode 100644 index c42884dd..00000000 --- a/syntaxes/flow1/associated-type.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: ":" - scope: punctuation.binding.flow - set: optional-type-expression - - optional-type-expression: - - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/cast.sublime-syntax b/syntaxes/flow1/cast.sublime-syntax deleted file mode 100644 index 75665ae0..00000000 --- a/syntaxes/flow1/cast.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: ":" - scope: keyword.operator.other.cast.flow - set: optional-type-expression - - optional-type-expression: - - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/comment.sublime-syntax b/syntaxes/flow1/comment.sublime-syntax deleted file mode 100644 index 32b1d960..00000000 --- a/syntaxes/flow1/comment.sublime-syntax +++ /dev/null @@ -1,69 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: "/\\*\\s*(?>::|flow-include)" - scope: punctuation.definition.comment.begin.flow - set: block-end - - match: /\*(?=\s*:) - scope: punctuation.definition.comment.begin.flow - set: block-end - - block-end: - - meta_scope: comment.block.flow - - match: \*/ - scope: punctuation.definition.comment.end.js.fjsx15 - pop: true - - match: (;) - captures: - 1: punctuation.terminator.flow - - match: (?=\S) - embed: statement-or-expression - escape: (?=\*/|;) - - statement-or-expression: - - match: \? - scope: storage.modifier.flow - - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax - - include: statement-without-label - - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - statement-without-label: - - include: Packages/Naomi/syntaxes/flow1/declare.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/interface.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/type-aliasing.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#block - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#break-continue - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#debugger - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#do-while - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#empty - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#for - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#if-else - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#return - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#switch-case - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#throw - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax#try-catch-finally diff --git a/syntaxes/flow1/declare.sublime-syntax b/syntaxes/flow1/declare.sublime-syntax deleted file mode 100644 index 0254ae12..00000000 --- a/syntaxes/flow1/declare.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: declare\b - scope: keyword.declaration.flow - set: possible-module - - possible-module: - - include: Packages/Naomi/syntaxes/flow1/module.sublime-syntax - - match: (?=\S) - pop: true diff --git a/syntaxes/flow1/function.no-pop.sublime-syntax b/syntaxes/flow1/function.no-pop.sublime-syntax deleted file mode 100644 index f2f0059a..00000000 --- a/syntaxes/flow1/function.no-pop.sublime-syntax +++ /dev/null @@ -1,138 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - genericArguments: | - (< - (?> {{string}} - | \g<-1> - | [^<>] - )* - >) - - parameters: | - (\( - (?> {{string}} - | \g<-1> - | [^()] - )* - \)) - - flowOperators: | - (?> &(?!\s*&) - | \|(?!\s*\|) - ) - - string: | - (?> '(?:\'|[^'])*?' - | "(?:\"|[^"])*?" - | `(?:\`|[^`])*?` - ) - - flowObject: | - (\{ - (?> {{string}} - | \g<-1> - | [^{}] - )* - }) - - simpleFlowType: | - (?> {{string}} - | {{flowObject}} - | [$_[:alpha:]][$_[:alnum:].]* - ) - (?:\s*{{genericArguments}})? - (?:\s*\[\s*\])? - - flowFunction: | - ( - {{parameters}} - \s*=>\s* - (?> (?:\?\s*){{simpleFlowType}} - | \g<-1> - ) - ) - - complexType: | - (?:\?\s*)? - ( - (?> {{simpleFlowType}} - | {{flowFunction}} - | \g<-1> - ) - ) - - multipleTypes: | - ( - (?> \s*{{flowOperators}} - | \s*{{complexType}} - | \g<-1> - )+ - ) - - flowComment: /\*\s*:.*?\*/ - - type: | - (?> {{flowComment}} - | \:\s*{{multipleTypes}} - ) - -contexts: - main: - # Normal. - - match: | - (?xi) - (?= - {{genericArguments}}? - {{flowFunction}} - ) - push: declaration - # Single parameter. - - match: | - (?xi) - (?= - {{complexType}} - \s*=> - (?!\s*{) - ) - push: [ - return, - meta-parameters, - optional-tail, - head - ] - - declaration: - - include: Packages/Naomi/syntaxes/flow1/function.sublime-syntax#declaration - - head: - - include: Packages/Naomi/syntaxes/flow1/function.sublime-syntax#head - - meta-parameters: - - include: Packages/Naomi/syntaxes/flow1/function.sublime-syntax#meta-parameters - - optional-tail: - - include: Packages/Naomi/syntaxes/flow1/function.sublime-syntax#optional-tail - - return: - - include: Packages/Naomi/syntaxes/flow1/function.sublime-syntax#return diff --git a/syntaxes/flow1/function.sublime-syntax b/syntaxes/flow1/function.sublime-syntax deleted file mode 100644 index ad80fd2b..00000000 --- a/syntaxes/flow1/function.sublime-syntax +++ /dev/null @@ -1,163 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - genericArguments: | - (< - (?> {{string}} - | \g<-1> - | [^<>] - )* - >) - - parameters: | - (\( - (?> {{string}} - | \g<-1> - | [^()] - )* - \)) - - flowOperators: | - (?> &(?!\s*&) - | \|(?!\s*\|) - ) - - string: | - (?> '(?:\'|[^'])*?' - | "(?:\"|[^"])*?" - | `(?:\`|[^`])*?` - ) - - flowObject: | - (\{ - (?> {{string}} - | \g<-1> - | [^{}] - )* - }) - - simpleFlowType: | - (?> {{string}} - | {{flowObject}} - | [$_[:alpha:]][$_[:alnum:].]* - ) - (?:\s*{{genericArguments}})? - (?:\s*\[\s*\])? - - flowFunction: | - ( - {{parameters}} - \s*=>\s* - (?> (?:\?\s*){{simpleFlowType}} - | \g<-1> - ) - ) - - complexType: | - (?:\?\s*)? - ( - (?> {{simpleFlowType}} - | {{flowFunction}} - | \g<-1> - ) - ) - - multipleTypes: | - ( - (?> \s*{{flowOperators}} - | \s*{{complexType}} - | \g<-1> - )+ - ) - - flowComment: /\*\s*:.*?\*/ - - type: | - (?> {{flowComment}} - | \:\s*{{multipleTypes}} - ) - -contexts: - main: - # Normal. - - match: | - (?xi) - (?= - {{genericArguments}}? - {{flowFunction}} - ) - set: declaration - # Single parameter. - - match: | - (?xi) - (?= - {{commonIdentifier}} - {{genericArguments}} - \s*=> - (?!\s*\{) - ) - set: [ - return, - meta-parameters, - optional-tail, - head - ] - - declaration: - # Generic parameters. - - match: (?=<) - push: generic-arguments - # Parameters. - - match: (?=\() - set: [ - return, - parameters - ] - - generic-arguments: - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax - - head: - - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax#head - - meta-parameters: - - meta_scope: meta.function.parameters.flow - - include: pop-now - - optional-tail: - - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax#optional-tail - - optional-type-expression: - - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax - - parameters: - - include: Packages/Naomi/syntaxes/flow1/function/parameters.sublime-syntax - - pop-now: - - match: "" - pop: true - - return: - - match: => - scope: storage.type.function.arrow.flow - set: optional-type-expression diff --git a/syntaxes/flow1/function/parameters.sublime-syntax b/syntaxes/flow1/function/parameters.sublime-syntax deleted file mode 100644 index 2745437c..00000000 --- a/syntaxes/flow1/function/parameters.sublime-syntax +++ /dev/null @@ -1,41 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \( - scope: punctuation.section.group.begin.flow - set: [ delimiters, optional-parameter ] - - delimiters: - - match: \, - scope: punctuation.separator.comma.flow - push: optional-parameter - - match: \) - scope: punctuation.section.group.end.flow - pop: true - - optional-parameter: - - meta_scope: meta.function.parameters.flow - # Rest. - - match: \.{3} - scope: keyword.operator.other.rest.flow - # Parameter and type. - - include: Packages/Naomi/syntaxes/flow1/function/parameters/simple.sublime-syntax - # Just the type. - - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/function/parameters/simple.sublime-syntax b/syntaxes/flow1/function/parameters/simple.sublime-syntax deleted file mode 100644 index 15550f1b..00000000 --- a/syntaxes/flow1/function/parameters/simple.sublime-syntax +++ /dev/null @@ -1,36 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: | - (?xi) - ({{commonIdentifier}})(\?)? - (?=\s*:) - captures: - 1: variable.parameter.function.js.fjsx15 - 2: storage.modifier.flow - set: optional-associated-type - - optional-associated-type: - - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax diff --git a/syntaxes/flow1/generic/arguments.no-pop.sublime-syntax b/syntaxes/flow1/generic/arguments.no-pop.sublime-syntax deleted file mode 100644 index 77e201f3..00000000 --- a/syntaxes/flow1/generic/arguments.no-pop.sublime-syntax +++ /dev/null @@ -1,25 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?=<) - push: arguments - - arguments: - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax diff --git a/syntaxes/flow1/generic/arguments.sublime-syntax b/syntaxes/flow1/generic/arguments.sublime-syntax deleted file mode 100644 index a1913e4d..00000000 --- a/syntaxes/flow1/generic/arguments.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \< - scope: punctuation.section.generic.begin.flow - set: [ delimiters, optional-type-expression ] - - delimiters: - - meta_scope: meta.generic.flow - - match: \, - scope: punctuation.separator.comma.flow - push: optional-type-expression - - match: \> - scope: punctuation.section.generic.end.flow - pop: true - - optional-type-expression: - - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/indexer.sublime-syntax b/syntaxes/flow1/indexer.sublime-syntax deleted file mode 100644 index a0d4694f..00000000 --- a/syntaxes/flow1/indexer.sublime-syntax +++ /dev/null @@ -1,75 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: \[ - scope: punctuation.section.brackets.begin.flow - set: [ - optional-associated-type, - indexer-end, - optional-name - ] - - associated-type: - - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - indexer-end: - - match: \] - scope: punctuation.section.brackets.end.flow - pop: true - - optional-associated-type: - - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax - - optional-name: - - include: comment-no-pop - # Named indexers are similar to function’s parameters. - - match: | - (?xi) - ({{commonIdentifier}})(\?)? - (?=\s*:) - captures: - 1: variable.parameter.function.js.fjsx15 - 2: storage.modifier.optional.flow - set: associated-type - # Strings. - - match: (?=(?>'|"|`)) - set: [ - associated-type, - string - ] - # Other type expressions. - - match: (?=\S) - set: type-expression - - string: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - type-expression: - - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax diff --git a/syntaxes/flow1/interface.sublime-syntax b/syntaxes/flow1/interface.sublime-syntax deleted file mode 100644 index 7eadc1a0..00000000 --- a/syntaxes/flow1/interface.sublime-syntax +++ /dev/null @@ -1,85 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: interface\b - scope: storage.type.interface.flow - set: declaration - - body: - - include: comment-no-pop - - match: \{ - scope: punctuation.section.block.begin.flow - set: body-end - - body-end: - - include: comment-no-pop - - match: (?>(,)|(;)) - captures: - 1: punctuation.separator.comma.flow - 2: punctuation.terminator.flow - - match: \} - scope: punctuation.section.block.end.flow - pop: true - - match: (?=\S) - push: statement-or-expression - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - co-contra-variant-no-pop: - - include: Packages/Naomi/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax - - declaration: - - include: comment-no-pop - # Extension. - - match: extends\b - scope: storage.modifier.extends.flow - push: optional-type-expression - # Generic parameters. - - match: (?=<) - push: generic-arguments - # Body. - - match: (?=\{) - set: body - # Identifier. - - match: (?xi){{commonIdentifier}} - scope: entity.name.interface.flow - - generic-arguments: - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax - - optional-type-expression: - - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax - - statement-or-expression: - - include: comment - - include: co-contra-variant-no-pop - - include: Packages/Naomi/syntaxes/flow1/indexer.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax diff --git a/syntaxes/flow1/module.sublime-syntax b/syntaxes/flow1/module.sublime-syntax deleted file mode 100644 index 7e96c954..00000000 --- a/syntaxes/flow1/module.sublime-syntax +++ /dev/null @@ -1,55 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - # Common JS module. - - match: (?=module\s*.\s*exports) - set: [ - object-literal, - association, - common-js-module - ] - # ES module. - - match: module\b - scope: storage.type.module.flow - set: identifier - - association: - - match: ":" - scope: keyword.operator.other.flow - pop: true - - common-js-module: - - include: Packages/Naomi/syntaxes/fjsx15/node-js.sublime-syntax - - identifier: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - match: (?xi){{commonIdentifier}} - scope: entity.name.module.flow - pop: true - - object-literal: - - include: Packages/Naomi/syntaxes/fjsx15/literal/object.sublime-syntax diff --git a/syntaxes/flow1/namespace-path.no-pop.sublime-syntax b/syntaxes/flow1/namespace-path.no-pop.sublime-syntax deleted file mode 100644 index b9dcfd40..00000000 --- a/syntaxes/flow1/namespace-path.no-pop.sublime-syntax +++ /dev/null @@ -1,37 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - # Javascript/flow don’t have namespaces, this is just a visual cue to highlight - # only the last element when a type is expected. - main: - - match: | - (?xi) - ({{commonIdentifier}})\s* - (?> (\?\.) - | (\.) - ) - captures: - 1: variable.other.namespace.flow - 2: punctuation.accessor.optional-chain.flow - 3: punctuation.accessor.flow diff --git a/syntaxes/flow1/object.sublime-syntax b/syntaxes/flow1/object.sublime-syntax deleted file mode 100644 index 5c04431d..00000000 --- a/syntaxes/flow1/object.sublime-syntax +++ /dev/null @@ -1,183 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - constantIdentifier: | - [$_[:upper:]] - [$_[:upper:][:digit:]]* - -contexts: - main: - # Exact. - - match: ({)\s*(\|) - captures: - 1: punctuation.section.block.begin.flow - 2: punctuation.section.block.begin.flow - set: [ - meta-exact, - delimiters, - optional-property-or-method - ] - # Normal. - - match: \{ - scope: punctuation.section.block.begin.flow - set: [ - meta-scope, - delimiters, - optional-property-or-method - ] - - associated-type: - - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - co-contra-variant-no-pop: - - include: Packages/Naomi/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax - - constant: - # Single character. - - match: | - (?x) - ([_[:upper:]])\b - (?:\s*(\?\B))? - captures: - 1: >- - meta.object-literal.key.flow - string.unquoted.flow - 2: storage.modifier.optional.flow - set: associated-type - # Two or more characters. - - match: | - (?x) - ( - {{constantIdentifier}} - (?> \$\B - | [_[:upper:]]\b - ) - ) - (?:\s*(\?\B))? - captures: - 1: >- - meta.object-literal.key.flow - string.unquoted.flow - 2: storage.modifier.optional.flow - set: associated-type - - delimiters: - - match: (?:(,)|(;)) - captures: - 1: punctuation.separator.comma.flow - 2: punctuation.terminator.flow - push: optional-property-or-method - # Exact. - - match: (\|)\s*(}) - captures: - 1: punctuation.section.block.end.flow - 2: punctuation.section.block.end.flow - pop: true - # Normal. - - match: \} - scope: punctuation.section.block.end.flow - pop: true - - else-pop: - - match: (?=\S) - pop: true - - meta-scope: - - meta_scope: >- - meta.object-literal.flow - meta.block.flow - - include: pop-now - - meta-exact: - - meta_scope: >- - meta.object-literal.exact.flow - meta.block.flow - - include: pop-now - - optional-property-or-method: - - include: comment-no-pop - - match: (?=[|}]) - pop: true - - include: co-contra-variant-no-pop - - match: \.{3} - scope: keyword.operator.spread.flow - set: type-expression - - include: Packages/Naomi/syntaxes/fjsx15/class/modifier.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/indexer.sublime-syntax - - include: constant - - include: variable - # String property name. - - match: (?=(?>'|"|`)) - set: [ - associated-type, - string - ] - - include: else-pop - - pop-now: - - match: "" - pop: true - - string: - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - type-expression: - - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax - - variable: - # Single character. - - match: | - (?xi) - ((?> \$\B - | [_[:alpha:]]\b - )) - (?:\s*(\?))? - captures: - 1: >- - meta.object-literal.key.flow - string.unquoted.flow - 2: storage.modifier.optional.flow - set: associated-type - # Two or more characters. - - match: | - (?xi) - ( - {{commonIdentifier}} - (?> \$\B - | [_[:alnum:]]\b - ) - ) - (?:\s*(\?))? - captures: - 1: >- - meta.object-literal.key.flow - string.unquoted.flow - 2: storage.modifier.optional.flow - set: associated-type diff --git a/syntaxes/flow1/operator.sublime-syntax b/syntaxes/flow1/operator.sublime-syntax deleted file mode 100644 index 270c15a9..00000000 --- a/syntaxes/flow1/operator.sublime-syntax +++ /dev/null @@ -1,24 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/flow1/operator/typeof.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/operator/intersection.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/operator/nullable.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/operator/union.sublime-syntax diff --git a/syntaxes/flow1/operator/array-shorthand.sublime-syntax b/syntaxes/flow1/operator/array-shorthand.sublime-syntax deleted file mode 100644 index 4d6e231a..00000000 --- a/syntaxes/flow1/operator/array-shorthand.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: ((\[)\s*(])) - captures: - 1: meta.sequence.flow - 2: punctuation.section.brackets.begin.flow - 3: punctuation.section.brackets.end.flow - pop: true diff --git a/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax b/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax deleted file mode 100644 index a4ce0b97..00000000 --- a/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax +++ /dev/null @@ -1,22 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \- - scope: storage.modifier.contravariant.flow diff --git a/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax b/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax deleted file mode 100644 index ba0e8f96..00000000 --- a/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax +++ /dev/null @@ -1,22 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \+ - scope: storage.modifier.covariant.flow diff --git a/syntaxes/flow1/operator/intersection.sublime-syntax b/syntaxes/flow1/operator/intersection.sublime-syntax deleted file mode 100644 index cc957767..00000000 --- a/syntaxes/flow1/operator/intersection.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \& - scope: keyword.operator.other.intersection.flow - set: optional-type-expression - - optional-type-expression: - - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/operator/nullable.sublime-syntax b/syntaxes/flow1/operator/nullable.sublime-syntax deleted file mode 100644 index e24dcbd3..00000000 --- a/syntaxes/flow1/operator/nullable.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \? - scope: storage.modifier.nullable.flow - set: optional-type-expression - - optional-type-expression: - - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/operator/typeof.sublime-syntax b/syntaxes/flow1/operator/typeof.sublime-syntax deleted file mode 100644 index e86ca3db..00000000 --- a/syntaxes/flow1/operator/typeof.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?i)typeof\b - scope: keyword.operator.word.typeof.flow - set: type - - type: - - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax diff --git a/syntaxes/flow1/operator/union.sublime-syntax b/syntaxes/flow1/operator/union.sublime-syntax deleted file mode 100644 index 53301a01..00000000 --- a/syntaxes/flow1/operator/union.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \|(?!}) - scope: keyword.operator.other.union.flow - set: optional-type-expression - - optional-type-expression: - - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/optional-associated-type.sublime-syntax b/syntaxes/flow1/optional-associated-type.sublime-syntax deleted file mode 100644 index c312a887..00000000 --- a/syntaxes/flow1/optional-associated-type.sublime-syntax +++ /dev/null @@ -1,27 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?=:) - set: associated-type - - match: (?=\S) - pop: true - - associated-type: - - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax diff --git a/syntaxes/flow1/optional-modifier.no-pop.sublime-syntax b/syntaxes/flow1/optional-modifier.no-pop.sublime-syntax deleted file mode 100644 index 7891bec9..00000000 --- a/syntaxes/flow1/optional-modifier.no-pop.sublime-syntax +++ /dev/null @@ -1,25 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?=\?) - push: optional-modifier - - optional-modifier: - - include: Packages/Naomi/syntaxes/flow1/optional-modifier.sublime-syntax diff --git a/syntaxes/flow1/optional-modifier.sublime-syntax b/syntaxes/flow1/optional-modifier.sublime-syntax deleted file mode 100644 index 870ebd63..00000000 --- a/syntaxes/flow1/optional-modifier.sublime-syntax +++ /dev/null @@ -1,23 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \? - scope: storage.modifier.optional.flow - pop: true diff --git a/syntaxes/flow1/optional-type-expression.sublime-syntax b/syntaxes/flow1/optional-type-expression.sublime-syntax deleted file mode 100644 index a71a7725..00000000 --- a/syntaxes/flow1/optional-type-expression.sublime-syntax +++ /dev/null @@ -1,23 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?=[>,;:)\]}]) - pop: true - - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax diff --git a/syntaxes/flow1/prolog.sublime-syntax b/syntaxes/flow1/prolog.sublime-syntax deleted file mode 100644 index 6f10cd0d..00000000 --- a/syntaxes/flow1/prolog.sublime-syntax +++ /dev/null @@ -1,27 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x) - (?> //\s*@flow - | /\*\s*@flow\s\*/ - ) - scope: keyword.other.prolog.flow - pop: true diff --git a/syntaxes/flow1/simple.sublime-syntax b/syntaxes/flow1/simple.sublime-syntax deleted file mode 100644 index 66756d59..00000000 --- a/syntaxes/flow1/simple.sublime-syntax +++ /dev/null @@ -1,54 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - include: Packages/Naomi/syntaxes/flow1/namespace-path.no-pop.sublime-syntax - # Existential. - - match: \* - scope: support.type.existential.flow - pop: true - # Predefined types. - - match: | - (?x) - (?> any - | Array - | [Bb]oolean - | false - | Function - | Generator - | mixed - | [Nn]umber - | null - | Object - | [Ss]tring - | true - | undefined - | void - )\b - scope: support.type.primitive.flow - pop: true - # Other types. - - match: (?xi){{commonIdentifier}} - scope: variable.other.type.flow - pop: true diff --git a/syntaxes/flow1/tuple.sublime-syntax b/syntaxes/flow1/tuple.sublime-syntax deleted file mode 100644 index 70618d3a..00000000 --- a/syntaxes/flow1/tuple.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \[ - scope: punctuation.section.brackets.begin.flow - set: [ delimiters, optional-type-expression ] - - delimiters: - - meta_scope: meta.sequence.flow - - match: \, - scope: punctuation.separator.comma.flow - push: optional-type-expression - - match: \] - scope: punctuation.section.brackets.end.flow - pop: true - - optional-type-expression: - - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/flow1/type-aliasing.sublime-syntax b/syntaxes/flow1/type-aliasing.sublime-syntax deleted file mode 100644 index b123f457..00000000 --- a/syntaxes/flow1/type-aliasing.sublime-syntax +++ /dev/null @@ -1,71 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - - genericArguments: | - (< - [^<>]* - \g<-1>? - [^<>]* - >) - -contexts: - main: - - match: | - (?xi) - (?:(opaque)\s+)? - (type)\b - (?=\s+ - {{commonIdentifier}} - {{genericArguments}}? - ) - captures: - 1: storage.modifier.opaque.flow - 2: storage.type.flow - set: [ - punctuation, - identifier - ] - - identifier: - - match: (?xi){{commonIdentifier}} - scope: entity.name.type.flow - pop: true - - meta-scope: - - meta_scope: meta.declaration.type.flow - - match: "" - pop: true - - optional-type-expression: - - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax - - punctuation: - - meta_scope: meta.declaration.type.flow - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/associated-type.no-pop.sublime-syntax - - match: = - scope: keyword.operator.other.assignment.flow - set: [ - meta-scope, - optional-type-expression - ] diff --git a/syntaxes/flow1/type-export.sublime-syntax b/syntaxes/flow1/type-export.sublime-syntax deleted file mode 100644 index fa01f929..00000000 --- a/syntaxes/flow1/type-export.sublime-syntax +++ /dev/null @@ -1,89 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: typeof\b - scope: keyword.operator.word.typeof.flow - set: optional-target - - match: | - (?xi) - (?= - type - \s+{{commonIdentifier}} - ) - set: type-aliasing - - match: type\b - scope: storage.type.flow - set: optional-target - - alias: - - match: as\b - scope: keyword.control.import-export.as.js.fjsx15 - set: alias-name - - alias-name: - - match: (?xi){{commonIdentifier}} - scope: variable.other.type.js.fjsx15 - pop: true - - close-block: - - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#close-block - - delimiter: - - match: \, - scope: punctuation.separator.comma.js.fjsx15 - push: optional-target - # From. - - include: origin - - include: else-pop - - else-pop: - - match: (?=\S) - pop: true - - optional-target: - - match: (?=(?>[,}]|from)) - pop: true - # Multiple targets. - - match: \{ - scope: punctuation.section.block.begin.js.fjsx15 - set: [ - close-block, - delimiter, - optional-target - ] - # Aliased. - - match: (?xi){{commonIdentifier}}(?=\s+as) - scope: variable.other.type.js.fjsx15 - set: alias - # Simple. - - match: (?xi){{commonIdentifier}} - scope: variable.other.type.js.fjsx15 - pop: true - - origin: - - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#origin - - type-aliasing: - - include: Packages/Naomi/syntaxes/flow1/type-aliasing.sublime-syntax diff --git a/syntaxes/flow1/type-expression.sublime-syntax b/syntaxes/flow1/type-expression.sublime-syntax deleted file mode 100644 index 5e41f78f..00000000 --- a/syntaxes/flow1/type-expression.sublime-syntax +++ /dev/null @@ -1,85 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: comment-no-pop - # Functions need to be detected before expression groups. - - include: Packages/Naomi/syntaxes/flow1/function.sublime-syntax - # Detect operators as soon as possible. - - include: Packages/Naomi/syntaxes/flow1/operator.sublime-syntax - # Open new type expression group. - - match: \( - scope: punctuation.section.group.begin.flow - set: open-group - # Start of the type expression. - - match: (?=\S) - set: [ optional-tail, head ] - - close-group: - - match: \) - scope: punctuation.section.group.end.flow - set: optional-tail - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - else-pop: - - match: (?=\S) - pop: true - - head: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/flow1/object.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/tuple.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/simple.sublime-syntax - - open-group: - - include: comment-no-pop - # Functions need to be detected before expression groups. - - include: Packages/Naomi/syntaxes/flow1/function.no-pop.sublime-syntax - # Open new type expression group. - - match: \( - scope: punctuation.section.group.begin.flow - push: open-group - # Close the current type expression group. - - include: close-group - # Start of the type expression. - - match: (?=\S) - push: optional-type-expression - - optional-tail: - - include: comment-no-pop - # Array shorthand or generic arguments. - - match: (?=[\[<]) - set: [ optional-tail, tail ] - # Other operators. - - include: Packages/Naomi/syntaxes/flow1/operator.sublime-syntax - - include: else-pop - - optional-type-expression: - - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax - - tail: - - include: comment-no-pop - - include: Packages/Naomi/syntaxes/flow1/operator/array-shorthand.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax diff --git a/syntaxes/flow1/type-import.sublime-syntax b/syntaxes/flow1/type-import.sublime-syntax deleted file mode 100644 index ed6abd85..00000000 --- a/syntaxes/flow1/type-import.sublime-syntax +++ /dev/null @@ -1,79 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: typeof\b - scope: keyword.operator.word.typeof.flow - set: optional-target - - match: type\b - scope: storage.type.flow - set: optional-target - - alias: - - match: as\b - scope: keyword.control.import-export.as.js.fjsx15 - set: alias-name - - alias-name: - - match: (?xi){{commonIdentifier}} - scope: entity.name.type.js.fjsx15 - pop: true - - close-block: - - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#close-block - - delimiter: - - match: \, - scope: punctuation.separator.comma.js.fjsx15 - push: optional-target - # From. - - include: origin - - include: else-pop - - else-pop: - - match: (?=\S) - pop: true - - optional-target: - - match: (?=(?>[,}]|from)) - pop: true - # Multiple targets. - - match: \{ - scope: punctuation.section.block.begin.js.fjsx15 - set: [ - close-block, - delimiter, - optional-target - ] - # Aliased. - - match: (?xi){{commonIdentifier}}(?=\s+as) - scope: variable.other.type.js.fjsx15 - set: alias - # Simple. - - match: (?xi){{commonIdentifier}} - scope: entity.name.type.js.fjsx15 - pop: true - - origin: - - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#origin diff --git a/syntaxes/html5/attribute.sublime-syntax b/syntaxes/html5/attribute.sublime-syntax deleted file mode 100644 index ad1d14f0..00000000 --- a/syntaxes/html5/attribute.sublime-syntax +++ /dev/null @@ -1,252 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - attributeIdentifier: | - [_:[:alpha:]] - [_:[:alnum:]\-.]* - -contexts: - main: - # Style: - - match: style\b - scope: >- - meta.attribute.builtin.html.html5 - entity.other.attribute-name.style.html.html5 - set: [ meta, style-begin, key-value-separator ] - # Event handler. - - match: | - (?xi)on - # onabort - (?> abort - # onafterprint - | afterprint - # onauxclick - | auxclick - # onbeforeprint, onbeforeunload - | before(?>print|unload) - # onblur - | blur - # oncancel - | cancel - # oncanplay, oncanplaythrough - | canplay(?:through)? - # onchange - | change - # onclick - | click - # onclose - | close - # oncopy - | copy - # oncuechange - | cuechange - # oncut - | cut - # ondblclick - | dblclick - # ondrag, ondragend ondragenter ondragexit ondragleave ondragover ondragstart - | drag(?>end|enter|exit|leave|over|start)? - # ondrop - | drop - # ondurationchange - | durationchange - # onemptied - | emptied - # onended - | ended - # onerror - | error - # onfocus - | focus - # onhashchange - | hashchange - # oninput - | input - # oninvalid - | invalid - # onkeydown, onkeypress, onkeyup - | key(?>down|press|up) - # onlanguagechange - | languagechange - # onload, onloadeddata, onloadedmetadata, onloadend, onloadstart - | load(?>ed(?>data|metadata)|end|start) - # onmessage - | message - # onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup - | mouse(?>down|enter|leave|move|out|over|up) - # onoffline - | offline - # ononline - | online - # onpagehide, onpageshow - | page(?>hide|show) - # onpaste - | paste - # onpause - | pause - # onplay, onplaying - | play(?:ing)? - # onpopstate - | popstate - # onprogress - | progress - # onratechange - | ratechange - # onreadystatechange - | readystatechange - # onrejectionhandled - | rejectionhandled - # onreset - | reset - # onresize - | resize - # onscroll - | scroll - # onseeked, onseeking - | seek(?>ed|ing) - # onselect - | select - # onshow - | show - # onstalled - | stalled - # onstorage - | storage - # onsubmit - | submit - # onsuspend - | suspend - # ontimeupdate - | timeupdate - # ontoggle - | toggle - # onunhandlerejection - | unhandledrejection - # onunload - | unload - # onvolumechange - | volumechange - # onwaiting - | waiting - # onwheel - | wheel - )\b - scope: >- - meta.attribute.builtin.event-handler.html.html5 - entity.other.attribute-name.html.html5 - set: [ meta, script-begin, key-value-separator ] - # With value. - - match: (?xi)(?={{attributeIdentifier}}\s*=) - set: [ meta, value, name ] - # Simple attribute. - - match: (?xi)(?={{attributeIdentifier}}) - set: name - - close-double-quote: - - match: \" - scope: punctuation.definition.string.end.html.html5 - pop: true - - close-single-quote: - - match: \' - scope: punctuation.definition.string.end.html.html5 - pop: true - - css: - - match: "" - push: - - include: Packages/Naomi/syntaxes/css3/ruleset/block.sublime-syntax#delimiter - - key-value-separator: - - match: \= - scope: punctuation.separator.key-value.html.html5 - set: wait-non-space - - meta: - - meta_scope: meta.attribute-with-value.html.html5 - - include: pop-now - - meta-script: - - clear_scopes: true - - meta_content_scope: source.js - - include: pop-now - - meta-style: - - clear_scopes: true - - meta_content_scope: source.css - - include: pop-now - - name: - - include: Packages/Naomi/syntaxes/html5/attribute/builtin.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/attribute/data.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/attribute/other.sublime-syntax - - pop-now: - - match: "" - pop: true - - script: - - include: Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax - - script-begin: - - match: \' - scope: punctuation.definition.string.begin.html.html5 - with_prototype: - - match: (?=') - pop: true - set: [ close-single-quote, meta-script, script ] - - match: \" - scope: punctuation.definition.string.begin.html.html5 - with_prototype: - - match: (?=") - pop: true - set: [ close-double-quote, meta-script, script ] - # Unquoted script. - - match: "" - with_prototype: - - match: (?=[\s'"`=<>]) - pop: true - set: [ meta-script, script ] - - style-begin: - - match: \' - scope: punctuation.definition.string.begin.html.html5 - with_prototype: - - match: (?=') - pop: true - set: [ close-single-quote, meta-style, css ] - - match: \" - scope: punctuation.definition.string.begin.html.html5 - with_prototype: - - match: (?=") - pop: true - set: [ close-double-quote, meta-style, css ] - # Unquoted script. - - match: "" - with_prototype: - - match: (?=[\s'"`=<>]) - pop: true - set: [ meta-style, css ] - - value: - - include: Packages/Naomi/syntaxes/html5/attribute/value.sublime-syntax - - wait-non-space: - - match: (?=\S) - pop: true diff --git a/syntaxes/html5/attribute/builtin.sublime-syntax b/syntaxes/html5/attribute/builtin.sublime-syntax deleted file mode 100644 index 7cf8301a..00000000 --- a/syntaxes/html5/attribute/builtin.sublime-syntax +++ /dev/null @@ -1,195 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: id\b - scope: >- - meta.attribute.builtin.html.html5 - entity.other.attribute-name.id.html.html5 - pop: true - # Other builtin. - - match: | - (?xi) - (?> a - # accept, accept-charset, accessKey - (?> cce(?>pt(?:-charset)?|sskey) - # action - | ction - # align, alt - | l(?>ign|t) - # async - | sync - # autocomplete, autofocus, autoplay, autosave - | uto(?>complete|focus|play|save) - ) - | buffered - | c - # challenge, charset - (?> ha(?>llenge|rset) - # checked - | hecked - # cite - | ite - # class - | lass - | o - # code, codebase - (?> de(?:base)? - # cols, colspan - | ls(?:pan)? - # content. contenteditable, contextmenu, controls - | nt(?>e(?>nt(?:editable)?|xtmenu)|rols) - # cords - | ords - ) - ) - | d - # data, datetime - (?> at(?>a|etime) - # default, defer - | ef(?>ault|er) - # dir, dirname - | ir(?:name)? - # disabled - | isabled - # download - | ownload - # draggable, dropzone - | r(?>aggable|opzone) - ) - | enctype - # form, formaction - | for(?:m(?:action)?)? - | h - # headers - (?> eaders - # height - | eight - # hidden - | idden - # high - | igh - # href - | ref(?:lang)? - # http-equiv - | ttp-equiv - ) - | i - # icon - (?> con - # ismap - | smap - # itemprop - | temprop - ) - # keytype, kind - | k(?>eytype|ind) - | l - # label - (?> abel - # lang, language - | ang(?:uage)? - # list - | ist - # loop - | oop - # low - | ow - ) - | m - # manifest - (?> anifest - # max - | ax(?:length)? - # media - | edia - # method - | ethod - # min - | in - # multiple - | ultiple - # muted - | uted - ) - # name, novalidate - | n(?>ame|ovalidate) - # open, optimum - | op(?>en|timum) - | p - # pattern - (?> attern - # ping - | ing - # placeholder - | laceholder - # poster - | oster - # preload - | reload - ) - | r - # radiogroup - (?> adiogroup - # readonly, rel, required, reversed - | e(?>adonly|l|quired|versed) - # rows, rowspan - | ows(?:pan)? - ) - | s - # sandbox - (?> andbox - # scope, scoped - | coped? - # seamless - | eamless - # selected - | elected - # shape - | hape - # size, sizes - | izes? - # span - | pan - # spellcheck - | pellcheck - # src, srcdoc, srclang, srcset - | rc(?>doc|lang|set)? - # start, step, style, summary - | t(?>art|ep|yle) - # summary - | ummary - ) - | t - # tabindex, target - (?> a(?>bindex|rget) - # title - | itle - # type - | ype - ) - | usemap - | value - # width, wrap - | w(?>idth|rap) - )\b(?!-) - scope: >- - meta.attribute.builtin.html.html5 - entity.other.attribute-name.html.html5 - pop: true diff --git a/syntaxes/html5/attribute/data.sublime-syntax b/syntaxes/html5/attribute/data.sublime-syntax deleted file mode 100644 index 60d3514f..00000000 --- a/syntaxes/html5/attribute/data.sublime-syntax +++ /dev/null @@ -1,25 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?i)data-[_:[:alnum:]\-.]* - scope: >- - meta.attribute.data.html.html5 - entity.other.attribute-name.html.html5 - pop: true diff --git a/syntaxes/html5/attribute/other.sublime-syntax b/syntaxes/html5/attribute/other.sublime-syntax deleted file mode 100644 index 85b6c1db..00000000 --- a/syntaxes/html5/attribute/other.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_:[:alpha:]] - [_:[:alnum:]\-.]* - -contexts: - main: - - match: (?xi){{commonIdentifier}} - scope: entity.other.attribute-name.html.html5 - pop: true diff --git a/syntaxes/html5/attribute/value.sublime-syntax b/syntaxes/html5/attribute/value.sublime-syntax deleted file mode 100644 index f3639b79..00000000 --- a/syntaxes/html5/attribute/value.sublime-syntax +++ /dev/null @@ -1,31 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \= - scope: punctuation.separator.key-value.html.html5 - set: value - - match: (?=\S) - pop: true - - value: - - include: Packages/Naomi/syntaxes/html5/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/literal/string/unquoted.sublime-syntax diff --git a/syntaxes/html5/element.sublime-syntax b/syntaxes/html5/element.sublime-syntax deleted file mode 100644 index 919463b5..00000000 --- a/syntaxes/html5/element.sublime-syntax +++ /dev/null @@ -1,31 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/html5/element/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/element/doctype.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/element/cdata.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/element/sectioning.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/element/sectioning-root.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/element/form.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/element/form-sectioning-root.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/element/script.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/element/style.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/element/other.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/element/text/character-reference.sublime-syntax diff --git a/syntaxes/html5/element/cdata.sublime-syntax b/syntaxes/html5/element/cdata.sublime-syntax deleted file mode 100644 index 9db51dc9..00000000 --- a/syntaxes/html5/element/cdata.sublime-syntax +++ /dev/null @@ -1,34 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -# https://w3c.github.io/html/syntax.html#cdata-sections -contexts: - main: - - match: ( - scope: punctuation.definition.tag.end.html.html5 - pop: true diff --git a/syntaxes/html5/element/comment.sublime-syntax b/syntaxes/html5/element/comment.sublime-syntax deleted file mode 100644 index 171f3292..00000000 --- a/syntaxes/html5/element/comment.sublime-syntax +++ /dev/null @@ -1,38 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -# https://w3c.github.io/html/syntax.html#comments -contexts: - main: - - match: - scope: punctuation.definition.comment.end.html.html5 - pop: true - - email-no-pop: - - include: Packages/Naomi/syntaxes/shared/email.no-pop.sublime-syntax - - link-no-pop: - - include: Packages/Naomi/syntaxes/shared/link.no-pop.sublime-syntax diff --git a/syntaxes/html5/element/doctype.sublime-syntax b/syntaxes/html5/element/doctype.sublime-syntax deleted file mode 100644 index 34cf200b..00000000 --- a/syntaxes/html5/element/doctype.sublime-syntax +++ /dev/null @@ -1,27 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?i)() - captures: - 0: meta.tag.sgml.doctype.html.html5 - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.doctype.html.html5 - 3: punctuation.definition.tag.end.html.html5 - pop: true diff --git a/syntaxes/html5/element/form-sectioning-root.sublime-syntax b/syntaxes/html5/element/form-sectioning-root.sublime-syntax deleted file mode 100644 index 7c584a62..00000000 --- a/syntaxes/html5/element/form-sectioning-root.sublime-syntax +++ /dev/null @@ -1,42 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # Closing tag. - - match: () - captures: - 0: meta.tag.close.html.html5 - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - 3: punctuation.definition.tag.end.html.html5 - set: meta - # Open tag. - - match: (<)(fieldset)\b - captures: - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - set: [ meta, close-open-tag ] - - close-open-tag: - - include: Packages/Naomi/syntaxes/html5/element/shared.sublime-syntax#close-open-tag - - meta: - - meta_scope: meta.tag.form.sectioning.root.html.html5 - - match: "" - pop: true diff --git a/syntaxes/html5/element/form.sublime-syntax b/syntaxes/html5/element/form.sublime-syntax deleted file mode 100644 index 654ac41c..00000000 --- a/syntaxes/html5/element/form.sublime-syntax +++ /dev/null @@ -1,57 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - # button, form, label, legend, option, select, textarea - otherTags: (?>(?>button|form|l(?>abel|egend)|option|select|textarea)) - -contexts: - main: - - include: void-elements - - include: other-elements - - close-open-tag: - - include: Packages/Naomi/syntaxes/html5/element/shared.sublime-syntax#close-open-tag - - meta: - - meta_scope: meta.tag.form.html.html5 - - match: "" - pop: true - - other-elements: - # Closing tag. - - match: () - captures: - 0: meta.tag.close.html.html5 - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - 3: punctuation.definition.tag.end.html.html5 - set: meta - # Open tag. - - match: (<)({{otherTags}})\b - captures: - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - set: [ meta, close-open-tag ] - - void-elements: - - match: (<)(input)\b - captures: - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - set: [ meta, close-open-tag ] diff --git a/syntaxes/html5/element/other.sublime-syntax b/syntaxes/html5/element/other.sublime-syntax deleted file mode 100644 index 4fe1c034..00000000 --- a/syntaxes/html5/element/other.sublime-syntax +++ /dev/null @@ -1,42 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # Closing tag. - - match: () - captures: - 0: meta.tag.close.html.html5 - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - 3: punctuation.definition.tag.end.html.html5 - set: meta - # Open tag. - - match: (<)(\w+)\b - captures: - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - set: [ meta, close-open-tag ] - - close-open-tag: - - include: Packages/Naomi/syntaxes/html5/element/shared.sublime-syntax#close-open-tag - - meta: - - meta_scope: meta.tag.html.html5 - - match: "" - pop: true diff --git a/syntaxes/html5/element/script.sublime-syntax b/syntaxes/html5/element/script.sublime-syntax deleted file mode 100644 index b3630130..00000000 --- a/syntaxes/html5/element/script.sublime-syntax +++ /dev/null @@ -1,53 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: closing-tag - # Open tag. - - match: (<)(script)\b - captures: - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - set: [ script, meta, close-open-tag ] - - close-open-tag: - - include: Packages/Naomi/syntaxes/html5/element/shared.sublime-syntax#close-open-tag - - closing-tag: - - match: () - captures: - 0: meta.tag.close.html.html5 - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - 3: punctuation.definition.tag.end.html.html5 - pop: true - - meta: - - meta_scope: meta.tag.html.html5 - - match: "" - pop: true - - script: - - clear_scopes: true - - include: closing-tag - - match: "" - push: scope:source.js - with_prototype: - - match: (?=b(?>lockquote|ody)|d(?>etails|ialog)|figure|td) - -contexts: - main: - # Closing tag. - - match: () - captures: - 0: meta.tag.close.html.html5 - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - 3: punctuation.definition.tag.end.html.html5 - set: meta - # Open tag. - - match: \s*(<)({{tags}})\b - captures: - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - set: [ meta, close-open-tag ] - - close-open-tag: - - include: Packages/Naomi/syntaxes/html5/element/shared.sublime-syntax#close-open-tag - - meta: - - meta_scope: meta.tag.sectioning.root.html.html5 - - match: "" - pop: true diff --git a/syntaxes/html5/element/sectioning.sublime-syntax b/syntaxes/html5/element/sectioning.sublime-syntax deleted file mode 100644 index a2814cb6..00000000 --- a/syntaxes/html5/element/sectioning.sublime-syntax +++ /dev/null @@ -1,46 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - # article, aside, nav, section - tags: (?>a(?>rticle|side)|nav|section) - -contexts: - main: - # Closing tag. - - match: () - captures: - 0: meta.tag.close.html.html5 - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - 3: punctuation.definition.tag.end.html.html5 - set: meta - # Open tag. - - match: (<)({{tags}})\b - captures: - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - set: [ meta, close-open-tag ] - - close-open-tag: - - include: Packages/Naomi/syntaxes/html5/element/shared.sublime-syntax#close-open-tag - - meta: - - meta_scope: meta.tag.sectioning.html.html5 - - match: "" - pop: true diff --git a/syntaxes/html5/element/shared.sublime-syntax b/syntaxes/html5/element/shared.sublime-syntax deleted file mode 100644 index 809248f9..00000000 --- a/syntaxes/html5/element/shared.sublime-syntax +++ /dev/null @@ -1,41 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - elementIdentifier: | - [$_[:alpha:]] - [$_.[:alnum:]\-]* - -contexts: - main: - - match: "" - set: trap - - attribute: - - include: Packages/Naomi/syntaxes/html5/attribute.sublime-syntax - - close-open-tag: - - match: /?> - scope: punctuation.definition.tag.end.html.html5 - pop: true - - match: (?=\S) - push: attribute - - trap: - - match: . - scope: trap.html5 diff --git a/syntaxes/html5/element/style.sublime-syntax b/syntaxes/html5/element/style.sublime-syntax deleted file mode 100644 index 6d1ad95f..00000000 --- a/syntaxes/html5/element/style.sublime-syntax +++ /dev/null @@ -1,53 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: closing-tag - # Open tag. - - match: (<)(style)\b - captures: - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - set: [ script, meta, close-open-tag ] - - close-open-tag: - - include: Packages/Naomi/syntaxes/html5/element/shared.sublime-syntax#close-open-tag - - closing-tag: - - match: () - captures: - 0: meta.tag.close.html.html5 - 1: punctuation.definition.tag.begin.html.html5 - 2: entity.name.tag.html.html5 - 3: punctuation.definition.tag.end.html.html5 - pop: true - - meta: - - meta_scope: meta.tag.html.html5 - - match: "" - pop: true - - script: - - clear_scopes: true - - include: closing-tag - - match: "" - push: scope:source.css - with_prototype: - - match: (?={{decimal}}|{{hex}}|\w+); - scope: constant.character.entity.html.html5 - pop: true diff --git a/syntaxes/html5/literal/number.sublime-syntax b/syntaxes/html5/literal/number.sublime-syntax deleted file mode 100644 index 21728510..00000000 --- a/syntaxes/html5/literal/number.sublime-syntax +++ /dev/null @@ -1,61 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - literalDecimal: "[0-9]+" - - literalFloat: | - -? - (?> [0-9]*[.]{{literalDecimal}} - | {{literalDecimal}}[.][0-9]* - ) - - scientificNotation: | - -? - (?> {{literalFloat}} - | {{literalDecimal}} - ) - [e][+-]? - {{literalDecimal}} - -contexts: - main: - - include: float - - include: integer - - float: - - match: (?xi){{scientificNotation}}(?=\s|>|$) - scope: constant.numeric.float.scientific.html.html5 - pop: true - - match: (?x){{literalFloat}}(?=\s|>|$) - scope: constant.numeric.float.html.html5 - pop: true - - integer: - - match: (?i)-?0b[01]+(?=\s|>|$) - scope: constant.numeric.binary.html.html5 - pop: true - - match: (?:-?0[0-7]+)(?=\s|>|$) - scope: constant.numeric.octal.html.html5 - pop: true - - match: (?i)-?0[x][0-9a-f]+(?=\s|>|$) - scope: constant.numeric.hex.html.html5 - pop: true - - match: (?:-?[1-9][0-9]*|0)(?=\s|>|$) - scope: constant.numeric.decimal.html.html5 - pop: true diff --git a/syntaxes/html5/literal/string/double-quoted.sublime-syntax b/syntaxes/html5/literal/string/double-quoted.sublime-syntax deleted file mode 100644 index 0b4badc1..00000000 --- a/syntaxes/html5/literal/string/double-quoted.sublime-syntax +++ /dev/null @@ -1,29 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \" - scope: punctuation.definition.string.begin.html.html5 - set: string - - string: - - meta_scope: string.quoted.double.html.html5 - - match: \" - scope: punctuation.definition.string.end.html.html5 - pop: true diff --git a/syntaxes/html5/literal/string/single-quoted.sublime-syntax b/syntaxes/html5/literal/string/single-quoted.sublime-syntax deleted file mode 100644 index adcdc7e0..00000000 --- a/syntaxes/html5/literal/string/single-quoted.sublime-syntax +++ /dev/null @@ -1,29 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \' - scope: punctuation.definition.string.begin.html.html5 - set: string - - string: - - meta_scope: string.quoted.single.html.html5 - - match: \' - scope: punctuation.definition.string.end.html.html5 - pop: true diff --git a/syntaxes/html5/literal/string/unquoted.sublime-syntax b/syntaxes/html5/literal/string/unquoted.sublime-syntax deleted file mode 100644 index 047ea630..00000000 --- a/syntaxes/html5/literal/string/unquoted.sublime-syntax +++ /dev/null @@ -1,23 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: "[^\\s<>]+" - scope: string.unquoted.html.html5 - pop: true diff --git a/syntaxes/html5/php.sublime-syntax b/syntaxes/html5/php.sublime-syntax deleted file mode 100644 index 734ae8cd..00000000 --- a/syntaxes/html5/php.sublime-syntax +++ /dev/null @@ -1,25 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?=<\?php) - push: php - - php: - - include: Packages/Naomi/syntaxes/naomi.php7.sublime-syntax diff --git a/syntaxes/jsx1/attribute.sublime-syntax b/syntaxes/jsx1/attribute.sublime-syntax deleted file mode 100644 index 193607ca..00000000 --- a/syntaxes/jsx1/attribute.sublime-syntax +++ /dev/null @@ -1,115 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - attributeIdentifier: | - [_[:alpha:]] - [_.[:alnum:]\-]* - -contexts: - main: - - include: Packages/Naomi/syntaxes/flow1/prolog.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/comment/eslint.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/comment/docblock.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/comment/block.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/comment/line.sublime-syntax - # Embedded JS. - - include: Packages/Naomi/syntaxes/jsx1/embedded-js.sublime-syntax - - include: dangerous - - include: key - - include: ref - - include: fallback - - dangerous: - # Attribute with value. - - match: dangerouslySetInnerHTML\b(?=\s*=) - scope: >- - meta.attribute.builtin.html.jsx.jsx1 - entity.other.attribute-name.dangerous.html.jsx.jsx1 - set: [ meta, optional-value ] - # Simple attribute. - - match: dangerouslySetInnerHTML\b - scope: >- - meta.attribute.builtin.html.jsx.jsx1 - entity.other.attribute-name.dangerous.html.jsx.jsx1 - pop: true - - else-pop: - - match: (?=\S) - pop: true - - key: - # Attribute with value. - - match: key(?=\s*=) - scope: >- - meta.attribute.builtin.html.jsx.jsx1 - entity.other.attribute-name.key.html.jsx.jsx1 - set: [ meta, optional-value ] - # Simple attribute. - - match: key\b - scope: >- - meta.attribute.builtin.html.jsx.jsx1 - entity.other.attribute-name.key.html.jsx.jsx1 - pop: true - - optional-value: - # Normal value. - - match: = - scope: punctuation.separator.key-value.html.jsx.jsx1 - set: value - - include: else-pop - - fallback: - # Attribute with value. - - match: (?xi){{attributeIdentifier}}(?=\s*=) - scope: entity.other.attribute-name.html.jsx.jsx1 - set: [ meta, optional-value ] - # Simple attribute. - - match: (?xi){{attributeIdentifier}} - scope: entity.other.attribute-name.html.jsx.jsx1 - pop: true - - meta: - - meta_scope: meta.attribute-with-value.html.html5 - - include: pop-now - - pop-now: - - match: "" - pop: true - - ref: - # Attribute with value. - - match: ref(?=\s*=) - scope: >- - meta.attribute.builtin.html.jsx.jsx1 - entity.other.attribute-name.ref.html.jsx.jsx1 - set: [ meta, optional-value ] - # Simple attribute. - - match: ref\b - scope: >- - meta.attribute.builtin.html.jsx.jsx1 - entity.other.attribute-name.ref.html.jsx.jsx1 - pop: true - - value: - - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax - - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax - - include: Packages/Naomi/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/jsx1/literal/string/single-quoted.sublime-syntax - - include: else-pop diff --git a/syntaxes/jsx1/component.sublime-syntax b/syntaxes/jsx1/component.sublime-syntax deleted file mode 100644 index 0527c652..00000000 --- a/syntaxes/jsx1/component.sublime-syntax +++ /dev/null @@ -1,80 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - componentIdentifier: | - [[:upper:]] - [$_.:[:alnum:]]* - - namespaceIdentifier: | - [$_[:alpha:]] - [$_.[:alnum:]\-]* - -contexts: - main: - - match: | - (?x) - (<) - (?: - \s*({{namespaceIdentifier}}) - \s*(:) - )? - \s*({{componentIdentifier}}) - captures: - 1: punctuation.definition.tag.begin.html.jsx.jsx1 - 2: entity.name.tag.namespace.html.jsx.jsx1 - 3: punctuation.separator.namespace.html.jsx.jsx1 - 4: entity.name.tag.component.jsx.jsx1 - set: [ - meta, - namespaced-closing-tag, - close-open-tag - ] - - close-open-tag: - - include: Packages/Naomi/syntaxes/jsx1/shared.sublime-syntax#close-open-tag - - meta: - - meta_scope: meta.tag.other.component.html.jsx.jsx1 - - match: "" - pop: true - - namespaced-closing-tag: - - include: Packages/Naomi/syntaxes/jsx1/shared.sublime-syntax#component-closing-tag - - with-js-fence: - - match: | - (?x) - (<) - (?: - \s*({{namespaceIdentifier}}) - \s*(:) - )? - \s*({{componentIdentifier}}) - captures: - 1: >- - meta.jsx-fence.jsx.jsx1 - punctuation.definition.tag.begin.jsx.jsx1 - 2: entity.name.tag.namespace.html.jsx.jsx1 - 3: punctuation.separator.namespace.html.jsx.jsx1 - 4: entity.name.tag.component.jsx.jsx1 - set: [ - meta, - namespaced-closing-tag, - close-open-tag - ] \ No newline at end of file diff --git a/syntaxes/jsx1/element.sublime-syntax b/syntaxes/jsx1/element.sublime-syntax deleted file mode 100644 index b1169d0b..00000000 --- a/syntaxes/jsx1/element.sublime-syntax +++ /dev/null @@ -1,87 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - elementIdentifier: | - [$_[:alpha:]] - [$_.[:alnum:]\-]* - - namespaceIdentifier: "{{elementIdentifier}}" - -contexts: - main: - - match: | - (?xi) - (<) - (?: - \s*({{namespaceIdentifier}}) - \s*(:) - )? - \s*({{elementIdentifier}}) - captures: - 1: punctuation.definition.tag.begin.html.jsx.jsx1 - 2: entity.name.tag.namespace.html.jsx.jsx1 - 3: punctuation.separator.namespace.html.jsx.jsx1 - 4: entity.name.tag.html.jsx.jsx1 - set: [ - meta, - namespaced-closing-tag, - close-open-tag - ] - - close-open-tag: - - include: Packages/Naomi/syntaxes/jsx1/shared.sublime-syntax#close-open-tag - - meta: - - meta_scope: meta.tag.other.html.jsx.jsx1 - - include: pop-now - - namespaced-closing-tag: - - include: Packages/Naomi/syntaxes/jsx1/shared.sublime-syntax#namespaced-closing-tag - - pop-now: - - match: "" - pop: true - - self-closing-tag: - - include: Packages/Naomi/syntaxes/jsx1/shared.sublime-syntax#self-closing-tag - - simple-closing-tag: - - include: Packages/Naomi/syntaxes/jsx1/shared.sublime-syntax#simple-closing-tag - - with-js-fence: - - match: | - (?xi) - (<) - (?: - \s*({{namespaceIdentifier}}) - \s*(:) - )? - \s*({{elementIdentifier}}) - captures: - 1: >- - meta.jsx-fence.jsx.jsx1 - punctuation.definition.tag.begin.jsx.jsx1 - 2: entity.name.tag.namespace.html.jsx.jsx1 - 3: punctuation.separator.namespace.html.jsx.jsx1 - 4: entity.name.tag.html.jsx.jsx1 - set: [ - meta, - namespaced-closing-tag, - close-open-tag - ] \ No newline at end of file diff --git a/syntaxes/jsx1/embedded-js.sublime-syntax b/syntaxes/jsx1/embedded-js.sublime-syntax deleted file mode 100644 index a4a181b9..00000000 --- a/syntaxes/jsx1/embedded-js.sublime-syntax +++ /dev/null @@ -1,51 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \{ - scope: punctuation.definition.template-expression.begin.html.jsx.jsx1 - set: [ meta, close, content ] - - close: - - match: \} - scope: punctuation.definition.template-expression.end.html.jsx.jsx1 - pop: true - - comment-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - content: - - clear_scopes: true - - meta_content_scope: source.js - - match: (?=}) - pop: true - # This is necessary, otherwise the context will be locked if there’s only a - # comment in the embedded code. - - include: comment-no-pop - # Actual expression. - - match: (?=\S) - push: expression - - expression: - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - - meta: - - meta_scope: meta.embedded-js.jsx.jsx1 - - match: "" - pop: true diff --git a/syntaxes/jsx1/fragment.sublime-syntax b/syntaxes/jsx1/fragment.sublime-syntax deleted file mode 100644 index 5fd932d3..00000000 --- a/syntaxes/jsx1/fragment.sublime-syntax +++ /dev/null @@ -1,67 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (<)\s*(>) - captures: - 1: punctuation.definition.tag.begin.jsx.jsx1 - 2: punctuation.definition.tag.end.jsx.jsx1 - set: [ - meta, - closing-tag - ] - - closing-tag: - # Closing tag. - - match: (()) - captures: - 1: meta.tag.close.jsx.jsx1 - 2: punctuation.definition.tag.begin.jsx.jsx1 - 3: punctuation.definition.tag.end.jsx.jsx1 - pop: true - - match: (?=.|\n) - push: [ meta-content, content ] - - content: - - include: Packages/Naomi/syntaxes/jsx1/shared.sublime-syntax#content - - meta: - - meta_scope: meta.tag.other.fragment.jsx.jsx1 - - include: pop-now - - meta-content: - - clear_scopes: true - - meta_scope: source.jsx - - include: pop-now - - pop-now: - - match: "" - pop: true - - with-js-fence: - - match: (<)\s*(>) - captures: - 1: >- - meta.jsx-fence.jsx.jsx1 - punctuation.definition.tag.begin.jsx.jsx1 - 2: punctuation.definition.tag.end.jsx.jsx1 - set: [ - meta, - closing-tag - ] diff --git a/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax b/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax deleted file mode 100644 index e030f442..00000000 --- a/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax +++ /dev/null @@ -1,29 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \" - scope: punctuation.definition.string.begin.html.html.jsx.jsx1 - set: string - - string: - - meta_scope: string.quoted.double.html.html.jsx.jsx1 - - match: \" - scope: punctuation.definition.string.end.html.html.jsx.jsx1 - pop: true diff --git a/syntaxes/jsx1/literal/string/single-quoted.sublime-syntax b/syntaxes/jsx1/literal/string/single-quoted.sublime-syntax deleted file mode 100644 index 26a2d703..00000000 --- a/syntaxes/jsx1/literal/string/single-quoted.sublime-syntax +++ /dev/null @@ -1,29 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \' - scope: punctuation.definition.string.begin.html.jsx.jsx1 - set: string - - string: - - meta_scope: string.quoted.single.html.jsx.jsx1 - - match: \' - scope: punctuation.definition.string.end.html.jsx.jsx1 - pop: true diff --git a/syntaxes/jsx1/shared.sublime-syntax b/syntaxes/jsx1/shared.sublime-syntax deleted file mode 100644 index 010deccc..00000000 --- a/syntaxes/jsx1/shared.sublime-syntax +++ /dev/null @@ -1,131 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - elementIdentifier: | - [$_[:alpha:]] - [$_.[:alnum:]\-]* - -contexts: - main: - - match: "" - set: trap - - attribute: - - include: Packages/Naomi/syntaxes/jsx1/attribute.sublime-syntax - - close-open-tag: - # Self closing tag. - - match: (?=/>) - pop: true - # Normal closing tag. - - match: \> - scope: punctuation.definition.tag.end.html.jsx.jsx1 - pop: true - # Attribute. - - match: (?=\S) - push: attribute - - component-closing-tag: - - include: self-closing-tag - - match: | - (?x) - ( - ( (\2)(:)(\4) - | (\4) - ) - (>) - ) - captures: - 1: meta.tag.close.html.jsx.jsx1 - 2: punctuation.definition.tag.begin.html.jsx.jsx1 - 3: entity.name.tag.namespace.html.jsx.jsx1 - 4: punctuation.separator.namespace.html.jsx.jsx1 - 5: entity.name.tag.component.jsx.jsx1 - 6: entity.name.tag.component.jsx.jsx1 - 7: punctuation.definition.tag.end.html.jsx.jsx1 - pop: true - - match: (?=.|\n) - push: [ meta-content, content ] - - content: - # Sub element. - - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax - - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax - # Embedded JS. - - include: Packages/Naomi/syntaxes/jsx1/embedded-js.sublime-syntax - # Text. - - match: .|\n - pop: true - - meta-content: - - clear_scopes: true - - meta_scope: source.jsx - - include: pop-now - - namespaced-closing-tag: - - include: self-closing-tag - - match: | - (?x) - ( - ( (\2)(:)(\4) - | (\4) - ) - (>) - ) - captures: - 1: meta.tag.close.html.jsx.jsx1 - 2: punctuation.definition.tag.begin.html.jsx.jsx1 - 3: entity.name.tag.namespace.html.jsx.jsx1 - 4: punctuation.separator.namespace.html.jsx.jsx1 - 5: entity.name.tag.jsx.jsx1 - 6: entity.name.tag.jsx.jsx1 - 7: punctuation.definition.tag.end.html.jsx.jsx1 - pop: true - # Content. - - match: (?=.|\n) - push: [ meta-content, content ] - - pop-now: - - match: "" - pop: true - - self-closing-tag: - - match: /> - scope: punctuation.definition.tag.end.html.jsx.jsx1 - pop: true - - simple-closing-tag: - - include: self-closing-tag - - match: (()) - captures: - 1: meta.tag.close.html.jsx.jsx1 - 2: punctuation.definition.tag.begin.html.jsx.jsx1 - 3: entity.name.tag.html.jsx.jsx1 - 4: punctuation.definition.tag.end.html.jsx.jsx1 - pop: true - # Content. - - match: (?=.|\n) - push: [ meta-content, content ] - - trap: - - match: . - scope: trap.jsx1 diff --git a/syntaxes/md1/code-block.sublime-syntax b/syntaxes/md1/code-block.sublime-syntax deleted file mode 100644 index f9a2b11d..00000000 --- a/syntaxes/md1/code-block.sublime-syntax +++ /dev/null @@ -1,66 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # JSON - - match: | - (?xi)^\s* - (```JSON) - captures: - 1: punctuation.definition.code-block.begin.md.md1 - push: - - match: ^\s*(```) - captures: - 1: punctuation.definition.code-block.end.md.md1 - pop: true - - match: "" - push: - - match: (?=^\s*```) - pop: true - - include: scope:source.json - - match: "" - pop: true - # JavaScript - - match: | - (?xi)^\s* - ( - ``` - (?> EcmaScript - | ES - (?> [67] - | 201[5678] - ) - | JavaScript - | JS - ) - ) - captures: - 1: punctuation.definition.code-block.begin.md.md1 - push: - - match: ^\s*(```) - captures: - 1: punctuation.definition.code-block.end.md.md1 - pop: true - - match: "" - push: - - match: (?=^\s*```) - pop: true - - include: Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/md1/header.sublime-syntax b/syntaxes/md1/header.sublime-syntax deleted file mode 100644 index 2b2cb7f2..00000000 --- a/syntaxes/md1/header.sublime-syntax +++ /dev/null @@ -1,80 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # Level 6. - - match: \s*(#{6})(.+$) - captures: - 1: >- - level-6.md.md1 - punctuation.definition.header.md.md1 - 2: >- - level-6.md.md1 - entity.name.header.md.md1 - pop: true - # Level 5. - - match: \s*(#{5})(.+$) - captures: - 1: >- - level-5.md.md1 - punctuation.definition.header.md.md1 - 2: >- - level-5.md.md1 - entity.name.header.md.md1 - pop: true - # Level 4. - - match: \s*(#{4})(.+$) - captures: - 1: >- - level-4.md.md1 - punctuation.definition.header.md.md1 - 2: >- - level-4.md.md1 - entity.name.header.md.md1 - pop: true - # Level 3. - - match: \s*(#{3})(.+$) - captures: - 1: >- - level-3.md.md1 - punctuation.definition.header.md.md1 - 2: >- - level-3.md.md1 - entity.name.header.md.md1 - pop: true - # Level 2. - - match: \s*(#{2})(.+$) - captures: - 1: >- - level-2.md.md1 - punctuation.definition.header.md.md1 - 2: >- - level-2.md.md1 - entity.name.header.md.md1 - pop: true - # Level 1. - - match: \s*(#{1})(.+$) - captures: - 1: >- - level-1.md.md1 - punctuation.definition.header.md.md1 - 2: >- - level-1.md.md1 - entity.name.header.md.md1 - pop: true diff --git a/syntaxes/mql4/array-access.sublime-syntax b/syntaxes/mql4/array-access.sublime-syntax deleted file mode 100644 index e3ebf0c7..00000000 --- a/syntaxes/mql4/array-access.sublime-syntax +++ /dev/null @@ -1,37 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x) - \s*(\[) - captures: - 1: punctuation.definition.array.access.begin.mql.mql4 - set: index - - index: - - match: \s*(]) - captures: - 1: punctuation.definition.array.access.end.mql.mql4 - pop: true - - match: "" - push: - - match: (?=\s*]) - pop: true - - include: Packages/Naomi/syntaxes/mql4/statement-and-expression.sublime-syntax diff --git a/syntaxes/mql4/cast.sublime-syntax b/syntaxes/mql4/cast.sublime-syntax deleted file mode 100644 index 10100fda..00000000 --- a/syntaxes/mql4/cast.sublime-syntax +++ /dev/null @@ -1,59 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - - typeIdentifier: | - {{commonIdentifier}} - (?> \s*\*+ - | \s*<.*?> - (?:\s*\**) - | \b - ) - -contexts: - main: - - match: | - (?xi) - (?= - \s*\( - {{typeIdentifier}} - \s*\) - ) - set: [ - definition, - type, - definition - ] - - definition: - - match: \s*(\() - captures: - 1: punctuation.definition.cast.begin.mql.mql4 - pop: true - - match: \s*(\)) - captures: - 1: punctuation.definition.cast.end.mql.mql4 - pop: true - - type: - - include: Packages/Naomi/syntaxes/mql4/type.sublime-syntax - diff --git a/syntaxes/mql4/cd-tor.inside.sublime-syntax b/syntaxes/mql4/cd-tor.inside.sublime-syntax deleted file mode 100644 index 00bab3c3..00000000 --- a/syntaxes/mql4/cd-tor.inside.sublime-syntax +++ /dev/null @@ -1,62 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - - typeIdentifier: | - {{commonIdentifier}} - -contexts: - main: - - match: | - (?xi) - (?=\s* - (?> \b - | \B(?:~)? - ) - {{commonIdentifier}} - \s*\( - ) - set: [ - body, - parameters, - name - ] - - name: - - match: | - (?xi)\s* - ( - (?> \b - | \B(?:~)? - ) - {{commonIdentifier}} - )\b - scope: >- - support.core.mql.mql4 - entity.name.function.mql.mql4 - pop: true - - parameters: - - include: Packages/Naomi/syntaxes/mql4/function/parameters.sublime-syntax - - body: - - include: Packages/Naomi/syntaxes/mql4/function/body.sublime-syntax diff --git a/syntaxes/mql4/cd-tor.outside.sublime-syntax b/syntaxes/mql4/cd-tor.outside.sublime-syntax deleted file mode 100644 index 1822e929..00000000 --- a/syntaxes/mql4/cd-tor.outside.sublime-syntax +++ /dev/null @@ -1,72 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - - typeIdentifier: | - {{commonIdentifier}} - -contexts: - main: - - match: | - (?xi) - (?= - \s*\b - {{commonIdentifier}}::(?:~)?{{commonIdentifier}} - \s*\( - ) - set: [ - body, - parameters, - name, - scope-operator, - class - ] - - class: - - match: (?xi)\s*\b({{commonIdentifier}})\b - captures: - 1: entity.name.class.mql.mql4 - pop: true - - scope-operator: - - match: \s*(::) - captures: - 1: keyword.operator.other.scope.mql.mql4 - pop: true - - name: - - match: | - (?xi) - (?> \b - | \B(?:~)? - ) - {{commonIdentifier}}\b - scope: >- - support.core.mql.mql4 - entity.name.function.mql.mql4 - pop: true - - parameters: - - include: Packages/Naomi/syntaxes/mql4/function/parameters.sublime-syntax - - body: - - include: Packages/Naomi/syntaxes/mql4/function/body.sublime-syntax diff --git a/syntaxes/mql4/class.sublime-syntax b/syntaxes/mql4/class.sublime-syntax deleted file mode 100644 index 323c2f36..00000000 --- a/syntaxes/mql4/class.sublime-syntax +++ /dev/null @@ -1,92 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - match: \s*\b(class)\b - captures: - 1: >- - storage.type.mql.mql4 - keyword.declaration.class.mql.mql4 - set: identifier - - identifier: - - match: | - (?xi)\s* - ({{commonIdentifier}}) - captures: - 1: entity.name.class.mql.mql4 - set: inheritance - - inheritance: - - include: comment - # End of declaration. - - match: \s*(;) - captures: - 1: punctuation.definition.class.body.end.mql.mql4 - pop: true - # Body beginning. - - match: \s*(\{) - captures: - 1: punctuation.definition.class.body.begin.mql.mql4 - set: body-content - # Inherited class access. - - match: | - (?xi) - \s*(:) - \s*( - (?> public - | protected - | private - ) - )\s* - captures: - 1: >- - storage.modifier.mql.mql4 - keyword.operator.other.inherit.mql.mql4 - 2: >- - storage.modifier.mql.mql4 - keyword.other.access.mql.mql4 - # Inherited class. - - match: "" - push: - - include: Packages/Naomi/syntaxes/mql4/type.sublime-syntax - - body-content: - - include: comment - - match: \s*(};?) - captures: - 1: punctuation.definition.class.body.end.mql.mql4 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: comment - - include: Packages/Naomi/syntaxes/mql4/cd-tor.inside.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/statement/hanging.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/variable-declaration.sublime-syntax - - comment: - - include: Packages/Naomi/syntaxes/mql4/comment.no-pop.sublime-syntax diff --git a/syntaxes/mql4/comment.no-pop.sublime-syntax b/syntaxes/mql4/comment.no-pop.sublime-syntax deleted file mode 100644 index 95409abc..00000000 --- a/syntaxes/mql4/comment.no-pop.sublime-syntax +++ /dev/null @@ -1,29 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x) - (?=\s*/ - (?> / - | \* - ) - ) - push: - - include: Packages/Naomi/syntaxes/mql4/comment.sublime-syntax diff --git a/syntaxes/mql4/comment.sublime-syntax b/syntaxes/mql4/comment.sublime-syntax deleted file mode 100644 index 75f1bb96..00000000 --- a/syntaxes/mql4/comment.sublime-syntax +++ /dev/null @@ -1,21 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/mql4/comment/normal.sublime-syntax diff --git a/syntaxes/mql4/comment/normal.sublime-syntax b/syntaxes/mql4/comment/normal.sublime-syntax deleted file mode 100644 index 8d57ff46..00000000 --- a/syntaxes/mql4/comment/normal.sublime-syntax +++ /dev/null @@ -1,57 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(//) - captures: - 1: punctuation.definition.comment.begin.mql.mql4 - set: line - - match: \s*(/\*) - captures: - 1: punctuation.definition.comment.begin.mql.mql4 - set: block - - line: - - meta_scope: comment.line.mql.mql4 - - include: email - - include: link - - match: \s*$ - pop: true - - block: - - meta_scope: comment.block.mql.mql4 - - include: email - - include: link - - match: \s*(\*/) - captures: - 1: punctuation.definition.comment.end.mql.mql4 - set: - # Used to fix the block comment indentation settings. - # https://forum.sublimetext.com/t/everything-you-n-ever-wanted-to-know-about-indentation-in-st3/26207/6 - - match: \s*$\n? - scope: meta.block-end.mql.mql4 - pop: true - - match: '' - pop: true - - link: - - include: Packages/Naomi/syntaxes/shared/link.sublime-syntax - - email: - - include: Packages/Naomi/syntaxes/shared/email.sublime-syntax diff --git a/syntaxes/mql4/constant.sublime-syntax b/syntaxes/mql4/constant.sublime-syntax deleted file mode 100644 index 16818fac..00000000 --- a/syntaxes/mql4/constant.sublime-syntax +++ /dev/null @@ -1,52 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # Types that look like constants. - - include: Packages/Naomi/syntaxes/mql4/type/support/enums.sublime-syntax - # Actual constants. - - include: Packages/Naomi/syntaxes/mql4/constant/support/align-mode.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/anchor.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/applied-price.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/border.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/chart-events.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/chart-properties.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/chart-positioning.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/chart-representation.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/color.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/core.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/corner.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/custom-indicator-properties.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/drawing-styles.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/error-codes.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/indicator-lines.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/init-ret-code.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/gann.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/object-periods.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/object-property.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/object-type.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/order-selection.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/order-type.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/other.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/series-identifiers.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/smoothing-methods.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/symbol-properties.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/timeframes.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/support/uninit-reason.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/normal.sublime-syntax diff --git a/syntaxes/mql4/constant/normal.sublime-syntax b/syntaxes/mql4/constant/normal.sublime-syntax deleted file mode 100644 index f682595b..00000000 --- a/syntaxes/mql4/constant/normal.sublime-syntax +++ /dev/null @@ -1,39 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - constantIdentifier: | - [_[:upper:]] - [_[:upper:][:digit:]]+ - -contexts: - main: - # Multiple characters. - - match: | - (?x)\s* - ({{constantIdentifier}})\b - captures: - 1: entity.name.constant.mql.mql4 - pop: true - # Single character. - - match: | - (?x)\s* - ([[:upper:]])\b - captures: - 1: entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/align-mode.sublime-syntax b/syntaxes/mql4/constant/support/align-mode.sublime-syntax deleted file mode 100644 index 3d3dfd76..00000000 --- a/syntaxes/mql4/constant/support/align-mode.sublime-syntax +++ /dev/null @@ -1,34 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - ALIGN_ - (?> LEFT - | CENTER - | RIGHT - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/anchor.sublime-syntax b/syntaxes/mql4/constant/support/anchor.sublime-syntax deleted file mode 100644 index b1188872..00000000 --- a/syntaxes/mql4/constant/support/anchor.sublime-syntax +++ /dev/null @@ -1,38 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - ANCHOR_ - (?> BOTTOM - | CENTER - | LEFT(?:_(?>LOWER|UPPER))? - | LOWER - | RIGHT(?:_(?>LOWER|UPPER))? - | TOP - | UPPER - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/applied-price.sublime-syntax b/syntaxes/mql4/constant/support/applied-price.sublime-syntax deleted file mode 100644 index 28b7c3a4..00000000 --- a/syntaxes/mql4/constant/support/applied-price.sublime-syntax +++ /dev/null @@ -1,38 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - PRICE_ - (?> CLOSE - | HIGH - | LOW - | MEDIAN - | OPEN - | TYPICAL - | WEIGHTED - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/border.sublime-syntax b/syntaxes/mql4/constant/support/border.sublime-syntax deleted file mode 100644 index 27e00aa3..00000000 --- a/syntaxes/mql4/constant/support/border.sublime-syntax +++ /dev/null @@ -1,34 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - BORDER_ - (?> FLAT - | RAISED - | SUNKEN - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/chart-events.sublime-syntax b/syntaxes/mql4/constant/support/chart-events.sublime-syntax deleted file mode 100644 index e6257fa8..00000000 --- a/syntaxes/mql4/constant/support/chart-events.sublime-syntax +++ /dev/null @@ -1,40 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - CHARTEVENT_ - (?> KEYDOWN - | MOUSE_MOVE - | OBJECT_ - (?:CREATE|CHANGE|DELETE) - | CLICK - | OBJECT_ - (?>CLICK|DRAG|ENDEDIT) - | CHART_CHANGE - | CUSTOM(?:_LAST)? - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/chart-positioning.sublime-syntax b/syntaxes/mql4/constant/support/chart-positioning.sublime-syntax deleted file mode 100644 index 1445e900..00000000 --- a/syntaxes/mql4/constant/support/chart-positioning.sublime-syntax +++ /dev/null @@ -1,34 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - CHART_ - (?> BEGIN - | CURRENT_POS - | END - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/chart-properties.sublime-syntax b/syntaxes/mql4/constant/support/chart-properties.sublime-syntax deleted file mode 100644 index 693b8cad..00000000 --- a/syntaxes/mql4/constant/support/chart-properties.sublime-syntax +++ /dev/null @@ -1,94 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - CHART_ - (?> AUTOSCROLL - | BRING_TO_TOP - | COLOR_ - (?> ASK - | BACKGROUND - | BID - | CANDLE_ - (?>BEAR|BULL) - | CHART_ - (?>DOWN|LINE|UP) - | FOREGROUND - | GRID - | LAST - | STOP_LEVEL - | VOLUME - ) - | COMMENT - | DRAG_TRADE_LEVELS - | EVENT_ - (?> MOUSE_MOVE - | OBJECT_ - (?>CREATE|DELETE) - ) - | FIRST_VISIBLE_BAR - | FIXED_ - (?>MAX|MIN|POSITION) - | FOREGROUND - | HEIGHT_IN_PIXELS - | IS_OFFLINE - | MODE - | MOUSE_SCROLL - | POINTS_PER_BAR - | PRICE_ - (?>MAX|MIN) - | SCALE - (?> _PT_PER_BAR - | FIX(?:_11)? - )? - | SHIFT(?:_SIZE)? - | SHOW_ - (?> ASK_LINE - | BID_LINE - | DATE_SCALE - | GRID - | LAST_LINE - | OBJECT_DESCR - | OHLC - | PERIOD_SEP - | PRICE_SCALE - | TRADE_LEVELS - | VOLUMES - ) - | VISIBLE_BARS - | WIDTH_IN_ - (?:BARS|PIXELS) - | WINDOW - (?> S_TOTAL - | _ - (?> HANDLE - | IS_VISIBLE - | YDISTANCE - ) - ) - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/chart-representation.sublime-syntax b/syntaxes/mql4/constant/support/chart-representation.sublime-syntax deleted file mode 100644 index 2da0f2b9..00000000 --- a/syntaxes/mql4/constant/support/chart-representation.sublime-syntax +++ /dev/null @@ -1,36 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - CHART_ - (?> BARS - | CANDLES - | LINE - | VOLUME_ - (?>HIDE|TICK) - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/color.sublime-syntax b/syntaxes/mql4/constant/support/color.sublime-syntax deleted file mode 100644 index 2ff69560..00000000 --- a/syntaxes/mql4/constant/support/color.sublime-syntax +++ /dev/null @@ -1,158 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - clr - (?> AliceBlue - | AntiqueWhite - | Aqua(?:marine)? - | Beige - | Bisque - | Black - | BlanchedAlmond - | Blue(?:Violet)? - | Brown - | BurlyWood - | CadetBlue - | Chartreuse - | Chocolate - | Coral - | Corn - (?>flowerBlue|silk) - | Crimson - | Dark - (?> Blue - | Goldenrod - | Gray - | Green - | Khaki - | OliveGreen - | Orange - | Orchid - | Salmon - | SeaGreen - | Slate - (?>Blue|Gray) - | Turquoise - | Violet - ) - | Deep - (?:Pink|SkyBlue) - | DimGray - | DodgerBlue - | FireBrick - | ForestGreen - | Gainsboro - | Gold(?:enrod)? - | Gray - | Green(?:Yellow)? - | Honeydew - | HotPink - | IndianRed - | Indigo - | Ivory - | Khaki - | Lavender(?:Blush)? - | LawnGreen - | LemonChiffon - | Light - (?> Blue - | Coral - | Cyan - | Goldenrod - | Gray - | Green - | Pink - | Salmon - | SeaGreen - | SkyBlue - | SlateGray - | SteelBlue - | Yellow - ) - | Lime(?:Green)? - | Linen - | Magenta - | Maroon - | Medium - (?> Aquamarine - | Blue - | Orchid - | Purple - | SeaGreen - | SlateBlue - | SpringGreen - | Turquoise - | VioletRed - ) - | MidnightBlue - | MintCream - | MistyRose - | Moccasin - | NavajoWhite - | Navy - | OldLace - | Olive(?:Drab)? - | Orange(?:Red)? - | Orchid - | PaleGoldenrod - | Pale - (?:Green|Turquoise|VioletRed) - | PapayaWhip - | PeachPuff - | Peru - | Pink - | Plum - | PowderBlue - | Purple - | Red - | RosyBrown - | RoyalBlue - | SaddleBrown - | Salmon - | SandyBrown - | Sea - (?:Green|shell) - | Sienna - | Silver - | SkyBlue - | Slate - (?:Blue|Gray) - | Snow - | SpringGreen - | SteelBlue - | Tan - | Teal - | Thistle - | Tomato - | Turquoise - | Violet - | Wheat - | White(?:Smoke)? - | Yellow(?:Green)? - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/core.sublime-syntax b/syntaxes/mql4/constant/support/core.sublime-syntax deleted file mode 100644 index 28e6fb04..00000000 --- a/syntaxes/mql4/constant/support/core.sublime-syntax +++ /dev/null @@ -1,40 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*\b(NULL)\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - - include: case-insentive - - case-insentive: - - match: | - (?xi)\s* - \b( - (?> true - | false - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/corner.sublime-syntax b/syntaxes/mql4/constant/support/corner.sublime-syntax deleted file mode 100644 index 7b466e2f..00000000 --- a/syntaxes/mql4/constant/support/corner.sublime-syntax +++ /dev/null @@ -1,33 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - CORNER_ - (?> LEFT_(?>UPPER|LOWER) - | RIGHT_(?>UPPER|LOWER) - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/custom-indicator-properties.sublime-syntax b/syntaxes/mql4/constant/support/custom-indicator-properties.sublime-syntax deleted file mode 100644 index dfa64447..00000000 --- a/syntaxes/mql4/constant/support/custom-indicator-properties.sublime-syntax +++ /dev/null @@ -1,46 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - INDICATOR_ - (?> CALCULATIONS - | COLOR_INDEX - | DATA - | DIGITS - | HEIGHT - | LEVEL - (?> COLOR - | S(?:TYLE)? - | TEXT - | VALUE - | WIDTH - ) - | MAXIMUM - | MINIMUM - | SHORTNAME - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/drawing-styles.sublime-syntax b/syntaxes/mql4/constant/support/drawing-styles.sublime-syntax deleted file mode 100644 index dd89800b..00000000 --- a/syntaxes/mql4/constant/support/drawing-styles.sublime-syntax +++ /dev/null @@ -1,44 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ( - (?> DRAW_ - (?> ARROW - | HISTOGRAM - | LINE - | NONE - | SECTION - | ZIGZAG - ) - | - STYLE_ - (?> DASH(?:DOT){0,2} - | DOT - | SOLID - ) - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/error-codes.sublime-syntax b/syntaxes/mql4/constant/support/error-codes.sublime-syntax deleted file mode 100644 index 705d18f8..00000000 --- a/syntaxes/mql4/constant/support/error-codes.sublime-syntax +++ /dev/null @@ -1,156 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - ERR_ - (?> ACCOUNT_DISABLED - | ARRAY_ - (?> AS_PARAMETER_EXPECTED - | INDEX_OUT_OF_RANGE - ) - | BROKER_BUSY - | CANNOT_ - (?> CALL_FUNCTION - | LOAD_LIBRARY - | OPEN_FILE - ) - | COMMON_ERROR - | CUSTOM_INDICATOR_ERROR - | DLL_CALLS_NOT_ALLOWED - | DOUBLE_PARAMETER_EXPECTED - | END_OF_FILE - | EXTERNAL_EXPERT_CALLS_NOT_ALLOWED - | FUNCTION_NOT_ - (?> ALLOWED_IN_TESTING_MODE - | CONFIRMED - ) - | GLOBAL_VARIABLE - (?> _NOT_FOUND - | S_PROCESSING_ERROR - ) - | HISTORY_WILL_UPDATED - | INCOMPATIBLE_ - (?> ACCESS_TO_FILE - | ARRAYS - ) - | INCORRECT_SERIES_ARRAY_USING - | INTEGER_PARAMETER_EXPECTED - | INVALID_ - (?> ACCOUNT - | FUNCTION_PARAMETER - (?> _VALUE - | S_COUNT - ) - | PRICE(?:_PARAM)? - | STOPS - | TICKET - | TRADE_(?:PARAMETERS|VOLUME) - ) - | LONG - (?> _POSITIONS_ONLY_ALLOWED - | S_NOT_ALLOWED - ) - | MALFUNCTIONAL_TRADE - | MARKET_CLOSED - | NO - (?> _ - (?> CONNECTION - | ERROR - | MEMORY_FOR_ - (?> ARRAYSTRING - | FUNCTION_CALL_STACK - | PARAMETER_STRING - | TEMP_STRING - ) - | MQLERROR - | OBJECT_NAME - | ORDER_SELECTED - | RESULT - | SPECIFIED_SUBWINDOW - ) - | T_ - (?> ENOUGH_ - (?> MEMORY_FOR_RETURNED_STRING - | MONEY - | RIGHTS - | STACK_FOR_PARAMETER - ) - | INITIALIZED_ - (?> ARRAY(?:STRING)? - | STRING - ) - ) - ) - | OBJECT_ - (?> ALREADY_EXISTS - | COORDINATES_ERROR - | DOES_NOT_EXIST - ) - | OFF_QUOTES - | OLD_VERSION - | ORDER_LOCKED - | PRICE_CHANGED - | RECURSIVE_STACK_OVERFLOW - | REMAINDER_FROM_ZERO_DIVIDE - | REQUOTE - | SEND_MAIL_ERROR - | SERVER_BUSY - | SHORTS_NOT_ALLOWED - | SOME_(?>ARRAY_ERROR|FILE_ERROR|OBJECT_ERROR) - | STRING_ - (?> FUNCTION_INTERNAL_ERROR - | PARAMETER_EXPECTED - ) - | SYSTEM_BUSY - | TOO_ - (?> FREQUENT_REQUESTS - | LONG_STRING - | MANY_(?>OPENED_FILES|REQUESTS) - ) - | TRADE_ - (?> CONTEXT_BUSY - | DISABLED - | ERROR - | EXPIRATION_DENIED - | MODIFY_DENIED - | NOT_ALLOWED - | TIMEOUT - | TOO_MANY_ORDERS - ) - | UNKNOWN_ - (?> COMMAND - | OBJECT_(?>PROPERTY|TYPE) - | SYMBOL - ) - | WRONG_ - (?> FILE_NAME - | FUNCTION_POINTER - | JUMP - ) - | ZERO_DIVIDE - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/gann.sublime-syntax b/syntaxes/mql4/constant/support/gann.sublime-syntax deleted file mode 100644 index 512f73ce..00000000 --- a/syntaxes/mql4/constant/support/gann.sublime-syntax +++ /dev/null @@ -1,33 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - GANN_ - (?> UP_TREND - | DOWN_TREND - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/indicator-lines.sublime-syntax b/syntaxes/mql4/constant/support/indicator-lines.sublime-syntax deleted file mode 100644 index 7c39c883..00000000 --- a/syntaxes/mql4/constant/support/indicator-lines.sublime-syntax +++ /dev/null @@ -1,42 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - MODE_ - (?> MAIN - | CHIKOUSPAN - | GATOR(?>JAW|LIPS|TEETH) - | KIJUNSEN - | LOWER - | MINUSDI - | PLUSDI - | SENKOUSPAN[AB] - | SIGNAL - | TENKANSEN - | UPPER - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/init-ret-code.sublime-syntax b/syntaxes/mql4/constant/support/init-ret-code.sublime-syntax deleted file mode 100644 index 599f1f25..00000000 --- a/syntaxes/mql4/constant/support/init-ret-code.sublime-syntax +++ /dev/null @@ -1,34 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - INIT_ - (?> SUCCEEDED - | FAILED - | PARAMETERS_INCORRECT - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/object-periods.sublime-syntax b/syntaxes/mql4/constant/support/object-periods.sublime-syntax deleted file mode 100644 index 6718d179..00000000 --- a/syntaxes/mql4/constant/support/object-periods.sublime-syntax +++ /dev/null @@ -1,43 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - OBJ_ - (?> NO_PERIODS - | PERIOD_ - (?> M15? - | M5 - | M30 - | H1 - | H4 - | D1 - | W1 - | MN1 - ) - | ALL_PERIODS - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/object-property.sublime-syntax b/syntaxes/mql4/constant/support/object-property.sublime-syntax deleted file mode 100644 index 092eb2d2..00000000 --- a/syntaxes/mql4/constant/support/object-property.sublime-syntax +++ /dev/null @@ -1,81 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - OBJPROP_ - (?> ALIGN - | ANCHOR - | ANGLE - | ARROWCODE - | BACK - | BGCOLOR - | BMPFILE - | BORDER_ - (?>COLOR|TYPE) - | COLOR - | CORNER - | CREATETIME - | DEVIATION - | DRAWLINES - | ELLIPSE - | FIBOLEVELS - | FIRSTLEVEL - | FONT(?:SIZE)? - | HIDDEN - | LEVEL - (?> COLOR - | S(TYLE)? - | TEXT - | VALUE - | WIDTH - ) - | NAME - | PRICE - (?>1|2|3)? - | RAY(?:_RIGHT)? - | READONLY - | SCALE - | SELECT - (?>ABLE|ED) - | STATE - | STYLE - | SYMBOL - | TEXT - | TIME - (?>1|2|3|FRAMES)? - | TOOLTIP - | TYPE - | WIDTH - | XDISTANCE - | XOFFSET - | XSIZE - | YDISTANCE - | YOFFSET - | YSIZE - | ZORDER - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/object-type.sublime-syntax b/syntaxes/mql4/constant/support/object-type.sublime-syntax deleted file mode 100644 index d46530df..00000000 --- a/syntaxes/mql4/constant/support/object-type.sublime-syntax +++ /dev/null @@ -1,69 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - OBJ_ - (?> ARROW - (?:_ - (?> BUY - | CHECK - | DOWN - | LEFT_PRICE - | RIGHT_PRICE - | SELL - | STOP - | THUMB_(?>DOWN|UP) - | UP - ) - )? - | BITMAP(?:_LABEL)? - | BUTTON - | CHANNEL - | CYCLES - | EDIT - | ELLIPSE - | EVENT - | EXPANSION - | FIBO - (?> ARC - | CHANNEL - | FAN - | TIMES - )? - | GANN(?>FAN|GRID|LINE)? - | HLINE - | LABEL - | PITCHFORK - | RECTANGLE(?:_LABEL)? - | REGRESSION - | STDDEVCHANNEL - | TEXT - | TREND(?:BYANGLE)? - | TRIANGLE - | VLINE - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/order-selection.sublime-syntax b/syntaxes/mql4/constant/support/order-selection.sublime-syntax deleted file mode 100644 index e4ee41bd..00000000 --- a/syntaxes/mql4/constant/support/order-selection.sublime-syntax +++ /dev/null @@ -1,32 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - (?> MODE_(?>HISTORY|TRADES) - | SELECT_BY_(?>POS|TICKET) - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/order-type.sublime-syntax b/syntaxes/mql4/constant/support/order-type.sublime-syntax deleted file mode 100644 index 6a3b3314..00000000 --- a/syntaxes/mql4/constant/support/order-type.sublime-syntax +++ /dev/null @@ -1,33 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - OP_ - (?> BUY(?>LIMIT|STOP)? - | SELL(?>LIMIT|STOP)? - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/other.sublime-syntax b/syntaxes/mql4/constant/support/other.sublime-syntax deleted file mode 100644 index e408d9b8..00000000 --- a/syntaxes/mql4/constant/support/other.sublime-syntax +++ /dev/null @@ -1,37 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - (?> CHARTS_MAX - | CLR_NONE - | EMPTY(?:_VALUE)? - | INVALID_HANDLE - | IS_(?>DEBUG_MODE|PROFILE_MODE) - | WHOLE_ARRAY - | WRONG_VALUE - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/series-identifiers.sublime-syntax b/syntaxes/mql4/constant/support/series-identifiers.sublime-syntax deleted file mode 100644 index 8caa4cc6..00000000 --- a/syntaxes/mql4/constant/support/series-identifiers.sublime-syntax +++ /dev/null @@ -1,34 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - MODE_ - (?> CLOSE - | OPEN - | VOLUME - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/smoothing-methods.sublime-syntax b/syntaxes/mql4/constant/support/smoothing-methods.sublime-syntax deleted file mode 100644 index 324f8e2e..00000000 --- a/syntaxes/mql4/constant/support/smoothing-methods.sublime-syntax +++ /dev/null @@ -1,34 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - MODE_ - (?> EMA - | LWMA - | SM(?>A|MA) - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/symbol-properties.sublime-syntax b/syntaxes/mql4/constant/support/symbol-properties.sublime-syntax deleted file mode 100644 index ed9c843a..00000000 --- a/syntaxes/mql4/constant/support/symbol-properties.sublime-syntax +++ /dev/null @@ -1,58 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - MODE_ - (?> ASK - | BID - | CLOSEBY_ALLOWED - | DIGITS - | EXPIRATION - | FREEZELEVEL - | HIGH - | LOT(?>SIZE|STEP) - | LOW - | MARGIN - (?> CALCMODE - | HEDGED - | INIT - | MAINTENANCE - | REQUIRED - ) - | MAXLOT - | MINLOT - | POINT - | PROFITCALCMODE - | SPREAD - | STARTING - | STOPLEVEL - | SWAP(?>LONG|SHORT|TYPE) - | TICK(?>SIZE|VALUE) - | TIME - | TRADEALLOWED - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/timeframes.sublime-syntax b/syntaxes/mql4/constant/support/timeframes.sublime-syntax deleted file mode 100644 index e9ae6469..00000000 --- a/syntaxes/mql4/constant/support/timeframes.sublime-syntax +++ /dev/null @@ -1,45 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - PERIOD_ - (?> CURRENT - | D1 - | H - (?> 12? - | [23468] - ) - | M - (?> 1[025]? - | 20? - | 30? - | [456] - | N1 - ) - | W1 - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/constant/support/uninit-reason.sublime-syntax b/syntaxes/mql4/constant/support/uninit-reason.sublime-syntax deleted file mode 100644 index b88dacec..00000000 --- a/syntaxes/mql4/constant/support/uninit-reason.sublime-syntax +++ /dev/null @@ -1,39 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - \b( - REASON_ - (?> ACCOUNT - | CHART(?>CHANGE|CLOSE) - | CLOSE - | INITFAILED - | PARAMETERS - | PROGRAM - | RE(?>COMPILE|MOVE) - | TEMPLATE - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.constant.mql.mql4 - pop: true diff --git a/syntaxes/mql4/enum.sublime-syntax b/syntaxes/mql4/enum.sublime-syntax deleted file mode 100644 index 855448e0..00000000 --- a/syntaxes/mql4/enum.sublime-syntax +++ /dev/null @@ -1,84 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - match: \s*\b(enum)\b - captures: - 1: >- - storage.type.mql.mql4 - keyword.enum.mql.mql4 - set: identifier - - identifier: - - match: | - (?xi)\s* - ({{commonIdentifier}}) - captures: - 1: entity.name.enum.mql.mql4 - set: body - - body: - - include: comment - - match: \s*(\{) - captures: - 1: punctuation.definition.enum.body.begin.mql.mql4 - set: body-content - - body-content: - - include: comment - # End of enum. - - match: \s*(};?) - captures: - 1: punctuation.definition.enum.body.end.mql.mql4 - pop: true - # definition. - - match: \s*(,) - captures: - 1: punctuation.definition.enum.items.mql.mql4 - # Optional value. - - match: \s*(=) - captures: - 1: keyword.operator.other.assignment.mql.mql4 - push: - - match: (?=\s*[,}]) - pop: true - - match: "" - push: - - include: statement-and-expression - - match: "" - pop: true - # Item. - - match: | - (?xi)\s* - ({{commonIdentifier}}) - captures: - 1: >- - enum.item.mql.mql4 - entity.name.variable.mql.mql4 - - comment: - - include: Packages/Naomi/syntaxes/mql4/comment.no-pop.sublime-syntax - - statement-and-expression: - - include: Packages/Naomi/syntaxes/mql4/statement-and-expression.sublime-syntax diff --git a/syntaxes/mql4/function-call.sublime-syntax b/syntaxes/mql4/function-call.sublime-syntax deleted file mode 100644 index 8db26b65..00000000 --- a/syntaxes/mql4/function-call.sublime-syntax +++ /dev/null @@ -1,38 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/mql4/function-call/support/account.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/array.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/chart.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/checkup.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/common.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/conversion.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/custom-indicator.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/datetime.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/file.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/indicators.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/market.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/math.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/object.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/string.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/timeseries.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/trade-signals.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/support/trade.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call/normal.sublime-syntax diff --git a/syntaxes/mql4/function-call/arguments.sublime-syntax b/syntaxes/mql4/function-call/arguments.sublime-syntax deleted file mode 100644 index 03ae54e3..00000000 --- a/syntaxes/mql4/function-call/arguments.sublime-syntax +++ /dev/null @@ -1,47 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(\() - captures: - 1: punctuation.definition.function.arguments.begin.mql.mql4 - set: arguments - - arguments: - - match: \s*(\)) - captures: - 1: punctuation.definition.function.arguments.end.mql.mql4 - pop: true - - match: \s*(,) - captures: - 1: punctuation.definition.function.arguments.mql.mql4 - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | \) - ) - ) - pop: true - - include: statement-and-expression - - statement-and-expression: - - include: Packages/Naomi/syntaxes/mql4/statement-and-expression.sublime-syntax diff --git a/syntaxes/mql4/function-call/normal.sublime-syntax b/syntaxes/mql4/function-call/normal.sublime-syntax deleted file mode 100644 index 2dc22bf9..00000000 --- a/syntaxes/mql4/function-call/normal.sublime-syntax +++ /dev/null @@ -1,140 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - - logicalOperators: | - (?> && - | \|\| - | ! - ) - - comparisonOperators: | - (?> == - | != - | >= - | <= - | >(?!>) - | <(?!<) - ) - - bitwiseOperators: | - (?> ~=? - | &=? - | \|=? - | \^=? - | <<=? - | >>>=? - | >>=? - ) - - arithmeticOperators: | - (?> -- - | -=? - | \+\+ - | \+=? - | \*\* - | \*=? - | /=? - | %=? - ) - - functionIdentifier: | - (?> operator - (?> {{comparisonOperators}} - | {{logicalOperators}} - | {{bitwiseOperators}} - | {{arithmeticOperators}} - | = - ) - | {{commonIdentifier}} - ) - - typeIdentifier: | - {{commonIdentifier}} - (?:\s*<.*?>\s+)? - (?:\s*\**)? - -scope: ... - -contexts: - main: - # Scoped function call. - - match: | - (?xi) - (?=\s* - \b{{typeIdentifier}}::{{functionIdentifier}} - \s*\( - ) - set: [ - name, - scope-operator, - class - ] - # Normal function call. - - match: | - (?xi) - (?=\s* - \b{{functionIdentifier}} - \s*\( - ) - set: name - - class: - - match: | - (?xi)\s* - \b({{typeIdentifier}})\b - captures: - 1: entity.name.class.mql.mql4 - pop: true - - scope-operator: - - match: \s*(::) - captures: - 1: keyword.operator.other.scope.mql.mql4 - pop: true - - name: - # Special function name. - - match: | - (?x)\s* - ((?> On - (?> Calculate - | Deinit - | Init - | Start - ) - ))(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - # Common function name. - - match: | - (?xi)\s* - ({{functionIdentifier}}) - captures: - 1: entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax - diff --git a/syntaxes/mql4/function-call/support/account.sublime-syntax b/syntaxes/mql4/function-call/support/account.sublime-syntax deleted file mode 100644 index 446d573e..00000000 --- a/syntaxes/mql4/function-call/support/account.sublime-syntax +++ /dev/null @@ -1,48 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ( - Account - (?> Balance - | Company - | Credit - | Currency - | Equity - | FreeMargin(?>Check|Mode)? - | Info(?>Double|Integer|String) - | Leverage - | Margin - | Name - | Number - | Profit - | Server - | Stopout(?>Level|Mode) - ) - )(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/array.sublime-syntax b/syntaxes/mql4/function-call/support/array.sublime-syntax deleted file mode 100644 index 0a62c231..00000000 --- a/syntaxes/mql4/function-call/support/array.sublime-syntax +++ /dev/null @@ -1,52 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ( - Array - (?> Bsearch - | Compare - | Copy - (?>Rates|Series)? - | Dimension - | Fill - | Free - | GetAsSeries - | Initialize - | Is - (?>Dynamic|Series) - | Maximum - | Minimum - | Range - | Resize - | SetAsSeries - | Size - | Sort - ) - )(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/chart.sublime-syntax b/syntaxes/mql4/function-call/support/chart.sublime-syntax deleted file mode 100644 index 1d954228..00000000 --- a/syntaxes/mql4/function-call/support/chart.sublime-syntax +++ /dev/null @@ -1,71 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> Chart - (?> ApplyTemplate - | Close - | First - | Get(?>Double|Integer|String) - | ID - | Indicator(?>Delete|Name|sTotal) - | Navigate - | Next - | Open - | Period - | PriceOnDropped - | Redraw - | SaveTemplate - | ScreenShot - | Set(?>Double|Integer|String|SymbolPeriod) - | Symbol - | Time(?>OnDropped|PriceToXY) - | Window(?>Find|OnDropped) - | XOnDropped - | XYToTimePrice - | YOnDropped - ) - | Period - | Symbol - | Window - (?> BarsPerChart - | ExpertName - | Find - | FirstVisibleBar - | Handle - | IsVisible - | OnDropped - | Price(?:Max|Min|OnDropped) - | Redraw - | ScreenShot - | sTotal - | TimeOnDropped - | (?>X|Y)OnDropped - ) - ))(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/checkup.sublime-syntax b/syntaxes/mql4/function-call/support/checkup.sublime-syntax deleted file mode 100644 index 28a603a7..00000000 --- a/syntaxes/mql4/function-call/support/checkup.sublime-syntax +++ /dev/null @@ -1,55 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> Digits - | GetLastError - | Is - (?> Connected - | Demo - | DllsAllowed - | ExpertEnabled - | LibrariesAllowed - | Optimization - | Stopped - | Testing - | Trade(?>Allowed|ContextBusy) - | VisualMode - ) - | MQLInfo(?>Integer|String) - | MQLSetInteger - | Point - | Terminal - (?> Company - | Info(?>Double|Integer|String) - | Name - | Path - ) - | UninitializeReason - ))(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/common.sublime-syntax b/syntaxes/mql4/function-call/support/common.sublime-syntax deleted file mode 100644 index cd6c9f85..00000000 --- a/syntaxes/mql4/function-call/support/common.sublime-syntax +++ /dev/null @@ -1,51 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> Alert - | CheckPointer - | Comment - | Crypt(?>De|En)code - | DebugBreak - | ExpertRemove - | Get(?>MicrosecondCount|Pointer|TickCount) - | MessageBox - | PeriodSeconds - | PlaySound - | Print(?:Format)? - | ResetLastError - | Resource(?>Create|Free|ReadImage|Save) - | Send(?>FTP|Mail|Notification) - | SetUserError - | Sleep - | TerminalClose - | TesterStatistics - | WebRequest - | ZeroMemory - ))(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/conversion.sublime-syntax b/syntaxes/mql4/function-call/support/conversion.sublime-syntax deleted file mode 100644 index 2cf16751..00000000 --- a/syntaxes/mql4/function-call/support/conversion.sublime-syntax +++ /dev/null @@ -1,51 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> Char(?>ArrayToString|ToStr(?:ing)?) - | ColorTo(?>ARGB|String) - | DoubleToStr(?:ing)? - | EnumToString - | IntegerToString - | NormalizeDouble - | Short(?>ArrayToString|ToString) - | String - (?> Format - | To - (?> CharArray - | Color - | Double - | Integer - | ShortArray - | Time - ) - ) - | StrTo(?>Double|Integer|Time) - | TimeToStr(?:ing)? - ))(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/custom-indicator.sublime-syntax b/syntaxes/mql4/function-call/support/custom-indicator.sublime-syntax deleted file mode 100644 index 08113c2f..00000000 --- a/syntaxes/mql4/function-call/support/custom-indicator.sublime-syntax +++ /dev/null @@ -1,51 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> HideTestIndicators - | Indicator - (?> Buffers - | Counted - | Digits - | Set(?>Double|Integer|String) - | ShortName - ) - | Set - (?> Index - (?> Arrow - | Buffer - | DrawBegin - | EmptyValue - | Label - | Shift - | Style - ) - | Level(?>Style|Value) - ) - ))(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/datetime.sublime-syntax b/syntaxes/mql4/function-call/support/datetime.sublime-syntax deleted file mode 100644 index f2bf7c00..00000000 --- a/syntaxes/mql4/function-call/support/datetime.sublime-syntax +++ /dev/null @@ -1,53 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> Day(?:Of(?>Week|Year))? - | Hour - | Minute - | Month - | Seconds - | StructToTime - | Time - (?> Current - | Day - (?> lightSavings - | Of(?>Week|Year) - )? - | GMT(?:Offset)? - | Hour - | Local - | Minute - | Month - | Seconds - | ToStruct - | Year - ) - | Year - ))(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/file.sublime-syntax b/syntaxes/mql4/function-call/support/file.sublime-syntax deleted file mode 100644 index 9f728ca4..00000000 --- a/syntaxes/mql4/function-call/support/file.sublime-syntax +++ /dev/null @@ -1,67 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> File - (?> Close - | Copy - | Delete - | Find(?>Close|First|Next) - | Flush - | GetInteger - | Is(?>Ending|Exist|LineEnding) - | Move - | Open(?:History)? - | Read - (?> Array - | Bool - | Datetime - | Double - | Float - | Integer - | Long - | Number - | String - | Struct - ) - | Seek - | Size - | Tell - | Write - (?> Array - | Double - | Float - | Integer - | Long - | String - | Struct - )? - ) - | Folder(?>Clean|Create|Delete) - ))(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/indicators.sublime-syntax b/syntaxes/mql4/function-call/support/indicators.sublime-syntax deleted file mode 100644 index f2d6ed74..00000000 --- a/syntaxes/mql4/function-call/support/indicators.sublime-syntax +++ /dev/null @@ -1,57 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ( - i - (?> A(?>C|DX?|lligator|O|TR) - | Bands(?:OnArray)? - | (?>Bears|Bulls)Power - | BWMFI - | CCI(?:OnArray)? - | Custom - | DeMarker - | Envelopes(?:OnArray)? - | Force - | Fractals - | Gator - | Ichimoku - | MA(?>CD|OnArray)? - | MFI - | Momentum(?:OnArray)? - | OBV - | OsMA - | RSI(?:OnArray)? - | RVI - | SAR - | StdDev(?:OnArray)? - | Stochastic - | WPR - ) - )(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/market.sublime-syntax b/syntaxes/mql4/function-call/support/market.sublime-syntax deleted file mode 100644 index 6ec77163..00000000 --- a/syntaxes/mql4/function-call/support/market.sublime-syntax +++ /dev/null @@ -1,44 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> MarketInfo - | Symbol - (?> Info - (?> Double - | Integer - | Session(?:Quote|Trade) - | String - | Tick - ) - | Name - | Select - | sTotal - ) - ))(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/math.sublime-syntax b/syntaxes/mql4/function-call/support/math.sublime-syntax deleted file mode 100644 index 2c7e0848..00000000 --- a/syntaxes/mql4/function-call/support/math.sublime-syntax +++ /dev/null @@ -1,53 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ( - Math - (?> Abs - | Arc - (?:cos|sin|tan) - | Ceil - | Cos - | Exp - | Floor - | IsValidNumber - | Log(?:10)? - | Max - | Min - | Mod - | Pow - | Rand - | Round - | Sin - | Sqrt - | Srand - | Tan - ) - )(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/object.sublime-syntax b/syntaxes/mql4/function-call/support/object.sublime-syntax deleted file mode 100644 index 19c16229..00000000 --- a/syntaxes/mql4/function-call/support/object.sublime-syntax +++ /dev/null @@ -1,60 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> Object - (?> Create - | Delete - | Description - | Find - | Get - (?> Double - | FiboDescription - | Integer - | ShiftByValue - | String - | TimeByValue - | ValueByShift - | ValueByTime - )? - | Move - | Name - | sDeleteAll - | Set - (?> Double - | FiboDescription - | Integer - | String - | Text - )? - | sTotal - | Type - ) - | Text(?>GetSize|Out|SetFont) - ))(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/string.sublime-syntax b/syntaxes/mql4/function-call/support/string.sublime-syntax deleted file mode 100644 index 913e32dd..00000000 --- a/syntaxes/mql4/function-call/support/string.sublime-syntax +++ /dev/null @@ -1,51 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ( - String - (?> Add - | BufferLen - | Compare - | Concatenate - | Fill - | Find - | GetChar(?:acter)? - | Init - | Len - | Replace - | SetChar(?:acter)? - | Split - | Substr - | To - (?:Lower|Upper) - | Trim - (?:Left|Right) - ) - )(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/timeseries.sublime-syntax b/syntaxes/mql4/function-call/support/timeseries.sublime-syntax deleted file mode 100644 index b5967597..00000000 --- a/syntaxes/mql4/function-call/support/timeseries.sublime-syntax +++ /dev/null @@ -1,52 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> Bars - | Copy - (?> Close - | High - | Low - | Open - | Rates - | TickVolume - | Time - ) - | i - (?> Bar(?:s|Shift) - | Close - | High(?:est)? - | Low(?:est)? - | Open - | Time - | Volume - ) - | RefreshRates - | SeriesInfoInteger - ))(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/trade-signals.sublime-syntax b/syntaxes/mql4/function-call/support/trade-signals.sublime-syntax deleted file mode 100644 index 42daada4..00000000 --- a/syntaxes/mql4/function-call/support/trade-signals.sublime-syntax +++ /dev/null @@ -1,46 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ( - Signal - (?> Base - (?> Get(?>Double|Integer|String) - | Select - | Total - ) - | Info - (?> Get(?>Double|Integer|String) - | Set(?>Double|Integer) - | Total - ) - | Subscribe - | Unsubscribe - ) - )(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function-call/support/trade.sublime-syntax b/syntaxes/mql4/function-call/support/trade.sublime-syntax deleted file mode 100644 index d9963fd3..00000000 --- a/syntaxes/mql4/function-call/support/trade.sublime-syntax +++ /dev/null @@ -1,60 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ( - Order - (?> Close - (?> By - | Price - | Time - )? - | Comment - | Commission - | Delete - | Expiration - | Lots - | MagicNumber - | Modify - | OpenPrice - | OpenTime - | Print - | Profit - | Select - | Send - | sHistoryTotal - | StopLoss - | sTotal - | Swap - | Symbol - | TakeProfit - | Ticket - | Type - ) - )(?=\s*\() - captures: - 1: >- - support.mql.mql4 - entity.name.function.mql.mql4 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax diff --git a/syntaxes/mql4/function.sublime-syntax b/syntaxes/mql4/function.sublime-syntax deleted file mode 100644 index dd69f505..00000000 --- a/syntaxes/mql4/function.sublime-syntax +++ /dev/null @@ -1,203 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - - logicalOperators: | - (?> && - | \|\| - | ! - ) - - comparisonOperators: | - (?> == - | != - | >= - | <= - | >(?!>) - | <(?!<) - ) - - bitwiseOperators: | - (?> ~=? - | &=? - | \|=? - | \^=? - | <<=? - | >>>=? - | >>=? - ) - - arithmeticOperators: | - (?> -- - | -=? - | \+\+ - | \+=? - | \*\* - | \*=? - | /=? - | %=? - ) - - functionIdentifier: | - (?> operator - (?> {{comparisonOperators}} - | {{logicalOperators}} - | {{bitwiseOperators}} - | {{arithmeticOperators}} - | = - | \[\s*] - ) - | {{commonIdentifier}} - ) - - typeIdentifier: | - {{commonIdentifier}} - (?> \s*\*+ - | \s*<.*?> - (?:\s*\**) - | \b - ) - -contexts: - main: - # Member function. - - match: | - (?xi)\s* - (?=\b - (?: - (?> virtual - | static - )\s+ - )? - {{typeIdentifier}} - \s*{{commonIdentifier}} - ::{{functionIdentifier}} - ) - set: [ - body, - parameters, - name, - scope-operator, - class, - return-type, - modifier - ] - # Free function. - - match: | - (?xi)\s* - (?=\b - (?: - (?> virtual - | static - )\s+ - )? - {{typeIdentifier}} - \s*{{functionIdentifier}} - \s*\( - ) - set: [ - body, - parameters, - name, - return-type, - modifier - ] - - modifier: - - match: | - (?xi)\s* - ((?> virtual - | static - )) - captures: - 1: >- - storage.modifier.mql.mql4 - keyword.other.access.mql.mql4 - pop: true - - match: "" - pop: true - - return-type: - - include: Packages/Naomi/syntaxes/mql4/type.sublime-syntax - - class: - - match: | - (?xi)\s* - \b({{commonIdentifier}})\b - captures: - 1: entity.name.class.mql.mql4 - pop: true - - scope-operator: - - match: \s*(::) - captures: - 1: keyword.operator.other.scope.mql.mql4 - pop: true - - name: - # Special function name. - - match: | - (?x)\s* - ((?> On - (?> Calculate - | ChartEvent - | Deinit - | Init - | Start - | Timer - ) - ))(?=\s*\() - captures: - 1: >- - support.core.mql.mql4 - entity.name.function.mql.mql4 - pop: true - # Operator functions. - - match: | - (?x)\s* - ((?> operator\s* - (?> {{comparisonOperators}} - | {{logicalOperators}} - | {{bitwiseOperators}} - | {{arithmeticOperators}} - | = - | \[\s*] - )? - ))(?=\s*\() - captures: - 1: >- - support.core.mql.mql4 - entity.name.function.mql.mql4 - pop: true - # Common function name. - - match: | - (?xi)\s* - ({{functionIdentifier}}) - captures: - 1: entity.name.function.mql.mql4 - pop: true - - parameters: - - include: Packages/Naomi/syntaxes/mql4/function/parameters.sublime-syntax - - body: - - include: Packages/Naomi/syntaxes/mql4/function/body.sublime-syntax diff --git a/syntaxes/mql4/function/body.sublime-syntax b/syntaxes/mql4/function/body.sublime-syntax deleted file mode 100644 index 0a322b59..00000000 --- a/syntaxes/mql4/function/body.sublime-syntax +++ /dev/null @@ -1,126 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - include: comment-no-pop - # End. - - match: \s*(;) - captures: - 1: punctuation.definition.function.declaration.end.mql.mql4 - pop: true - # Pure virtual or constant. - - match: | - (?x)\s* - (?> (const)\s* - | - ( - =\s* - (?> 0 - | NULL - )\s* - )? - ) - captures: - 1: >- - storage.modifier.mql.mql4 - keyword.other.constant-function.mql.mql4 - 2: >- - storage.modifier.mql.mql4 - keyword.other.pure-virtual.mql.mql4 - # Initialization. - - match: \s*(:) - captures: - 1: punctuation.definition.function.initializations.mql.mql4 - set: initializations - # Normal body. - - include: body-start - - initializations: - - match: "" - set: [ - definition, - end-initialization, - initialization-expression, - begin-initialization, - initialized-identifier - ] - - initialized-identifier: - - match: | - (?xi)\s* - ({{commonIdentifier}}) - captures: - 1: entity.name.ambiguous.mql.mql4 - pop: true - - begin-initialization: - - match: \s*(\() - captures: - 1: punctuation.definition.initialization.begin.mql.mql4 - pop: true - - initialization-expression: - - match: (?=\s*\)) - pop: true - - match: \s*(,) - captures: - 1: punctuation.definition.initialization.mql.mql4 - - match: (?=\S) - push: statement-and-expression - - end-initialization: - - match: \s*(\)) - captures: - 1: punctuation.definition.initialization.end.mql.mql4 - pop: true - - definition: - - include: body-start - - match: \s*(,) - captures: - 1: punctuation.definition.initialization.mql.mql4 - set: initializations - - body-start: - - match: \s*(\{) - captures: - 1: punctuation.definition.function.body.begin.mql.mql4 - set: body-content - - body-content: - - match: \s*(}) - captures: - 1: punctuation.definition.function.body.end.mql.mql4 - pop: true - - match: "" - push: - - include: statement-and-expression - - match: "" - pop: true - - comment-no-pop: - - include: Packages/Naomi/syntaxes/mql4/comment.no-pop.sublime-syntax - - statement-and-expression: - - include: Packages/Naomi/syntaxes/mql4/statement-and-expression.sublime-syntax diff --git a/syntaxes/mql4/function/parameter.sublime-syntax b/syntaxes/mql4/function/parameter.sublime-syntax deleted file mode 100644 index 6ebd19b8..00000000 --- a/syntaxes/mql4/function/parameter.sublime-syntax +++ /dev/null @@ -1,116 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - - typeIdentifier: | - {{commonIdentifier}} - (?:\s*<.*?>\s+)? - (?:\s*\**)? - -contexts: - main: - - match: | - (?xi) - (?=\s* - (?:const)? - {{typeIdentifier}} - ) - set: [ - parameter, - type - ] - - type: - - match: \s*(const) - captures: - 1: >- - storage.type.mql.mql4 - keyword.declaration.const.mql.mql4 - - include: Packages/Naomi/syntaxes/mql4/type.sublime-syntax - - parameter: - - include: comment-no-pop - # End of parameter. - - match: | - (?x) - (?=\s* - (?> , - | \) - ) - ) - pop: true - # Reference. - - match: \s*(&) - captures: - 1: >- - storage.modifier.mql.mql4 - keyword.operator.other.reference.mql.mql4 - # Array indicator. - - match: \s*(\[) - captures: - 1: punctuation.definition.array.begin.mql.mql4 - push: array - # Default value. - - match: \s*(=) - captures: - 1: keyword.operator.other.assignment.mql.mql4 - set: value - # Identifier. - - match: | - (?xi) - (?=\s*{{commonIdentifier}}) - push: identifier - - identifier: - - meta_scope: function.parameter.mql.mql4 - - include: Packages/Naomi/syntaxes/mql4/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/variable.sublime-syntax - - array: - - match: \s*(]) - captures: - 1: punctuation.definition.array.end.mql.mql4 - pop: true - - match: "" - push: - - include: statement-and-expression - - value: - - match: | - (?x) - (?=\s* - (?> , - | \) - ) - ) - pop: true - - match: "" - push: - - include: statement-and-expression - - match: "" - pop: true - - comment-no-pop: - - include: Packages/Naomi/syntaxes/mql4/comment.no-pop.sublime-syntax - - statement-and-expression: - - include: Packages/Naomi/syntaxes/mql4/statement-and-expression.sublime-syntax diff --git a/syntaxes/mql4/function/parameters.sublime-syntax b/syntaxes/mql4/function/parameters.sublime-syntax deleted file mode 100644 index b2bd3359..00000000 --- a/syntaxes/mql4/function/parameters.sublime-syntax +++ /dev/null @@ -1,65 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # Function without parameters. - - match: | - (?x)\s* - (\() - (?: - \s*(void)\s* - )? - (\)) - captures: - 1: punctuation.definition.function.parameters.begin.mql.mql4 - 2: >- - support.type.mql.mql4 - entity.name.type.mql.mql4 - 3: punctuation.definition.function.parameters.end.mql.mql4 - pop: true - # Parameters. - - match: \s*(\() - captures: - 1: punctuation.definition.function.parameters.begin.mql.mql4 - set: parameters - - parameters: - - match: \s*(\,) - captures: - 1: punctuation.definition.function.parameters.mql.mql4 - - match: \s*(\)) - captures: - 1: punctuation.definition.function.parameters.end.mql.mql4 - pop: true - - match: "" - push: - - include: comment-no-pop - - include: preprocessor - - include: parameter - - match: "" - pop: true - - preprocessor: - - include: Packages/Naomi/syntaxes/mql4/preprocessor.sublime-syntax - - comment-no-pop: - - include: Packages/Naomi/syntaxes/mql4/comment.no-pop.sublime-syntax - - parameter: - - include: Packages/Naomi/syntaxes/mql4/function/parameter.sublime-syntax diff --git a/syntaxes/mql4/goto.sublime-syntax b/syntaxes/mql4/goto.sublime-syntax deleted file mode 100644 index 8223c1be..00000000 --- a/syntaxes/mql4/goto.sublime-syntax +++ /dev/null @@ -1,37 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: \s*(goto) - captures: - 1: keyword.control.mql.mql4 - set: label - - label: - - match: | - (?xi) - ({{commonIdentifier}}) - captures: - 1: entity.name.label.mql.mql4 - pop: true diff --git a/syntaxes/mql4/input.sublime-syntax b/syntaxes/mql4/input.sublime-syntax deleted file mode 100644 index 3468e45a..00000000 --- a/syntaxes/mql4/input.sublime-syntax +++ /dev/null @@ -1,27 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*\b(input)\s - captures: - 1: keyword.input.mql.mql4 - set: input - - input: - - include: Packages/Naomi/syntaxes/mql4/unguarded-variable-declaration.sublime-syntax diff --git a/syntaxes/mql4/literal.sublime-syntax b/syntaxes/mql4/literal.sublime-syntax deleted file mode 100644 index 6fc6b6d4..00000000 --- a/syntaxes/mql4/literal.sublime-syntax +++ /dev/null @@ -1,25 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/mql4/literal/string.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/literal/color.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/literal/datetime.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/literal/character.sublime-syntax diff --git a/syntaxes/mql4/literal/character.sublime-syntax b/syntaxes/mql4/literal/character.sublime-syntax deleted file mode 100644 index 025a79cc..00000000 --- a/syntaxes/mql4/literal/character.sublime-syntax +++ /dev/null @@ -1,56 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - hexEscapedChar: | - \\x[a-f0-9]{1,4} - - decimalEscapedChar: | - \\d[0-9]{1,5} - - escapeSequences: | - (?> \\\\ - | \\" - | \\n - | \\r - | \\t - | {{hexEscapedChar}} - | {{decimalEscapedChar}} - ) - -contexts: - main: - - match: | - (?xi)\s* - (') - (?> ({{escapeSequences}}) - | (.) - ) - (') - captures: - 1: >- - string.quoted.single.mql.mql4 - punctuation.definition.string.begin.mql.mql4 - 2: >- - string.quoted.single.mql.mql4 - constant.character.escape.a.mql.mql4 - 3: string.quoted.single.mql.mql4 - 4: >- - string.quoted.single.mql.mql4 - punctuation.definition.string.end.mql.mql4 - pop: true diff --git a/syntaxes/mql4/literal/color.sublime-syntax b/syntaxes/mql4/literal/color.sublime-syntax deleted file mode 100644 index dae48611..00000000 --- a/syntaxes/mql4/literal/color.sublime-syntax +++ /dev/null @@ -1,78 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - colorValue: | - (?:0x)?[0-9]+ - -contexts: - main: - - match: \s*(C') - captures: - 1: >- - constant.color.mql.mql4 - punctuation.definition.color.begin.mql.mql4 - set: [ - end, - blue-value, - definition, - green-value, - definition, - red-value - ] - - end: - - match: \' - scope: >- - constant.color.mql.mql4 - punctuation.definition.color.end.mql.mql4 - pop: true - - definition: - - match: \, - scope: >- - constant.color.mql.mql4 - punctuation.definition.color.mql.mql4 - pop: true - - red-value: - - match: | - (?x) - {{colorValue}} - scope: >- - constant.color.mql.mql4 - color.value.r.mql.mql4 - pop: true - - green-value: - - match: | - (?x) - {{colorValue}} - scope: >- - constant.color.mql.mql4 - color.value.g.mql.mql4 - pop: true - - blue-value: - - match: | - (?x) - {{colorValue}} - scope: >- - constant.color.mql.mql4 - color.value.b.mql.mql4 - pop: true diff --git a/syntaxes/mql4/literal/datetime.sublime-syntax b/syntaxes/mql4/literal/datetime.sublime-syntax deleted file mode 100644 index 32bd1f0b..00000000 --- a/syntaxes/mql4/literal/datetime.sublime-syntax +++ /dev/null @@ -1,106 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(D') - captures: - 1: >- - constant.datetime.mql.mql4 - punctuation.definition.datetime.begin.mql.mql4 - set: year-value - - end: - - match: \' - scope: >- - constant.datetime.mql.mql4 - punctuation.definition.datetime.end.mql.mql4 - pop: true - - date-definition: - - match: (?=\') - pop: true - - match: \. - scope: >- - constant.datetime.mql.mql4 - punctuation.definition.date.mql.mql4 - pop: true - - time-definition: - - meta_content_scope: constant.datetime.mql.mql4 - - match: (?=') - pop: true - - match: ":" - scope: >- - constant.datetime.mql.mql4 - punctuation.definition.time.mql.mql4 - pop: true - - year-value: - - meta_content_scope: constant.datetime.mql.mql4 - - include: end - - match: "[0-9]{4}" - scope: datetime.year.mql.mql4 - set: [ - month-value, - date-definition - ] - - month-value: - - meta_content_scope: constant.datetime.mql.mql4 - - include: end - - match: "[0-9]{2}" - scope: datetime.month.mql.mql4 - set: [ - day-value, - date-definition - ] - - day-value: - - meta_content_scope: constant.datetime.mql.mql4 - - include: end - - match: "[0-9]{2}" - scope: datetime.day.mql.mql4 - set: hour-value - - hour-value: - - meta_content_scope: constant.datetime.mql.mql4 - - include: end - - match: "[0-9]{2}" - scope: datetime.hour.mql.mql4 - set: [ - minute-value, - time-definition - ] - - minute-value: - - meta_content_scope: constant.datetime.mql.mql4 - - include: end - - match: "[0-9]{2}" - scope: datetime.minute.mql.mql4 - set: [ - second-value, - time-definition - ] - - second-value: - - meta_content_scope: constant.datetime.mql.mql4 - - include: end - - match: "[0-9]{2}" - scope: datetime.second.mql.mql4 - set: end diff --git a/syntaxes/mql4/literal/number.sublime-syntax b/syntaxes/mql4/literal/number.sublime-syntax deleted file mode 100644 index ebeb5024..00000000 --- a/syntaxes/mql4/literal/number.sublime-syntax +++ /dev/null @@ -1,60 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - literalDecimal: | - [0-9]+ - - literalFloat: | - (?> [0-9]*[.]{{literalDecimal}} - | {{literalDecimal}}[.][0-9]* - ) - - scientificNotation: | - ( - (?> {{literalFloat}} - | {{literalDecimal}} - ) - [e][+-]? - {{literalDecimal}} - ) - -contexts: - main: - - include: float - - include: integer - - float: - - match: (?xi)\s*({{scientificNotation}}) - captures: - 1: constant.numeric.float.scientific.mql.mql4 - pop: true - - match: (?x)\s*({{literalFloat}}) - captures: - 1: constant.numeric.float.mql.mql4 - pop: true - - integer: - - match: (?i)\s*(0[x][0-9a-f]+) - captures: - 1: constant.numeric.hex.mql.mql4 - pop: true - - match: \s*([1-9][0-9]*|0) - captures: - 1: constant.numeric.decimal.mql.mql4 - pop: true diff --git a/syntaxes/mql4/literal/string.sublime-syntax b/syntaxes/mql4/literal/string.sublime-syntax deleted file mode 100644 index e187c75b..00000000 --- a/syntaxes/mql4/literal/string.sublime-syntax +++ /dev/null @@ -1,63 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - hexEscapedChar: | - x[a-f0-9]{1,4} - - decimalEscapedChar: | - d[0-9]{1,5} - - escapeSequences: | - \\ - (?> [\\"nrt] - | {{hexEscapedChar}} - | {{decimalEscapedChar}} - ) - -contexts: - main: - - match: \s*(") - captures: - 1: >- - string.quoted.double.mql.mql4 - punctuation.definition.string.begin.mql.mql4 - with_prototype: - - match: \s*(") - captures: - 1: >- - string.quoted.double.mql.mql4 - punctuation.definition.string.end.mql.mql4 - pop: true - set: escape-a - - escape-a: - - meta_content_scope: >- - string.quoted.double.mql.mql4 - string.content.mql.mql4 - - match: (?x){{escapeSequences}} - scope: constant.character.escape.a.mql.mql4 - set: escape-b - - escape-b: - - meta_content_scope: >- - string.quoted.double.mql.mql4 - string.content.mql.mql4 - - match: (?x){{escapeSequences}} - scope: constant.character.escape.b.mql.mql4 - set: escape-a diff --git a/syntaxes/mql4/new.sublime-syntax b/syntaxes/mql4/new.sublime-syntax deleted file mode 100644 index c654d118..00000000 --- a/syntaxes/mql4/new.sublime-syntax +++ /dev/null @@ -1,33 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?i)\s*\b(new)\b - captures: - 1: keyword.other.mql.mql4 - set: [ - arguments, - type - ] - - arguments: - - include: Packages/Naomi/syntaxes/mql4/function-call/arguments.sublime-syntax - - type: - - include: Packages/Naomi/syntaxes/mql4/type.sublime-syntax diff --git a/syntaxes/mql4/operator.sublime-syntax b/syntaxes/mql4/operator.sublime-syntax deleted file mode 100644 index bee002a2..00000000 --- a/syntaxes/mql4/operator.sublime-syntax +++ /dev/null @@ -1,31 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/mql4/operator/other.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/operator/comparison.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/operator/logical.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/operator/bitwise.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/operator/arithmetic.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/operator/pointer.sublime-syntax - # Assignment. - - match: \s*(=) - captures: - 1: keyword.operator.other.assignment.mql.mql4 - pop: true diff --git a/syntaxes/mql4/operator/arithmetic.sublime-syntax b/syntaxes/mql4/operator/arithmetic.sublime-syntax deleted file mode 100644 index 02167925..00000000 --- a/syntaxes/mql4/operator/arithmetic.sublime-syntax +++ /dev/null @@ -1,54 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:----------------| - # | -- | Decrement. | - # | - | Subtraction. | - # | ++ | Increment. | - # | + | Addition. | - # | += | | - # | * | Multiplication. | - # | *= | | - # | / | Division. | - # | /= | | - # | % | Modulus. | - # | %= | | - main: - - match: | - (?x)\s* - ((?> -- - | -=? - | \+\+ - | \+=? - | /=? - | %=? - )) - captures: - 1: keyword.operator.arithmetic.mql.mql4 - pop: true - # Multiplication operator needs an extra check to prevent it being confused - # with the pointer operator. - - match: | - (?x) - (?<=^|\w|\)|]|}) - \s*(\*) - captures: - 1: keyword.operator.arithmetic.multiplication.mql.mql4 - pop: true diff --git a/syntaxes/mql4/operator/bitwise.sublime-syntax b/syntaxes/mql4/operator/bitwise.sublime-syntax deleted file mode 100644 index db3080cd..00000000 --- a/syntaxes/mql4/operator/bitwise.sublime-syntax +++ /dev/null @@ -1,49 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:---------------------------------| - # | ~ | Bitwise not. | - # | ~= | Bitwise not assignment. | - # | & | Bitwise AND. | - # | &= | Bitwise AND assignment. | - # | | | Bitwise OR. | - # | |= | Bitwise OR assignment. | - # | ^ | Bitwise XOR. | - # | ^= | Bitwise XOR assignment. | - # | << | Left shift. | - # | <<= | Left shift assignment. | - # | >> | Right shift. | - # | >>= | Right shift assignment. | - # | >>> | Unsigned right shift. | - # | >>>= | Unsigned right shift assignment. | - main: - - match: | - (?x)\s* - ((?> ~=? - | &=? - | \|=? - | \^=? - | <<=? - | >>>=? - | >>=? - )) - captures: - 1: keyword.operator.bitwise.mql.mql4 - pop: true diff --git a/syntaxes/mql4/operator/comparison.sublime-syntax b/syntaxes/mql4/operator/comparison.sublime-syntax deleted file mode 100644 index b9d2918f..00000000 --- a/syntaxes/mql4/operator/comparison.sublime-syntax +++ /dev/null @@ -1,40 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:--------------------------| - # | == | Equal. | - # | != | Not equal. | - # | >= | Greater than or equal to. | - # | <= | Less than or equal to. | - # | > | Greater than. | - # | < | Less than. | - main: - - match: | - (?x)\s* - ((?> == - | != - | >= - | <= - | >(?!>) - | <(?!<) - )) - captures: - 1: keyword.operator.comparison.mql.mql4 - pop: true diff --git a/syntaxes/mql4/operator/logical.sublime-syntax b/syntaxes/mql4/operator/logical.sublime-syntax deleted file mode 100644 index afa61cf0..00000000 --- a/syntaxes/mql4/operator/logical.sublime-syntax +++ /dev/null @@ -1,34 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:------------| - # | && | And. | - # | || | Or. | - # | ! | Not. | - main: - - match: | - (?x)\s* - ((?> && - | \|\| - | ! - )) - captures: - 1: keyword.operator.logical.mql.mql4 - pop: true diff --git a/syntaxes/mql4/operator/other.sublime-syntax b/syntaxes/mql4/operator/other.sublime-syntax deleted file mode 100644 index 63d7b3c6..00000000 --- a/syntaxes/mql4/operator/other.sublime-syntax +++ /dev/null @@ -1,60 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:----------:|:--------------------| - # | & | Reference. | - # | . | Member access. | - # | -> | Member access. | - # | :: | Scope resolution. | - # | ? | | - # | : | | - main: - - match: \s*(&)(?![&=]) - captures: - 1: keyword.operator.other.reference.mql.mql4 - pop: true - - match: | - (?x)\s* - ((?> -> - | \. - )) - captures: - 1: keyword.operator.other.member-access.mql.mql4 - set: member-access - - match: \s*(\?) - captures: - 1: keyword.operator.other.ternary.mql.mql4 - set: ternary-condition - - ternary-condition: - - match: \s*(:) - captures: - 1: keyword.operator.other.ternary.mql.mql4 - pop: true - - match: "" - push: - - match: (?=\s*:) - pop: true - - include: Packages/Naomi/syntaxes/mql4/statement-and-expression.sublime-syntax - - member-access: - - include: Packages/Naomi/syntaxes/mql4/function-call/normal.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/constant/normal.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/variable.sublime-syntax diff --git a/syntaxes/mql4/operator/pointer.sublime-syntax b/syntaxes/mql4/operator/pointer.sublime-syntax deleted file mode 100644 index 17c0ceea..00000000 --- a/syntaxes/mql4/operator/pointer.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x) - \s*(\*+) - captures: - 1: >- - storage.modifier.mql.mql4 - keyword.operator.other.pointer.mql.mql4 - pop: true diff --git a/syntaxes/mql4/preprocessor.sublime-syntax b/syntaxes/mql4/preprocessor.sublime-syntax deleted file mode 100644 index b854ba3d..00000000 --- a/syntaxes/mql4/preprocessor.sublime-syntax +++ /dev/null @@ -1,127 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - # Include. - - match: \s*(\#include) - captures: - 1: keyword.preprocessor.mql.mql4 - set: include-value - # Define. - - match: | - (?xi) - \s*(\#define) - \s*({{commonIdentifier}}) - captures: - 1: keyword.preprocessor.mql.mql4 - 2: entity.name.variable.mql.mql4 - set: value - # Property. - - match: | - (?x)\s* - (\#property) - captures: - 1: keyword.preprocessor.mql.mql4 - set: [ - value, - property-identifier - ] - # Other keyword value pairs. - - match: | - (?x)\s* - (\# - (?> elif - | else - | endif - | if(?:n?def)? - | import - | pragma - ) - ) - captures: - 1: keyword.preprocessor.mql.mql4 - set: value - - include-value: - - match: \s*(\<.+?\>) - scope: string.unquoted.mql.mql4 - pop: true - - include: Packages/Naomi/syntaxes/mql4/literal/string.sublime-syntax - - value: - - match: \s*$ - pop: true - - match: "" - push: - - include: statement-and-expression - - statement-and-expression: - - include: Packages/Naomi/syntaxes/mql4/statement-and-expression.sublime-syntax - - property-identifier: - # Expected properties. - - match: | - (?x)\s*\b - ((?> copyright - | description - | icon - | indicator_ - (?> chart_window - | buffers - | color[1-8] - | height - | label[1-8] - | level - (?> color - | style - | width - ) - | maximum - | minimum - | separate_window - | style[1-8] - | width[1-8] - ) - | library - | link - | script_show_ - (?>confirm|inputs) - | stacksize - | strict - | tester_ - (?>file|indicator|library) - | version - )) - captures: - 1: >- - support.mql.mql4 - entity.name.property.mql.mql4 - pop: true - # Not expected property. - - match: | - (?x)\s* - ({{commonIdentifier}}) - captures: - 1: entity.name.unknown.mql.mql4 - pop: true diff --git a/syntaxes/mql4/property.sublime-syntax b/syntaxes/mql4/property.sublime-syntax deleted file mode 100644 index e8a63de3..00000000 --- a/syntaxes/mql4/property.sublime-syntax +++ /dev/null @@ -1,21 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/mql4/variable-declaration.sublime-syntax diff --git a/syntaxes/mql4/sizeof.sublime-syntax b/syntaxes/mql4/sizeof.sublime-syntax deleted file mode 100644 index b798c1a6..00000000 --- a/syntaxes/mql4/sizeof.sublime-syntax +++ /dev/null @@ -1,39 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?xi)\s*\b - (sizeof)\s*(\() - captures: - 1: keyword.other.mql.mql4 - 2: punctuation.definition.function.parameters.begin.mql.mql4 - set: [ - definition, - type - ] - - type: - - include: Packages/Naomi/syntaxes/mql4/type.sublime-syntax - - definition: - - match: \s*(\)) - captures: - 1: punctuation.definition.function.parameters.end.mql.mql4 - pop: true diff --git a/syntaxes/mql4/statement-and-expression.sublime-syntax b/syntaxes/mql4/statement-and-expression.sublime-syntax deleted file mode 100644 index 899bbe68..00000000 --- a/syntaxes/mql4/statement-and-expression.sublime-syntax +++ /dev/null @@ -1,118 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - - expressionGroupBegin: | - \s*(\() - -contexts: - main: - - include: cast-operator - # Open new expression group. - - match: | - (?xi) - {{expressionGroupBegin}} - captures: - 1: punctuation.definition.expression.group.a.begin.mql.mql4 - set: open-b-close-a - # Expression contents. - - include: sequence - - open-a-close-b: - - include: cast-operator - # Open new expression group. - - match: | - (?xi) - {{expressionGroupBegin}} - captures: - 1: punctuation.definition.expression.group.a.begin.mql.mql4 - push: open-b-close-a - # Close current expression group. - - match: \s*(\)) - captures: - 1: punctuation.definition.expression.group.b.end.mql.mql4 - pop: true - # Expression contents. - - match: "" - push: - - include: sequence - - match: "" - pop: true - - open-b-close-a: - - include: cast-operator - # Open new expression group. - - match: | - (?xi) - {{expressionGroupBegin}} - captures: - 1: punctuation.definition.expression.group.b.begin.mql.mql4 - push: open-a-close-b - # Close current expression group. - - match: \s*(\)) - captures: - 1: punctuation.definition.expression.group.a.end.mql.mql4 - pop: true - # Expression contents. - - match: "" - push: - - include: sequence - - match: "" - pop: true - - cast-operator: - - include: Packages/Naomi/syntaxes/mql4/cast.sublime-syntax - - sequence: - - include: Packages/Naomi/syntaxes/mql4/terminator.sublime-syntax - # Comments. - - include: Packages/Naomi/syntaxes/mql4/comment.sublime-syntax - # Expression keywords. - - include: Packages/Naomi/syntaxes/mql4/sizeof.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/new.sublime-syntax - # Simple statements. - - include: Packages/Naomi/syntaxes/mql4/goto.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/statement/hanging.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/statement/bodied.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/statement/simple.sublime-syntax - # Complex statements. - - include: Packages/Naomi/syntaxes/mql4/preprocessor.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/input.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/cd-tor.outside.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/template.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/class.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/struct.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/typedef.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/enum.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function.sublime-syntax - # Expression. - - include: Packages/Naomi/syntaxes/mql4/array-access.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/literal.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function-call.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/operator.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/variable-declaration.sublime-syntax - # When it comes to constants and variables, there's no way to tell apart - # without an intellisense, so it’ll treat that anything that looks a - # uppercase variable as if it was a constant. - - include: Packages/Naomi/syntaxes/mql4/constant.sublime-syntax - # Constant matching failed, so it could be a variable. - - include: Packages/Naomi/syntaxes/mql4/variable.sublime-syntax diff --git a/syntaxes/mql4/statement/bodied.sublime-syntax b/syntaxes/mql4/statement/bodied.sublime-syntax deleted file mode 100644 index e5fe60e2..00000000 --- a/syntaxes/mql4/statement/bodied.sublime-syntax +++ /dev/null @@ -1,102 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # Header only. - - match: (?xi)\s*\b(return)\b - captures: - 1: keyword.control.flow-break.mql.mql4 - set: [ - terminator, - optional-header - ] - # Body only. - - match: | - (?xi)\s*\b - ((?> do - | else - ))\b - captures: - 1: keyword.control.mql.mql4 - set: body - # Header and body. - - match: | - (?xi)\s*\b - ((?> else\s+if - | for - | if - | switch - | while - ))\b - captures: - 1: keyword.control.mql.mql4 - set: [ - body, - header - ] - - optional-header: - - match: (?=\s*;) - pop: true - - match: (?=\s*\() - set: header - - header: - - match: \s*(\() - captures: - 1: punctuation.definition.control.header.begin.mql.mql4 - set: header-content - - header-content: - - match: \s*(\)) - captures: - 1: punctuation.definition.control.header.end.mql.mql4 - pop: true - - match: "" - push: - - match: (?=\)) - pop: true - - include: statement-and-expression - - terminator: - - match: \s*(;) - captures: - 1: keyword.other.terminator.mql.mql4 - pop: true - - body: - - match: \s*(\{) - captures: - 1: punctuation.definition.control.body.begin.mql.mql4 - set: body-content - - include: statement-and-expression - - body-content: - - match: \s*(}) - captures: - 1: punctuation.definition.control.body.end.mql.mql4 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: statement-and-expression - - statement-and-expression: - - include: Packages/Naomi/syntaxes/mql4/statement-and-expression.sublime-syntax diff --git a/syntaxes/mql4/statement/hanging.sublime-syntax b/syntaxes/mql4/statement/hanging.sublime-syntax deleted file mode 100644 index 38f78009..00000000 --- a/syntaxes/mql4/statement/hanging.sublime-syntax +++ /dev/null @@ -1,50 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?xi)\s*\b - ((?> private - | protected - | public - ))\b - captures: - 1: >- - storage.modifier.mql.mql4 - keyword.other.access.mql.mql4 - set: operator - - match: | - (?xi)\s*\b - ((?> case - | default - ))\b - captures: - 1: keyword.control.mql.mql4 - set: operator - - operator: - - match: \s*(:) - captures: - 1: keyword.operator.other.scope.mql.mql4 - pop: true - - match: "" - push: statement-and-expression - - statement-and-expression: - - include: Packages/Naomi/syntaxes/mql4/statement-and-expression.sublime-syntax diff --git a/syntaxes/mql4/statement/simple.sublime-syntax b/syntaxes/mql4/statement/simple.sublime-syntax deleted file mode 100644 index 4485ef0c..00000000 --- a/syntaxes/mql4/statement/simple.sublime-syntax +++ /dev/null @@ -1,36 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> break - | continue - ))\b - captures: - 1: keyword.control.flow-break.mql.mql4 - pop: true - - match: | - (?xi)\s*\b - ((?> default - | delete - ))\b - captures: - 1: keyword.control.mql.mql4 - pop: true diff --git a/syntaxes/mql4/struct.sublime-syntax b/syntaxes/mql4/struct.sublime-syntax deleted file mode 100644 index dfc8ccba..00000000 --- a/syntaxes/mql4/struct.sublime-syntax +++ /dev/null @@ -1,89 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - match: \s*\b(struct)\b - captures: - 1: >- - storage.type.mql.mql4 - keyword.declaration.struct.mql.mql4 - set: identifier - - identifier: - - match: | - (?xi)\s* - ({{commonIdentifier}}) - captures: - 1: entity.name.struct.mql.mql4 - set: [ - body, - inheritance - ] - - inheritance: - - match: (?=\s*\{) - pop: true - - match: | - (?xi)\s* - (:) - \s*( - (?> public - | protected - | private - ) - )\s* - captures: - 1: >- - storage.modifier.mql.mql4 - keyword.operator.other.inherit.mql.mql4 - 2: >- - storage.modifier.mql.mql4 - keyword.other.access.mql.mql4 - - include: Packages/Naomi/syntaxes/mql4/type.sublime-syntax - - body: - - include: comment - - match: \s*(\{) - captures: - 1: punctuation.definition.struct.body.begin.mql.mql4 - set: body-content - - body-content: - - include: comment - - match: \s*(\};?) - captures: - 1: punctuation.definition.struct.body.end.mql.mql4 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: comment - - include: Packages/Naomi/syntaxes/mql4/cd-tor.inside.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/statement/hanging.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/variable-declaration.sublime-syntax - - comment: - - include: Packages/Naomi/syntaxes/mql4/comment.no-pop.sublime-syntax diff --git a/syntaxes/mql4/template.sublime-syntax b/syntaxes/mql4/template.sublime-syntax deleted file mode 100644 index d2d23b69..00000000 --- a/syntaxes/mql4/template.sublime-syntax +++ /dev/null @@ -1,56 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - match: \s*\b(template)\b - captures: - 1: >- - storage.type.mql.mql4 - keyword.template.mql.mql4 - set: parameters - - parameters: - - match: \s*(<) - captures: - 1: punctuation.definition.template.parameters.begin.mql.mql4 - set: parameters-content - - parameters-content: - - match: \s*(>) - captures: - 1: punctuation.definition.template.parameters.end.mql.mql4 - set: target - - match: | - (?xi)\s* - (typename) - \s*({{commonIdentifier}}) - \s*(,)? - captures: - 1: keyword.other.mql.mql4 - 2: entity.name.type.mql.mql4 - 3: punctuation.definition.template.parameter.mql.mql4 - - target: - - include: Packages/Naomi/syntaxes/mql4/function.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/class.sublime-syntax diff --git a/syntaxes/mql4/terminator.sublime-syntax b/syntaxes/mql4/terminator.sublime-syntax deleted file mode 100644 index 4dcbf1bd..00000000 --- a/syntaxes/mql4/terminator.sublime-syntax +++ /dev/null @@ -1,24 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(;) - captures: - 1: keyword.other.terminator.mql.mql4 - pop: true diff --git a/syntaxes/mql4/type.sublime-syntax b/syntaxes/mql4/type.sublime-syntax deleted file mode 100644 index 4ddd91d9..00000000 --- a/syntaxes/mql4/type.sublime-syntax +++ /dev/null @@ -1,24 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/mql4/type/support/core.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/type/support/enums.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/type/support/structures.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/type/normal.sublime-syntax diff --git a/syntaxes/mql4/type/modifiers.sublime-syntax b/syntaxes/mql4/type/modifiers.sublime-syntax deleted file mode 100644 index 6554b95f..00000000 --- a/syntaxes/mql4/type/modifiers.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x) - (?=\s*(?>\*|<)) - push: - - include: Packages/Naomi/syntaxes/mql4/operator/pointer.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/type/template-arguments.sublime-syntax - - match: (?=\s*\S) - pop: true diff --git a/syntaxes/mql4/type/normal.sublime-syntax b/syntaxes/mql4/type/normal.sublime-syntax deleted file mode 100644 index bf49e358..00000000 --- a/syntaxes/mql4/type/normal.sublime-syntax +++ /dev/null @@ -1,34 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - match: | - (?xi)\s* - \b({{commonIdentifier}})\b - captures: - 1: entity.name.type.mql.mql4 - set: modifiers - - modifiers: - - include: Packages/Naomi/syntaxes/mql4/type/modifiers.sublime-syntax diff --git a/syntaxes/mql4/type/support/core.sublime-syntax b/syntaxes/mql4/type/support/core.sublime-syntax deleted file mode 100644 index 4c9b0e9b..00000000 --- a/syntaxes/mql4/type/support/core.sublime-syntax +++ /dev/null @@ -1,43 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> bool - | char - | color - | datetime - | double - | float - | int - | long - | short - | string - | u(?>char|int|long|short) - | void - ))\b - captures: - 1: >- - support.mql.mql4 - entity.name.type.mql.mql4 - set: modifiers - - modifiers: - - include: Packages/Naomi/syntaxes/mql4/type/modifiers.sublime-syntax diff --git a/syntaxes/mql4/type/support/enums.sublime-syntax b/syntaxes/mql4/type/support/enums.sublime-syntax deleted file mode 100644 index 099a17af..00000000 --- a/syntaxes/mql4/type/support/enums.sublime-syntax +++ /dev/null @@ -1,52 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ( - ENUM_ - (?> ALIGN_MODE - | ANCHOR_POINT - | APPLIED_PRICE - | ARROW_ANCHOR - | BASE_CORNER - | BORDER_TYPE - | CHART_ - (?> EVENT - | MODE - | POSITION - | PROPERTY_(?>DOUBLE|INTEGER|STRING) - ) - | GANN_DIRECTION - | LINE_STYLE - | MA_METHOD - | OBJECT_PROPERTY_(?>DOUBLE|INTEGER|STRING) - | TIMEFRAMES - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.type.mql.mql4 - set: modifiers - - modifiers: - - include: Packages/Naomi/syntaxes/mql4/type/modifiers.sublime-syntax - diff --git a/syntaxes/mql4/type/support/structures.sublime-syntax b/syntaxes/mql4/type/support/structures.sublime-syntax deleted file mode 100644 index 32840097..00000000 --- a/syntaxes/mql4/type/support/structures.sublime-syntax +++ /dev/null @@ -1,39 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - - -contexts: - main: - - match: | - (?x)\s*\b - ( - Mql - (?> DateTime - | Rates - | Tick - ) - )\b - captures: - 1: >- - support.mql.mql4 - entity.name.type.mql.mql4 - set: modifiers - - modifiers: - - include: Packages/Naomi/syntaxes/mql4/type/modifiers.sublime-syntax - diff --git a/syntaxes/mql4/type/template-arguments.sublime-syntax b/syntaxes/mql4/type/template-arguments.sublime-syntax deleted file mode 100644 index f408f589..00000000 --- a/syntaxes/mql4/type/template-arguments.sublime-syntax +++ /dev/null @@ -1,54 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - match: \s*(<) - captures: - 1: punctuation.definition.template.arguments.begin.mql.mql4 - set: [ - definition, - argument - ] - - match: (?=\S) - pop: true - - argument: - - include: Packages/Naomi/syntaxes/mql4/type.sublime-syntax - - definition: - - match: \> - scope: punctuation.definition.template.arguments.end.mql.mql4 - pop: true - - match: \, - scope: punctuation.definition.template.arguments.mql.mql4 - set: [ - definition, - argument - ] - - match: \< - scope: punctuation.definition.template.arguments.begin.mql.mql4 - push: [ - definition, - argument - ] diff --git a/syntaxes/mql4/typedef.sublime-syntax b/syntaxes/mql4/typedef.sublime-syntax deleted file mode 100644 index da09f2bb..00000000 --- a/syntaxes/mql4/typedef.sublime-syntax +++ /dev/null @@ -1,125 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - - typeIdentifier: | - {{commonIdentifier}} - (?> \s*\*+ - | \s*<.*?> - (?:\s*\**) - | \b - ) - -contexts: - main: - - match: | - (?xi)\s* - \b(typedef)\b - (?=\s* - {{typeIdentifier}} - \s*{{commonIdentifier}} - ) - captures: - 1: >- - storage.type.mql.mql4 - keyword.declaration.typedef.mql.mql4 - set: [ - identifier, - type - ] - - comment: - - include: Packages/Naomi/syntaxes/mql4/comment.no-pop.sublime-syntax - - type: - - include: Packages/Naomi/syntaxes/mql4/type.sublime-syntax - - identifier: - - match: | - (?xi)\s* - ({{commonIdentifier}}) - captures: - 1: entity.name.typedef.mql.mql4 - pop: true - - # - match: \s*\b(typedef)\b - # captures: - # 1: >- - # storage.type.mql.mql4 - # keyword.declaration.typedef.mql.mql4 - # set: identifier - - - identifieraaaa: - - match: | - (?xi)\s* - ({{commonIdentifier}}) - captures: - 1: entity.name.typedef.mql.mql4 - set: [ - body, - inheritance - ] - - inheritance: - - match: (?=\s*\{) - pop: true - - match: | - (?xi)\s* - (:) - \s*( - (?> public - | protected - | private - ) - )\s* - captures: - 1: >- - storage.modifier.mql.mql4 - keyword.operator.other.inherit.mql.mql4 - 2: >- - storage.modifier.mql.mql4 - keyword.other.access.mql.mql4 - - include: Packages/Naomi/syntaxes/mql4/type.sublime-syntax - - body: - - include: comment - - match: \s*(\{) - captures: - 1: punctuation.definition.typedef.body.begin.mql.mql4 - set: body-content - - body-content: - - include: comment - - match: \s*(\};?) - captures: - 1: punctuation.definition.typedef.body.end.mql.mql4 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: comment - - include: Packages/Naomi/syntaxes/mql4/cd-tor.inside.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/statement/hanging.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/function.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/variable-declaration.sublime-syntax diff --git a/syntaxes/mql4/unguarded-variable-declaration.sublime-syntax b/syntaxes/mql4/unguarded-variable-declaration.sublime-syntax deleted file mode 100644 index f76cf22d..00000000 --- a/syntaxes/mql4/unguarded-variable-declaration.sublime-syntax +++ /dev/null @@ -1,103 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - match: "" - set: [ - punctuation, - variable, - type - ] - - type: - - match: \s*(const) - captures: - 1: >- - storage.type.mql.mql4 - keyword.declaration.const.mql.mql4 - - match: | - (?x)\s* - ((?> extern - | static - )) - captures: - 1: >- - storage.modifier.mql.mql4 - keyword.other.access.mql.mql4 - - include: Packages/Naomi/syntaxes/mql4/type.sublime-syntax - - variable: - - include: Packages/Naomi/syntaxes/mql4/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/mql4/variable.sublime-syntax - - punctuation: - - include: terminator - - match: (?=\s*\)) - pop: true - - match: \s*(,) - captures: - 1: keyword.operator.other.comma.mql.mql4 - set: [ - punctuation, - variable - ] - - match: \s*(\[) - captures: - 1: punctuation.definition.array.index.begin.mql.mql4 - push: array-index - - match: \s*(=) - captures: - 1: keyword.operator.other.assignment.mql.mql4 - push: value - - array-index: - - match: \s*(,) - captures: - 1: punctuation.definition.array.index.mql.mql4 - - match: \s*(]) - captures: - 1: punctuation.definition.array.index.end.mql.mql4 - pop: true - - match: "" - push: - - include: statement-and-expression - - value: - - match: | - (?x) - (?=\s* - (?> , - | ; - ) - ) - pop: true - - match: "" - push: - - include: statement-and-expression - - statement-and-expression: - - include: Packages/Naomi/syntaxes/mql4/statement-and-expression.sublime-syntax - - terminator: - - include: Packages/Naomi/syntaxes/mql4/terminator.sublime-syntax diff --git a/syntaxes/mql4/variable-declaration.sublime-syntax b/syntaxes/mql4/variable-declaration.sublime-syntax deleted file mode 100644 index d7ca8bbd..00000000 --- a/syntaxes/mql4/variable-declaration.sublime-syntax +++ /dev/null @@ -1,54 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - - typeIdentifier: | - {{commonIdentifier}} - (?> \s*\*+ - | \s*<.*?> - (?:\s*\**) - | \b - ) - -contexts: - main: - - match: | - (?xi) - (?=\s* - (?: - (?> const - | extern - | static - )\s+ - )? - {{typeIdentifier}} - \s*{{commonIdentifier}}\s* - (?> = - | \[ - | , - | ; - ) - ) - set: actual-declaration - - actual-declaration: - - include: Packages/Naomi/syntaxes/mql4/unguarded-variable-declaration.sublime-syntax diff --git a/syntaxes/mql4/variable.sublime-syntax b/syntaxes/mql4/variable.sublime-syntax deleted file mode 100644 index 77df6b05..00000000 --- a/syntaxes/mql4/variable.sublime-syntax +++ /dev/null @@ -1,43 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - include: support-variable - - include: common-variable - - common-variable: - - match: | - (?xi)\s* - \b({{commonIdentifier}})\b - captures: - 1: entity.name.variable.mql.mql4 - pop: true - - support-variable: - - match: (?i)\s*\b(this)\b - captures: - 1: >- - support.mql.mql4 - entity.name.variable.mql.mql4 - pop: true diff --git a/syntaxes/naomi.css3.sublime-syntax b/syntaxes/naomi.css3.sublime-syntax index 317184c3..d1e6433f 100644 --- a/syntaxes/naomi.css3.sublime-syntax +++ b/syntaxes/naomi.css3.sublime-syntax @@ -13,27 +13,11 @@ # License for the specific language governing permissions and limitations under # the License. -name: CSS (Naomi) -scope: source.css - -file_extensions: - - css - - css3 +name: Placeholder +scope: text +hidden: true contexts: main: - - match: "" - push: [ entry ] - - entry: - - include: Packages/Naomi/syntaxes/css3/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/css3/statement.sublime-syntax - - match: (?=\S) - push: - - include: Packages/Naomi/syntaxes/css3/ruleset.sublime-syntax - - # Used by the core syntax to highlight inline CSS. - rule-list-body: - - match: "" - push: - - include: Packages/Naomi/syntaxes/css3/ruleset/block.sublime-syntax#delimiter + - match: . + pop: true diff --git a/syntaxes/naomi.fjsx15.sublime-syntax b/syntaxes/naomi.fjsx15.sublime-syntax index 77b05ebe..d1e6433f 100644 --- a/syntaxes/naomi.fjsx15.sublime-syntax +++ b/syntaxes/naomi.fjsx15.sublime-syntax @@ -13,20 +13,11 @@ # License for the specific language governing permissions and limitations under # the License. -name: JavaScript (Naomi) -scope: source.js - -file_extensions: - - js - - jsx - - mjs +name: Placeholder +scope: text +hidden: true contexts: main: - - match: "" - push: [ entry ] - - entry: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + - match: . + pop: true diff --git a/syntaxes/naomi.flow1.sublime-syntax b/syntaxes/naomi.flow1.sublime-syntax index e5cd14b6..d1e6433f 100644 --- a/syntaxes/naomi.flow1.sublime-syntax +++ b/syntaxes/naomi.flow1.sublime-syntax @@ -13,19 +13,11 @@ # License for the specific language governing permissions and limitations under # the License. -name: Flow Statements and Expressions (Naomi) +name: Placeholder +scope: text hidden: true -scope: source.flow contexts: main: - - match: "" - push: [ entry ] - - entry: - - include: Packages/Naomi/syntaxes/flow1/declare.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/interface.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/module.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/prolog.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/type-aliasing.sublime-syntax - - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax + - match: . + pop: true diff --git a/syntaxes/naomi.html5.sublime-syntax b/syntaxes/naomi.html5.sublime-syntax index 2bc285a8..d1e6433f 100644 --- a/syntaxes/naomi.html5.sublime-syntax +++ b/syntaxes/naomi.html5.sublime-syntax @@ -13,34 +13,11 @@ # License for the specific language governing permissions and limitations under # the License. -name: HTML 5 (Naomi) -scope: text.html - -file_extensions: - - html - - html5 - - htm - - htm5 - - shtml - - shtml5 - - xhtml - - xhtml5 - - inc - - inc5 - - tmpl - - tmpl5 - - tpl - - tpl5 - -first_line_match: +name: Placeholder +scope: text +hidden: true contexts: main: - - match: "" - push: [ entry ] - - entry: - # - include: Packages/Naomi/syntaxes/html5/php.sublime-syntax - - include: Packages/Naomi/syntaxes/html5/element.sublime-syntax - - match: "" + - match: . pop: true diff --git a/syntaxes/naomi.jsnap1.sublime-syntax b/syntaxes/naomi.jsnap1.sublime-syntax index 9a7c4a47..d1e6433f 100644 --- a/syntaxes/naomi.jsnap1.sublime-syntax +++ b/syntaxes/naomi.jsnap1.sublime-syntax @@ -13,154 +13,11 @@ # License for the specific language governing permissions and limitations under # the License. -name: Jest Snapshot (Naomi) -scope: source.js.jest-snapshot - -file_extensions: - - js.snap - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* +name: Placeholder +scope: text +hidden: true contexts: main: - # Version. - - match: | - (?xi) - //\s+Jest\s+Snapshot.* - scope: keyword.declaration.snapshot-version.js.jest-snapshot - # Exports. - - match: exports\b - scope: support.type.object.js.jest-snapshot - push: [ value, assignment, property-access ] - # Terminator. - - match: ; - scope: punctuation.terminator.js.jest-snapshot - - array: - - match: \[ - scope: punctuation.section.brackets.begin.js.jest-snapshot - set: array-close - - array-close: - - match: \] - scope: punctuation.section.brackets.end.js.jest-snapshot - pop: true - - include: comma-no-pop - - match: (?=\S) - push: snapshot-content - - assignment: - - match: \= - scope: keyword.operator.other.assignment.js.jest-snapshot - pop: true - - close-object: - - meta_scope: meta.object-literal.js.jest-snapshot - - match: \} - scope: punctuation.section.block.end.js.jest-snapshot - pop: true - - include: comma-no-pop - - match: (?=\S) - push: [ key-value, key-bind, key ] - - close-snapshot: - - match: \` - scope: punctuation.definition.snapshot.end.js.jest-snapshot - pop: true - - match: (?=\S) - push: snapshot-content - - comma-no-pop: - - match: \, - scope: punctuation.separator.comma.js.jest-snapshot - - key: - - meta_scope: meta.object-literal.key.jest-snapshot - - include: Packages/Naomi/syntaxes/fjsx15/literal/object/property.sublime-syntax#any-key - - key-bind: - - match: ":" - scope: punctuation.separator.key-value.js.jest-snapshot - pop: true - - key-value: - # Core constants. - - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax#constants - # Other values. - - include: snapshot-content - - js-literals: - - include: Packages/Naomi/syntaxes/fjsx15/literal.sublime-syntax - - jsx: - - include: Packages/Naomi/syntaxes/naomi.jsx1.sublime-syntax - - meta-jsx: - - clear_scopes: true - - meta_content_scope: source.jsx - - include: pop-now - - object: - - match: \{ - scope: punctuation.section.block.begin.js.jest-snapshot - set: close-object - - pop-now: - - match: "" + - match: . pop: true - - property-access: - - include: Packages/Naomi/syntaxes/fjsx15/property-access.sublime-syntax - - snapshot-content: - # Object {} - - match: (?xi)(?={{commonIdentifier}}\s*{) - set: [ object, type ] - # Type[]. - - match: (?xi)(?={{commonIdentifier}}\s*\[) - set: type-array - # JSX. - - match: (?xi)(?=<{{commonIdentifier}}) - set: [ meta-jsx, jsx ] - # Other values. - - include: js-literals - - support-type: - - match: \[Function] - scope: >- - source.js.jest-snapshot - support.type.js.jest-snapshot - pop: true - - type: - - match: | - (?x) - (?> Array - | Object - | Promise - ) - scope: support.type.js.jest-snapshot - pop: true - - match: (?xi){{commonIdentifier}} - scope: variable.other.type.js.jest-snapshot - pop: true - - type-array: - - match: "" - set: [ array, type ] - - value: - # Snapshot. - - match: (`) - captures: - 0: source.js.jest-snapshot - 1: keyword.operator.assignment.js.fjsx15 - 2: punctuation.definition.snapshot.begin.js.fjsx15 - with_prototype: - - include: support-type - set: [ close-snapshot ] - # Other values. - - include: js-literals diff --git a/syntaxes/naomi.jsx1.sublime-syntax b/syntaxes/naomi.jsx1.sublime-syntax index b9014587..d1e6433f 100644 --- a/syntaxes/naomi.jsx1.sublime-syntax +++ b/syntaxes/naomi.jsx1.sublime-syntax @@ -13,12 +13,11 @@ # License for the specific language governing permissions and limitations under # the License. -name: JSX (Naomi) +name: Placeholder +scope: text hidden: true -scope: source.jsx contexts: main: - - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax - - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax + - match: . + pop: true diff --git a/syntaxes/naomi.md1.sublime-syntax b/syntaxes/naomi.md1.sublime-syntax index ce5e51ab..d1e6433f 100644 --- a/syntaxes/naomi.md1.sublime-syntax +++ b/syntaxes/naomi.md1.sublime-syntax @@ -13,19 +13,11 @@ # License for the specific language governing permissions and limitations under # the License. -name: Markdown (Github) (Naomi) -scope: text.html.markdown - -file_extensions: - - md +name: Placeholder +scope: text +hidden: true contexts: main: - - match: "" - push: [ entry ] - - entry: - - include: Packages/Naomi/syntaxes/md1/header.sublime-syntax - - include: Packages/Naomi/syntaxes/md1/code-block.sublime-syntax - - match: "" + - match: . pop: true diff --git a/syntaxes/naomi.mql4.sublime-syntax b/syntaxes/naomi.mql4.sublime-syntax index 3fd2bc40..d1e6433f 100644 --- a/syntaxes/naomi.mql4.sublime-syntax +++ b/syntaxes/naomi.mql4.sublime-syntax @@ -13,18 +13,11 @@ # License for the specific language governing permissions and limitations under # the License. -name: MQL 4 (Naomi) -scope: source.mql - -file_extensions: - - mq4 - - mqh4 - - mql4 +name: Placeholder +scope: text +hidden: true contexts: main: - - match: "" - push: statement-and-expression - - statement-and-expression: - - include: Packages/Naomi/syntaxes/mql4/statement-and-expression.sublime-syntax + - match: . + pop: true diff --git a/syntaxes/naomi.php7.sublime-syntax b/syntaxes/naomi.php7.sublime-syntax index 7079d3c8..d1e6433f 100644 --- a/syntaxes/naomi.php7.sublime-syntax +++ b/syntaxes/naomi.php7.sublime-syntax @@ -13,46 +13,11 @@ # License for the specific language governing permissions and limitations under # the License. -name: PHP (Naomi) -scope: text.html - -file_extensions: - - php - - php7 +name: Placeholder +scope: text +hidden: true contexts: main: - # Normal open tag. - - match: \s*(<\?php) - captures: - 1: keyword.embedded.begin.php.php7 - set: embedded - # Short open tag. - - match: \s*(<\?=) - captures: - 1: keyword.embedded.begin.php.php7 - set: embedded-short - - embedded: - - meta_scope: >- - embedded.php.php7 - source.php.php7 - - include: content - - embedded-short: - - meta_scope: >- - embedded.short.php.php7 - source.php.php7 - - include: content - - content: - - match: \s*(\?>) - captures: - 1: keyword.embedded.end.php.php7 + - match: . pop: true - - match: "" - with_prototype: - - match: (?=\s*\?>) - pop: true - push: - - include: Packages/Naomi/syntaxes/php7/statement-and-expression.sublime-syntax diff --git a/syntaxes/naomi.scss3.sublime-syntax b/syntaxes/naomi.scss3.sublime-syntax index 6f6382a4..d1e6433f 100644 --- a/syntaxes/naomi.scss3.sublime-syntax +++ b/syntaxes/naomi.scss3.sublime-syntax @@ -13,13 +13,11 @@ # License for the specific language governing permissions and limitations under # the License. -name: SCSS (Naomi) -scope: source.scss - -file_extensions: - - scss +name: Placeholder +scope: text +hidden: true contexts: main: - - include: Packages/Naomi/syntaxes/scss3/selector.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax + - match: . + pop: true diff --git a/syntaxes/php7/array-access.sublime-syntax b/syntaxes/php7/array-access.sublime-syntax deleted file mode 100644 index 586b992f..00000000 --- a/syntaxes/php7/array-access.sublime-syntax +++ /dev/null @@ -1,41 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - (?<= [$_[:alnum:]] - | ] - | \) - ) - \s*(\[) - captures: - 1: punctuation.definition.array.access.begin.php.php7 - set: index - - index: - - match: \s*(]) - captures: - 1: punctuation.definition.array.access.end.php.php7 - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/php7/statement-and-expression.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/php7/class.sublime-syntax b/syntaxes/php7/class.sublime-syntax deleted file mode 100644 index d76a7e4b..00000000 --- a/syntaxes/php7/class.sublime-syntax +++ /dev/null @@ -1,128 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -scope: ... - -contexts: - main: - - match: | - (?xi) - (?=\s*\b - (?: - (?> private - | protected - | public - )\s+ - )? - (?: - (?> abstract - | final - )\s+ - )? - class\b - ) - set: [ - declaration, - keyword - ] - - keyword: - - match: (?i)\s*\b(class)(?!\\)\b - captures: - 1: >- - storage.type.php.php7 - keyword.declaration.class.php.php7 - pop: true - - include: Packages/Naomi/syntaxes/php7/modifier.no-pop.sublime-syntax - - comment: - - include: Packages/Naomi/syntaxes/php7/comment.no-pop.sublime-syntax - - declaration: - - include: comment - # Extends. - - match: (?i)\s*\b(extends)\b - captures: - 1: >- - storage.modifier.php.php7 - keyword.inherit.php.php7 - push: extend-target - # Implements. - - match: (?i)\s*\b(implements)\b - captures: - 1: >- - storage.modifier.php.php7 - keyword.implement.php.php7 - push: implement-targets - # Class’s name. - - match: (?xi)\s*\b({{commonIdentifier}})\b - captures: - 1: entity.name.class.php.php7 - # Body. - - match: \s*(\{) - scope: punctuation.definition.class.body.begin.php.php7 - set: body - - body: - - match: \s*(}) - captures: - 1: punctuation.definition.class.body.end.php.php7 - pop: true - - include: body-content - - body-content: - - match: "" - push: - - include: Packages/Naomi/syntaxes/php7/statement-and-expression.sublime-syntax - - match: "" - pop: true - - extend-target: - - include: comment - - match: (?=\s*\{) - pop: true - - match: (?i)(?=\s*\bimplements\b) - pop: true - - include: Packages/Naomi/syntaxes/php7/type.sublime-syntax - - implement-targets: - - include: comment - - match: (?=\s*\{) - pop: true - - match: (?=\s*\S) - push: [ - implement-target-definition, - implement-target - ] - - implement-target: - - include: comment - - include: Packages/Naomi/syntaxes/php7/type.sublime-syntax - - implement-target-definition: - - include: comment - - match: \s*(,) - captures: - 1: punctuation.definition.implement-list.separator.php.php7 - pop: true - - match: (?=\s*\S) - pop: true diff --git a/syntaxes/php7/closure.sublime-syntax b/syntaxes/php7/closure.sublime-syntax deleted file mode 100644 index 76b52c5f..00000000 --- a/syntaxes/php7/closure.sublime-syntax +++ /dev/null @@ -1,120 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -scope: ... - -contexts: - main: - - match: | - (?xi) - (?=\s*\b - (?: - (?> private - | protected - | public - )\s+ - )? - (?:static\s+)? - function\b - ) - set: [ - body, - optional-imported-variables-and-return-type-hint, - parameters, - keyword - ] - - keyword: - - match: (?i)\s*\b(function)(?!\\)\b - captures: - 1: >- - storage.type.php.php7 - keyword.declaration.function.php.php7 - pop: true - - include: Packages/Naomi/syntaxes/php7/modifier.no-pop.sublime-syntax - - parameters: - - include: Packages/Naomi/syntaxes/php7/function/parameters.sublime-syntax - - optional-imported-variables-and-return-type-hint: - - match: (?=\s*(?>:|\{)) - pop: true - - include: Packages/Naomi/syntaxes/php7/function/return-type-hint.sublime-syntax - - match: \s*(use) - captures: - 1: >- - storage.modifier.php.php7 - keyword.import.variable.php.php7 - set: imported-variables-begin - - imported-variables-begin: - - match: \s*(\() - captures: - 1: punctuation.definition.function.parameters.begin.php.php7 - set: imported-variables - - imported-variables: - - match: \s*(\)) - captures: - 1: punctuation.definition.function.parameters.end.php.php7 - pop: true - # Starts with a variable. - - match: (?=\s*\$) - push: [ - target-definition, - target-variable, - ] - # Starts with a reference operator. - - match: (?=\s*&) - push: [ - target-definition, - target-variable, - reference-operator - ] - - comment: - - include: Packages/Naomi/syntaxes/php7/comment.no-pop.sublime-syntax - - reference-operator: - - include: comment - - match: (?=\s*\$) - pop: true - - match: \s*(\&) - captures: - 1: keyword.operator.other.reference.php.php7 - pop: true - - target-definition: - - include: comment - - match: (?=\s*\)) - pop: true - - match: \s*(,) - captures: - 1: punctuation.definition.function.parameters.php.php7 - pop: true - - target-variable: - - include: comment - - include: Packages/Naomi/syntaxes/php7/variable.sublime-syntax - - body: - - include: Packages/Naomi/syntaxes/php7/function/body.sublime-syntax diff --git a/syntaxes/php7/comment.no-pop.sublime-syntax b/syntaxes/php7/comment.no-pop.sublime-syntax deleted file mode 100644 index 71b3b165..00000000 --- a/syntaxes/php7/comment.no-pop.sublime-syntax +++ /dev/null @@ -1,30 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x) - (?= - (?> \/\/ - | \/\* - | \# - ) - ) - push: - - include: Packages/Naomi/syntaxes/php7/comment.sublime-syntax diff --git a/syntaxes/php7/comment.sublime-syntax b/syntaxes/php7/comment.sublime-syntax deleted file mode 100644 index 9369a8ac..00000000 --- a/syntaxes/php7/comment.sublime-syntax +++ /dev/null @@ -1,22 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/php7/comment/documentation.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/comment/normal.sublime-syntax diff --git a/syntaxes/php7/comment/documentation.sublime-syntax b/syntaxes/php7/comment/documentation.sublime-syntax deleted file mode 100644 index 819390d0..00000000 --- a/syntaxes/php7/comment/documentation.sublime-syntax +++ /dev/null @@ -1,44 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(/\*\*) - captures: - 1: punctuation.definition.comment.documentation.begin.php.php7 - set: content - - content: - - meta_scope: comment.block.documentation.php.php7 - - match: \s*(\*/) - captures: - 1: punctuation.definition.comment.documentation.end.php.php7 - set: - # Used to fix the block comment indentation settings. - # https://forum.sublimetext.com/t/everything-you-n-ever-wanted-to-know-about-indentation-in-st3/26207/6 - - match: \s*$\n? - scope: meta.block-end.php.php7 - pop: true - - match: '' - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/php7/comment/phpdoc.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/comment/phpunit.sublime-syntax - - match: (?=\s*\*/) - pop: true diff --git a/syntaxes/php7/comment/normal.sublime-syntax b/syntaxes/php7/comment/normal.sublime-syntax deleted file mode 100644 index cd92baa8..00000000 --- a/syntaxes/php7/comment/normal.sublime-syntax +++ /dev/null @@ -1,57 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(//|#) - captures: - 1: punctuation.definition.comment.begin.php.php7 - set: line - - match: \s*(/\*) - captures: - 1: punctuation.definition.comment.begin.php.php7 - set: block - - line: - - meta_scope: comment.line.php.php7 - - include: email - - include: link - - match: \s*$ - pop: true - - block: - - meta_scope: comment.block.php.php7 - - include: email - - include: link - - match: \s*(\*/) - captures: - 1: punctuation.definition.comment.end.php.php7 - set: - # Used to fix the block comment indentation settings. - # https://forum.sublimetext.com/t/everything-you-n-ever-wanted-to-know-about-indentation-in-st3/26207/6 - - match: \s*$\n? - scope: meta.block-end.php.php7 - pop: true - - match: '' - pop: true - - link: - - include: Packages/Naomi/syntaxes/shared/link.sublime-syntax - - email: - - include: Packages/Naomi/syntaxes/shared/email.sublime-syntax diff --git a/syntaxes/php7/comment/phpdoc.sublime-syntax b/syntaxes/php7/comment/phpdoc.sublime-syntax deleted file mode 100644 index 7bfe8830..00000000 --- a/syntaxes/php7/comment/phpdoc.sublime-syntax +++ /dev/null @@ -1,154 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - match: | - (?xi)\s* - (\{@)(inheritDoc)(}) - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.definition.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - 3: >- - keyword.documentation.php.php7 - punctuation.definition.keyword.end.php.php7 - pop: true - - include: param - - include: return - - include: throws - - include: var - - include: other-tags - - variable: - - include: Packages/Naomi/syntaxes/php7/variable.sublime-syntax - - types: - # $this. - - match: \s*(\$this)\b - captures: - 1: >- - support.php.php7 - entity.name.variable.php.php7 - pop: true - # Variables. - - match: (?=\s*(?>\$|$)) - pop: true - # Actual type. - - match: (?=\s*\S) - set: [ - type-definition, - type - ] - - type: - - include: Packages/Naomi/syntaxes/php7/type.sublime-syntax - - type-definition: - - match: | - (?x) - (?=\s* - (?>\$|$) - ) - pop: true - - match: \s*(\|) - captures: - 1: keyword.operator.other.php.php7 - set: [ - type-definition, - type - ] - - param: - - match: \s*\B(@)(param)\b - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.definition.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - set: [ - variable, - types - ] - - return: - - match: \s*\B(@)(return)\b - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.definition.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - set: types - - throws: - - match: \s*\B(@)(throws)\b - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.definition.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - set: type - - var: - - match: \s*\B(@)(var)\b - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.definition.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - set: types - - other-tags: - - match: | - (?x)\s*\B(@) - ((?> api - | access - | author - | category - | copyright - | deprecated - | example - | filesource - | global - | ignore - | internal - | license - | link - | method - | package - | property(?>-(?>read|write))? - | see - | since - | source - | subpackage - | todo - | tutorial - | version - ))\b - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.definition.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - pop: true diff --git a/syntaxes/php7/comment/phpunit.sublime-syntax b/syntaxes/php7/comment/phpunit.sublime-syntax deleted file mode 100644 index ae08fcac..00000000 --- a/syntaxes/php7/comment/phpunit.sublime-syntax +++ /dev/null @@ -1,192 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - include: covers - - include: dataProvider - - include: depends - - include: expectedExceptionCode - - include: expectedExceptionMessage - - include: simple-tags - - include: boolean-tags - - include: string-tags - - include: type-tags - - scope-operator: - - match: \s*(::) - captures: - 1: keyword.operator.other.scope-resolution.php.php7 - pop: true - - constant: - - include: Packages/Naomi/syntaxes/php7/constant/normal.sublime-syntax - - number: - - include: Packages/Naomi/syntaxes/php7/literal/number.sublime-syntax - - type: - - include: Packages/Naomi/syntaxes/php7/type.sublime-syntax - - function: - - match: (?xi)\s*({{commonIdentifier}}) - captures: - 1: entity.name.function.php.php7 - pop: true - - covers: - - match: | - (?x)\s*\B(@)(covers)\b - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - push: [ - function, - scope-operator, - type - ] - - dataProvider: - - match: | - (?x)\s*\B(@)(dataProvider)\b - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - push: function - - depends: - - match: | - (?x)\s*\B(@)(depends)\b - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - push: function - - expectedExceptionCode: - - match: | - (?x)\s*\B(@)(expectedExceptionCode)\b - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - push: number - - expectedExceptionMessage: - - match: | - (?x)\s*\B(@)(expectedExceptionMessage)\b - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - push: - - match: (?=\s+[^ ]+\s*$) - set: [ - constant, - scope-operator, - type - ] - - match: .+$ - scope: string.php.php7 - pop: true - - simple-tags: - - match: | - (?x)\s*\B(@) - ((?> after(?:Class)? - | before(?:Class)? - | coversNothing - | codeCoverage (?>Ignore(?>Start|End)?) - | large - | medium - | requires - | run (?>TestsInSeparateProcesses|InSeparateProcess) - | small - | test(?:dox)? - | ticket - ))\b - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - - boolean-tags: - - match: | - (?x)\s*\B(@) - ((?> backup (?>Globals|StaticAttributes) - | backupGlobals - | preserveGlobalState - ))\b - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - push: - - match: | - (?x)\s* - ((?> enabled - | disabled - )) - captures: - 1: keyword.documentation.php.php7 - pop: true - - string-tags: - - match: | - (?x)\s*\B(@) - ((?> expectedExceptionMessageRegExp - | group - ))\b - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - push: - - match: .+$ - scope: string.php.php7 - pop: true - - type-tags: - - match: | - (?x)\s*\B(@) - ((?> coversDefaultClass - | expectedException - | uses - ))\b - captures: - 1: >- - keyword.documentation.php.php7 - punctuation.keyword.begin.php.php7 - 2: keyword.documentation.php.php7 - push: type - diff --git a/syntaxes/php7/constant.sublime-syntax b/syntaxes/php7/constant.sublime-syntax deleted file mode 100644 index 5457c634..00000000 --- a/syntaxes/php7/constant.sublime-syntax +++ /dev/null @@ -1,30 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/php7/namespace/path.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/constant/support/core.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/constant/support/error.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/constant/support/array.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/constant/support/string.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/constant/support/magic.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/constant/support/math.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/constant/support/math-gmp.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/constant/support/output.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/constant/normal.sublime-syntax diff --git a/syntaxes/php7/constant/normal.sublime-syntax b/syntaxes/php7/constant/normal.sublime-syntax deleted file mode 100644 index c0e54042..00000000 --- a/syntaxes/php7/constant/normal.sublime-syntax +++ /dev/null @@ -1,43 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - constantIdentifier: | - [_[:upper:]] - [_[:upper:][:digit:]]+ - -contexts: - main: - # Multiple characters. - - match: | - (?x)\s* - ((?>\\|\b)) - ({{constantIdentifier}})\b - captures: - 1: punctuation.definition.constant.php.php7 - 2: entity.name.constant.php.php7 - pop: true - # Single character. - - match: | - (?x)\s* - ((?>\\|\b)) - ([[:upper:]])\b - captures: - 1: punctuation.definition.constant.php.php7 - 2: entity.name.constant.php.php7 - pop: true diff --git a/syntaxes/php7/constant/support/array.sublime-syntax b/syntaxes/php7/constant/support/array.sublime-syntax deleted file mode 100644 index 4556f4be..00000000 --- a/syntaxes/php7/constant/support/array.sublime-syntax +++ /dev/null @@ -1,49 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> CASE_(?>UPPER|LOWER) - | SORT_ - (?> ASC - | DESC - | REGULAR - | NUMERIC - | STRING - | LOCALE_STRING - | NATURAL - | FLAG_CASE - ) - | ARRAY_FILTER_USE_(?>KEY|BOTH) - | COUNT_(?>NORMAL|RECURSIVE) - | EXTR_ - (?> OVERWRITE - | SKIP - | PREFIX_ - (?>SAME|ALL|INVALID|IF_EXISTS) - | IF_EXISTS - | REFS - ) - ))\b - captures: - 1: >- - support.php.php7 - entity.name.constant.php.php7 - pop: true diff --git a/syntaxes/php7/constant/support/core.sublime-syntax b/syntaxes/php7/constant/support/core.sublime-syntax deleted file mode 100644 index 5db200cd..00000000 --- a/syntaxes/php7/constant/support/core.sublime-syntax +++ /dev/null @@ -1,73 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: normal - - include: case-insenstive - - normal: - - match: | - (?x)\s*\b - ((?> - PHP_ - (?> VERSION(?:_ID)? - | MAJOR_VERSION - | MINOR_VERSION - | RELEASE_VERSION - | EXTRA_VERSION - | ZTS - | DEBUG - | MAXPATHLEN - | OS - | SAPI - | EOL - | INT_(?>MAX|MIN|SIZE) - | EXTENSION_DIR - | PREFIX - | BINDIR - | BINARY - | MANDIR - | LIBDIR - | DATADIR - | SYSCONFDIR - | LOCALSTATEDIR - | CONFIG_FILE_(?>PATH|SCAN_DIR) - | SHLIB_SUFFIX - ) - | PEAR_(?>INSTALL_DIR|EXTENSION_DIR) - | DEFAULT_INCLUDE_PATH - ))\b - captures: - 1: >- - support.php.php7 - entity.name.constant.php.php7 - pop: true - - case-insenstive: - - match: | - (?xi)\s*\b - ((?> TRUE - | FALSE - | NULL - ))\b - captures: - 1: >- - support.php.php7 - entity.name.constant.php.php7 - pop: true diff --git a/syntaxes/php7/constant/support/error.sublime-syntax b/syntaxes/php7/constant/support/error.sublime-syntax deleted file mode 100644 index ccd23dc6..00000000 --- a/syntaxes/php7/constant/support/error.sublime-syntax +++ /dev/null @@ -1,42 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ( - E_ - (?> ERROR - | WARNING - | PARSE - | NOTICE - | CORE_(?>ERROR|WARNING) - | COMPILE_(?>ERROR|WARNING) - | USER_(?>ERROR|WARNING|NOTICE) - | DEPRECATED - | USER_DEPRECATED - | ALL - | STRICT - ) - )\b - captures: - 1: >- - support.php.php7 - entity.name.constant.php.php7 - pop: true diff --git a/syntaxes/php7/constant/support/magic.sublime-syntax b/syntaxes/php7/constant/support/magic.sublime-syntax deleted file mode 100644 index 1b861db0..00000000 --- a/syntaxes/php7/constant/support/magic.sublime-syntax +++ /dev/null @@ -1,40 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ( - __ - (?> LINE - | FILE - | DIR - | FUNCTION - | CLASS - | TRAIT - | METHOD - | NAMESPACE - )__ - )\b - captures: - 1: >- - support.php.php7 - preprocessor.php.php7 - entity.name.constant.php.php7 - pop: true diff --git a/syntaxes/php7/constant/support/math-gmp.sublime-syntax b/syntaxes/php7/constant/support/math-gmp.sublime-syntax deleted file mode 100644 index a3b8c05c..00000000 --- a/syntaxes/php7/constant/support/math-gmp.sublime-syntax +++ /dev/null @@ -1,38 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ( - GMP_ - (?> ROUND_(?>ZERO|PLUSINF|MINUSINF) - | MSW_FIRST - | LSW_FIRST - | LITTLE_ENDIAN - | BIG_ENDIAN - | NATIVE_ENDIAN - | VERSION - ) - )\b - captures: - 1: >- - support.php.php7 - entity.name.constant.php.php7 - pop: true diff --git a/syntaxes/php7/constant/support/math.sublime-syntax b/syntaxes/php7/constant/support/math.sublime-syntax deleted file mode 100644 index e2b164bf..00000000 --- a/syntaxes/php7/constant/support/math.sublime-syntax +++ /dev/null @@ -1,41 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> INF - | M_ - (?> 1_PI - | 2_(?>PI|SQRTPI) - | EULER(?>2|10|PI)? - | E - | LN(?>2|10|PI) - | LOG(?>2E|10E) - | PI(?>_2|_4)? - | SQRT(?>1_2|2|3|PI) - ) - | NAN - | PHP_ROUND_HALF_(?>DOWN|EVEN|ODD|UP) - ))\b - captures: - 1: >- - support.php.php7 - entity.name.constant.php.php7 - pop: true diff --git a/syntaxes/php7/constant/support/output.sublime-syntax b/syntaxes/php7/constant/support/output.sublime-syntax deleted file mode 100644 index 2b5b8d88..00000000 --- a/syntaxes/php7/constant/support/output.sublime-syntax +++ /dev/null @@ -1,40 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ( - PHP_OUTPUT_HANDLER_ - (?> START - | WRITE - | FLUSH(?:ABLE)? - | CLEAN(?:ABLE)? - | FINAL - | CONT - | END - | REMOVABLE - | STDFLAGS - ) - )\b - captures: - 1: >- - support.php.php7 - entity.name.constant.php.php7 - pop: true diff --git a/syntaxes/php7/constant/support/string.sublime-syntax b/syntaxes/php7/constant/support/string.sublime-syntax deleted file mode 100644 index 61e8c272..00000000 --- a/syntaxes/php7/constant/support/string.sublime-syntax +++ /dev/null @@ -1,53 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s*\b - ((?> CRYPT_(?>SALT_LENGTH|STD_DES|EXT_DES|MD5|BLOWFISH) - | HTML_(?>SPECIALCHARS|ENTITIES) - | ENT_ - (?> COMPAT - | QUOTES - | NOQUOTES - | IGNORE - | SUBSTITUTE - | DISALLOWED - | HTML401 - | XML1 - | XHTML - | HTML5 - ) - | CHAR_MAX - | LC_ - (?> CTYPE - | NUMERIC - | TIME - | COLLATE - | MONETARY - | ALL - | MESSAGES - ) - | STR_PAD_(?>LEFT|RIGHT|BOTH) - ))\b - captures: - 1: >- - support.php.php7 - entity.name.constant.php.php7 - pop: true diff --git a/syntaxes/php7/declare.sublime-syntax b/syntaxes/php7/declare.sublime-syntax deleted file mode 100644 index 3c30e86c..00000000 --- a/syntaxes/php7/declare.sublime-syntax +++ /dev/null @@ -1,95 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -scope: ... - -contexts: - main: - - match: (?i)\s*\b(declare)\b - captures: - 1: keyword.declare.php.php7 - push: declaration - - declaration: - - match: \s*(\() - captures: - 1: punctuation.definition.declare.parameters.begin.php.php7 - push: parameters - - match: \s*(\)) - captures: - 1: punctuation.definition.declare.parameters.end.php.php7 - set: body - - parameters: - - match: (?=\s*\)) - pop: true - - match: (?=\s*\S) - push: [ - value, - operator, - directive - ] - - directive: - - match: (?=\s*=) - pop: true - - match: | - (?x)\s*\b - ((?> ticks - | encoding - | strict - ))\b - captures: - 1: keyword.directive.php.php7 - pop: true - - operator: - - match: \s*(=) - captures: - 1: keyword.operator.other.assignment.php.php7 - pop: true - - value: - - include: Packages/Naomi/syntaxes/php7/literal.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/constant.sublime-syntax - - body: - - match: \s*(;) - captures: - 1: punctuation.definition.declare.body.begin.php.php7 - pop: true - - match: \s*(\{) - captures: - 1: punctuation.definition.declare.body.begin.php.php7 - set: bracketed-body - - bracketed-body: - - match: \s*(}) - captures: - 1: punctuation.definition.declare.body.end.php.php7 - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/php7/statement-and-expression.sublime-syntax - - match: "" - pop: true - diff --git a/syntaxes/php7/function-call.sublime-syntax b/syntaxes/php7/function-call.sublime-syntax deleted file mode 100644 index 0deb91b1..00000000 --- a/syntaxes/php7/function-call.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/php7/function-call/support/array.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call/support/class-object.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call/support/core.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call/support/directories.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call/support/error.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call/support/filesystem.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call/support/math.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call/support/math-gmp.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call/support/magic.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call/support/mb_string.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call/support/output.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call/support/spl.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call/support/string.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call/support/variable.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call/normal.sublime-syntax diff --git a/syntaxes/php7/function-call/arguments.sublime-syntax b/syntaxes/php7/function-call/arguments.sublime-syntax deleted file mode 100644 index cb02eb4e..00000000 --- a/syntaxes/php7/function-call/arguments.sublime-syntax +++ /dev/null @@ -1,37 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(\() - captures: - 1: punctuation.definition.function.arguments.begin.php.php7 - set: arguments - - arguments: - - match: \s*(\)) - captures: - 1: punctuation.definition.function.arguments.end.php.php7 - pop: true - - match: \s*(,) - scope: punctuation.definition.function.arguments.php.php7 - - match: "" - push: - - include: Packages/Naomi/syntaxes/php7/statement-and-expression.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/php7/function-call/normal.sublime-syntax b/syntaxes/php7/function-call/normal.sublime-syntax deleted file mode 100644 index 55e241fa..00000000 --- a/syntaxes/php7/function-call/normal.sublime-syntax +++ /dev/null @@ -1,54 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -scope: ... - -contexts: - main: - # Closure. - - match: | - (?xi) - (?= - \s*\B(\$)({{commonIdentifier}})\b - \s*\( - ) - set: [ - arguments, - variable - ] - # Actual function. - - match: | - (?xi)\s* - ((?>\\|\b)) - ( - {{commonIdentifier}} - )(?=\s*\() - captures: - 1: punctuation.definition.function.php.php7 - 2: entity.name.function.php.php7 - set: arguments - - variable: - - include: Packages/Naomi/syntaxes/php7/variable.sublime-syntax - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function-call/support/array.sublime-syntax b/syntaxes/php7/function-call/support/array.sublime-syntax deleted file mode 100644 index a6224def..00000000 --- a/syntaxes/php7/function-call/support/array.sublime-syntax +++ /dev/null @@ -1,105 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> array - (?:_ - (?> change_key_case - | chunk - | column - | combine - | count_values - | diff - (?:_(?>assoc|key|uassoc|ukey))? - | fill(?:_keys)? - | filter - | flip - | intersect - (?:_(?>assoc|key|uassoc|ukey))? - | key_exists - | keys - | map - | merge(?:_recursive)? - | multisort - | pad - | pop - | product - | push - | rand - | reduce - | replace(?:_recursive)? - | reverse - | search - | shift - | slice - | splice - | sum - | udiff - (?:_(?>assoc|uassoc))? - | uintersect - (?:_(?>assoc|uassoc))? - | unique - | unshift - | values - | walk(?:_recursive)? - ) - ) - | arsort - | asort - | compact - | count - | current - | each - | end - | extract - | in_array - | key(?:_exists)? - | krsort - | ksort - | list - | natcasesort - | natsort - | next - | pos - | prev - | range - | reset - | rsort - | shuffle - | sizeof - | sort - | uasort - | uksort - | usort - ) - ) - (?=\s*\() - captures: - 1: punctuation.definition.support.php.php7 - 2: >- - support.php.php7 - entity.name.function.php.php7 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function-call/support/class-object.sublime-syntax b/syntaxes/php7/function-call/support/class-object.sublime-syntax deleted file mode 100644 index c5a96598..00000000 --- a/syntaxes/php7/function-call/support/class-object.sublime-syntax +++ /dev/null @@ -1,54 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> - class_ - (?>alias|exists) - | get_ - (?> called_class - | class - (?:_(?>methods|vars))? - | declared_ - (?>classes|interfaces|traits) - | object_vars - | parent_class - ) - | interface_exists - | is_ - (?>a|subclass_of) - | method_exists - | property_exists - | trait_exists - ) - ) - (?=\s*\() - captures: - 1: punctuation.definition.support.php.php7 - 2: >- - support.php.php7 - entity.name.function.php.php7 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function-call/support/core.sublime-syntax b/syntaxes/php7/function-call/support/core.sublime-syntax deleted file mode 100644 index 6aa3546f..00000000 --- a/syntaxes/php7/function-call/support/core.sublime-syntax +++ /dev/null @@ -1,96 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> assert(?:_options)? - | cli_ - (?>get_process_title|set_process_title) - | dl - | define - | extension_loaded - | gc_ - (?> collect_cycles - | disable - | enabled? - | mem_caches - ) - | get - (?> env - | lastmod - | mygid - | myinode - | mypid - | myuid - | opt - | rusage - | _ - (?> cfg_var - | current_user - | defined_constants - | extension_funcs - | include - (?>_path|d_files) - | loaded_extensions - | magic_quotes_ - (?>gpc|runtime) - | required_files - | resources - ) - ) - | ini_ - (?> alter - | get(?:_all)? - | restore - | set - ) - | main - | memory_get_ - (?>peak_usage|usage) - | php - (?> _ini_ - (?>loaded_file|scanned_files) - | _sapi_name - | _uname - ) - | php - (?>credits|info|version) - | putenv - | restore_include_path - | set_ - (?>include_path|time_limit) - | sys_get_temp_dir - | version_compare - | zend_ - (?>thread_id|version) - ) - ) - (?=\s*\() - captures: - 1: punctuation.definition.support.php.php7 - 2: >- - support.php.php7 - entity.name.function.php.php7 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function-call/support/directories.sublime-syntax b/syntaxes/php7/function-call/support/directories.sublime-syntax deleted file mode 100644 index f8943a61..00000000 --- a/syntaxes/php7/function-call/support/directories.sublime-syntax +++ /dev/null @@ -1,45 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> ch - (?>dir|root) - | closedir - | dir - | getcwd - | opendir - | re - (?>addir|winddir) - | scandir - ) - ) - (?=\s*\() - captures: - 1: punctuation.definition.support.php.php7 - 2: >- - support.php.php7 - entity.name.function.php.php7 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function-call/support/error.sublime-syntax b/syntaxes/php7/function-call/support/error.sublime-syntax deleted file mode 100644 index 52d03cd7..00000000 --- a/syntaxes/php7/function-call/support/error.sublime-syntax +++ /dev/null @@ -1,46 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> debug_ - (?>backtrace|print_backtrace) - | error_ - (?>clear_last|get_last|log|reporting) - | restore_ - (?>error_handler|exception_handler) - | set_ - (?>error_handler|exception_handler) - | trigger_error - | user_error - ) - ) - (?=\s*\() - captures: - 1: punctuation.definition.support.php.php7 - 2: >- - support.php.php7 - entity.name.function.php.php7 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function-call/support/filesystem.sublime-syntax b/syntaxes/php7/function-call/support/filesystem.sublime-syntax deleted file mode 100644 index 0d624169..00000000 --- a/syntaxes/php7/function-call/support/filesystem.sublime-syntax +++ /dev/null @@ -1,119 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> basename - | ch(?>grp|mod|own) - | clearstatcache - | copy - | delete - | dirname - | disk - (?>_ - (?>free_space|total_space) - | freespace - ) - | f - (?> close - | eof - | flush - | getc(?:sv)? - | getss? - | ile - (?>_ - (?>exists|get_contents|put_contents) - | atime - | ctime - | group - | inode - | mtime - | owner - | perms - | size - | type - )? - | lock - | nmatch - | open - | passthru - | putcsv - | puts - | read - | scanf - | seek - | stat - | tell - | truncate - | write - ) - | glob - | is_ - (?> dir - | executable - | file - | link - | readable - | uploaded_file - | writable - | writeable - ) - | lchgrp - | lchown - | link(?:info)? - | lstat - | mkdir - | move_uploaded_file - | parse_ini_ - (?>file|string) - | pathinfo - | pclose - | popen - | read - (?>file|link) - | realpath - (?>_cache_ - (?>get|size) - )? - | rename - | rewind - | rmdir - | set_file_buffer - | stat - | symlink - | tempnam - | tmpfile - | touch - | umask - | unlink - ) - ) - (?=\s*\() - captures: - 1: punctuation.definition.support.php.php7 - 2: >- - support.php.php7 - entity.name.function.php.php7 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function-call/support/magic.sublime-syntax b/syntaxes/php7/function-call/support/magic.sublime-syntax deleted file mode 100644 index 128b1dd5..00000000 --- a/syntaxes/php7/function-call/support/magic.sublime-syntax +++ /dev/null @@ -1,49 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - (__ - (?> call(?:Static)? - | clone - | construct - | debugInfo - | destruct - | get - | invoke - | isset - | set(?:_state)? - | sleep - | toString - | unset - | wakeup - ) - ) - (?=\s*\() - captures: - 1: punctuation.definition.support.php.php7 - 2: >- - support.php.php7 - entity.name.function.php.php7 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function-call/support/math-gmp.sublime-syntax b/syntaxes/php7/function-call/support/math-gmp.sublime-syntax deleted file mode 100644 index 922e829d..00000000 --- a/syntaxes/php7/function-call/support/math-gmp.sublime-syntax +++ /dev/null @@ -1,78 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - gmp_ - (?> abs - | add - | and - | clrbit - | cmp - | com - | div - (?> _(?>r|qr?) - | exact - )? - | export - | fact - | gcd(?:ext)? - | hamdist - | import - | init - | intval - | invert - | jacobi - | legendre - | mod - | mul - | neg - | nextprime - | or - | perfect_square - | popcount - | powm? - | prob_prime - | random - (?:_(?>bits|range|seed))? - | root(?:rem)? - | scan - (?>0|1) - | setbit - | sign - | sqrt(?:rem)? - | strval - | sub - | testbit - | xor - ) - ) - (?=\s*\() - captures: - 1: punctuation.definition.support.php.php7 - 2: >- - support.php.php7 - entity.name.function.php.php7 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function-call/support/math.sublime-syntax b/syntaxes/php7/function-call/support/math.sublime-syntax deleted file mode 100644 index a7dc4e4c..00000000 --- a/syntaxes/php7/function-call/support/math.sublime-syntax +++ /dev/null @@ -1,72 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> abs - | acosh? - | asinh? - | atan[2h]? - | base_convert - | bindec - | ceil - | cosh? - | decbin - | dechex - | decoct - | deg2rad - | exp(?:m1)? - | floor - | fmod - | getrandmax - | hexdec - | hypot - | intdiv - | is_ - (?:finite|infinite|nan) - | lcg_value - | log(?:10|1p)? - | max - | min - | mt_ - (?:getrandmax|rand|srand) - | octdec - | pi - | pow - | rad2deg - | rand - | round - | sinh? - | sqrt - | srand - | tanh? - ) - )\b - captures: - 1: punctuation.definition.support.php.php7 - 2: >- - support.php.php7 - entity.name.function.php.php7 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function-call/support/mb_string.sublime-syntax b/syntaxes/php7/function-call/support/mb_string.sublime-syntax deleted file mode 100644 index cb0c7c77..00000000 --- a/syntaxes/php7/function-call/support/mb_string.sublime-syntax +++ /dev/null @@ -1,97 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - mb_ - (?> check_encoding - | convert_ - (?> case - | encoding - | kana - | variables - ) - | decode_(?>mimeheader|numericentity) - | detect_(?>encoding|order) - | encode_(?>mimeheader|numericentity) - | encoding_aliases - | ereg - (?> i(?:_replace)? - | _ - (?> match - | lala - | replace(?:_callback)? - | search - (?:_ - (?> getpos - | getregs - | init - | pos - | regs - | setpos - ) - )? - ) - )? - | get_info - | http_(?:input|output) - | internal_encoding - | language - | list_encodings - | output_handler - | parse_str - | preferred_mime_name - | regex_(?>encoding|set_options) - | send_mail - | split - | str - (?> cut - | i - (?> mwidth - | pos - | str - ) - | len - | pos - | r - (?> chr - | i(?>chr|pos) - | pos - ) - | str - | to(?>lower|upper) - | width - ) - | substitute_character - | substr(?:_count)? - ) - ) - (?=\s*\() - captures: - 1: punctuation.definition.support.php.php7 - 2: >- - support.php.php7 - entity.name.function.php.php7 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function-call/support/output.sublime-syntax b/syntaxes/php7/function-call/support/output.sublime-syntax deleted file mode 100644 index 32ac53d8..00000000 --- a/syntaxes/php7/function-call/support/output.sublime-syntax +++ /dev/null @@ -1,54 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> flush - | output_ - (?>add_rewrite_var|reset_rewrite_vars) - | ob_ - (?> clean - | end_clean - | end_flush - | flush - | get_clean - | get_contents - | get_flush - | get_length - | get_level - | get_status - | gzhandler - | implicit_flush - | list_handlers - | start - ) - ) - )\b - captures: - 1: punctuation.definition.support.php.php7 - 2: >- - support.php.php7 - entity.name.function.php.php7 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function-call/support/spl.sublime-syntax b/syntaxes/php7/function-call/support/spl.sublime-syntax deleted file mode 100644 index b6e17699..00000000 --- a/syntaxes/php7/function-call/support/spl.sublime-syntax +++ /dev/null @@ -1,50 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> class_ - (?>implements|parents|uses) - | iterator_ - (?>apply|count|to_array) - | spl_autoload - (?:_ - (?> call - | extensions - | functions - | register - | unregister - ) - )? - | spl_(?>classes|object_hash) - ) - ) - (?=\s*\() - captures: - 1: punctuation.definition.support.php.php7 - 2: >- - support.php.php7 - entity.name.function.php.php7 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function-call/support/string.sublime-syntax b/syntaxes/php7/function-call/support/string.sublime-syntax deleted file mode 100644 index 70cf370b..00000000 --- a/syntaxes/php7/function-call/support/string.sublime-syntax +++ /dev/null @@ -1,134 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> add - (?>cslashes|slashes) - | bin2hex - | chop - | chr - | chunk_split - | convert_ - (?> cyr_string - | uu(?>decode|encode) - ) - | count_chars - | crc32 - | crypt - | explode - | fprintf - | get_html_translation_table - | hebrevc? - | hex2bin - | html_entity_decode - | htmlentities - | htmlspecialchars(?:_decode)? - | implode - | join - | lcfirst - | levenshtein - | localeconv - | ltrim - | md5_file - | md5 - | metaphone - | money_format - | nl_langinfo - | nl2br - | number_format - | ord - | parse_str - | printf? - | quoted_printable_ - (?>encode|decode) - | quotemeta - | rtrim - | setlocale - | sha1_file - | sha1 - | similar_text - | soundex - | sprintf - | sscanf - | str - (?> _ - (?> getcsv - | ireplace - | pad - | repeat - | replace - | rot13 - | shuffle - | split - | word_count - ) - | casecmp - | chr - | cmp - | coll - | cspn - | ip_tags - | ipcslashes - | ipos - | ipslashes - | istr - | len - | natcasecmp - | natcmp - | ncasecmp - | ncmp - | pbrk - | pos - | rchr - | rev - | ripos - | rpos - | spn - | str - | tok - | tolower - | toupper - | tr - ) - | substr - (?:_ - (?>compare|count|replace) - )? - | trim - | uc - (?>first|words) - | vfprintf - | vprintf - | vsprintf - | wordwrap - ) - )\b - captures: - 1: punctuation.definition.support.php.php7 - 2: >- - support.php.php7 - entity.name.function.php.php7 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function-call/support/variable.sublime-syntax b/syntaxes/php7/function-call/support/variable.sublime-syntax deleted file mode 100644 index c128bb76..00000000 --- a/syntaxes/php7/function-call/support/variable.sublime-syntax +++ /dev/null @@ -1,70 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> boolval - | debug_zval_dump - | doubleval - | empty - | floatval - | get_defined_vars - | get_resource_type - | gettype - | import_request_variables - | intval - | is_ - (?> array - | bool - | callable - | double - | float - | int(?:eger)? - | long - | null - | numeric - | object - | real - | resource - | scalar - | string - ) - | isset - | print_r - | serialize - | settype - | strval - | unserialize - | unset - | var_ - (?>dump|export) - ) - )\b - captures: - 1: punctuation.definition.support.php.php7 - 2: >- - support.php.php7 - entity.name.function.php.php7 - set: arguments - - arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax diff --git a/syntaxes/php7/function.sublime-syntax b/syntaxes/php7/function.sublime-syntax deleted file mode 100644 index 5501cb00..00000000 --- a/syntaxes/php7/function.sublime-syntax +++ /dev/null @@ -1,73 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -scope: ... - -contexts: - main: - - match: | - (?xi) - (?=\s*\b - (?:abstract\s+)? - (?: - (?> private - | protected - | public - )\s+ - )? - (?: - (?> abstract - | static - )\s+ - )? - function\s+{{commonIdentifier}} - ) - set: [ - body, - optional-return-type-hint, - parameters, - name, - keyword - ] - - keyword: - - match: (?i)\s*\b(function)(?!\\)\b - captures: - 1: >- - storage.type.php.php7 - keyword.declaration.function.php.php7 - pop: true - - include: Packages/Naomi/syntaxes/php7/modifier.no-pop.sublime-syntax - - name: - - include: Packages/Naomi/syntaxes/php7/function/name.sublime-syntax - - parameters: - - include: Packages/Naomi/syntaxes/php7/function/parameters.sublime-syntax - - optional-return-type-hint: - - match: (?=;|{) - pop: true - - include: Packages/Naomi/syntaxes/php7/function/return-type-hint.sublime-syntax - - body: - - include: Packages/Naomi/syntaxes/php7/function/body.sublime-syntax diff --git a/syntaxes/php7/function/body.sublime-syntax b/syntaxes/php7/function/body.sublime-syntax deleted file mode 100644 index 4420906d..00000000 --- a/syntaxes/php7/function/body.sublime-syntax +++ /dev/null @@ -1,41 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # Function without body. - - match: \s*(;) - captures: - 1: punctuation.definition.function.declaration.end.php.php7 - pop: true - # Normal body. - - match: \s*(\{) - captures: - 1: punctuation.definition.function.body.begin.php.php7 - set: body-content - - body-content: - - match: \s*(}) - captures: - 1: punctuation.definition.function.body.end.php.php7 - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/php7/statement-and-expression.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/php7/function/name.sublime-syntax b/syntaxes/php7/function/name.sublime-syntax deleted file mode 100644 index 78f465eb..00000000 --- a/syntaxes/php7/function/name.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - include: Packages/Naomi/syntaxes/php7/namespace/path.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function/support/magic.sublime-syntax - - match: | - (?xi)\s* - ((?>\\|\b)) - ({{commonIdentifier}})\b - captures: - 1: punctuation.definition.function.php.php7 - 2: entity.name.function.php.php7 - pop: true diff --git a/syntaxes/php7/function/parameter.sublime-syntax b/syntaxes/php7/function/parameter.sublime-syntax deleted file mode 100644 index 3bbfde39..00000000 --- a/syntaxes/php7/function/parameter.sublime-syntax +++ /dev/null @@ -1,36 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - match: | - (?xi)\s* - \B(\$)({{commonIdentifier}})\b - captures: - 1: >- - function.parameter.php.php7 - punctuation.definition.variable.begin.php.php7 - 2: >- - function.parameter.php.php7 - entity.name.variable.php.php7 - pop: true diff --git a/syntaxes/php7/function/parameters.sublime-syntax b/syntaxes/php7/function/parameters.sublime-syntax deleted file mode 100644 index f502c273..00000000 --- a/syntaxes/php7/function/parameters.sublime-syntax +++ /dev/null @@ -1,139 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - match: \s*(\() - captures: - 1: punctuation.definition.function.parameters.begin.php.php7 - set: parameters - - comment: - - include: Packages/Naomi/syntaxes/php7/comment.no-pop.sublime-syntax - - parameters: - - include: comment - - match: \s*(\)) - captures: - 1: punctuation.definition.function.parameters.end.php.php7 - pop: true - # Starts with a variable. - - match: (?=\s*\$) - push: [ - param-definition, - param-optional-default-value, - param-variable - ] - # Starts with a variadic or reference operator. - - match: (?=\s*(?>\.\.\.|&)) - push: [ - param-definition, - param-optional-default-value, - param-variable, - variadic-or-reference-operator - ] - # Starts with a type hint. - - match: (?=\s*\S) - push: [ - param-definition, - param-optional-default-value, - param-variable, - variadic-or-reference-operator, - variable-type - ] - - variable-type: - - include: comment - - include: Packages/Naomi/syntaxes/php7/type.sublime-syntax - - variadic-or-reference-operator: - - include: comment - - match: (?=\s*\$) - pop: true - - match: \s*(\&) - captures: - 1: keyword.operator.other.reference.php.php7 - pop: true - - match: \s*(\.\.\.) - captures: - 1: keyword.operator.other.rest.php.php7 - pop: true - - reference-operator: - - include: comment - - match: (?=\s*\$) - pop: true - - match: \s*(\&) - captures: - 1: keyword.operator.other.reference.php.php7 - pop: true - - param-variable: - - include: comment - - include: Packages/Naomi/syntaxes/php7/function/parameter.sublime-syntax - - param-optional-default-value: - - include: comment - - match: (?=\s*(?>,|\))) - pop: true - - match: \s*(=) - captures: - 1: keyword.operator.other.assignment.php.php7 - set: param-default-value - - param-default-value: - - include: comment - - match: (?=\s*(?>,|\))) - pop: true - - include: Packages/Naomi/syntaxes/php7/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/literal.sublime-syntax - # Constant inside class. - - match: | - (?xi) - (?=\s*{{commonIdentifier}}) - push: [ - default-value-constant, - default-value-scope-operator, - default-value-type - ] - - param-definition: - - include: comment - - match: (?=\s*\)) - pop: true - - match: \s*(,) - captures: - 1: punctuation.definition.function.parameters.php.php7 - pop: true - - default-value-type: - - include: Packages/Naomi/syntaxes/php7/type.sublime-syntax - - default-value-scope-operator: - - match: "::" - captures: - 1: keyword.operator.other.scope-resolution.php.php7 - pop: true - - default-value-constant: - - include: Packages/Naomi/syntaxes/php7/constant.sublime-syntax diff --git a/syntaxes/php7/function/return-type-hint.sublime-syntax b/syntaxes/php7/function/return-type-hint.sublime-syntax deleted file mode 100644 index 77c29720..00000000 --- a/syntaxes/php7/function/return-type-hint.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(:) - captures: - 1: punctuation.definition.function.php.php7 - set: return-type - - return-type: - - include: Packages/Naomi/syntaxes/php7/comment.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/type.sublime-syntax diff --git a/syntaxes/php7/function/support/magic.sublime-syntax b/syntaxes/php7/function/support/magic.sublime-syntax deleted file mode 100644 index 0b14c8e1..00000000 --- a/syntaxes/php7/function/support/magic.sublime-syntax +++ /dev/null @@ -1,43 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - (__ - (?> call(?:Static)? - | clone - | construct - | debugInfo - | destruct - | get - | invoke - | isset - | set(?:_state)? - | sleep - | toString - | unset - | wakeup - ) - ) - captures: - 1: >- - support.php.php7 - entity.name.function.php.php7 - pop: true diff --git a/syntaxes/php7/goto.sublime-syntax b/syntaxes/php7/goto.sublime-syntax deleted file mode 100644 index 9afd2e6a..00000000 --- a/syntaxes/php7/goto.sublime-syntax +++ /dev/null @@ -1,37 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: \s*(goto) - captures: - 1: keyword.control.php.php7 - set: label - - label: - - match: | - (?xi) - ({{commonIdentifier}}) - captures: - 1: entity.name.label.php.php7 - pop: true diff --git a/syntaxes/php7/interface.sublime-syntax b/syntaxes/php7/interface.sublime-syntax deleted file mode 100644 index 0dc69de4..00000000 --- a/syntaxes/php7/interface.sublime-syntax +++ /dev/null @@ -1,91 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -scope: ... - -contexts: - main: - - match: (?i)\s*\b(interface)(?!\\)\b - captures: - 1: >- - storage.type.php.php7 - keyword.declaration.interface.php.php7 - set: declaration - - comment: - - include: Packages/Naomi/syntaxes/php7/comment.no-pop.sublime-syntax - - declaration: - - include: comment - # Extends. - - match: (?i)\s*\b(extends)\b - captures: - 1: >- - storage.modifier.php.php7 - keyword.inherit.php.php7 - push: extend-targets - # interface’s name. - - match: (?xi)\s*\b({{commonIdentifier}})\b - captures: - 1: entity.name.interface.php.php7 - # Body. - - match: \s*(\{) - captures: - 1: punctuation.definition.interface.body.begin.php.php7 - set: body - - body: - - match: \s*(}) - captures: - 1: punctuation.definition.interface.body.end.php.php7 - pop: true - - include: body-content - - body-content: - - match: "" - push: - - include: Packages/Naomi/syntaxes/php7/statement-and-expression.sublime-syntax - - match: "" - pop: true - - extend-targets: - - include: comment - - match: (?=\s*\{) - pop: true - - match: (?=\s*\S) - push: [ - extend-target-definition, - extend-target - ] - - extend-target: - - include: comment - - include: Packages/Naomi/syntaxes/php7/type.sublime-syntax - - extend-target-definition: - - include: comment - - match: \s*(,) - captures: - 1: punctuation.definition.extend.php.php7 - pop: true - - match: (?=\s*\S) - pop: true diff --git a/syntaxes/php7/literal.sublime-syntax b/syntaxes/php7/literal.sublime-syntax deleted file mode 100644 index fe285637..00000000 --- a/syntaxes/php7/literal.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/php7/literal/array.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/literal/string/nowdoc.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/literal/string/heredoc.sublime-syntax diff --git a/syntaxes/php7/literal/array.sublime-syntax b/syntaxes/php7/literal/array.sublime-syntax deleted file mode 100644 index f2afb407..00000000 --- a/syntaxes/php7/literal/array.sublime-syntax +++ /dev/null @@ -1,76 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(\[) - captures: - 1: punctuation.definition.array.begin.php.php7 - set: short-array-items - - match: | - (?x) - \s*(array) - \s*(\() - captures: - 1: entity.name.type.array.php.php7 - 2: punctuation.definition.array.begin.php.php7 - set: items - - short-array-items: - - match: \s*(]) - captures: - 1: punctuation.definition.array.end.php.php7 - pop: true - - match: (?=\s*\S) - push: key-or-value - - items: - - match: \s*(\)) - captures: - 1: punctuation.definition.array.end.php.php7 - pop: true - - match: (?=\s*\S) - push: key-or-value - - key-or-value: - - include: end - - include: item-definition - - match: "" - push: - - include: Packages/Naomi/syntaxes/php7/statement-and-expression.sublime-syntax - - match: "" - pop: true - - value: - - include: end - - include: item-definition - - match: "" - push: - - include: Packages/Naomi/syntaxes/php7/statement-and-expression.sublime-syntax - - match: "" - pop: true - - item-definition: - - match: \s*(,) - captures: - 1: punctuation.definition.array.php.php7 - pop: true - - end: - - match: (?=\s*(?>\)|])) - pop: true diff --git a/syntaxes/php7/literal/number.sublime-syntax b/syntaxes/php7/literal/number.sublime-syntax deleted file mode 100644 index df404e06..00000000 --- a/syntaxes/php7/literal/number.sublime-syntax +++ /dev/null @@ -1,68 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - literalDecimal: | - [0-9]+ - - literalFloat: | - (?> [0-9]*[.]{{literalDecimal}} - | {{literalDecimal}}[.][0-9]* - ) - - scientificNotation: | - ( - (?> {{literalFloat}} - | {{literalDecimal}} - ) - [e][+-]? - {{literalDecimal}} - ) - -contexts: - main: - - include: float - - include: integer - - float: - - match: (?xi)\s*({{scientificNotation}}) - captures: - 1: constant.numeric.float.scientific.php.php7 - pop: true - - match: (?x)\s*({{literalFloat}}) - captures: - 1: constant.numeric.float.php.php7 - pop: true - - integer: - - match: \s*(0b[01]+) - captures: - 1: constant.numeric.binary.php.php7 - pop: true - - match: \s*(0[0-7]+) - captures: - 1: constant.numeric.octal.php.php7 - pop: true - - match: (?i)\s*(0[x][0-9a-f]+) - captures: - 1: constant.numeric.hex.php.php7 - pop: true - - match: \s*([1-9][0-9]*|0) - captures: - 1: constant.numeric.decimal.php.php7 - pop: true diff --git a/syntaxes/php7/literal/string/double-quoted.sublime-syntax b/syntaxes/php7/literal/string/double-quoted.sublime-syntax deleted file mode 100644 index 907a5298..00000000 --- a/syntaxes/php7/literal/string/double-quoted.sublime-syntax +++ /dev/null @@ -1,124 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - octalEscapedChar: | - [0-7]{1,3} - - hexEscapedChar: | - x[a-f0-9]{1,2} - - unicodeEscapedChar: | - u\{[a-f0-9]+\} - - doubleQuotedEscapeSequences: | - \\ - (?> [\\"nrtvef$] - | {{octalEscapedChar}} - | {{hexEscapedChar}} - | {{unicodeEscapedChar}} - ) - - embeddedVariableStart: | - \$ - -contexts: - main: - - match: \s*(") - scope: >- - string.quoted.double.php.php7 - punctuation.definition.string.begin.php.php7 - with_prototype: - - match: \s*(") - scope: >- - string.quoted.double.php.php7 - punctuation.definition.string.end.php.php7 - pop: true - set: escape-a-variable-a - - escape-a-variable-a: - - meta_content_scope: string.quoted.double.php.php7 - - match: (?x)(?=\s*{{doubleQuotedEscapeSequences}}) - set: [ - escape-b-variable-a, - escape-a - ] - - match: (?x)(?=\s*{{embeddedVariableStart}}) - set: [ - escape-a-variable-b, - variable-a - ] - - escape-b-variable-a: - - meta_content_scope: string.quoted.double.php.php7 - - match: (?x)(?=\s*{{doubleQuotedEscapeSequences}}) - set: [ - escape-a-variable-a, - escape-b - ] - - match: (?x)(?=\s*{{embeddedVariableStart}}) - set: [ - escape-b-variable-b, - variable-a - ] - - escape-a-variable-b: - - meta_content_scope: string.quoted.double.php.php7 - - match: (?x)(?=\s*{{doubleQuotedEscapeSequences}}) - set: [ - escape-b-variable-b, - escape-a - ] - - match: (?x)(?=\s*{{embeddedVariableStart}}) - set: [ - escape-a-variable-a, - variable-b - ] - - escape-b-variable-b: - - meta_content_scope: string.quoted.double.php.php7 - - match: (?x)(?=\s*{{doubleQuotedEscapeSequences}}) - set: [ - escape-a-variable-b, - escape-b - ] - - match: (?x)(?=\s*{{embeddedVariableStart}}) - set: [ - escape-b-variable-a, - variable-b - ] - - escape-a: - - match: (?x)\s*({{doubleQuotedEscapeSequences}}) - captures: - 1: constant.character.escape.a.php.php7 - pop: true - - escape-b: - - match: (?x)\s*({{doubleQuotedEscapeSequences}}) - captures: - 1: constant.character.escape.b.php.php7 - pop: true - - variable-a: - - meta_scope: variable.a.php.php7 - - include: Packages/Naomi/syntaxes/php7/literal/string/embedded-variable.sublime-syntax - - variable-b: - - meta_scope: variable.b.php.php7 - - include: Packages/Naomi/syntaxes/php7/literal/string/embedded-variable.sublime-syntax diff --git a/syntaxes/php7/literal/string/embedded-variable.sublime-syntax b/syntaxes/php7/literal/string/embedded-variable.sublime-syntax deleted file mode 100644 index 5cc6a4ea..00000000 --- a/syntaxes/php7/literal/string/embedded-variable.sublime-syntax +++ /dev/null @@ -1,44 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - - simpleVariableIdentifier: | - (?> \{{{commonIdentifier}}\} - | {{commonIdentifier}} - ) - - simpleVariable: | - (\$)({{simpleVariableIdentifier}}) - (?: - (\[)([^\]]*)(\]) - )* - -contexts: - main: - - match: (?xi)\s*{{simpleVariable}} - captures: - 1: punctuation.definition.variable.begin.php.php7 - 2: entity.name.variable.php.php7 - 3: keyword.operator.other.subscript.begin.php.php7 - 4: array.key.php.php7 - 5: keyword.operator.other.subscript.end.php.php7 - pop: true diff --git a/syntaxes/php7/literal/string/heredoc.sublime-syntax b/syntaxes/php7/literal/string/heredoc.sublime-syntax deleted file mode 100644 index ac6fa57c..00000000 --- a/syntaxes/php7/literal/string/heredoc.sublime-syntax +++ /dev/null @@ -1,134 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - octalEscapedChar: | - [0-7]{1,3} - - hexEscapedChar: | - x[a-f0-9]{1,2} - - unicodeEscapedChar: | - u\{[a-f0-9]+\} - - heredocEscapeSequences: | - \\ - (?> [\\nrtvef$] - | {{octalEscapedChar}} - | {{hexEscapedChar}} - | {{unicodeEscapedChar}} - ) - - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - - embeddedVariableStart: | - \$ - -contexts: - main: - - match: (?xi)\s*(<<<{{commonIdentifier}}) - captures: - 1: >- - string.unquoted.heredoc.php.php7 - punctuation.definition.string.begin.php.php7 - with_prototype: - # HACK: This pattern is not matching the one captured when the heredoc - # was opened, it’ll work in most cases but another solution must be - # used. - - match: | - (?xi) - ^[_[:alpha:]][_[:alnum:]]*;$ - scope: >- - string.unquoted.heredoc.php.php7 - punctuation.definition.string.end.php.php7 - pop: true - set: escape-a-variable-a - - escape-a-variable-a: - - meta_content_scope: string.unquoted.heredoc.php.php7 - - match: (?x)(?=\s*{{heredocEscapeSequences}}) - set: [ - escape-b-variable-a, - escape-a - ] - - match: (?x)(?=\s*{{embeddedVariableStart}}) - set: [ - escape-a-variable-b, - variable-a - ] - - escape-b-variable-a: - - meta_content_scope: string.unquoted.heredoc.php.php7 - - match: (?x)(?=\s*{{heredocEscapeSequences}}) - set: [ - escape-a-variable-a, - escape-b - ] - - match: (?x)(?=\s*{{embeddedVariableStart}}) - set: [ - escape-b-variable-b, - variable-a - ] - - escape-a-variable-b: - - meta_content_scope: string.unquoted.heredoc.php.php7 - - match: (?x)(?=\s*{{heredocEscapeSequences}}) - set: [ - escape-b-variable-b, - escape-a - ] - - match: (?x)(?=\s*{{embeddedVariableStart}}) - set: [ - escape-a-variable-a, - variable-b - ] - - escape-b-variable-b: - - meta_content_scope: string.unquoted.heredoc.php.php7 - - match: (?x)(?=\s*{{heredocEscapeSequences}}) - set: [ - escape-a-variable-b, - escape-b - ] - - match: (?x)(?=\s*{{embeddedVariableStart}}) - set: [ - escape-b-variable-a, - variable-b - ] - - escape-a: - - match: (?x)\s*({{heredocEscapeSequences}}) - captures: - 1: constant.character.escape.a.php.php7 - pop: true - - escape-b: - - match: (?x)\s*({{heredocEscapeSequences}}) - captures: - 1: constant.character.escape.b.php.php7 - pop: true - - variable-a: - - meta_scope: variable.a.php.php7 - - include: Packages/Naomi/syntaxes/php7/literal/string/embedded-variable.sublime-syntax - - variable-b: - - meta_scope: variable.b.php.php7 - - include: Packages/Naomi/syntaxes/php7/literal/string/embedded-variable.sublime-syntax diff --git a/syntaxes/php7/literal/string/nowdoc.sublime-syntax b/syntaxes/php7/literal/string/nowdoc.sublime-syntax deleted file mode 100644 index 9c3bf34c..00000000 --- a/syntaxes/php7/literal/string/nowdoc.sublime-syntax +++ /dev/null @@ -1,36 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - match: (?xi)\s*(<<<'({{commonIdentifier}})') - captures: - 1: punctuation.definition.string.begin.php.php7 - set: nowdoc-string - - nowdoc-string: - - meta_scope: string.unquoted.nowdoc.php.php7 - - match: ^(\2;) - captures: - 1: punctuation.definition.string.end.php.php7 - pop: true diff --git a/syntaxes/php7/literal/string/single-quoted.sublime-syntax b/syntaxes/php7/literal/string/single-quoted.sublime-syntax deleted file mode 100644 index c0a54105..00000000 --- a/syntaxes/php7/literal/string/single-quoted.sublime-syntax +++ /dev/null @@ -1,64 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - singleQuotedEscapeSequences: \\[\\'] - -contexts: - main: - - match: \s*(') - captures: - 1: >- - string.quoted.single.php.php7 - punctuation.definition.string.begin.php.php7 - with_prototype: - - match: \s*(') - captures: - 1: >- - string.quoted.single.php.php7 - punctuation.definition.string.end.php.php7 - pop: true - set: escape-a - - escape-a: - - meta_content_scope: string.quoted.single.php.php7 - - match: (?x)(?=\s*{{singleQuotedEscapeSequences}}) - set: [ - escape-b, - escape-a-match - ] - - escape-b: - - meta_content_scope: string.quoted.single.php.php7 - - match: (?x)(?=\s*{{singleQuotedEscapeSequences}}) - set: [ - escape-a, - escape-b-match - ] - - escape-a-match: - - match: (?x)\s*({{singleQuotedEscapeSequences}}) - captures: - 1: constant.character.escape.a.php.php7 - pop: true - - escape-b-match: - - match: (?x)\s*({{singleQuotedEscapeSequences}}) - captures: - 1: constant.character.escape.b.php.php7 - pop: true diff --git a/syntaxes/php7/member-variable.sublime-syntax b/syntaxes/php7/member-variable.sublime-syntax deleted file mode 100644 index a4e5b356..00000000 --- a/syntaxes/php7/member-variable.sublime-syntax +++ /dev/null @@ -1,43 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x) - (?= - (?: - (?> private - | protected - | public - )\s+ - )? - (?:static\s+)? - \s*\$ - ) - set: [ - expression, - declaration - ] - - declaration: - - include: Packages/Naomi/syntaxes/php7/variable.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/modifier.no-pop.sublime-syntax - - expression: - - include: Packages/Naomi/syntaxes/php7/expression.sublime-syntax diff --git a/syntaxes/php7/modifier.no-pop.sublime-syntax b/syntaxes/php7/modifier.no-pop.sublime-syntax deleted file mode 100644 index 5e5e8cac..00000000 --- a/syntaxes/php7/modifier.no-pop.sublime-syntax +++ /dev/null @@ -1,23 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?=\S) - push: - - include: Packages/Naomi/syntaxes/php7/modifier.sublime-syntax diff --git a/syntaxes/php7/modifier.sublime-syntax b/syntaxes/php7/modifier.sublime-syntax deleted file mode 100644 index b1209b72..00000000 --- a/syntaxes/php7/modifier.sublime-syntax +++ /dev/null @@ -1,36 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?xi)\s*\b - ((?> abstract - | const - | final - | global - | private - | protected - | public - | static - ))\b - captures: - 1: >- - storage.modifier.php.php7 - keyword.other.access.php.php7 - pop: true diff --git a/syntaxes/php7/namespace.sublime-syntax b/syntaxes/php7/namespace.sublime-syntax deleted file mode 100644 index 537de351..00000000 --- a/syntaxes/php7/namespace.sublime-syntax +++ /dev/null @@ -1,59 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?xi)\s*\b(namespace)(?!\\)\b - captures: - 1: >- - storage.type.php.php7 - keyword.namespace.php.php7 - set: declaration - - declaration: - - include: Packages/Naomi/syntaxes/php7/namespace/name.no-pop.sublime-syntax - # Implicit body. - - match: \s*(;) - captures: - 1: punctuation.definition.namespace.body.begin.php.php7 - set: implicit-body - # Bracketed body. - - match: \s*(\{) - captures: - 1: punctuation.definition.namespace.body.begin.php.php7 - set: bracketed-body - - body-content: - - match: "" - push: - - include: Packages/Naomi/syntaxes/php7/statement-and-expression.sublime-syntax - - match: "" - pop: true - - implicit-body: - - match: (?=\s*\bnamespace\b) - pop: true - - include: body-content - - bracketed-body: - - match: \s*(}) - captures: - 1: >- - punctuation.definition.namespace.body.end.php.php7 - pop: true - - include: body-content diff --git a/syntaxes/php7/namespace/name.no-pop.sublime-syntax b/syntaxes/php7/namespace/name.no-pop.sublime-syntax deleted file mode 100644 index b2e934bc..00000000 --- a/syntaxes/php7/namespace/name.no-pop.sublime-syntax +++ /dev/null @@ -1,49 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - - namespacePath: | - (?> - (?: - ((?>\\|\b)) - ({{commonIdentifier}}) - (\\) - ({{commonIdentifier}}) - ) - | - (?: - ((?>\\|\b)) - ({{commonIdentifier}}) - ) - ) - -contexts: - main: - - match: (?xi)\s*({{namespacePath}}) - captures: - 1: namespace.path.php.php7 - 2: punctuation.definition.namespace.a.php.php7 - 3: entity.name.namespace.a.php.php7 - 4: punctuation.definition.namespace.b.php.php7 - 5: entity.name.namespace.b.php.php7 - 6: punctuation.definition.namespace.a.php.php7 - 7: entity.name.namespace.a.php.php7 diff --git a/syntaxes/php7/namespace/path.no-pop.sublime-syntax b/syntaxes/php7/namespace/path.no-pop.sublime-syntax deleted file mode 100644 index 6491d011..00000000 --- a/syntaxes/php7/namespace/path.no-pop.sublime-syntax +++ /dev/null @@ -1,51 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - - namespacePath: | - (?> - (?: - ((?>\\|\b)) - ({{commonIdentifier}}) - (\\) - ({{commonIdentifier}}) - (?=\\{{commonIdentifier}}) - ) - | - (?: - ((?>\\|\b)) - ({{commonIdentifier}}) - (?=\\{{commonIdentifier}}) - ) - ) - -contexts: - main: - - match: (?xi)\s*({{namespacePath}}) - captures: - 1: namespace.path.php.php7 - 2: punctuation.definition.namespace.a.php.php7 - 3: entity.name.namespace.a.php.php7 - 4: punctuation.definition.namespace.b.php.php7 - 5: entity.name.namespace.b.php.php7 - 6: punctuation.definition.namespace.a.php.php7 - 7: entity.name.namespace.a.php.php7 diff --git a/syntaxes/php7/new.sublime-syntax b/syntaxes/php7/new.sublime-syntax deleted file mode 100644 index 5060c3d0..00000000 --- a/syntaxes/php7/new.sublime-syntax +++ /dev/null @@ -1,40 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -scope: ... - -contexts: - main: - - match: (?i)\s*\b(new)\b - scope: keyword.other.php.php7 - set: [ - optional-arguments, - type - ] - - optional-arguments: - - include: Packages/Naomi/syntaxes/php7/function-call/arguments.sublime-syntax - - match: (?=\s*\S) - pop: true - - type: - - include: Packages/Naomi/syntaxes/php7/type.sublime-syntax diff --git a/syntaxes/php7/operator.sublime-syntax b/syntaxes/php7/operator.sublime-syntax deleted file mode 100644 index fce9d072..00000000 --- a/syntaxes/php7/operator.sublime-syntax +++ /dev/null @@ -1,30 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/php7/operator/other.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/operator/comparison.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/operator/logical.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/operator/bitwise.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/operator/arithmetic.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/operator/string.sublime-syntax - - match: \s*(=) - captures: - 1: keyword.operator.other.assignment.php.php7 - pop: true diff --git a/syntaxes/php7/operator/arithmetic.sublime-syntax b/syntaxes/php7/operator/arithmetic.sublime-syntax deleted file mode 100644 index fd0de105..00000000 --- a/syntaxes/php7/operator/arithmetic.sublime-syntax +++ /dev/null @@ -1,47 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:----------------| - # | -- | Decrement. | - # | - | Subtraction. | - # | ++ | Increment. | - # | + | Addition. | - # | += | | - # | * | Multiplication. | - # | *= | | - # | / | Division. | - # | /= | | - # | % | Modulus. | - # | %= | | - main: - - match: | - (?x)\s* - ((?> -- - | -=? - | \+\+ - | \+=? - | \*\* - | \*=? - | /=? - | %=? - )) - captures: - 1: keyword.operator.arithmetic.php.php7 - pop: true diff --git a/syntaxes/php7/operator/bitwise.sublime-syntax b/syntaxes/php7/operator/bitwise.sublime-syntax deleted file mode 100644 index 71642381..00000000 --- a/syntaxes/php7/operator/bitwise.sublime-syntax +++ /dev/null @@ -1,51 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:---------------------------------| - # | ~ | Bitwise not. | - # | ~= | Bitwise not assignment. | - # | & | Bitwise AND. | - # | &= | Bitwise AND assignment. | - # | | | Bitwise OR. | - # | |= | Bitwise OR assignment. | - # | xor | Bitwise XOR. | - # | ^ | Bitwise XOR. | - # | ^= | Bitwise XOR assignment. | - # | << | Left shift. | - # | <<= | Left shift assignment. | - # | >> | Right shift. | - # | >>= | Right shift assignment. | - # | >>> | Unsigned right shift. | - # | >>>= | Unsigned right shift assignment. | - main: - - match: | - (?x)\s* - ((?> xor - | ~=? - | &=? - | \|=? - | \^=? - | <<=? - | >>>=? - | >>=? - )) - captures: - 1: keyword.operator.bitwise.php.php7 - pop: true diff --git a/syntaxes/php7/operator/comparison.sublime-syntax b/syntaxes/php7/operator/comparison.sublime-syntax deleted file mode 100644 index fb9947a2..00000000 --- a/syntaxes/php7/operator/comparison.sublime-syntax +++ /dev/null @@ -1,46 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:--------------------------| - # | === | Identical. | - # | == | Equal. | - # | !== | Not identical. | - # | != | Not equal. | - # | <> | Not equal. | - # | >= | Greater than or equal to. | - # | <=> | Spaceship. | - # | <= | Less than or equal to. | - # | > | Greater than. | - # | < | Less than. | - main: - - match: | - (?x)\s* - ((?> ===? - | !==? - | <> - | >= - | <=> - | <= - | >(?!>) - | <(?!<) - )) - captures: - 1: keyword.operator.comparison.php.php7 - pop: true diff --git a/syntaxes/php7/operator/logical.sublime-syntax b/syntaxes/php7/operator/logical.sublime-syntax deleted file mode 100644 index cdafe902..00000000 --- a/syntaxes/php7/operator/logical.sublime-syntax +++ /dev/null @@ -1,46 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:------------| - # | and | | - # | or | | - # | && | And. | - # | || | Or. | - # | ! | Not. | - main: - - match: | - (?x)\s*\b - ((?> and - | or - ))\b - captures: - 1: >- - word.php.php7 - keyword.operator.logical.php.php7 - pop: true - - match: | - (?x)\s* - ((?> && - | \|\| - | ! - )) - captures: - 1: keyword.operator.logical.php.php7 - pop: true diff --git a/syntaxes/php7/operator/other.sublime-syntax b/syntaxes/php7/operator/other.sublime-syntax deleted file mode 100644 index 6f44de41..00000000 --- a/syntaxes/php7/operator/other.sublime-syntax +++ /dev/null @@ -1,104 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - - constantIdentifier: | - [_[:upper:]] - [_[:upper:][:digit:]]* - -contexts: - # | Operator | Description | - # |:----------:|:--------------------| - # | as | | - # | instanceof | | - # | @ | Error suppression. | - # | -> | Member access. | - # | => | Key/value. | - # | :: | Scope resolution. | - # | ... | Argument unpacking. | - # | ?? | Null coalescing. | - # | ? | Ternary. | - main: - - match: (?xi)\s*\b(as)\b - captures: - 1: >- - word.php.php7 - keyword.operator.other.alias.php.php7 - pop: true - - match: (?xi)\s*\b(instanceof)\b - captures: - 1: >- - word.php.php7 - keyword.operator.relational.php.php7 - pop: true - - match: \s*(=>) - captures: - 1: keyword.operator.other.key-value.php.php7 - - match: \s*(@) - captures: - 1: keyword.operator.other.error.suppression.php.php7 - pop: true - - match: \s*(\.\.\.) - captures: - 1: keyword.operator.other.spread.php.php7 - pop: true - - match: \s*(->) - captures: - 1: keyword.operator.other.member-access.php.php7 - set: member-access - - match: \s*(::) - captures: - 1: keyword.operator.other.scope-resolution.php.php7 - set: scope-resolution - - match: \s*(\?\?) - captures: - 1: keyword.operator.other.php.php7 - pop: true - - match: \s*(\?) - captures: - 1: keyword.operator.other.ternary.js.fjsx15 - set: ternary-condition - - ternary-condition: - - match: \s*(:) - captures: - 1: keyword.operator.other.ternary.php.php7 - pop: true - - match: "" - push: - - match: (?=\s*:) - pop: true - - include: Packages/Naomi/syntaxes/php7/statement-and-expression.sublime-syntax - - member-access: - - meta_content_scope: member.php.php7 - - include: Packages/Naomi/syntaxes/php7/function-call/normal.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/variable.no-dollar.sublime-syntax - - scope-resolution: - - match: \s*\b(class)\b - scope: keyword.other.php.php7 - pop: true - - include: Packages/Naomi/syntaxes/php7/function-call.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/variable.sublime-syntax diff --git a/syntaxes/php7/operator/string.sublime-syntax b/syntaxes/php7/operator/string.sublime-syntax deleted file mode 100644 index 6ca679c3..00000000 --- a/syntaxes/php7/operator/string.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:---------------| - # | . | Concatenation. | - # | .= | Append. | - main: - - match: \s*(\.=?) - captures: - 1: keyword.operator.other.string.php.php7 - pop: true diff --git a/syntaxes/php7/statement-and-expression.sublime-syntax b/syntaxes/php7/statement-and-expression.sublime-syntax deleted file mode 100644 index c592170c..00000000 --- a/syntaxes/php7/statement-and-expression.sublime-syntax +++ /dev/null @@ -1,111 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - expressionGroupBegin: | - \s*(\() - -contexts: - main: - # Open new expression group. - - match: | - (?xi) - {{expressionGroupBegin}} - captures: - 1: punctuation.definition.expression.group.a.begin.php.php7 - set: open-b-close-a - # Expression contents. - - include: sequence - - open-a-close-b: - # Open new expression group. - - match: | - (?xi) - {{expressionGroupBegin}} - captures: - 1: punctuation.definition.expression.group.a.begin.php.php7 - push: open-b-close-a - # Close current expression group. - - match: \s*(\)) - captures: - 1: punctuation.definition.expression.group.b.end.php.php7 - pop: true - # Expression contents. - - match: "" - push: - - include: sequence - - match: "" - pop: true - - open-b-close-a: - # Open new expression group. - - match: | - (?xi) - {{expressionGroupBegin}} - captures: - 1: punctuation.definition.expression.group.b.begin.php.php7 - push: open-a-close-b - # Close current expression group. - - match: \s*(\)) - captures: - 1: punctuation.definition.expression.group.a.end.php.php7 - pop: true - # Expression contents. - - match: "" - push: - - include: sequence - - match: "" - pop: true - - sequence: - - include: Packages/Naomi/syntaxes/php7/terminator.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/comment.sublime-syntax - # Complex statements. - - include: Packages/Naomi/syntaxes/php7/class.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/interface.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/trait.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/declare.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/namespace.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/closure.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/use.sublime-syntax - # Simple statements. - - include: Packages/Naomi/syntaxes/php7/goto.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/statement/label.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/statement/hanging.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/statement/bodied.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/statement/simple.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/statement/other.sublime-syntax - # Other keywords. - - include: Packages/Naomi/syntaxes/php7/modifier.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/new.sublime-syntax - # Expression. - - include: Packages/Naomi/syntaxes/php7/array-access.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/literal.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/function-call.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/operator.sublime-syntax - # When it comes to constants and variables, there's no way to tell apart - # without an intellisense, so it’ll treat that anything that looks a - # uppercase variable as if it was a constant. - - include: Packages/Naomi/syntaxes/php7/constant.sublime-syntax - # Some types can look like constants but we will give the power to the user - # to override types and in turn we get some predefined constants highlighted - # correctly.. - - include: Packages/Naomi/syntaxes/php7/type.sublime-syntax - # Constant matching failed, so it could be a variable. - - include: Packages/Naomi/syntaxes/php7/variable.sublime-syntax diff --git a/syntaxes/php7/statement/bodied.sublime-syntax b/syntaxes/php7/statement/bodied.sublime-syntax deleted file mode 100644 index 503c2781..00000000 --- a/syntaxes/php7/statement/bodied.sublime-syntax +++ /dev/null @@ -1,97 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # Body only. - - match: | - (?x)\s* - ((?> do - | else - | finally - | try - ))\b - captures: - 1: keyword.control.php.php7 - set: body - # Header and body. - - match: | - (?x)\s*\b - ((?> catch - | if - | elseif - | for(?:each)? - | while - | switch - ))\b - captures: - 1: keyword.control.php.php7 - set: [ - body, - header - ] - - optional-header: - - match: (?=\s*;) - pop: true - - match: (?=\s*\() - set: header - - header: - - match: \s*(\() - captures: - 1: punctuation.definition.control.header.begin.php.php7 - set: header-content - - header-content: - - match: \s*(\)) - captures: - 1: punctuation.definition.control.header.end.php.php7 - pop: true - - match: "" - push: - - match: (?=\s*\)) - pop: true - - include: statement-and-expression - - terminator: - - match: \s*(;) - captures: - 1: keyword.other.terminator.php.php7 - pop: true - - body: - - match: \s*(\{) - captures: - 1: punctuation.definition.control.body.begin.php.php7 - set: body-content - - include: statement-and-expression - - body-content: - - match: \s*(}) - captures: - 1: punctuation.definition.control.body.end.php.php7 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: statement-and-expression - - statement-and-expression: - - include: Packages/Naomi/syntaxes/php7/statement-and-expression.sublime-syntax diff --git a/syntaxes/php7/statement/hanging.sublime-syntax b/syntaxes/php7/statement/hanging.sublime-syntax deleted file mode 100644 index fa1ad6de..00000000 --- a/syntaxes/php7/statement/hanging.sublime-syntax +++ /dev/null @@ -1,37 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?> case - | default - ))\b - captures: - 1: keyword.control.php.php7 - set: operator - - operator: - - match: \s*(:) - captures: - 1: keyword.operator.other.php.php7 - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/php7/statement-and-expression.sublime-syntax diff --git a/syntaxes/php7/statement/label.sublime-syntax b/syntaxes/php7/statement/label.sublime-syntax deleted file mode 100644 index f0fb2804..00000000 --- a/syntaxes/php7/statement/label.sublime-syntax +++ /dev/null @@ -1,96 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: | - (?xi) - (?> ^ - | (?<=;) - )\s* - ({{commonIdentifier}}) - (? clone - | die - | e(?>cho|val|xit) - | include(?:_once)? - | require(?:_once)? - ))\b - captures: - 1: keyword.other.php.php7 - pop: true diff --git a/syntaxes/php7/statement/simple.sublime-syntax b/syntaxes/php7/statement/simple.sublime-syntax deleted file mode 100644 index f3f22e95..00000000 --- a/syntaxes/php7/statement/simple.sublime-syntax +++ /dev/null @@ -1,136 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - include: break-continue - - include: yield - - match: | - (?x)\s* - ((?> return - | throw - ))\b - captures: - 1: keyword.control.flow-break.php.php7 - pop: true - - match: | - (?x)\s* - ((?> await - | default - ))\b - captures: - 1: keyword.control.php.php7 - pop: true - - break-continue: - - match: | - (?x)\s* - ((?> break - | continue - ))\b - captures: - 1: keyword.control.flow-break.php.php7 - set: optional-label - - optional-label: - - match: | - (?xi)\s* - ({{commonIdentifier}}) - (? \s*(from) - | \b - ) - captures: - 1: keyword.control.php.php7 - 2: keyword.control.php.php7 - pop: true diff --git a/syntaxes/php7/terminator.sublime-syntax b/syntaxes/php7/terminator.sublime-syntax deleted file mode 100644 index 2cdcdaea..00000000 --- a/syntaxes/php7/terminator.sublime-syntax +++ /dev/null @@ -1,24 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(;) - captures: - 1: keyword.other.terminator.php.php7 - pop: true diff --git a/syntaxes/php7/trait.sublime-syntax b/syntaxes/php7/trait.sublime-syntax deleted file mode 100644 index ace7d5a6..00000000 --- a/syntaxes/php7/trait.sublime-syntax +++ /dev/null @@ -1,62 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -scope: ... - -contexts: - main: - - match: (?xi)\s*\b(trait)(?!\\)\b - captures: - 1: >- - storage.type.php.php7 - keyword.declaration.trait.php.php7 - set: declaration - - comment: - - include: Packages/Naomi/syntaxes/php7/comment.no-pop.sublime-syntax - - declaration: - - include: comment - # Body. - - match: \s*(\{) - captures: - 1: >- - punctuation.definition.trait.body.begin.php.php7 - set: body - # Trait’s name. - - match: (?xi)\s*({{commonIdentifier}}) - captures: - 1: entity.name.trait.php.php7 - - body: - - match: \s*(}) - captures: - 1: punctuation.definition.trait.body.end.php.php7 - pop: true - - include: body-content - - body-content: - - match: "" - push: - - include: Packages/Naomi/syntaxes/php7/statement-and-expression.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/php7/type.sublime-syntax b/syntaxes/php7/type.sublime-syntax deleted file mode 100644 index 6963de24..00000000 --- a/syntaxes/php7/type.sublime-syntax +++ /dev/null @@ -1,26 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/php7/namespace/path.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/type/support/core.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/type/support/class.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/type/support/exception.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/type/support/interface.sublime-syntax - - include: Packages/Naomi/syntaxes/php7/type/normal.sublime-syntax diff --git a/syntaxes/php7/type/normal.sublime-syntax b/syntaxes/php7/type/normal.sublime-syntax deleted file mode 100644 index cd3d5efd..00000000 --- a/syntaxes/php7/type/normal.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - match: | - (?xi)\s* - ((?>\\|\b)) - ( - {{commonIdentifier}} - )\b - captures: - 1: punctuation.definition.type.php.php7 - 2: entity.name.type.php.php7 - pop: true diff --git a/syntaxes/php7/type/support/class.sublime-syntax b/syntaxes/php7/type/support/class.sublime-syntax deleted file mode 100644 index b56d54bf..00000000 --- a/syntaxes/php7/type/support/class.sublime-syntax +++ /dev/null @@ -1,73 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> ArrayIterator - | AppendIterator - | CachingIterator - | CallbackFilterIterator - | Closure - | DirectoryIterator - | EmptyIterator - | FilesystemIterator - | FilterIterator - | Generator - | GlobIterator - | InfiniteIterator - | IteratorIterator - | LimitIterator - | MultipleIterator - | NoRewindIterator - | ParentIterator - | Recursive - (?> ArrayIterator - | CachingIterator - | CallbackFilterIterator - | DirectoryIterator - | FilterIterator - | IteratorIterator - | RegexIterator - | TreeIterator - ) - | RegexIterator - | Spl - (?> DoublyLinkedList - | Stack - | Queue - | Heap - | MaxHeap - | MinHeap - | PriorityQueue - | FixedArray - | ObjectStorage - ) - ) - )\b - captures: - 1: >- - support.php.php7 - punctuation.definition.type.php.php7 - 2: >- - support.php.php7 - entity.name.type.php.php7 - pop: true diff --git a/syntaxes/php7/type/support/core.sublime-syntax b/syntaxes/php7/type/support/core.sublime-syntax deleted file mode 100644 index 284a1dbb..00000000 --- a/syntaxes/php7/type/support/core.sublime-syntax +++ /dev/null @@ -1,42 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> array - | callable - | bool - | float - | int - | parent - | string - | self - ) - )\b - captures: - 1: >- - support.php.php7 - punctuation.definition.type.php.php7 - 2: >- - support.php.php7 - entity.name.type.php.php7 - pop: true diff --git a/syntaxes/php7/type/support/exception.sublime-syntax b/syntaxes/php7/type/support/exception.sublime-syntax deleted file mode 100644 index 401cffcc..00000000 --- a/syntaxes/php7/type/support/exception.sublime-syntax +++ /dev/null @@ -1,51 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> Bad - (?> FunctionCallException - | MethodCallException - ) - | DomainException - | InvalidArgumentException - | LengthException - | LogicException - | OutOf - (?> BoundsException - | RangeException - ) - | OverflowException - | RangeException - | RuntimeException - | UnderflowException - | UnexpectedValueException - ) - )\b - captures: - 1: >- - support.php.php7 - punctuation.definition.type.php.php7 - 2: >- - support.php.php7 - entity.name.type.php.php7 - pop: true diff --git a/syntaxes/php7/type/support/interface.sublime-syntax b/syntaxes/php7/type/support/interface.sublime-syntax deleted file mode 100644 index a33fd108..00000000 --- a/syntaxes/php7/type/support/interface.sublime-syntax +++ /dev/null @@ -1,43 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ((?>\\|\b)) - ( - (?> ArrayAccess - | Countable - | Iterator(?:Aggregate)? - | OuterIterator - | RecursiveIterator - | SeekableIterator - | Throwable - | Traversable - | Serializable - ) - )\b - captures: - 1: >- - support.php.php7 - punctuation.definition.type.php.php7 - 2: >- - support.php.php7 - entity.name.type.php.php7 - pop: true diff --git a/syntaxes/php7/use.sublime-syntax b/syntaxes/php7/use.sublime-syntax deleted file mode 100644 index c8153abb..00000000 --- a/syntaxes/php7/use.sublime-syntax +++ /dev/null @@ -1,102 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - match: (?i)\s*\b(use)(?!\\)\b - captures: - 1: keyword.import.php.php7 - set: declaration - - comment: - - include: Packages/Naomi/syntaxes/php7/comment.no-pop.sublime-syntax - - terminator: - - include: Packages/Naomi/syntaxes/php7/terminator.sublime-syntax - - declaration: - - include: comment - - include: terminator - - match: \s*(,) - captures: - 1: punctuation.definition.import.php.php7 - - match: (?=\s*\S) - push: [ - alias, - const-or-function - ] - - const-or-function: - - include: comment - - match: (?i)\s*\b(const)\b - captures: - 1: keyword.import.constant.php.php7 - set: namespaced-const - - match: (?i)\s*\b(function)\b - captures: - 1: keyword.import.function.php.php7 - set: namespaced-function - - match: (?=\s*\S) - set: namespace-or-type - - namespaced-const: - - include: comment - - include: Packages/Naomi/syntaxes/php7/constant.sublime-syntax - - namespaced-function: - - include: comment - - include: Packages/Naomi/syntaxes/php7/function/name.sublime-syntax - - namespace-or-type: - - include: Packages/Naomi/syntaxes/php7/namespace/path.no-pop.sublime-syntax - # Target namespace or type. - - match: | - (?xi)\s* - ((?>\\|\b)) - ({{commonIdentifier}})\b - captures: - 1: punctuation.definition.ambiguous.php.php7 - 2: entity.name.ambiguous.php.php7 - pop: true - - target-type: - - include: comment - - include: Packages/Naomi/syntaxes/php7/type.sublime-syntax - - alias: - - include: comment - - match: (?=\s*(?>,|;)) - pop: true - - match: (?i)\s*\b(as)\b - captures: - 1: keyword.import.alias.php.php7 - set: alias-name - - alias-name: - - include: comment - - match: (?=\s*;) - pop: true - - match: (?xi)\s*({{commonIdentifier}}) - captures: - 1: entity.name.alias.php.php7 - pop: true diff --git a/syntaxes/php7/variable.no-dollar.sublime-syntax b/syntaxes/php7/variable.no-dollar.sublime-syntax deleted file mode 100644 index 249b72c6..00000000 --- a/syntaxes/php7/variable.no-dollar.sublime-syntax +++ /dev/null @@ -1,31 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - match: | - (?xi) - \b({{commonIdentifier}})\b - captures: - 1: entity.name.variable.php.php7 - pop: true diff --git a/syntaxes/php7/variable.sublime-syntax b/syntaxes/php7/variable.sublime-syntax deleted file mode 100644 index 6883c898..00000000 --- a/syntaxes/php7/variable.sublime-syntax +++ /dev/null @@ -1,67 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - include: Packages/Naomi/syntaxes/php7/namespace/path.no-pop.sublime-syntax - - include: support-variable - - include: common-variable - - support-variable: - - match: | - (?x)\s* - \B(\$)( - (?> argc - | argv - | php_errormsg - | http_response_header - | this - | GLOBALS - | _ - (?> SERVER - | GET - | POST - | FILES - | REQUEST - | SESSION - | COOKIE - ) - ) - )\b - captures: - 1: >- - support.php.php7 - punctuation.definition.variable.begin.php.php7 - 2: >- - support.php.php7 - entity.name.variable.php.php7 - pop: true - - common-variable: - - match: | - (?xi)\s* - \B(\$)({{commonIdentifier}})\b - captures: - 1: punctuation.definition.variable.begin.php.php7 - 2: entity.name.variable.php.php7 - pop: true diff --git a/syntaxes/scss3/attribute.sublime-syntax b/syntaxes/scss3/attribute.sublime-syntax deleted file mode 100644 index bbd501e6..00000000 --- a/syntaxes/scss3/attribute.sublime-syntax +++ /dev/null @@ -1,224 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_\-[:alpha:]] - [_\-[:alnum:]]* - - pseudoClasses: | - (?> active - | any(?:-link)? - | checked - | default - | dir - | disabled - | empty - | enabled - | first-child - | first-of-type - | first - | focus - | fullscreen - | global - | hover - | in-range - | indeterminate - | invalid - | lang - | last-child - | last-of-type - | left - | link - | local - | not - | nth-child - | nth-last-child - | nth-last-of-type - | nth-of-type - | only-child - | only-of-type - | optional - | out-of-range - | read-only - | read-write - | required - | right - | root - | scope - | target - | valid - | visited - ) - - pseudoClassesOrElement: | - (?> : - | {{pseudoClasses}} - ) - -contexts: - main: - - include: extension - - include: normal-attribute - - include: unreconized-attribute - - extension: - - match: | - (?xi) - \s* - ( - -{{commonIdentifier}} - ) - \s*(:) - (?! - {{pseudoClassesOrElement}} - ) - captures: - 0: extension.scss.scss3 - 1: entity.name.attribute.scss.scss3 - 2: keyword.operator.other.association.scss.scss3 - set: value - - normal-attribute: - - match: | - (?xi) - \s* - ( - (?> align-content - | align-items - | animation - | background-color - | background-image - | background-size - | background - | border-collapse - | border-color - | border-radius - | border-spacing - | border - | bottom - | box-shadow - | box-sizing - | content - | color - | cursor - | display - | fill - | flex-basis - | flex-direction - | flex-flow - | flex-grow - | flex-shrink - | flex-wrap - | flex - | float - | font-family - | font-size - | font-style - | font-weight - | font - | height - | justify-content - | left - | letter-spacing - | line-height - | margin-bottom - | margin-left - | margin-right - | margin-top - | margin - | max-height - | max-width - | min-height - | min-width - | opacity - | orientation - | overflow - | outline - | padding-bottom - | padding-left - | padding-right - | padding-top - | padding - | pointer-events - | position - | right - | src - | stroke-width - | stroke - | text-align - | text-decoration - | text-transform - | top - | transform-origin - | transform - | transition-timing-function - | transition-duration - | transition - | type - | vertical-align - | unicode-range - | white-space - | width - | z-index - ) - ) - \s*(:) - (?! - {{pseudoClassesOrElement}} - ) - captures: - 0: support.scss.scss3 - 1: entity.name.attribute.scss.scss3 - 2: keyword.operator.other.association.scss.scss3 - set: value - - unreconized-attribute: - - match: | - (?xi) - \s* - ( - {{commonIdentifier}} - ) - \s*(:) - (?! - {{pseudoClassesOrElement}} - ) - captures: - 1: entity.name.attribute.scss.scss3 - 2: keyword.operator.other.association.scss.scss3 - set: value - - value: - - match: | - (?x) - (?=\s* - (?> ; - | \) - | } - ) - ) - pop: true - - match: "" - push: - - include: expression - - match: "" - pop: true - - expression: - - include: Packages/Naomi/syntaxes/scss3/expression.sublime-syntax diff --git a/syntaxes/scss3/comment.sublime-syntax b/syntaxes/scss3/comment.sublime-syntax deleted file mode 100644 index 1341e8d8..00000000 --- a/syntaxes/scss3/comment.sublime-syntax +++ /dev/null @@ -1,57 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(\/\/) - captures: - 1: punctuation.comment.begin.scss.scss3 - set: line - - match: \s*(\/\*) - captures: - 1: punctuation.comment.begin.scss.scss3 - set: block - - line: - - meta_scope: comment.line.scss.scss3 - - include: email - - include: link - - match: $ - pop: true - - block: - - meta_scope: comment.block.scss.scss3 - - include: email - - include: link - - match: \s*(\*\/) - captures: - 1: punctuation.comment.end.scss.scss3 - set: - # Used to fix the block comment indentation settings. - # https://forum.sublimetext.com/t/everything-you-n-ever-wanted-to-know-about-indentation-in-st3/26207/6 - - match: \s*$\n? - scope: meta.block-end.scss.scss3 - pop: true - - match: '' - pop: true - - link: - - include: Packages/Naomi/syntaxes/shared/link.sublime-syntax - - email: - - include: Packages/Naomi/syntaxes/shared/email.sublime-syntax diff --git a/syntaxes/scss3/constant.sublime-syntax b/syntaxes/scss3/constant.sublime-syntax deleted file mode 100644 index c6eb40f9..00000000 --- a/syntaxes/scss3/constant.sublime-syntax +++ /dev/null @@ -1,290 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - constantIdentifier: | - [$_\-[:upper:]] - [$_\-[:upper:][:digit:]]* - -contexts: - main: - - include: support-color-constant - - include: support-constant - - include: common-constant - - common-constant: - - match: | - (?x) - (\$) - ( - {{constantIdentifier}} - (?> [$\-]\B - | [_[:upper:][:digit:]]\b - ) - ) - captures: - 0: constant.scss.scss3 - 1: punctuation.definition.constant.begin.scss.scss3 - 2: entity.name.constant.scss.scss3 - pop: true - - support-constant: - - match: | - (?x) - (?> absolute - | alternate - | all - | at - | auto - | baseline - | block - | bold - | border-box - | bottom - | button - | center - | checkbox - | content-box - | collapse - | column(?:-reverse)? - | contain - | cover - | dashed - | disabled - | dotted - | ease - | ellipsis - | ellipse - | false - | fixed - | flex-start - | flex-end - | flex - | forwards - | hidden - | infinite - | inline-block - | inline-flex - | inline-grid - | inline-table - | inline - | inherit - | initial - | italic - | landscape - | left - | list-item - | middle - | no-repeat - | none - | normal - | nowrap - | number - | only - | pointer - | print - | projection - | radio - | relative - | repeat - | reset - | right - | row(?:-reverse)? - | run-in - | screen - | search - | space-arround - | space-between - | speech - | solid - | submit - | sub - | super - | table-caption - | table-cell - | table-column(?:-group)? - | table-footer-group - | table-header-group - | table-row(?:-group)? - | table - | text-bottom - | text-top - | top - | transparent - | true - | tv - | visible - | uppercase - ) - scope: >- - support.scss.scss3 - entity.name.constant.scss.scss3 - pop: true - - support-color-constant: - - match: | - (?xi) - (?> aliceblue - | antiquewhite - | aqua - | aquamarine - | azure - | beige - | bisque - | black - | blanchedalmond - | blue - | blueviolet - | brown - | burlywood - | cadetblue - | chartreuse - | chocolate - | coral - | cornflowerblue - | cornsilk - | crimson - | cyan - | dark - (?> blue - | cyan - | goldenrod - | gray - | grey - | green - | khaki - | magenta - | olivegreen - | orange - | orchid - | red - | salmon - | seagreen - | slateblue - | slategray - | slategrey - | turquoise - | violet - ) - | deeppink - | deepskyblue - | dimgray - | dimgrey - | dodgerblue - | firebrick - | floralwhite - | forestgreen - | fuchsia - | gainsboro - | ghostwhite - | gold(?:enrod)? - | gr[ae]y - | green(?:yellow)? - | honeydew - | hotpink - | indianred - | indigo - | ivory - | khaki - | lavender(?:blush)? - | lawngreen - | lemonchiffon - | light - (?> blue - | coral - | cyan - | goldenrodyellow - | gray - | grey - | green - | pink - | salmon - | seagreen - | skyblue - | slategray - | slategrey - | steelblue - | yellow - ) - | lime(?:green)? - | linen - | magenta - | maroon - | medium - (?> aquamarine - | blue - | orchid - | purple - | seagreen - | slateblue - | springgreen - | turquoise - | violetred - ) - | midnightblue - | mintcream - | mistyrose - | moccasin - | navajowhite - | navy - | oldlace - | olive(?:drab)? - | orange(?:red)? - | orchid - | palegoldenrod - | palegreen - | paleturquoise - | palevioletred - | papayawhip - | peachpuff - | peru - | pink - | plum - | powderblue - | purple - | rebeccapurple - | red - | rosybrown - | royalblue - | saddlebrown - | salmon - | sandybrown - | seagreen - | seashell - | sienna - | silver - | skyblue - | slateblue - | slategr[ae]y - | snow - | springgreen - | steelblue - | tan - | teal - | thistle - | tomato - | turquoise - | violet - | wheat - | white(?:smoke)? - | yellow(?:green)? - ) - scope: >- - support.scss.scss3 - entity.name.constant.color.scss.scss3 - pop: true diff --git a/syntaxes/scss3/expression.sublime-syntax b/syntaxes/scss3/expression.sublime-syntax deleted file mode 100644 index 5754e7f4..00000000 --- a/syntaxes/scss3/expression.sublime-syntax +++ /dev/null @@ -1,82 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - expressionGroupBegin: | - (? constructor - | super - ) - )\b - captures: - 1: >- - support.scss.scss3 - entity.name.function.scss.scss3 - pop: true - # Identifier. - - match: | - (?xi) - \s*({{commonIdentifier}}) - captures: - 1: entity.name.function.scss.scss3 - pop: true - - arguments: - - include: Packages/Naomi/syntaxes/scss3/function-call/arguments.sublime-syntax diff --git a/syntaxes/scss3/function-call/arguments.sublime-syntax b/syntaxes/scss3/function-call/arguments.sublime-syntax deleted file mode 100644 index eadd433f..00000000 --- a/syntaxes/scss3/function-call/arguments.sublime-syntax +++ /dev/null @@ -1,61 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_\-[:alpha:]] - [$_\-[:alnum:]]* - -contexts: - main: - - match: \s*(\() - captures: - 1: punctuation.definition.function.arguments.begin.scss.scss3 - set: arguments - - arguments: - - match: \s*(\)) - captures: - 1: punctuation.definition.function.arguments.end.scss.scss3 - pop: true - - match: \s*(\,) - captures: - 1: punctuation.definition.function.arguments.scss.scss3 - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | \) - ) - ) - pop: true - - include: value - - value: - - match: | - (?xi) - \s*(\${{commonIdentifier}}) - \s*(:) - captures: - 1: >- - parameter.scss.scss3 - entity.name.variable.scss.scss3 - 2: keyword.operator.other.association.scss.scss3 - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax diff --git a/syntaxes/scss3/function.sublime-syntax b/syntaxes/scss3/function.sublime-syntax deleted file mode 100644 index 5c610d4a..00000000 --- a/syntaxes/scss3/function.sublime-syntax +++ /dev/null @@ -1,67 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_\-[:alpha:]] - [$_\-[:alnum:]]* - -contexts: - main: - - match: | - (?xi) - \s*(@function)\b - captures: - 0: storage.type.scss.scss3 - 1: keyword.declaration.function.scss.scss3 - set: [ - body, - optional-parameters, - name - ] - - name: - - match: | - (?xi) - \s*({{commonIdentifier}}) - captures: - 1: entity.name.function.scss.scss3 - pop: true - - optional-parameters: - - match: (?=\s*{) - pop: true - - include: Packages/Naomi/syntaxes/scss3/function/parameters.sublime-syntax - - body: - - match: \s*({) - scope: punctuation.definition.function.body.begin.scss.scss3 - set: body-content - - body-content: - - match: \s*(}) - captures: - 1: punctuation.definition.function.body.end.scss.scss3 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: Packages/Naomi/syntaxes/scss3/attribute.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax diff --git a/syntaxes/scss3/function/parameter.sublime-syntax b/syntaxes/scss3/function/parameter.sublime-syntax deleted file mode 100644 index 76da9242..00000000 --- a/syntaxes/scss3/function/parameter.sublime-syntax +++ /dev/null @@ -1,37 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_\-[:alpha:]] - [$_\-[:alnum:]]* - -contexts: - main: - - match: | - (?xi) - ( - \${{commonIdentifier}} - (?> [$\-]\B - | [_[:alnum:]]\b - ) - ) - captures: - 0: function.parameter.scss.scss3 - 1: entity.name.variable.scss.scss3 - pop: true diff --git a/syntaxes/scss3/function/parameters.sublime-syntax b/syntaxes/scss3/function/parameters.sublime-syntax deleted file mode 100644 index 1b9577f1..00000000 --- a/syntaxes/scss3/function/parameters.sublime-syntax +++ /dev/null @@ -1,58 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_\-[:alpha:]] - [$_\-[:alnum:]]* - -contexts: - main: - - match: \s*(\() - captures: - 1: punctuation.definition.function.parameters.begin.scss.scss3 - set: parameters - - parameters: - - match: \s*(\)) - captures: - 1: punctuation.definition.function.parameters.end.scss.scss3 - pop: true - - match: \s*(\,) - captures: - 1: punctuation.definition.function.parameters.scss.scss3 - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | \) - ) - ) - pop: true - # Default value. - - match: \s*(:) - scope: keyword.other.association.scss.scss3 - set: value - # Parameter. - - include: Packages/Naomi/syntaxes/scss3/function/parameter.sublime-syntax - - - value: - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax diff --git a/syntaxes/scss3/interpolation.sublime-syntax b/syntaxes/scss3/interpolation.sublime-syntax deleted file mode 100644 index f498186c..00000000 --- a/syntaxes/scss3/interpolation.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(#{) - captures: - 1: keyword.operator.other.interpolation.begin.scss.scss3 - set: value - - value: - - match: \s*(}) - captures: - 1: keyword.operator.other.interpolation.end.scss.scss3 - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/scss3/keyword.sublime-syntax b/syntaxes/scss3/keyword.sublime-syntax deleted file mode 100644 index 89eee26f..00000000 --- a/syntaxes/scss3/keyword.sublime-syntax +++ /dev/null @@ -1,36 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - # Other keywords. - - match: | - (?x)\s* - ( - (?> !default - | !important - | !optional - | from - | if - | in - | through - ) - )\b - captures: - 1: keyword.other.scss.scss3 - pop: true diff --git a/syntaxes/scss3/literal.sublime-syntax b/syntaxes/scss3/literal.sublime-syntax deleted file mode 100644 index 840b87f8..00000000 --- a/syntaxes/scss3/literal.sublime-syntax +++ /dev/null @@ -1,25 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/scss3/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/literal/string/single-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/literal/color.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/literal/string/unquoted.sublime-syntax diff --git a/syntaxes/scss3/literal/color.sublime-syntax b/syntaxes/scss3/literal/color.sublime-syntax deleted file mode 100644 index 5a7777a9..00000000 --- a/syntaxes/scss3/literal/color.sublime-syntax +++ /dev/null @@ -1,40 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - hex: | - [0-9a-f] - -contexts: - main: - - match: | - (?xi) - (\#) - (?> ({{hex}}{{hex}}) ({{hex}}{{hex}}) ({{hex}}{{hex}}) - | ({{hex}}) ({{hex}}) ({{hex}}) - ) - captures: - 0: constant.color.scss.scss3 - 1: punctuation.definition.color.begin.scss.scss3 - 2: constant.color.red.scss.scss3 - 3: constant.color.green.scss.scss3 - 4: constant.color.blue.scss.scss3 - 5: constant.color.red.scss.scss3 - 6: constant.color.green.scss.scss3 - 7: constant.color.blue.scss.scss3 - pop: true diff --git a/syntaxes/scss3/literal/number.sublime-syntax b/syntaxes/scss3/literal/number.sublime-syntax deleted file mode 100644 index ed147e55..00000000 --- a/syntaxes/scss3/literal/number.sublime-syntax +++ /dev/null @@ -1,86 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - literalDecimal: | - [0-9]+ - - literalFloat: | - (?> [0-9]*[.]{{literalDecimal}} - | {{literalDecimal}}[.][0-9]* - ) - - scientificNotation: | - ( - (?> {{literalFloat}} - | {{literalDecimal}} - ) - [e][+-]? - {{literalDecimal}} - ) - -contexts: - main: - - include: float - - include: integer - - float: - - match: (?xi){{scientificNotation}} - scope: constant.numeric.float.scientific.scss.scss3 - set: unit - - match: (?x){{literalFloat}} - scope: constant.numeric.float.scss.scss3 - set: unit - - integer: - - match: "0b[01]+" - scope: constant.numeric.binary.scss.scss3 - set: unit - - match: "0o[0-7]+" - scope: constant.numeric.octal.scss.scss3 - set: unit - - match: "(?i)0[x][0-9a-f]+" - scope: constant.numeric.hex.scss.scss3 - set: unit - - match: "[1-9][0-9]*|0" - scope: constant.numeric.decimal.scss.scss3 - set: unit - - unit: - - match: | - (?x)\s* - (?> % - | cm - | deg - | e[mx] - | in - | mm - | p[ctx] - | rem - | s - | v - (?> h - | max - | min - | w - ) - ) - scope: keyword.other.unit.scss.scss3 - pop: true - - match: "" - pop: true diff --git a/syntaxes/scss3/literal/string/double-quoted.sublime-syntax b/syntaxes/scss3/literal/string/double-quoted.sublime-syntax deleted file mode 100644 index 57b0bc67..00000000 --- a/syntaxes/scss3/literal/string/double-quoted.sublime-syntax +++ /dev/null @@ -1,58 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - hexEscapedChar: | - [a-f0-9]+ - - doubleQuotedEscapeSequences: | - \\ - (?> ["\\acd] - | {{hexEscapedChar}} - ) - -contexts: - main: - - match: \" - scope: >- - string.quoted.double.scss.scss3 - punctuation.definition.string.begin.scss.scss3 - with_prototype: - - match: (?- - string.quoted.double.scss.scss3 - punctuation.definition.string.end.scss.scss3 - pop: true - set: escape-a - - trap: - - meta_content_scope: context.trap - - escape-a: - - meta_content_scope: string.quoted.double.scss.scss3 - - match: (?xi){{doubleQuotedEscapeSequences}} - scope: constant.character.escape.a.scss.scss3 - set: escape-b - - escape-b: - - meta_content_scope: string.quoted.double.scss.scss3 - - match: (?xi){{doubleQuotedEscapeSequences}} - scope: constant.character.escape.b.scss.scss3 - set: escape-a diff --git a/syntaxes/scss3/literal/string/single-quoted.sublime-syntax b/syntaxes/scss3/literal/string/single-quoted.sublime-syntax deleted file mode 100644 index 0e1e4ec1..00000000 --- a/syntaxes/scss3/literal/string/single-quoted.sublime-syntax +++ /dev/null @@ -1,58 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - hexEscapedChar: | - [a-f0-9]+ - - singleQuotedEscapeSequences: | - \\ - (?> ['\\acd] - | {{hexEscapedChar}} - ) - -contexts: - main: - - match: \' - scope: >- - string.quoted.single.scss.scss3 - punctuation.definition.string.begin.scss.scss3 - with_prototype: - - match: (?- - string.quoted.single.scss.scss3 - punctuation.definition.string.end.scss.scss3 - pop: true - set: escape-a - - trap: - - meta_content_scope: context.trap - - escape-a: - - meta_content_scope: string.quoted.single.scss.scss3 - - match: (?xi){{singleQuotedEscapeSequences}} - scope: constant.character.escape.a.scss.scss3 - set: escape-b - - escape-b: - - meta_content_scope: string.quoted.single.scss.scss3 - - match: (?xi){{singleQuotedEscapeSequences}} - scope: constant.character.escape.b.scss.scss3 - set: escape-a diff --git a/syntaxes/scss3/literal/string/unquoted.sublime-syntax b/syntaxes/scss3/literal/string/unquoted.sublime-syntax deleted file mode 100644 index 67e1f83d..00000000 --- a/syntaxes/scss3/literal/string/unquoted.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x) - \S.*? - (?= - (?> \s - | , - | ; - | \) - | \] - | \} - | $ - ) - ) - scope: string.unquoted.scss.scss3 - pop: true diff --git a/syntaxes/scss3/mixin.sublime-syntax b/syntaxes/scss3/mixin.sublime-syntax deleted file mode 100644 index d8809356..00000000 --- a/syntaxes/scss3/mixin.sublime-syntax +++ /dev/null @@ -1,65 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_\-[:alpha:]] - [$_\-[:alnum:]]* - -contexts: - main: - - match: | - (?xi) - \s*(@mixin)\b - captures: - 0: storage.type.scss.scss3 - 1: keyword.declaration.mixin.scss.scss3 - set: [ - body, - optional-parameters, - name - ] - - name: - - match: | - (?xi) - \s*({{commonIdentifier}}) - captures: - 1: entity.name.mixin.scss.scss3 - pop: true - - optional-parameters: - - match: (?=\s*{) - pop: true - - include: Packages/Naomi/syntaxes/scss3/mixin/parameters.sublime-syntax - - body: - - match: \s*({) - scope: punctuation.definition.mixin.body.begin.scss.scss3 - set: body-content - - body-content: - - match: \s*(}) - scope: punctuation.definition.mixin.body.end.scss.scss3 - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: Packages/Naomi/syntaxes/scss3/attribute.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax diff --git a/syntaxes/scss3/mixin/parameters.sublime-syntax b/syntaxes/scss3/mixin/parameters.sublime-syntax deleted file mode 100644 index 16628f67..00000000 --- a/syntaxes/scss3/mixin/parameters.sublime-syntax +++ /dev/null @@ -1,52 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(\() - captures: - 1: punctuation.definition.mixin.parameters.begin.scss.scss3 - set: parameters - - parameters: - - match: \s*(\)) - captures: - 1: punctuation.definition.mixin.parameters.end.scss.scss3 - pop: true - - match: \s*(\,) - captures: - 1: punctuation.definition.mixin.parameters.scss.scss3 - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | \) - ) - ) - pop: true - # Default value. - - match: \s*(:) - scope: keyword.other.association.scss.scss3 - set: value - # Parameter. - - include: Packages/Naomi/syntaxes/scss3/function/parameter.sublime-syntax - - value: - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax diff --git a/syntaxes/scss3/operator.sublime-syntax b/syntaxes/scss3/operator.sublime-syntax deleted file mode 100644 index e0eb3c45..00000000 --- a/syntaxes/scss3/operator.sublime-syntax +++ /dev/null @@ -1,24 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/scss3/operator/comparison.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/operator/logical.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/operator/arithmetic.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/operator/other.sublime-syntax diff --git a/syntaxes/scss3/operator/arithmetic.sublime-syntax b/syntaxes/scss3/operator/arithmetic.sublime-syntax deleted file mode 100644 index 46aff42c..00000000 --- a/syntaxes/scss3/operator/arithmetic.sublime-syntax +++ /dev/null @@ -1,40 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:----------------| - # | - | Subtraction. | - # | + | Addition. | - # | * | Multiplication. | - # | / | Division. | - # | % | Modulus. | - main: - - match: | - (?x)\s* - ( - (?> - - | \+ - | \* - | / - | % - ) - ) - captures: - 1: keyword.operator.arithmetic.scss.scss3 - pop: true diff --git a/syntaxes/scss3/operator/comparison.sublime-syntax b/syntaxes/scss3/operator/comparison.sublime-syntax deleted file mode 100644 index eaa929ff..00000000 --- a/syntaxes/scss3/operator/comparison.sublime-syntax +++ /dev/null @@ -1,42 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:--------------------------| - # | == | Loose equality. | - # | != | Not equal. | - # | >= | Greater than or equal to. | - # | <= | Less than or equal to. | - # | > | Greater than. | - # | < | Less than. | - main: - - match: | - (?x)\s* - ( - (?> == - | != - | >= - | <= - | >(?!>) - | <(?!<) - ) - ) - captures: - 1: keyword.operator.comparison.scss.scss3 - pop: true diff --git a/syntaxes/scss3/operator/logical.sublime-syntax b/syntaxes/scss3/operator/logical.sublime-syntax deleted file mode 100644 index 9e8fd847..00000000 --- a/syntaxes/scss3/operator/logical.sublime-syntax +++ /dev/null @@ -1,47 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - # | Operator | Description | - # |:--------:|:------------| - # | && | And. | - # | || | Or. | - # | ! | Not. | - main: - - match: | - (?x)\s* - ( - (?> and - | or - | not - ) - )\b - captures: - 1: keyword.operator.logical.word.scss.scss3 - pop: true - - match: | - (?x)\s* - ( - (?> && - | \|\| - | ! - ) - ) - captures: - 1: keyword.operator.logical.scss.scss3 - pop: true diff --git a/syntaxes/scss3/operator/other.sublime-syntax b/syntaxes/scss3/operator/other.sublime-syntax deleted file mode 100644 index e20d4846..00000000 --- a/syntaxes/scss3/operator/other.sublime-syntax +++ /dev/null @@ -1,24 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(,) - captures: - 1: keyword.operator.other.comma.js.fjsx15 - pop: true diff --git a/syntaxes/scss3/selector.sublime-syntax b/syntaxes/scss3/selector.sublime-syntax deleted file mode 100644 index 33051e11..00000000 --- a/syntaxes/scss3/selector.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - include: Packages/Naomi/syntaxes/scss3/selector/interpolation.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector/operator.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector/keyframe.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector/id.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector/placeholder.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector/class.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector/pseudo-class.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector/pseudo-element.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector/attribute.sublime-syntax - # Tag selectors. - - include: Packages/Naomi/syntaxes/scss3/selector/tag/embedded.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector/tag/form.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector/tag/sectioning-root.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector/tag/sectioning.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector/tag/other.sublime-syntax diff --git a/syntaxes/scss3/selector/attribute.sublime-syntax b/syntaxes/scss3/selector/attribute.sublime-syntax deleted file mode 100644 index e7c8a36a..00000000 --- a/syntaxes/scss3/selector/attribute.sublime-syntax +++ /dev/null @@ -1,145 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_\-[:alpha:]] - [_\-[:alnum:]]* - -contexts: - main: - - match: \s*(\[) - captures: - 1: punctuation.definition.selector.begin.scss.scss3 - set: attributes - - attributes: - - match: \s*(\]) - captures: - 1: punctuation.definition.selector.end.scss.scss3 - set: trap - - match: "" - push: - - match: (?=\s*\]) - pop: true - - include: attribute - - include: operator - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax - - attribute: - - match: | - (?xi)\s* - ( - (?> animation - | background-color - | background-image - | background-size - | background - | border-collapse - | border-color - | border-radius - | border-spacing - | border - | bottom - | box-shadow - | box-sizing - | checked - | color - | controls - | cursor - | disabled - | display - | fill - | float - | font-family - | font-size - | font-style - | font-weight - | font - | height - | hidden - | left - | letter-spacing - | line-height - | margin-bottom - | margin-left - | margin-right - | margin-top - | margin - | max-height - | max-width - | min-height - | min-width - | opacity - | overflow - | padding-bottom - | padding-left - | padding-right - | padding-top - | padding - | position - | right - | src - | stroke-width - | stroke - | text-align - | text-decoration - | text-transform - | title - | top - | transform-origin - | transform - | transition - | type - | vertical-align - | width - | z-index - ) - ) - captures: - 0: support.scss.scss3 - 1: entity.name.attribute.scss.scss3 - pop: true - - operator: - - match: | - (?x)\s* - ( - (?> = - | ~= - | \|= - | ^= - | \$= - | \*= - ) - ) - captures: - 1: keyword.operator.other.scss.scss3 - set: value - - value: - - match: (?=\s*\]) - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax - - match: "" - pop: true - diff --git a/syntaxes/scss3/selector/class.sublime-syntax b/syntaxes/scss3/selector/class.sublime-syntax deleted file mode 100644 index 2cdea802..00000000 --- a/syntaxes/scss3/selector/class.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_\-[:alpha:]] - [_\-[:alnum:]]* - -contexts: - main: - - match: | - (?xi)\s* - (\.)({{commonIdentifier}})? - captures: - 1: punctuation.definition.selector.class.scss.scss3 - 2: entity.name.selector.class.scss.scss3 - set: trap - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax diff --git a/syntaxes/scss3/selector/id.sublime-syntax b/syntaxes/scss3/selector/id.sublime-syntax deleted file mode 100644 index f82a3d27..00000000 --- a/syntaxes/scss3/selector/id.sublime-syntax +++ /dev/null @@ -1,36 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_\-[:alpha:]] - [_\-[:alnum:]]* - -contexts: - main: - - match: | - (?xi)\s* - (\#)(?!{) - ({{commonIdentifier}})? - captures: - 1: punctuation.definition.selector.id.scss.scss3 - 2: entity.name.selector.id.scss.scss3 - set: trap - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax diff --git a/syntaxes/scss3/selector/interpolation.sublime-syntax b/syntaxes/scss3/selector/interpolation.sublime-syntax deleted file mode 100644 index d986e4a4..00000000 --- a/syntaxes/scss3/selector/interpolation.sublime-syntax +++ /dev/null @@ -1,38 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(#{) - captures: - 1: keyword.operator.other.interpolation.begin.scss.scss3 - set: value - - value: - - match: \s*(}) - captures: - 1: keyword.operator.other.interpolation.end.scss.scss3 - set: trap - - match: "" - push: - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax - - match: "" - pop: true - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax diff --git a/syntaxes/scss3/selector/keyframe.sublime-syntax b/syntaxes/scss3/selector/keyframe.sublime-syntax deleted file mode 100644 index fd7c1a0d..00000000 --- a/syntaxes/scss3/selector/keyframe.sublime-syntax +++ /dev/null @@ -1,29 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ([0-9]{1,3}%) - captures: - 1: entity.name.selector.keyframe.scss.scss3 - set: trap - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax diff --git a/syntaxes/scss3/selector/operator.sublime-syntax b/syntaxes/scss3/selector/operator.sublime-syntax deleted file mode 100644 index 6aa6fe20..00000000 --- a/syntaxes/scss3/selector/operator.sublime-syntax +++ /dev/null @@ -1,47 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(\,) - captures: - 1: keyword.operator.other.comma.scss.scss3 - set: trap - - match: \s*(&)(?!&) - captures: - 1: keyword.operator.other.selector.inherit.css.css3 - set: trap - - match: \s*(\*) - captures: - 1: keyword.operator.other.selector.all.css.css3 - set: trap - - match: \s*(\+) - captures: - 1: keyword.operator.other.selector.adjacent.css.css3 - set: trap - - match: \s*(>) - captures: - 1: keyword.operator.other.selector.direct.css.css3 - set: trap - - match: \s*(~) - captures: - 1: keyword.operator.other.selector.sibling.css.css3 - set: trap - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax diff --git a/syntaxes/scss3/selector/placeholder.sublime-syntax b/syntaxes/scss3/selector/placeholder.sublime-syntax deleted file mode 100644 index 4c622c28..00000000 --- a/syntaxes/scss3/selector/placeholder.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_\-[:alpha:]] - [_\-[:alnum:]]* - -contexts: - main: - - match: | - (?xi)\s* - (%)({{commonIdentifier}})\b - captures: - 1: punctuation.definition.selector.placeholder.scss.scss3 - 2: entity.name.selector.placeholder.scss.scss3 - set: trap - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax diff --git a/syntaxes/scss3/selector/pseudo-class.sublime-syntax b/syntaxes/scss3/selector/pseudo-class.sublime-syntax deleted file mode 100644 index 6b6218aa..00000000 --- a/syntaxes/scss3/selector/pseudo-class.sublime-syntax +++ /dev/null @@ -1,106 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_\-[:alpha:]] - [_\-[:alnum:]]* - -contexts: - main: - - include: extension - - include: normal - - extension: - - match: | - (?xi) - \s* - (:-)({{commonIdentifier}}) - captures: - 0: extension.scss.scss3 - 1: punctuation.definition.selector.pseudo-class.scss.scss3 - 2: entity.name.selector.pseudo-class.scss.scss3 - set: trap - - normal: - - match: | - (?xi)\s* - (:) - ( - (?> active - | any(?:-link)? - | checked - | default - | dir - | disabled - | empty - | enabled - | first-child - | first-of-type - | first - | focus - | fullscreen - | global - | hover - | in-range - | indeterminate - | invalid - | lang - | last-child - | last-of-type - | left - | link - | local - | not - | nth-child - | nth-last-child - | nth-last-of-type - | nth-of-type - | only-child - | only-of-type - | optional - | out-of-range - | read-only - | read-write - | required - | right - | root - | scope - | target - | valid - | visited - ) - )\b - captures: - 1: punctuation.definition.selector.pseudo-class.scss.scss3 - 2: entity.name.selector.pseudo-class.scss.scss3 - set: optional-arguments - - optional-arguments: - - match: (?=\s*\() - set: [ - trap, - arguments - ] - - include: trap - - arguments: - - include: Packages/Naomi/syntaxes/scss3/selector/pseudo-class/arguments.sublime-syntax - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax diff --git a/syntaxes/scss3/selector/pseudo-class/arguments.sublime-syntax b/syntaxes/scss3/selector/pseudo-class/arguments.sublime-syntax deleted file mode 100644 index 56cb9d83..00000000 --- a/syntaxes/scss3/selector/pseudo-class/arguments.sublime-syntax +++ /dev/null @@ -1,45 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(\() - captures: - 1: punctuation.definition.selector.pseudo-class.arguments.begin.scss.scss3 - set: arguments - - arguments: - - match: \s*(\)) - captures: - 1: punctuation.definition.selector.pseudo-class.arguments.end.scss.scss3 - pop: true - - match: \s*(\,) - captures: - 1: punctuation.definition.selector.pseudo-class.arguments.scss.scss3 - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | \) - ) - ) - pop: true - - include: Packages/Naomi/syntaxes/scss3/attribute.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector.sublime-syntax diff --git a/syntaxes/scss3/selector/pseudo-element.sublime-syntax b/syntaxes/scss3/selector/pseudo-element.sublime-syntax deleted file mode 100644 index a8079adc..00000000 --- a/syntaxes/scss3/selector/pseudo-element.sublime-syntax +++ /dev/null @@ -1,73 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_\-[:alpha:]] - [_\-[:alnum:]]* - -contexts: - main: - - include: extension - - include: pseudo-element - - extension: - - match: | - (?xi) - \s* - (::-)({{commonIdentifier}}) - captures: - 0: extension.scss.scss3 - 1: punctuation.definition.selector.pseudo-element.scss.scss3 - 2: entity.name.selector.pseudo-element.scss.scss3 - set: trap - - pseudo-element: - # Old. - - match: | - (?xi)\s* - (:) - ( - (?> after - | before - ) - )\b - captures: - 1: punctuation.definition.selector.pseudo-element.scss.scss3 - 2: entity.name.selector.pseudo-element.scss.scss3 - set: trap - # New. - - match: | - (?xi)\s* - (::) - ( - (?> after - | backdrop - | before - | first-letter - | first-line - | selection - ) - )\b - captures: - 1: punctuation.definition.selector.pseudo-element.scss.scss3 - 2: entity.name.selector.pseudo-element.scss.scss3 - set: trap - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax diff --git a/syntaxes/scss3/selector/tag/embedded.sublime-syntax b/syntaxes/scss3/selector/tag/embedded.sublime-syntax deleted file mode 100644 index 609071ad..00000000 --- a/syntaxes/scss3/selector/tag/embedded.sublime-syntax +++ /dev/null @@ -1,40 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ( - (?> audio - | canvas - | embed - | i(?>frame|mg) - | math - | object - | svg - | video - ) - )\b - (?!\s*\() - captures: - 1: entity.name.selector.tag.embedded.scss.scss3 - set: trap - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax diff --git a/syntaxes/scss3/selector/tag/form.sublime-syntax b/syntaxes/scss3/selector/tag/form.sublime-syntax deleted file mode 100644 index 10ce7623..00000000 --- a/syntaxes/scss3/selector/tag/form.sublime-syntax +++ /dev/null @@ -1,42 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ( - (?> button - | form - | input - | l - (?> abel - | egend - ) - | option - | select - | textarea - ) - )\b - (?!\s*\() - captures: - 1: entity.name.selector.tag.form.scss.scss3 - set: trap - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax diff --git a/syntaxes/scss3/selector/tag/other.sublime-syntax b/syntaxes/scss3/selector/tag/other.sublime-syntax deleted file mode 100644 index 2c900fed..00000000 --- a/syntaxes/scss3/selector/tag/other.sublime-syntax +++ /dev/null @@ -1,35 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [_\-[:alpha:]] - [_\-[:alnum:]]* - -contexts: - main: - - match: | - (?x) - \s*({{commonIdentifier}})\b - (?!\s*\() - captures: - 1: entity.name.selector.tag.scss.scss3 - set: trap - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax diff --git a/syntaxes/scss3/selector/tag/sectioning-root.sublime-syntax b/syntaxes/scss3/selector/tag/sectioning-root.sublime-syntax deleted file mode 100644 index 3776ba05..00000000 --- a/syntaxes/scss3/selector/tag/sectioning-root.sublime-syntax +++ /dev/null @@ -1,37 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ( - (?> b - (?>lockquote|ody) - | fi - (?>eldset|gure) - | td - ) - )\b - (?!\s*\() - captures: - 1: entity.name.selector.tag.sectioning.root.scss.scss3 - set: trap - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax diff --git a/syntaxes/scss3/selector/tag/sectioning.sublime-syntax b/syntaxes/scss3/selector/tag/sectioning.sublime-syntax deleted file mode 100644 index 865353b1..00000000 --- a/syntaxes/scss3/selector/tag/sectioning.sublime-syntax +++ /dev/null @@ -1,36 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?x)\s* - ( - (?> a - (?>rticle|side) - | nav - | section - ) - )\b - (?!\s*\() - captures: - 1: entity.name.selector.tag.sectioning.scss.scss3 - set: trap - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax diff --git a/syntaxes/scss3/selector/trap.sublime-syntax b/syntaxes/scss3/selector/trap.sublime-syntax deleted file mode 100644 index 0b7c725a..00000000 --- a/syntaxes/scss3/selector/trap.sublime-syntax +++ /dev/null @@ -1,54 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: "" - set: selectors - - selectors: - - match: | - (?x) - (?=\s* - (?> ; - | \) - ) - ) - pop: true - - match: \s*({) - captures: - 1: punctuation.definition.body.begin.scss.scss3 - set: body - - match: \s*(,) - captures: - 1: keyword.operator.other.comma.scss.scss3 - - include: Packages/Naomi/syntaxes/scss3/keyword.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector.sublime-syntax - - body: - - match: \s*(}) - captures: - 1: punctuation.definition.body.end.scss.scss3 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: Packages/Naomi/syntaxes/scss3/attribute.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax diff --git a/syntaxes/scss3/statement-and-expression.sublime-syntax b/syntaxes/scss3/statement-and-expression.sublime-syntax deleted file mode 100644 index 9376cd00..00000000 --- a/syntaxes/scss3/statement-and-expression.sublime-syntax +++ /dev/null @@ -1,89 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - expressionGroupBegin: | - (? each - | for - | media - ) - )\b - captures: - 1: keyword.control.scss.scss3 - set: [ - body, - free-header-content - ] - - match: | - (?x) - \s* - (@ - (?> else - | font-face - | if - | keyframes - ) - )\b - captures: - 1: keyword.control.scss.scss3 - set: [ - body, - header - ] - - header: - - match: \s*\( - scope: punctuation.definition.control.header.begin.scss.scss3 - set: enveloped-header-content - - match: "" - set: free-header-content - - free-header-content: - - match: (?=\s*{) - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax - - match: "" - pop: true - - enveloped-header-content: - - match: \s*\) - scope: punctuation.definition.control.header.end.scss.scss3 - set: header - - match: "" - push: - - match: (?=\)) - pop: true - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax - - body: - - match: \s*({) - captures: - 1: punctuation.definition.control.body.begin.scss.scss3 - set: body-content - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax - - body-content: - - match: \s*(}) - captures: - 1: punctuation.definition.control.body.end.scss.scss3 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: Packages/Naomi/syntaxes/scss3/attribute.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax diff --git a/syntaxes/scss3/statement/simple.sublime-syntax b/syntaxes/scss3/statement/simple.sublime-syntax deleted file mode 100644 index fa7e612a..00000000 --- a/syntaxes/scss3/statement/simple.sublime-syntax +++ /dev/null @@ -1,100 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_\-[:alpha:]] - [$_\-[:alnum:]]* - -contexts: - main: - - match: | - (?x) - \s*(@ - (?> content - | return - ) - )\b - captures: - 1: keyword.control.other.scss.scss3 - set: value - # Extend. - - match: | - (?x) - \s* - (@extend)\b - captures: - 0: storage.modifier.scss.scss3 - 1: keyword.control.extend.scss.scss3 - set: value-with-selectors - # Import. - - match: | - (?x) - \s*(@import)\b - captures: - 1: keyword.control.import.scss.scss3 - set: value - # Include. - - match: | - (?x) - \s*(@include)\b - captures: - 1: keyword.control.include.scss.scss3 - set: include-value - - trap: - - include: Packages/Naomi/syntaxes/scss3/selector/trap.sublime-syntax - - statement-and-expression: - - include: Packages/Naomi/syntaxes/scss3/statement-and-expression.sublime-syntax - - include-value: - # Mixin. - - match: | - (?xi)\s* - ({{commonIdentifier}}) - (?=\s*(?>$|\{)) - captures: - 1: entity.name.mixin.scss.scss3 - set: trap - # Other values. - - include: value - - value: - - match: (?=\s*\{) - set: trap - - include: Packages/Naomi/syntaxes/scss3/terminator.sublime-syntax - - match: "" - push: - - match: | - (?x) - (?=\s*;) - pop: true - - include: statement-and-expression - - value-with-selectors: - - include: Packages/Naomi/syntaxes/scss3/terminator.sublime-syntax - - match: "" - push: - - match: | - (?x) - (?=\s*;) - pop: true - - include: Packages/Naomi/syntaxes/scss3/attribute.sublime-syntax - - include: Packages/Naomi/syntaxes/scss3/selector.sublime-syntax - - include: statement-and-expression diff --git a/syntaxes/scss3/terminator.sublime-syntax b/syntaxes/scss3/terminator.sublime-syntax deleted file mode 100644 index e20a4676..00000000 --- a/syntaxes/scss3/terminator.sublime-syntax +++ /dev/null @@ -1,24 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: \s*(;) - captures: - 1: keyword.other.terminator.scss.scss3 - pop: true diff --git a/syntaxes/scss3/variable-declaration.sublime-syntax b/syntaxes/scss3/variable-declaration.sublime-syntax deleted file mode 100644 index bc6673cf..00000000 --- a/syntaxes/scss3/variable-declaration.sublime-syntax +++ /dev/null @@ -1,49 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_\-[:alpha:]] - [$_\-[:alnum:]]* - -contexts: - main: - - match: | - (?xi) - \s*(\${{commonIdentifier}}) - \s*(:) - captures: - 1: >- - declaration.scss.scss3 - entity.name.variable.scss.scss3 - 2: punctuation.binding.scss.scss3 - set: value - - value: - - include: terminator - - match: "" - push: - - match: (?=\s*;) - pop: true - - include: expression - - terminator: - - include: Packages/Naomi/syntaxes/scss3/terminator.sublime-syntax - - expression: - - include: Packages/Naomi/syntaxes/scss3/expression.sublime-syntax diff --git a/syntaxes/scss3/variable.sublime-syntax b/syntaxes/scss3/variable.sublime-syntax deleted file mode 100644 index 206d15a6..00000000 --- a/syntaxes/scss3/variable.sublime-syntax +++ /dev/null @@ -1,49 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -variables: - commonIdentifier: | - [$_\-[:alpha:]] - [$_\-[:alnum:]]* - -contexts: - main: - # Single character. - - match: | - (?xi)\s* - ( - \$ - (?> [$\-]\B - | [_[:alnum:]]\b - ) - ) - captures: - 1: entity.name.variable.scss.scss3 - pop: true - # Two or more characters - - match: | - (?xi)\s* - ( - \${{commonIdentifier}} - (?> [$\-]\B - | [_[:alnum:]]\b - ) - ) - captures: - 1: entity.name.variable.scss.scss3 - pop: true diff --git a/syntaxes/shared/email.no-pop.sublime-syntax b/syntaxes/shared/email.no-pop.sublime-syntax deleted file mode 100644 index f1170c76..00000000 --- a/syntaxes/shared/email.no-pop.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?xi) - (?> ([.[:alnum:]]+@[.[:alnum:]]+)\s - | (<[.[:alnum:]]+@[.[:alnum:]]+>) - ) - captures: - 1: entity.email - 2: entity.email diff --git a/syntaxes/shared/email.sublime-syntax b/syntaxes/shared/email.sublime-syntax deleted file mode 100644 index b2682191..00000000 --- a/syntaxes/shared/email.sublime-syntax +++ /dev/null @@ -1,28 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?xi)\s* - (?> ([.[:alnum:]]+@[.[:alnum:]]+)\s - | (<[.[:alnum:]]+@[.[:alnum:]]+>) - ) - captures: - 1: entity.email - 2: entity.email diff --git a/syntaxes/shared/link.no-pop.sublime-syntax b/syntaxes/shared/link.no-pop.sublime-syntax deleted file mode 100644 index a573c4d5..00000000 --- a/syntaxes/shared/link.no-pop.sublime-syntax +++ /dev/null @@ -1,23 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: (?i)([[:alnum:]]+://\S+)\s - captures: - 1: entity.link diff --git a/syntaxes/shared/link.sublime-syntax b/syntaxes/shared/link.sublime-syntax deleted file mode 100644 index e2326444..00000000 --- a/syntaxes/shared/link.sublime-syntax +++ /dev/null @@ -1,25 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -hidden: true -scope: ... - -contexts: - main: - - match: | - (?xi)\s* - ([[:alnum:]]+://\S+)\s - captures: - 1: entity.link diff --git a/system/__init__.py b/system/__init__.py new file mode 100644 index 00000000..b528b38a --- /dev/null +++ b/system/__init__.py @@ -0,0 +1,57 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from os.path import ( + dirname, + join, + realpath, +) + +from .integration import ( + integrate_commands, + integrate_keymaps, + integrate_menus, + integrate_preferences, + integrate_syntaxes, +) + +from .event_bus import * # noqa +from .logging import * # noqa +from .path import * # noqa +from .state_store import * # noqa + +INTEGRATION_DIR = realpath(join(dirname(__file__), '..', 'integration')) + +integrate_commands( + join(INTEGRATION_DIR, 'commands', 'src'), + join(INTEGRATION_DIR, 'commands', 'build'), +) + +integrate_keymaps( + join(INTEGRATION_DIR, 'keymaps', 'src'), + join(INTEGRATION_DIR, 'keymaps', 'build'), +) + +integrate_menus( + join(INTEGRATION_DIR, 'menus', 'src'), + join(INTEGRATION_DIR, 'menus', 'build'), +) + +integrate_preferences( + join(INTEGRATION_DIR, 'preferences', 'src'), + join(INTEGRATION_DIR, 'preferences', 'build'), +) + +integrate_syntaxes( + join(INTEGRATION_DIR, 'syntaxes', 'src'), + join(INTEGRATION_DIR, 'syntaxes', 'build'), +) diff --git a/plugin/__init__.py b/system/__tests__/__init__.py similarity index 100% rename from plugin/__init__.py rename to system/__tests__/__init__.py diff --git a/system/__tests__/my_test.py b/system/__tests__/my_test.py new file mode 100644 index 00000000..bf157752 --- /dev/null +++ b/system/__tests__/my_test.py @@ -0,0 +1,17 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from unittest import TestCase + +class HelloTest(TestCase): + def test_something(self): + self.assertEqual(0, 0) diff --git a/system/commands/Build.py b/system/commands/Build.py new file mode 100644 index 00000000..54b2bbb6 --- /dev/null +++ b/system/commands/Build.py @@ -0,0 +1,37 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from Naomi.system.compilers import ( + compile_configured_syntaxes, + compile_integrated_commands, + compile_integrated_keymaps, + compile_integrated_menus, + compile_integrated_preferences, +) + +from sublime import set_timeout_async +from sublime_plugin import ApplicationCommand + +COMPILERS = { + 'syntaxes': compile_configured_syntaxes, + 'commands': compile_integrated_commands, + 'keymaps': compile_integrated_keymaps, + 'menus': compile_integrated_menus, + 'preferences': compile_integrated_preferences, +} + +class NaomiBuildCommand(ApplicationCommand): + def description(self, what): + return 'Build %s' % what.title() + + def run(self, what): + set_timeout_async(lambda: COMPILERS[what]()) diff --git a/plugin/commands/CloseJsxTag.py b/system/commands/CloseJsxTag.py similarity index 99% rename from plugin/commands/CloseJsxTag.py rename to system/commands/CloseJsxTag.py index 10b19426..809f663f 100644 --- a/plugin/commands/CloseJsxTag.py +++ b/system/commands/CloseJsxTag.py @@ -13,7 +13,6 @@ from sublime import Region from sublime_plugin import TextCommand - class NaomiCloseJsxTagCommand(TextCommand): def __init__(self, view): self.view = view diff --git a/system/commands/RunCommands.py b/system/commands/RunCommands.py new file mode 100644 index 00000000..34a95102 --- /dev/null +++ b/system/commands/RunCommands.py @@ -0,0 +1,57 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +import sublime +from sublime_plugin import TextCommand + +# This command can be used in key bindings to run multiple commands, it +# expects a single argument “commands” containing the list of commands to +# run. +# +# Each command have 3 properties: +# +# * “command”: The actual command to run; +# * “on”: Where the command will run, it accepts: app, window and view; If +# no value is specified, the default one “view” will be used; +# * “args”: Arguments to pass directly to the command; +# +# There’s an example in: +# +# Naomi/keymaps/src/normalize-enter/parenthesis.yml +# +class NaomiRunCommandsCommand(TextCommand): + def run(self, edit, commands=None): + # Ignore empty commands. + if commands is None: + return + + for command in commands: + if 'on' not in command: + command['on'] = 'view' + + command_receiver = None + command_on = command['on'] + + if command_on == 'app': + command_receiver = sublime + elif command_on == 'window': + command_receiver = self.view.window + elif command_on == 'view': + command_receiver = self.view + else: + message = 'Invalid command destination “%s”.' % command_on + raise ValueError(message) + + command_receiver.run_command( + command['command'], + command['args'] + ) diff --git a/system/commands/RunTests.py b/system/commands/RunTests.py new file mode 100644 index 00000000..8410ff3f --- /dev/null +++ b/system/commands/RunTests.py @@ -0,0 +1,20 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from sublime_plugin import ApplicationCommand + +class NaomiRunTestsCommand(ApplicationCommand): + def description(self, test_type): + return 'Run %s tests' % test_type + + def run(self, test_type): + print('Running %s tests...' % test_type) diff --git a/system/commands/ToggleJsxComment.py b/system/commands/ToggleJsxComment.py new file mode 100644 index 00000000..4f1c0c76 --- /dev/null +++ b/system/commands/ToggleJsxComment.py @@ -0,0 +1,20 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from sublime_plugin import TextCommand + +class NaomiToggleJsxCommentCommand(TextCommand): + def __init__(self, view): + self.view = view + + def run(self, edit, block): + self.view.run_command('toggle_comment') diff --git a/system/commands/Watch.py b/system/commands/Watch.py new file mode 100644 index 00000000..48ddfcef --- /dev/null +++ b/system/commands/Watch.py @@ -0,0 +1,114 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from Naomi.system.events import ( + stopped_watching_commands, + stopped_watching_keymaps, + stopped_watching_menus, + stopped_watching_preferences, + stopped_watching_syntaxes, + + watching_commands, + watching_keymaps, + watching_menus, + watching_preferences, + watching_syntaxes, +) + +from Naomi.system import ( + EVENT_BUS, + log_info, + STATE_STORE, +) + +from Naomi.system.compilers import ( + compile_configured_syntaxes, + compile_integrated_commands, + compile_integrated_keymaps, + compile_integrated_menus, + compile_integrated_preferences, +) + +from sublime import set_timeout_async +from sublime_plugin import ApplicationCommand +from watchdog.events import PatternMatchingEventHandler +from watchdog.observers import Observer + +COMPILERS = { + 'syntaxes': compile_configured_syntaxes, + 'commands': compile_integrated_commands, + 'keymaps': compile_integrated_keymaps, + 'menus': compile_integrated_menus, + 'preferences': compile_integrated_preferences, +} + +STOPPED_EVENTS = { + 'commands': stopped_watching_commands, + 'keymaps': stopped_watching_keymaps, + 'menus': stopped_watching_menus, + 'preferences': stopped_watching_preferences, + 'syntaxes': stopped_watching_syntaxes, +} + +WATCHING_EVENTS = { + 'commands': watching_commands, + 'keymaps': watching_keymaps, + 'menus': watching_menus, + 'preferences': watching_preferences, + 'syntaxes': watching_syntaxes, +} + +class EventHandler(PatternMatchingEventHandler): + patterns = ['*.yml'] + + def __init__(self, compiler): + self.compiler = compiler + + def on_created(self, event): + self.process(event) + + def on_modified(self, event): + self.process(event) + + def on_deleted(self, event): + self.process(event) + + def process(self, event): + set_timeout_async(lambda: self.compiler()) + +class NaomiWatchCommand(ApplicationCommand): + def __init__(self): + self.observers = {} + + def description(self, what): + if STATE_STORE['watching'][what]: + return 'Unwatch %s' % what.title() + return 'Watch %s' % what.title() + + def run(self, what): + if not STATE_STORE['watching'][what]: + self.observers[what] = Observer() + + for integrated in STATE_STORE['integrated'][what]: + self.observers[what].schedule( + EventHandler(COMPILERS[what]), + path=integrated['src_dir'], + recursive=True, + ) + + self.observers[what].start() + EVENT_BUS.emit(WATCHING_EVENTS[what]()) + log_info('Started watching %s...' % what) + else: + self.observers[what].stop() + EVENT_BUS.emit(STOPPED_EVENTS[what]()) + log_info('Stopped watching %s.' % what) diff --git a/system/commands/__init__.py b/system/commands/__init__.py new file mode 100644 index 00000000..8f2dd106 --- /dev/null +++ b/system/commands/__init__.py @@ -0,0 +1,18 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .Build import * # noqa +from .CloseJsxTag import * # noqa +from .RunCommands import * # noqa +from .RunTests import * # noqa +from .ToggleJsxComment import * # noqa +from .Watch import * # noqa diff --git a/system/compilers/__init__.py b/system/compilers/__init__.py new file mode 100644 index 00000000..d6be5a53 --- /dev/null +++ b/system/compilers/__init__.py @@ -0,0 +1,91 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from Naomi.system import ( + EVENT_BUS, + STATE_STORE, +) + +from Naomi.system.events import ( + building_commands, + building_keymaps, + building_menus, + building_preferences, + building_syntaxes, + + finished_building_commands, + finished_building_keymaps, + finished_building_menus, + finished_building_preferences, + finished_building_syntaxes, +) + +from .syntaxes import compile_syntax # noqa +from .commands import compile_commands # noqa +from .keymaps import compile_keymaps # noqa +from .menus import compile_menus # noqa +from .preferences import compile_preferences # noqa + +def compile_integrated_commands(): + EVENT_BUS.emit(building_commands()) + + for integrated in STATE_STORE['integrated']['commands']: + compile_commands( + integrated['src_dir'], + integrated['build_dir'], + ) + + EVENT_BUS.emit(finished_building_commands()) + +def compile_integrated_keymaps(): + EVENT_BUS.emit(building_keymaps()) + + for integrated in STATE_STORE['integrated']['keymaps']: + compile_keymaps( + integrated['src_dir'], + integrated['build_dir'], + ) + + EVENT_BUS.emit(finished_building_keymaps()) + +def compile_integrated_menus(): + EVENT_BUS.emit(building_menus()) + + for integrated in STATE_STORE['integrated']['menus']: + compile_menus( + integrated['src_dir'], + integrated['build_dir'], + ) + + EVENT_BUS.emit(finished_building_menus()) + +def compile_integrated_preferences(): + EVENT_BUS.emit(building_preferences()) + + for integrated in STATE_STORE['integrated']['preferences']: + compile_preferences( + integrated['src_dir'], + integrated['build_dir'], + ) + + EVENT_BUS.emit(finished_building_preferences()) + +def compile_configured_syntaxes(): + EVENT_BUS.emit(building_syntaxes()) + + for settings in STATE_STORE['settings']['syntaxes']: + compile_syntax( + settings, + STATE_STORE['integrated']['syntaxes'], + ) + + EVENT_BUS.emit(finished_building_syntaxes()) diff --git a/system/compilers/commands.py b/system/compilers/commands.py new file mode 100644 index 00000000..5e099feb --- /dev/null +++ b/system/compilers/commands.py @@ -0,0 +1,62 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from borela import ( + delete_dir_contents, + list_files, + load_yaml, + modify_path, + to_json_string, + write_text_file, +) + +from Naomi.system import ( + EVENT_BUS, + log_debug, + log_info, + package_relpath, +) + +from Naomi.system.headers import command as command_header + +# Convert commands from “x.yml” to “x.sublime-commands”. +def compile_commands(src_dir, build_dir): + log_debug('Cleaning: %s' % package_relpath(build_dir)) + + delete_dir_contents(build_dir) + + log_info('Building command files: %s' % src_dir) + + for file, _, _ in list_files(src_dir): + destination = modify_path( + file, + old_base=src_dir, + new_base=build_dir, + new_extension='sublime-commands', + ) + + relative_file_path = package_relpath(file) + log_debug('Building file: %s' % relative_file_path) + + data = load_yaml(file) + + if data is None: + log_debug('Empty file: %s' % relative_file_path) + continue + + json_string = to_json_string(data, indent=True) + final_string = command_header(src_dir) + json_string + + write_text_file(destination, final_string) + log_debug('File generated: %s' % package_relpath(destination)) + + log_info('Done building commands: %s' % src_dir) diff --git a/system/compilers/keymaps.py b/system/compilers/keymaps.py new file mode 100644 index 00000000..e5d96d58 --- /dev/null +++ b/system/compilers/keymaps.py @@ -0,0 +1,150 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from borela import ( + delete_dir_contents, + list_files, + load_yaml, + to_json_string, + write_text_file, +) + +from Naomi.system import ( + EVENT_BUS, + log_debug, + log_info, + package_relpath, +) + +from Naomi.system.headers import keymap as keymap_header +from os.path import join + +# Load all keymaps sources and generate files for each OS on demand: +# +# Default.sublime-keymap +# Default (Linux).sublime-keymap +# Default (Windows).sublime-keymap +# Default (OSX).sublime-keymap +# +def compile_keymaps(src_dir, build_dir): + log_debug('Cleaning: %s' % package_relpath(build_dir)) + + delete_dir_contents(build_dir) + + log_info('Compiling keymaps: %s' % src_dir) + + files = [file for file, _, _ in list_files(src_dir)] + (shared, per_os) = load_keymaps(files) + + write_shared_keymap(shared, src_dir, build_dir) + write_per_os_keymap(per_os, src_dir, build_dir) + + log_info('Done compiling keymaps: %s' % src_dir) + +# Load keymaps, combine all shared and exclusive bindings into a single +# result that is used later to generate the final “Default” files. +def load_keymaps(files_paths): + combined_shared = [] + combined_per_os = {} + loaded_files = [load_keymap(file_path) for file_path in files_paths] + + for (shared, per_os) in loaded_files: + combined_shared += shared + for os in per_os: + if os not in combined_per_os: + combined_per_os[os] = [] + combined_per_os[os] += per_os[os] + + return combined_shared, combined_per_os + +# Load a single keymap source, returns bindings shared by all OSs and the +# exclusive ones indexed by OS. +def load_keymap(file_path): + relative_file_path = package_relpath(file_path) + shared = [] + per_os = {} + + data = load_yaml(file_path) + if data is None: + log_debug('Empty file: %s' % relative_file_path) + return shared, per_os + + log_debug('Loading: %s' % relative_file_path) + + # The actual key bindings. + bindings = data['bindings'] + + # If “os” is not specified, that means that the keymap works on all + # platforms. + if 'os' not in data: + shared = bindings + log_debug('Generic shortcut: %s' % relative_file_path) + return shared, per_os + + # “os” can be a string representing a single platform. + oss = data['os'] + if isinstance(oss, str): + oss = [oss] + + # Triage the bindings by OS. + for os in oss: + validate_os(os, file_path) + if os not in per_os: + per_os[os] = [] + per_os[os] += bindings + + log_debug('Contains shortcuts for %s: %s' % (oss, relative_file_path)) + return shared, per_os + +def validate_os(os, file_path): + valid_os = ['Linux', 'Windows', 'OSX'] + if os not in valid_os: + raise ValueError('Invalid OS “%s” for file: %s' % (os, file_path)) + +# Write bindings indexed by OS on their respective files: +# +# Default (Linux).sublime-keymap +# Default (Windows).sublime-keymap +# Default (OSX).sublime-keymap +# +def write_per_os_keymap(per_os_bindings, src_dir, build_dir): + for os in per_os_bindings: + bindings = per_os_bindings[os] + if len(bindings) < 1: + continue + + file_name = 'Default (%s).sublime-keymap' % os + destination = join(build_dir, file_name) + final_string = ( + keymap_header(src_dir) + + to_json_string(bindings, indent=True) + ) + + write_text_file(destination, final_string) + log_debug('File generated: %s' % package_relpath(destination)) + +# Write bindings shared by all OSs on: +# +# Default.sublime-keymap +# +def write_shared_keymap(bindings, src_dir, build_dir): + if len(bindings) < 1: + return + + destination = join(build_dir, 'Default.sublime-keymap') + final_string = ( + keymap_header(src_dir) + + to_json_string(bindings, indent=True) + ) + + write_text_file(destination, final_string) + log_debug('File generated: %s' % package_relpath(destination)) diff --git a/system/compilers/menus.py b/system/compilers/menus.py new file mode 100644 index 00000000..75237f60 --- /dev/null +++ b/system/compilers/menus.py @@ -0,0 +1,136 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from borela import ( + delete_dir_contents, + list_files, + load_yaml, + to_json_string, + write_text_file, +) + +from Naomi.system import ( + EVENT_BUS, + log_debug, + log_info, + package_relpath, +) + +from collections import defaultdict +from Naomi.system.headers import menu as menu_header +from os.path import join + +def compile_menus(src_dir, build_dir): + log_debug('Cleaning: %s' % package_relpath(build_dir)) + + delete_dir_contents(build_dir) + + log_info('Building menus: %s' % src_dir) + + files = [file for file, _, _ in list_files(src_dir)] + menus = load_menus(files) + + for location in menus: + log_debug('Building menus for %s...' % location) + + destination = join(build_dir, '%s.sublime-menu' % location) + final_string = menu_header(src_dir) + to_json_string( + menus[location], + indent=True, + ) + + write_text_file(destination, final_string) + log_debug('File generated: %s' % package_relpath(destination)) + + log_info('Done building menus: %s' % src_dir) + +# Load all menu sources and returns the result indexed by the destination. +def load_menus(files_paths): + result = {} + loaded_files = [ + load_menus_from_file(file_path) + for file_path in files_paths + ] + + for loaded_menus in loaded_files: + # Files can be empty. + if load_menus is None: + continue + + for location in loaded_menus: + if location not in result: + result[location] = defaultdict(dict) + result[location]['add'] = [] + result[location]['extend'] = [] + + menus = loaded_menus[location] + result[location]['add'].extend(menus.get('add', [])) + result[location]['extend'].extend(menus.get('extend', [])) + + # Merge the result putting extensions first. + merged_result = defaultdict(list) + for location, menus in result.items(): + merged_result[location] = menus['extend'] + menus['add'] + + return merged_result + +# Load menus from a single source and returns the result indexed by +# destination. +def load_menus_from_file(file_path): + relative_file_path = package_relpath(file_path) + data = load_yaml(file_path) + result = {} + + # Empty file. + if data is None: + log_debug('Empty file: %s' % relative_file_path) + return None + + log_debug('Loading: %s' % relative_file_path) + + if 'location' not in data: + message = 'Missing “location” for menu: %s' % relative_file_path + raise ValueError(message) + + locations = data['location'] + + # Single location. + if isinstance(locations, str): + locations = [locations] + + for location in locations: + validate_location(location, file_path) + if location not in result: + result[location] = [] + result[location] = data['menus'] + + log_debug('Done processing: %s' % relative_file_path) + return result + +def validate_location(location, file_path): + valid_locations = [ + 'Context', + 'Encoding', + 'Find in Files', + 'Indentation', + 'Line Endings', + 'Main', + 'Side Bar Mount Point', + 'Side Bar', + 'Syntax', + 'Tab Context', + 'Widget Context', + ] + + if location not in valid_locations: + message = 'Invalid location “%s” for file: %s' % (location, file_path) + raise ValueError(message) diff --git a/system/compilers/preferences.py b/system/compilers/preferences.py new file mode 100644 index 00000000..112be63a --- /dev/null +++ b/system/compilers/preferences.py @@ -0,0 +1,69 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from borela import ( + delete_dir_contents, + list_files, + load_yaml, + modify_path, + to_plist_string, + write_text_file, +) + +from Naomi.system.headers import ( + preferences as preferences_header, + plist as plist_header, +) + +from Naomi.system import ( + EVENT_BUS, + log_debug, + log_info, + package_relpath, +) + +# Convert preferences from “x.yml” to “x.tmPreferences”. +def compile_preferences(src_dir, build_dir): + log_debug('Cleaning: %s' % package_relpath(build_dir)) + + delete_dir_contents(build_dir) + + log_info('Compiling preferences: %s' % src_dir) + + for file_path, _, _ in list_files(src_dir): + relative_file_path = package_relpath(file_path) + destination = modify_path( + file_path, + old_base=src_dir, + new_base=build_dir, + new_extension='tmPreferences', + ) + + log_debug('Processing: %s' % relative_file_path) + + data = load_yaml(file_path) + + if data is None: + log_debug('Empty file: %s' % relative_file_path) + continue + + plist_string = to_plist_string(data) + final_string = ( + plist_header() + + preferences_header(src_dir) + + plist_string + ) + + write_text_file(destination, final_string) + log_debug('File generated: %s' % package_relpath(destination)) + + log_info('Done compiling preferences: %s' % src_dir) diff --git a/system/compilers/syntaxes/CompilationError.py b/system/compilers/syntaxes/CompilationError.py new file mode 100644 index 00000000..96f1559d --- /dev/null +++ b/system/compilers/syntaxes/CompilationError.py @@ -0,0 +1,32 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from ruamel.yaml.comments import LineCol + +class CompilationError(Exception): + def __init__(self, message, path=None, location=None): + if path and location: + if isinstance(location, LineCol): + line = location.line + column = location.col + else: + line = location.line + column = location.column + + message = '%s (%i, %i): %s' % ( + path, + line + 1, + column + 1, + message, + ) + + Exception.__init__(self, message) diff --git a/system/compilers/syntaxes/Visitor.py b/system/compilers/syntaxes/Visitor.py new file mode 100644 index 00000000..ef8142b7 --- /dev/null +++ b/system/compilers/syntaxes/Visitor.py @@ -0,0 +1,18 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +class Visitor: + def enter(self, path): + pass + + def exit(self, path): + pass diff --git a/system/compilers/syntaxes/__init__.py b/system/compilers/syntaxes/__init__.py new file mode 100644 index 00000000..7d051eaf --- /dev/null +++ b/system/compilers/syntaxes/__init__.py @@ -0,0 +1,77 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from borela import ( + delete_dir_contents, + list_files, + load_yaml, + to_json_string, + write_text_file, +) + +from .ast import FunctionCall +from .CompilationError import CompilationError +from .generator import generate_dict +from .optimizer import optimize +from .parser import parse +from .transformer import transform +from borela.functions import dict_to_yaml_string +from hashlib import sha512 +from Naomi.system import log_error +from os.path import join +from ruamel.yaml.constructor import DuplicateKeyError + +def cleanup_unneeded_syntaxes(hashes): + # TODO:.. + pass + +def compile_syntax(settings, integrated_syntaxes): + try: + compilation = parse( + settings, + integrated_syntaxes, + ) + + transform(compilation) + optimize(compilation) + + hashes = [] + names = settings.get('names') + syntax = generate_dict(compilation) + build_dir = compilation.build_dir + + if isinstance(names, list): + for name in names: + syntax['name'] = name + hashes.append(generate_file(build_dir, syntax)) + else: + hashes.append(generate_file(build_dir, syntax)) + + cleanup_unneeded_syntaxes(hashes) + except CompilationError as error: + log_error(str(error)) + except DuplicateKeyError as error: + lc = error.problem_mark + log_error('(%i, %i) Duplicated key.' % ( + lc.line + 1, + lc.column + 1, + )) + +def generate_file(build_dir, syntax): + contents = dict_to_yaml_string(syntax) + name_hash = sha512(syntax['name'].encode()) + file_name = '%s.yml' % name_hash.hexdigest() + write_text_file( + join(build_dir, file_name), + contents, + ) + return name_hash diff --git a/system/compilers/syntaxes/ast/AstError.py b/system/compilers/syntaxes/ast/AstError.py new file mode 100644 index 00000000..3dc3da19 --- /dev/null +++ b/system/compilers/syntaxes/ast/AstError.py @@ -0,0 +1,16 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from ..CompilationError import CompilationError + +class AstError(CompilationError): + pass diff --git a/system/compilers/syntaxes/ast/ClearScopes.py b/system/compilers/syntaxes/ast/ClearScopes.py new file mode 100644 index 00000000..d65d8ddb --- /dev/null +++ b/system/compilers/syntaxes/ast/ClearScopes.py @@ -0,0 +1,16 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .Statement import Statement + +class ClearScopes(Statement): + __slots__ = 'value' diff --git a/system/compilers/syntaxes/ast/Compilation.py b/system/compilers/syntaxes/ast/Compilation.py new file mode 100644 index 00000000..b7d46315 --- /dev/null +++ b/system/compilers/syntaxes/ast/Compilation.py @@ -0,0 +1,163 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from borela.functions import ( + indent_string, + iterable_repr, +) + +from .AstError import AstError +from .Context import Context +from .ContextRequest import ContextRequest +from .Node import Node +from .Syntax import Syntax +from .Variable import Variable +from .VariableRequest import VariableRequest +from borela import Stack +from collections import OrderedDict + +class Statistics(Node): + __slots__ = [ + 'contexts', + 'contexts_inlined', + 'contexts_removed', + 'files', + 'variables', + 'variables_removed', + ] + + def __init__(self): + Node.__init__(self) + self.contexts = 0 + self.contexts_inlined = 0 + self.contexts_removed = 0 + self.files = 0 + self.variables = 0 + self.variables_removed = 0 + + def __repr__(self): + result = '' + for attribute in self.__slots__: + if result: + result += '\n' + result += '%s: %s' % (attribute, getattr(self, attribute)) + return result + +class Compilation(Node): + __slots__ = [ + 'settings', + + # Location where the compiled file will be saved. + 'build_dir', + + # Entry syntax file. + 'entry', + + # Files used in the compilation indexed by their path. + 'syntaxes', + + # The file id will be prepended in all contexts to allow us to see the + # context’s origin. + 'syntaxes_ids', + + # Contexts indexed by their full path. + 'contexts', + + # Variables indexed by their full path. + 'variables', + + # Variables and contexts that need to be resolved after parsing the + # syntax. + 'context_requests', + 'variable_requests', + + # Data such as number of contexts, files used, etc... + 'statistics', + ] + + def __init__(self, settings, build_dir): + Node.__init__(self) + + self.settings = settings + self.build_dir = build_dir + + self.syntaxes = OrderedDict() + self.syntaxes_ids = OrderedDict() + + self.contexts = OrderedDict() + self.variables = OrderedDict() + + self.context_requests = Stack() + self.variable_requests = Stack() + + self.statistics = Statistics() + + def __repr__(self): + return '[Compilation] {\n%s\n}' % indent_string( + iterable_repr(self.syntaxes.values()) + ) + + def enqueue_context_request(self, statement, origin, path): + request = ContextRequest( + statement, + origin, + path, + ) + self.context_requests.push(request) + return request + + def enqueue_variable_request(self, syntax, origin, path): + request = VariableRequest( + syntax, + origin, + path, + ) + self.variable_requests.push(request) + return request + + def get_subnodes(self): + return ['syntaxes'] + + def index_context(self, context): + if not isinstance(context, Context): + raise AstError('Object is not a Context: %s' % context) + + self.contexts[context.full_path] = context + self.statistics.contexts += 1 + + def index_syntax(self, syntax): + if not isinstance(syntax, Syntax): + raise AstError('Object is not a syntax file: %s' % syntax) + + path = syntax.path + + if path not in self.syntaxes: + self.syntaxes[path] = syntax + self.syntaxes_ids[path] = len(self.syntaxes) + self.statistics.files += 1 + + syntax.syntax_id = self.syntaxes_ids[path] + + def index_variable(self, variable): + if not isinstance(variable, Variable): + raise AstError('Object is not a Variable: %s' % variable) + + self.variables[variable.full_path] = variable + self.statistics.variables += 1 + + def remove_context(self, context_path): + del self.contexts[context_path] + self.statistics.contexts_removed += 1 + + def remove_variable(self, variable_path): + del self.variables[variable_path] + self.statistics.variables_removed += 1 diff --git a/system/compilers/syntaxes/ast/Context.py b/system/compilers/syntaxes/ast/Context.py new file mode 100644 index 00000000..ebc2e10f --- /dev/null +++ b/system/compilers/syntaxes/ast/Context.py @@ -0,0 +1,70 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from borela.functions import ( + indent_string, + iterable_repr, +) + +from .Node import Node + +class Context(Node): + __slots__ = [ + 'syntax', + 'name', + 'statements', + # References to this context. This can be used to eliminate unused + # contexts. + 'references', + ] + + def __init__(self, syntax, name=None): + Node.__init__(self) + + self.syntax = syntax + self.name = name + self.statements = [] + self.references = [] + + if name is not None: + self.syntax.index_context(self) + + def __repr__(self): + return '[Context]: %s {\n%s\n}' % ( + self.name, + indent_string( + iterable_repr(self.statements) + ), + ) + + @property + def compilation(self): + return self.syntax.compilation + + @property + def full_path(self): + path = self.syntax.path + name = self.name + return '%s#%s' % (path, name) + + @property + def short_name(self): + if self.name == 'main': + return self.syntax.package_relpath.replace('\\', '/') + + return '%s_%s' % ( + self.syntax.syntax_id, + self.name, + ) + + def get_subnodes(self): + return ['statements'] diff --git a/system/compilers/syntaxes/ast/ContextRequest.py b/system/compilers/syntaxes/ast/ContextRequest.py new file mode 100644 index 00000000..2eec48b5 --- /dev/null +++ b/system/compilers/syntaxes/ast/ContextRequest.py @@ -0,0 +1,50 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .Node import Node + +class ContextRequest(Node): + __slots__ = [ + 'statement', + # Exact location of the request. + 'origin', + # Path used to import the context without any modifcation. + 'path', + # Full path to the context. + 'resolved_path', + # The actual context. + 'resolved', + ] + + def __init__(self, statement, origin, path): + Node.__init__(self) + self.statement = statement + self.origin = origin + self.path = path + + def __repr__(self): + return '[ContextRequest]: %s' % self.path + + @property + def compilation(self): + return self.statement.compilation + + @property + def context(self): + return self.statement.context + + @property + def syntax(self): + return self.statement.syntax + + def get_subnodes(self): + return ['resolved'] diff --git a/system/compilers/syntaxes/ast/Embed.py b/system/compilers/syntaxes/ast/Embed.py new file mode 100644 index 00000000..c984408b --- /dev/null +++ b/system/compilers/syntaxes/ast/Embed.py @@ -0,0 +1,23 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .StackAction import StackAction + +class Embed(StackAction): + __slots__ = [ + 'embed_context', + 'embed_scope', + 'escape', + ] + + def get_subnodes(self): + return ['embed_context'] diff --git a/system/compilers/syntaxes/ast/FunctionCall.py b/system/compilers/syntaxes/ast/FunctionCall.py new file mode 100644 index 00000000..a78373ce --- /dev/null +++ b/system/compilers/syntaxes/ast/FunctionCall.py @@ -0,0 +1,40 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from borela.functions import ( + indent_string, + iterable_repr, +) + +from .Node import Node + +class FunctionCall(Node): + __slots__ = [ + 'name', + 'arguments', + ] + + def __init__(self, name, arguments=None): + Node.__init__(self) + self.name = name + self.arguments = arguments or [] + + def __repr__(self): + return '[FunctionCall] %s (\n%s\n)' % ( + self.name, + indent_string( + iterable_repr(self.arguments) + ), + ) + + def get_subnodes(self): + return ['arguments'] diff --git a/system/compilers/syntaxes/ast/Include.py b/system/compilers/syntaxes/ast/Include.py new file mode 100644 index 00000000..735e09e5 --- /dev/null +++ b/system/compilers/syntaxes/ast/Include.py @@ -0,0 +1,22 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .Statement import Statement + +class Include(Statement): + __slots__ = [ + 'path', + 'context_request', + ] + + def get_subnodes(self): + return ['context_request'] diff --git a/system/compilers/syntaxes/ast/Location.py b/system/compilers/syntaxes/ast/Location.py new file mode 100644 index 00000000..8aa543ce --- /dev/null +++ b/system/compilers/syntaxes/ast/Location.py @@ -0,0 +1,30 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +class Location: + __slots__ = [ + 'path', + 'column', + 'line', + ] + + def __init__(self): + self.path = None + self.column = -1 + self.line = -1 + + def __repr__(self): + return '[Location]: (%i, %i) %s' % ( + self.line, + self.column, + self.path, + ) diff --git a/system/compilers/syntaxes/ast/Match.py b/system/compilers/syntaxes/ast/Match.py new file mode 100644 index 00000000..65acc36b --- /dev/null +++ b/system/compilers/syntaxes/ast/Match.py @@ -0,0 +1,65 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from borela.functions import ( + indent_string, + iterable_repr, +) + +from .Statement import Statement + +class Match(Statement): + __slots__ = [ + # The actual match pattern. + 'pattern', + # Scope to be applied to the entire pattern. + 'scope', + # An optional action to the stack: embed, pop, push, set. + 'action', + # Applies scopes to capturing groups. + 'captures', + # Creates a copy of the entire graph of contexts with the rules + # defined here. + 'with_prototype', + ] + + def __init__(self, context): + Statement.__init__(self, context) + self.pattern = None + self.scope = None + self.action = None + self.captures = None + self.with_prototype = None + + def __repr__(self): + body = 'Pattern: ' + repr(self.pattern) + + if self.scope: + body += '\nScope: ' + repr(self.scope) + + if self.captures: + body += '\nCaptures: ' + repr(self.captures) + + if self.action: + body += '\n' + repr(self.action) + + if self.with_prototype: + body += '\n' + repr(self.with_prototype) + + return '[Match] {\n%s\n}' % indent_string(body) + + def get_subnodes(self): + return [ + 'pattern', + 'action', + 'with_prototype', + ] diff --git a/system/compilers/syntaxes/ast/Node.py b/system/compilers/syntaxes/ast/Node.py new file mode 100644 index 00000000..c6166dac --- /dev/null +++ b/system/compilers/syntaxes/ast/Node.py @@ -0,0 +1,25 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .Location import Location + +class Node: + __slots__ = ['location'] + + def __init__(self): + self.location = Location() + + def __repr__(self): + return '[%s]' % self.__class__.__name__ + + def get_subnodes(self): + return [] diff --git a/system/compilers/syntaxes/ast/Pop.py b/system/compilers/syntaxes/ast/Pop.py new file mode 100644 index 00000000..d2df101e --- /dev/null +++ b/system/compilers/syntaxes/ast/Pop.py @@ -0,0 +1,16 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .StackAction import StackAction + +class Pop(StackAction): + __slots__ = 'value' diff --git a/system/compilers/syntaxes/ast/Push.py b/system/compilers/syntaxes/ast/Push.py new file mode 100644 index 00000000..0dc1c851 --- /dev/null +++ b/system/compilers/syntaxes/ast/Push.py @@ -0,0 +1,33 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from borela.functions import ( + indent_string, + iterable_repr, +) + +from .StackAction import StackAction + +class Push(StackAction): + __slots__ = 'sequence' + + def __init__(self, match): + StackAction.__init__(self, match) + self.sequence = [] + + def __repr__(self): + return '[Push] [\n%s\n]' % indent_string( + iterable_repr(self.sequence) + ) + + def get_subnodes(self): + return ['sequence'] diff --git a/system/compilers/syntaxes/ast/Set.py b/system/compilers/syntaxes/ast/Set.py new file mode 100644 index 00000000..a28ec670 --- /dev/null +++ b/system/compilers/syntaxes/ast/Set.py @@ -0,0 +1,33 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from borela.functions import ( + indent_string, + iterable_repr, +) + +from .StackAction import StackAction + +class Set(StackAction): + __slots__ = 'sequence' + + def __init__(self, match): + StackAction.__init__(self, match) + self.sequence = [] + + def __repr__(self): + return '[Set] [\n%s\n]' % indent_string( + iterable_repr(self.sequence) + ) + + def get_subnodes(self): + return ['sequence'] diff --git a/system/compilers/syntaxes/ast/SetMetaContentScope.py b/system/compilers/syntaxes/ast/SetMetaContentScope.py new file mode 100644 index 00000000..68f891f2 --- /dev/null +++ b/system/compilers/syntaxes/ast/SetMetaContentScope.py @@ -0,0 +1,16 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .Statement import Statement + +class SetMetaContentScope(Statement): + __slots__ = 'scope' diff --git a/system/compilers/syntaxes/ast/SetMetaScope.py b/system/compilers/syntaxes/ast/SetMetaScope.py new file mode 100644 index 00000000..502ec2e8 --- /dev/null +++ b/system/compilers/syntaxes/ast/SetMetaScope.py @@ -0,0 +1,16 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .Statement import Statement + +class SetMetaScope(Statement): + __slots__ = 'scope' diff --git a/system/compilers/syntaxes/ast/StackAction.py b/system/compilers/syntaxes/ast/StackAction.py new file mode 100644 index 00000000..328ca55a --- /dev/null +++ b/system/compilers/syntaxes/ast/StackAction.py @@ -0,0 +1,35 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .Node import Node + +class StackAction(Node): + __slots__ = 'match' + + def __init__(self, match): + Node.__init__(self) + self.match = match + + def __repr__(self): + return '[%s]' % self.__class__.__name__ + + @property + def compilation(self): + return self.match.compilation + + @property + def context(self): + return self.match.context + + @property + def syntax(self): + return self.match.syntax diff --git a/system/compilers/syntaxes/ast/Statement.py b/system/compilers/syntaxes/ast/Statement.py new file mode 100644 index 00000000..54b391a0 --- /dev/null +++ b/system/compilers/syntaxes/ast/Statement.py @@ -0,0 +1,28 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .Node import Node + +class Statement(Node): + __slots__ = 'context' + + def __init__(self, context): + Node.__init__(self) + self.context = context + + @property + def compilation(self): + return self.context.syntax.compilation + + @property + def syntax(self): + return self.context.syntax diff --git a/system/compilers/syntaxes/ast/Syntax.py b/system/compilers/syntaxes/ast/Syntax.py new file mode 100644 index 00000000..d379b8b5 --- /dev/null +++ b/system/compilers/syntaxes/ast/Syntax.py @@ -0,0 +1,113 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .AstError import AstError +from .Context import Context +from .Node import Node +from .Variable import Variable +from borela.functions import indent_string +from collections import OrderedDict +from Naomi.system import package_relpath +from os.path import dirname + +class Syntax(Node): + __slots__ = [ + 'syntax_id', + 'compilation', + + 'home_dir', + 'path', + 'parent_dir', + 'package_relpath', + + # Unmodified YAML data. + 'raw', + + 'name', + 'hidden', + 'scope', + 'scope_prefix', + 'scope_suffix', + 'file_extensions', + 'first_line_match', + + # Variables indexed by their name. + 'variables', + + # Contexts indexed by their name. + 'contexts', + ] + + def __init__(self, compilation, home_dir, path): + Node.__init__(self) + + self.home_dir = home_dir + self.path = path + self.parent_dir = dirname(path) + self.package_relpath = package_relpath(path) + + self.variables = OrderedDict() + self.contexts = OrderedDict() + + self.syntax_id = -1 + self.compilation = compilation + self.compilation.index_syntax(self) + + def __repr__(self): + variables = '' + for _, variable in self.variables.items(): + if variables: + variables += '\n' + variables += repr(variable) + + contexts = '' + for _, context in self.contexts.items(): + if contexts: + contexts += '\n' + contexts += repr(context) + + if variables: + variables = 'Variables: [\n%s\n]' % indent_string(variables) + else: + variables = 'Variables: []' + + if contexts: + contexts = 'Contexts: [\n%s\n]' % indent_string(contexts) + else: + contexts = 'Contexts: []' + + return '[Syntax]: %s (%i) {\n%s\n%s\n}' % ( + self.package_relpath, + self.syntax_id, + indent_string(variables), + indent_string(contexts), + ) + + def get_subnodes(self): + return [ + 'variables', + 'contexts', + ] + + def index_context(self, context): + if not isinstance(context, Context): + raise AstError('Object is not a Context: %s' % context) + + self.contexts[context.name] = context + self.compilation.index_context(context) + + def index_variable(self, variable): + if not isinstance(variable, Variable): + raise AstError('Object is not a Variable: %s' % variable) + + self.variables[variable.name] = variable + self.compilation.index_variable(variable) diff --git a/system/compilers/syntaxes/ast/Variable.py b/system/compilers/syntaxes/ast/Variable.py new file mode 100644 index 00000000..74999c4c --- /dev/null +++ b/system/compilers/syntaxes/ast/Variable.py @@ -0,0 +1,53 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .Node import Node + +class Variable(Node): + __slots__ = [ + 'syntax', + 'name', + 'pattern', + # References to this context. This can be used to eliminate unused + # contexts. + 'references', + ] + + def __init__(self, syntax, name): + Node.__init__(self) + self.name = name + self.references = [] + + self.syntax = syntax + self.syntax.index_variable(self) + + def __repr__(self): + return '[Variable]: %s' % self.name + + @property + def compilation(self): + return self.syntax.compilation + + @property + def full_path(self): + path = self.syntax.path + name = self.name + return '%s#%s' % (path, name) + + @property + def short_name(self): + path = self.syntax.syntax_id + name = self.name + return '%s_%s' % (path, name) + + def get_subnodes(self): + return ['pattern'] diff --git a/system/compilers/syntaxes/ast/VariableRequest.py b/system/compilers/syntaxes/ast/VariableRequest.py new file mode 100644 index 00000000..25cb921d --- /dev/null +++ b/system/compilers/syntaxes/ast/VariableRequest.py @@ -0,0 +1,43 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .Node import Node +from Naomi.system import package_relpath + +class VariableRequest(Node): + __slots__ = [ + 'syntax', + # Exact location of the request. + 'origin', + # Path used to import the context without any modifcation. + 'path', + # Full path to the variable. + 'resolved_path', + # The actual variable. + 'resolved', + ] + + def __init__(self, syntax, origin, path): + Node.__init__(self) + self.syntax = syntax + self.origin = origin + self.path = path + + def __repr__(self): + return '[VariableRequest] %s' % package_relpath(self.path) + + @property + def compilation(self): + return self.syntax.compilation + + def get_subnodes(self): + return ['resolved'] diff --git a/system/compilers/syntaxes/ast/__init__.py b/system/compilers/syntaxes/ast/__init__.py new file mode 100644 index 00000000..92e63d15 --- /dev/null +++ b/system/compilers/syntaxes/ast/__init__.py @@ -0,0 +1,30 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .AstError import * # noqa +from .ClearScopes import * # noqa +from .Compilation import * # noqa +from .Context import * # noqa +from .ContextRequest import * # noqa +from .Embed import * # noqa +from .FunctionCall import * # noqa +from .Include import * # noqa +from .Location import * # noqa +from .Match import * # noqa +from .Pop import * # noqa +from .Push import * # noqa +from .Set import * # noqa +from .SetMetaContentScope import * # noqa +from .SetMetaScope import * # noqa +from .Statement import * # noqa +from .Syntax import * # noqa +from .Variable import * # noqa diff --git a/system/compilers/syntaxes/generator/GenerationError.py b/system/compilers/syntaxes/generator/GenerationError.py new file mode 100644 index 00000000..cac86429 --- /dev/null +++ b/system/compilers/syntaxes/generator/GenerationError.py @@ -0,0 +1,16 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from ..CompilationError import CompilationError + +class GenerationError(CompilationError): + pass diff --git a/system/compilers/syntaxes/generator/__init__.py b/system/compilers/syntaxes/generator/__init__.py new file mode 100644 index 00000000..8851d8f7 --- /dev/null +++ b/system/compilers/syntaxes/generator/__init__.py @@ -0,0 +1,141 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from ..ast import ( + ClearScopes, + Compilation, + Context, + ContextRequest, + Embed, + FunctionCall, + Include, + Match, + Pop, + Push, + Set, + SetMetaContentScope, + SetMetaScope, + Syntax, + Variable, +) + +from .GenerationError import GenerationError +from borela.functions import indent_string +from collections import OrderedDict +from ruamel.yaml.comments import CommentedMap +from Naomi.system.headers import syntax as syntax_header + +def generate_action_sequence(sequence): + result = [] + + for action in sequence: + if isinstance(action, str): + result.append(action) + continue + + if isinstance(action, Context): + result.append(generate_context(action)) + continue + + raise GenerationError( + 'Unexpected action sequence type: %s' % type(action) + ) + + return result + +def generate_context(context): + result = [] + + for statement in context.statements: + # clear_scopes + if isinstance(statement, ClearScopes): + result.append({'clear_scopes': statement.value}) + continue + + # meta_scope + if isinstance(statement, SetMetaScope): + result.append({'meta_scope': statement.scope}) + continue + + # meta_content_scope + if isinstance(statement, SetMetaContentScope): + result.append({'meta_content_scope': statement.scope}) + continue + + # include + if isinstance(statement, Include): + result.append({'include': statement.context_request}) + continue + + # match + if isinstance(statement, Match): + match = OrderedDict() + match['match'] = statement.pattern + + if statement.scope: + match['scope'] = statement.scope + + if statement.captures: + match['captures'] = OrderedDict() + for i, scope in statement.captures.items(): + match['captures'][i] = scope + + if statement.action: + action = statement.action + + if isinstance(action, Pop): + match['pop'] = action.value + + if isinstance(action, Push): + match['push'] = generate_action_sequence(action.sequence) + + if isinstance(action, Set): + match['set'] = generate_action_sequence(action.sequence) + + result.append(match) + + return result + +def generate_dict(compilation): + entry = compilation.entry + result = CommentedMap() + result.yaml_set_start_comment('%s---\n%s\n---' % ( + syntax_header(entry.path), + indent_string( + 'Statistics:\n%s' % indent_string( + text=str(compilation.statistics), + amount=2, + ) + ), + )) + + result['name'] = entry.name + + if entry.scope: + result['scope'] = entry.scope + + if entry.file_extensions: + result['file_extensions'] = entry.file_extensions + + if entry.first_line_match: + result['first_line_match'] = entry.first_line_match + + result['variables'] = OrderedDict() + result['contexts'] = OrderedDict() + + for variable in compilation.variables.values(): + result['variables'][variable.short_name] = variable.pattern + + for context in compilation.contexts.values(): + result['contexts'][context.short_name] = generate_context(context) + + return result diff --git a/system/compilers/syntaxes/optimizer/__init__.py b/system/compilers/syntaxes/optimizer/__init__.py new file mode 100644 index 00000000..13c1222a --- /dev/null +++ b/system/compilers/syntaxes/optimizer/__init__.py @@ -0,0 +1,29 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .visitors import ( + RemoveDuplicatedVariables, + RemoveUnusedContexts, + RemoveUnusedVariables, +) + +from ..transformer import transform + +def optimize(compilation): + visitors = { + 'Context': RemoveUnusedContexts(), + 'Variable': [ + RemoveUnusedVariables(), + RemoveDuplicatedVariables(), + ], + } + transform(compilation, visitors) diff --git a/system/compilers/syntaxes/optimizer/visitors/RemoveDuplicatedVariables.py b/system/compilers/syntaxes/optimizer/visitors/RemoveDuplicatedVariables.py new file mode 100644 index 00000000..64ef639b --- /dev/null +++ b/system/compilers/syntaxes/optimizer/visitors/RemoveDuplicatedVariables.py @@ -0,0 +1,18 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from ...Visitor import Visitor + +class RemoveDuplicatedVariables(Visitor): + def exit(self, path): + # TODO... + pass diff --git a/system/compilers/syntaxes/optimizer/visitors/RemoveUnusedContexts.py b/system/compilers/syntaxes/optimizer/visitors/RemoveUnusedContexts.py new file mode 100644 index 00000000..255a5e3b --- /dev/null +++ b/system/compilers/syntaxes/optimizer/visitors/RemoveUnusedContexts.py @@ -0,0 +1,18 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from ...Visitor import Visitor + +class RemoveUnusedContexts(Visitor): + def enter(self, path): + if len(path.node.references) < 1: + path.remove_node() diff --git a/system/compilers/syntaxes/optimizer/visitors/RemoveUnusedVariables.py b/system/compilers/syntaxes/optimizer/visitors/RemoveUnusedVariables.py new file mode 100644 index 00000000..7b679be2 --- /dev/null +++ b/system/compilers/syntaxes/optimizer/visitors/RemoveUnusedVariables.py @@ -0,0 +1,22 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from ...Visitor import Visitor + +import re + +COMMENT = re.compile(r'#.*?\n') + +class RemoveUnusedVariables(Visitor): + def enter(self, path): + if len(path.node.references) < 1: + path.remove_node() diff --git a/system/compilers/syntaxes/optimizer/visitors/__init__.py b/system/compilers/syntaxes/optimizer/visitors/__init__.py new file mode 100644 index 00000000..31194f73 --- /dev/null +++ b/system/compilers/syntaxes/optimizer/visitors/__init__.py @@ -0,0 +1,15 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .RemoveDuplicatedVariables import * # noqa +from .RemoveUnusedVariables import * # noqa +from .RemoveUnusedContexts import * # noqa diff --git a/system/compilers/syntaxes/parser/ParsingError.py b/system/compilers/syntaxes/parser/ParsingError.py new file mode 100644 index 00000000..a92a1d11 --- /dev/null +++ b/system/compilers/syntaxes/parser/ParsingError.py @@ -0,0 +1,16 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from ..CompilationError import CompilationError + +class ParsingError(CompilationError): + pass diff --git a/system/compilers/syntaxes/parser/__init__.py b/system/compilers/syntaxes/parser/__init__.py new file mode 100644 index 00000000..d05007a1 --- /dev/null +++ b/system/compilers/syntaxes/parser/__init__.py @@ -0,0 +1,615 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from ..ast import ( + ClearScopes, + Compilation, + Context, + Embed, + FunctionCall, + Include, + Match, + SetMetaContentScope, + SetMetaScope, + Pop, + Push, + Set, + Syntax, + Variable, +) + +from Naomi.system import ( + log_debug, + log_error, + log_info, + packages_dir, + package_relpath, +) + +from os.path import ( + isdir, + isfile, + join, + realpath, +) + +from .ParsingError import ParsingError +from borela.functions import load_yaml +from collections import OrderedDict + +import re + +def check_embed_exists(key, statement, raw): + if 'embed' not in raw: + raise ParsingError( + '“%s” without embed.' % key, + statement.syntax.package_relpath, + key.lc, + ) + + if not statement.action: + raise ParsingError( + '“%s” must be after embed.' % key, + statement.syntax.package_relpath, + key.lc, + ) + +def dict_to_function_calls(calls, syntax_path): + result = [] + for name, args in calls.items(): + function_call = FunctionCall(name, args) + function_call.location.path = syntax_path + function_call.location.line = name.lc.line + function_call.location.column = name.lc.col + + result.append(function_call) + return result + +def parse(settings, integrated_syntaxes): + entry = settings.get('entry', None) + + if not isinstance(entry, str) or not entry: + log_error('Configured syntax has no entry.') + return + + names = settings.get('names', None) + + if not names: + log_info('Compiling syntax: %s []' % (entry)) + else: + log_info('Compiling syntax: %s %s' % (entry, names)) + + entry_path, home_dir, build_dir = resolve_syntax_entry( + entry, + integrated_syntaxes, + ) + + compilation = Compilation( + settings, + build_dir, + ) + + compilation.entry = parse_syntax( + compilation, + home_dir, + entry_path, + ) + + # Link context resquests. + requests = compilation.context_requests + while len(requests): + resolve_context_request( + compilation, + requests.pop(), + ) + + # Link variable resquests. + requests = compilation.variable_requests + while len(requests): + resolve_variable_request( + compilation, + requests.pop(), + ) + + log_info('Done parsing syntax.') + return compilation + +def parse_clear_scopes(context, raw): + statement = ClearScopes(context) + statement.value = bool(raw['clear_scopes']) + + statement.location.path = context.syntax.path + statement.location.line = raw.lc.line + statement.location.column = raw.lc.col + + return statement + +def parse_context(syntax, name, raw): + context = Context(syntax, name) + + context.location.path = syntax.path + context.location.line = raw.lc.line + context.location.column = raw.lc.col + + parse_context_statements(context, raw) + + return context + +def parse_context_sequence(statement, raw): + syntax = statement.syntax + compilation = statement.compilation + + # Context sequences are used in Set and Push actions, they can be a list + # that contains references and inline contexts: + # + # [ + # string, # Reference. + # [OrderedDict, OrderedDict, ...] # Context. + # ... + # ] + # + # Or just a single reference/context. + if isinstance(raw, list): + # At this point the list might be in the format we want or just be a + # single inline context. + if any(isinstance(item, OrderedDict) for item in raw): + raw = [raw] + else: + # Anything else means that we are referencing a single context. + raw = [raw] + + # Mixed, list containing references to or inline contexts. + result = [] + + for item in raw: + # Inline context. + if isinstance(item, list): + context = Context(syntax) + context.location.path = syntax.path + context.location.line = item.lc.line + context.location.column = item.lc.col + result.append(context) + + parse_context_statements(context, item) + # Context reference. + else: + result.append(compilation.enqueue_context_request( + statement=statement, + origin=item, + path=str(item), + )) + + return result + +def parse_context_statements(context, raw): + for statement in raw: + if 'clear_scopes' in statement: + context.statements.append(parse_clear_scopes( + context, + statement, + )) + continue + + if 'include' in statement: + context.statements.append(parse_include( + context, + statement, + )) + continue + + MATCH_STATEMENTS = ['match', 'match_word', 'match_words'] + if any(key in MATCH_STATEMENTS for key in statement): + context.statements.append(parse_match( + context, + statement, + )) + continue + + if 'meta_content_scope' in statement: + context.statements.append(parse_meta_content_scope( + context, + statement, + )) + continue + + if 'meta_scope' in statement: + context.statements.append(parse_meta_scope( + context, + statement, + )) + continue + + raise ParsingError( + 'Unexpected statement: %s' % statement, + statement.syntax.package_relpath, + statement.lc, + ) + +def parse_contexts(syntax): + contexts = syntax.raw.get('contexts', {}) + + for name, statements in contexts.items(): + parse_context( + syntax, + name, + statements, + ) + +VARIABLE_PATTERN = re.compile(r'(? 1: + nodes = FunctionCall('join', nodes) + nodes.location.path = syntax.path + nodes.location.line = origin.lc.line + nodes.location.column = origin.lc.col + elif len(nodes) == 1: + nodes = nodes[0] + else: + nodes = '' + + return nodes + +def parse_include(context, raw): + compilation = context.compilation + path = str(raw['include']) + + statement = Include(context) + statement.path = path + statement.context_request = compilation.enqueue_context_request( + statement=statement, + origin=raw, + path=path, + ) + + statement.location.path = context.syntax.path + statement.location.line = raw.lc.line + statement.location.column = raw.lc.col + + return statement + +def parse_match(context, raw): + syntax = context.syntax + + statement = Match(context) + statement.location.path = syntax.path + statement.location.line = raw.lc.line + statement.location.column = raw.lc.col + + match_parsed = False + scope_parsed = False + + for key, value in raw.items(): + if key == 'escape': + check_embed_exists(key, statement, raw) + statement.action.escape = value + continue + + if key == 'embed_scope': + check_embed_exists(key, statement, raw) + statement.action.embed_scope = value + continue + + if key == 'match': + if match_parsed: + raise_multiple_match(syntax, key.lc) + statement.pattern = parse_expression( + syntax=syntax, + origin=key, + pattern=value, + ) + match_parsed = True + continue + + if key in ['match_word', 'match_words']: + if match_parsed: + raise_multiple_match(syntax, key.lc) + + if key == 'match_word': + statement.pattern = FunctionCall('word', value) + elif key == 'match_words': + statement.pattern = FunctionCall('words', value) + + statement.pattern.location.path = syntax.path + statement.pattern.location.line = key.lc.line + statement.pattern.location.column = key.lc.col + match_parsed = True + continue + + if key == 'scope': + if scope_parsed: + raise_multiple_scope(syntax, key.lc) + statement.scope = str(value) + scope_parsed = True + continue + + if key == 'captures': + if scope_parsed: + raise_multiple_scope(syntax, key.lc) + + statement.captures = OrderedDict() + for key, scope in value.items(): + statement.captures[key] = str(scope) + + scope_parsed = True + continue + + if key == 'with_prototype': + statement.with_prototype = value + continue + + if key in ['embed', 'pop', 'push', 'set']: + if statement.action: + raise ParsingError( + 'Multiple stack actions.', + syntax.package_relpath, + key.lc, + ) + + if key == 'embed': + statement.action = Embed(statement) + statement.action.embed_context = value + elif key == 'pop': + statement.action = Pop(statement) + statement.action.value = str(value) + elif key == 'push': + statement.action = Push(statement) + statement.action.sequence = parse_context_sequence( + statement, + value, + ) + elif key == 'set': + statement.action = Set(statement) + statement.action.sequence = parse_context_sequence( + statement, + value, + ) + + statement.action.location.path = syntax.path + statement.action.location.line = key.lc.line + statement.action.location.column = key.lc.col + continue + + raise ParsingError( + 'Unexpected statement: %s' % key, + syntax.package_relpath, + key.lc, + ) + + return statement + +def parse_meta_scope(context, raw): + statement = SetMetaScope(context) + statement.scope = str(raw['meta_scope']) + + statement.location.path = context.syntax.path + statement.location.line = raw.lc.line + statement.location.column = raw.lc.col + + return statement + +def parse_meta_content_scope(context, raw): + statement = SetMetaContentScope(context) + statement.scope = str(raw['meta_content_scope']) + + statement.location.path = context.syntax.path + statement.location.line = raw.lc.line + statement.location.column = raw.lc.col + + return statement + +def parse_syntax(compilation, home_dir, path): + raw = load_yaml(path) + + syntax = Syntax( + compilation, + home_dir, + path, + ) + + syntax.raw = raw + syntax.name = str(raw.get('name', '')) + syntax.hidden = bool(raw.get('hidden', False)) + syntax.scope = str(raw.get('scope', '')) + syntax.scope_prefix = str(raw.get('scope_prefix', '')) + syntax.scope_suffix = str(raw.get('scope_suffix', '')) + syntax.first_line_match = str(raw.get('first_line_match', '')) + + syntax.file_extensions = [] + for ext in raw.get('file_extensions', []): + syntax.file_extensions.append(str(ext)) + + parse_variables(syntax) + parse_contexts(syntax) + + log_debug('Done parsing: %s' % syntax.package_relpath) + + return syntax + +def parse_variable(syntax, name, value): + statement = Variable(syntax, name) + statement.pattern = parse_expression( + syntax=syntax, + origin=name, + pattern=value, + ) + + statement.location.path = syntax.path + statement.location.line = name.lc.line + statement.location.column = name.lc.col + + return statement + +def parse_variables(syntax): + variables = syntax.raw.get('variables', {}) + + for name, value in variables.items(): + parse_variable( + syntax, + name, + value, + ) + +def raise_multiple_match(syntax, location): + raise ParsingError( + 'Multiple match statements.', + syntax.package_relpath, + location, + ) + +def raise_multiple_scope(syntax, location): + raise ParsingError( + 'A match must not contain both “captures” and “scope” statements.', + syntax.package_relpath, + location, + ) + +def resolve_context_request(compilation, request): + syntax = request.syntax + home_dir = syntax.home_dir + path = request.path + + if path.startswith('Packages/'): + # Normal sublime path. + path = join(packages_dir(), '..', path) + elif path.startswith('./'): + # Relative to the syntax file_path. + path = join(syntax.parent_dir, path) + elif path.startswith('~/'): + # Relative to the home dir. + path = path.replace('~/', '') + path = join(home_dir, path) + else: + # Context. + path = '%s#%s' % (syntax.path, path) + + if '#' not in path: + path += '#main' + + file_path, context = path.split('#') + + if isdir(file_path): + file_path = join(file_path, 'index.yml') + + if not isfile(file_path) and not file_path.endswith('.yml'): + file_path += '.yml' + + # Final file path. + file_path = realpath(file_path) + + # Full path to the context. + request.resolved_path = path = '%s#%s' % (file_path, context) + + # The target context was loaded before. + if path not in compilation.contexts: + if file_path not in compilation.syntaxes: + parse_syntax( + compilation, + home_dir, + file_path, + ) + + request.resolved = compilation.contexts.get(path, None) + + if not request.resolved: + raise ParsingError( + 'Context not found: %s' % package_relpath(path), + request.syntax.package_relpath, + request.origin.lc, + ) + else: + request.resolved.references.append(request) + +def resolve_variable_request(compilation, request): + path = request.path + request.resolved = compilation.variables.get(path, None) + + if not request.resolved: + raise ParsingError( + 'Variable not found: %s' % path.split('#')[1], + request.syntax.package_relpath, + request.origin.lc, + ) + else: + request.resolved.references.append(request) + +# Resolve relative paths to the syntaxes src directories being managed by +# the Naomi’s system. +def resolve_syntax_entry(path, integrated_syntaxes): + if isfile(path): + return realpath(path) + + dirs = [ + (integrated['src_dir'], integrated['build_dir']) + for integrated in integrated_syntaxes + ] + + # Allow external packages to override Naomi’s syntax files. + dirs.reverse() + + # Try to find a file with the integrated src directories. + for src_dir, build_dir in dirs: + resolved_path = join(src_dir, path) + + if isdir(resolved_path): + resolved_path = join(resolved_path, 'index.yml') + return resolved_path, src_dir, build_dir + elif isfile(resolved_path): + return resolved_path, src_dir, build_dir + else: + resolved_path += '.yml' + + if isfile(resolved_path): + return resolved_path, src_dir, build_dir + + raise ParsingError('Syntax entry not found: %s' % path) diff --git a/system/compilers/syntaxes/transformer/Path.py b/system/compilers/syntaxes/transformer/Path.py new file mode 100644 index 00000000..3261cc3f --- /dev/null +++ b/system/compilers/syntaxes/transformer/Path.py @@ -0,0 +1,62 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from ..ast import ( + Context, + Variable, +) + +class Path: + __slots__ = [ + 'parent', + 'node_name', + 'node_index', + 'node', + ] + + def __init__( + self, + parent=None, + node_name=None, + node_index=-1, + node=None, + ): + self.parent = parent + self.node_name = node_name + self.node_index = node_index + self.node = node + + def replace_with(self, new_node): + subnode_list = getattr(self.parent, self.node_name) + + if isinstance(subnode_list, list): + subnode_list[self.node_index] = new_node + else: + setattr(self.parent, self.node_name, new_node) + + self.node = new_node + + def remove_node(self): + if isinstance(self.node, (Context, Variable)): + if isinstance(self.node, Context) and self.node.name: + self.node.compilation.remove_context(self.node.full_path) + elif isinstance(self.node, Variable): + self.node.compilation.remove_variable(self.node.full_path) + else: + subnode_list = getattr(self.parent, self.node_name) + + if isinstance(subnode_list, list): + del subnode_list[self.node_index] + else: + delattr(self.parent, self.node_name) + + self.node = None diff --git a/system/compilers/syntaxes/transformer/TransformationError.py b/system/compilers/syntaxes/transformer/TransformationError.py new file mode 100644 index 00000000..92d9f649 --- /dev/null +++ b/system/compilers/syntaxes/transformer/TransformationError.py @@ -0,0 +1,16 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from ..CompilationError import CompilationError + +class TransformationError(CompilationError): + pass diff --git a/system/compilers/syntaxes/transformer/__init__.py b/system/compilers/syntaxes/transformer/__init__.py new file mode 100644 index 00000000..9de4dfa8 --- /dev/null +++ b/system/compilers/syntaxes/transformer/__init__.py @@ -0,0 +1,169 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .visitors import ( + CollapseContextRequest, + CollapseVariableRequest, + ExecuteFunctionCall, +) + +from collections import ( + defaultdict, + OrderedDict, +) + +from ..ast import Node +from .Path import Path +from borela import trim_whitespace + +import re + +def get_visitors(name, visitors): + result = [] + + any_visitor = visitors.get('*', None) + if any_visitor: + result.extend(any_visitor) + + type_visitor = visitors.get(name, None) + if type_visitor: + result.extend(type_visitor) + + return result + +def prepare_visitors(visitors): + result = defaultdict(list) + + for key, visitors in visitors.items(): + if '|' not in key: + if isinstance(visitors, list): + result[key].extend(visitors) + else: + result[key].append(visitors) + continue + + for node_type in key.split('|'): + node_type = trim_whitespace(node_type) + + if isinstance(visitors, list): + result[node_type].extend(visitors) + else: + result[node_type].append(visitors) + + return result + +def transform(root, visitors=None): + if visitors is None: + visitors = { + 'ContextRequest': CollapseContextRequest(), + 'FunctionCall': ExecuteFunctionCall(), + 'VariableRequest': CollapseVariableRequest(), + } + visit(Path(node=root), visitors) + +# Visit each node in the tree allowing visitors to modify it. The visitors +# dictionary follows the format: +# +# { +# # Visit all nodes. +# '*': [VisitorInstance, ...], +# +# # Visit only NodeType. +# 'NodeType': [VisitorInstance, ...], +# +# # Visit only NodeTypeA and NodeTypeB. +# 'NodeTypeA | NodeTypeB': [VisitorInstance, ...], +# +# # If there’s just one visitor, a list is not necessary. +# 'NodeType': VisitorInstance, +# +# } +def visit(path, visitors, visited=None): + if not isinstance(path.node, Node): + return + + # This is the first node being visited. + if visited is None: + visited = {} + visitors = prepare_visitors(visitors) + + node = path.node + node_hash = hash(node) + + if node_hash not in visited: + visited[node_hash] = True + else: + return + + name = node.__class__.__name__ + node_visitors = get_visitors(name, visitors) + + # Enter. + if len(node_visitors): + for visitor in node_visitors: + visitor.enter(path) + + # Node changed, revisit. + if path.node is not node: + return visit(path, visitors, visited) + + # Visit the subnodes. + for subnode_name in node.get_subnodes(): + subnode = getattr(node, subnode_name) + + if not isinstance(subnode, (Node, OrderedDict, list)): + continue + + # Subnode is a simple node. + if isinstance(subnode, Node): + visit( + Path( + parent=node, + node_name=subnode_name, + node=subnode, + ), + visitors, + visited, + ) + continue + + # Subnode is actually multiple nodes. + if isinstance(subnode, OrderedDict): + subnodes = subnode.values() + elif isinstance(subnode, list): + subnodes = subnode + else: + raise ValueError('Unexpected node type: %s' % type(subnode)) + + for i, subnode in enumerate(subnodes): + if not isinstance(subnode, Node): + continue + + visit( + Path( + parent=node, + node_name=subnode_name, + node_index=i, + node=subnode, + ), + visitors, + visited, + ) + + # Exit. + if len(node_visitors): + for visitor in node_visitors: + visitor.exit(path) + + # Node changed, revisit. + if path.node is not node: + return visit(path, visitors, visited) diff --git a/system/compilers/syntaxes/transformer/visitors/CollapseContextRequest.py b/system/compilers/syntaxes/transformer/visitors/CollapseContextRequest.py new file mode 100644 index 00000000..d431f376 --- /dev/null +++ b/system/compilers/syntaxes/transformer/visitors/CollapseContextRequest.py @@ -0,0 +1,17 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from ...Visitor import Visitor + +class CollapseContextRequest(Visitor): + def exit(self, path): + path.replace_with(path.node.resolved.short_name) diff --git a/system/compilers/syntaxes/transformer/visitors/CollapseVariableRequest.py b/system/compilers/syntaxes/transformer/visitors/CollapseVariableRequest.py new file mode 100644 index 00000000..d62a1760 --- /dev/null +++ b/system/compilers/syntaxes/transformer/visitors/CollapseVariableRequest.py @@ -0,0 +1,17 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from ...Visitor import Visitor + +class CollapseVariableRequest(Visitor): + def exit(self, path): + path.replace_with('{{%s}}' % path.node.resolved.short_name) diff --git a/system/compilers/syntaxes/transformer/visitors/ExecuteFunctionCall.py b/system/compilers/syntaxes/transformer/visitors/ExecuteFunctionCall.py new file mode 100644 index 00000000..04c08dd5 --- /dev/null +++ b/system/compilers/syntaxes/transformer/visitors/ExecuteFunctionCall.py @@ -0,0 +1,45 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from ...Visitor import Visitor +from ..TransformationError import TransformationError +from borela.functions import make_words_regex + +def join(arguments): + return ''.join(arguments) + +def word(argument): + return '\b%s\b' % argument + +def words(arguments): + return make_words_regex(arguments) + +FUNCTIONS = { + 'join': join, + 'word': word, + 'words': words, +} + +class ExecuteFunctionCall(Visitor): + def exit(self, path): + node = path.node + name = node.name + arguments = node.arguments + + if name not in FUNCTIONS: + raise TransformationError( + message='Function not “%s” found.' % name, + path=node.location.path, + location=node.location, + ) + + path.replace_with(FUNCTIONS[name](arguments)) diff --git a/system/compilers/syntaxes/transformer/visitors/__init__.py b/system/compilers/syntaxes/transformer/visitors/__init__.py new file mode 100644 index 00000000..0ab3f4d2 --- /dev/null +++ b/system/compilers/syntaxes/transformer/visitors/__init__.py @@ -0,0 +1,15 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .CollapseContextRequest import * # noqa +from .CollapseVariableRequest import * # noqa +from .ExecuteFunctionCall import * # noqa diff --git a/system/event_bus.py b/system/event_bus.py new file mode 100644 index 00000000..fce6675a --- /dev/null +++ b/system/event_bus.py @@ -0,0 +1,15 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from borela import EventEngine + +EVENT_BUS = EventEngine() diff --git a/system/events/__init__.py b/system/events/__init__.py new file mode 100644 index 00000000..c8a57aa1 --- /dev/null +++ b/system/events/__init__.py @@ -0,0 +1,18 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .building import * # noqa +from .integrated import * # noqa +from .finished_building import * # noqa +from .stopped_watching import * # noqa +from .settings import * # noqa +from .watching import * # noqa diff --git a/system/events/building.py b/system/events/building.py new file mode 100644 index 00000000..48bed271 --- /dev/null +++ b/system/events/building.py @@ -0,0 +1,32 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +BUILDING_COMMANDS = 'BUILDING_COMMANDS' +BUILDING_KEYMAPS = 'BUILDING_KEYMAPS' +BUILDING_MENUS = 'BUILDING_MENUS' +BUILDING_PREFERENCES = 'BUILDING_PREFERENCES' +BUILDING_SYNTAXES = 'BUILDING_SYNTAXES' + +def building_commands(): + return {'type': BUILDING_COMMANDS} + +def building_keymaps(): + return {'type': BUILDING_KEYMAPS} + +def building_menus(): + return {'type': BUILDING_MENUS} + +def building_preferences(): + return {'type': BUILDING_PREFERENCES} + +def building_syntaxes(): + return {'type': BUILDING_SYNTAXES} diff --git a/system/events/finished_building.py b/system/events/finished_building.py new file mode 100644 index 00000000..060049c5 --- /dev/null +++ b/system/events/finished_building.py @@ -0,0 +1,32 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +FINISHED_BUILDING_COMMANDS = 'FINISHED_BUILDING_COMMANDS' +FINISHED_BUILDING_KEYMAPS = 'FINISHED_BUILDING_KEYMAPS' +FINISHED_BUILDING_MENUS = 'FINISHED_BUILDING_MENUS' +FINISHED_BUILDING_PREFERENCES = 'FINISHED_BUILDING_PREFERENCES' +FINISHED_BUILDING_SYNTAXES = 'FINISHED_BUILDING_SYNTAXES' + +def finished_building_commands(): + return {'type': FINISHED_BUILDING_COMMANDS} + +def finished_building_keymaps(): + return {'type': FINISHED_BUILDING_KEYMAPS} + +def finished_building_menus(): + return {'type': FINISHED_BUILDING_MENUS} + +def finished_building_preferences(): + return {'type': FINISHED_BUILDING_PREFERENCES} + +def finished_building_syntaxes(): + return {'type': FINISHED_BUILDING_SYNTAXES} diff --git a/system/events/integrated.py b/system/events/integrated.py new file mode 100644 index 00000000..fd57bb37 --- /dev/null +++ b/system/events/integrated.py @@ -0,0 +1,62 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +INTEGRATED_COMMANDS = 'INTEGRATED_COMMANDS' +INTEGRATED_KEYMAPS = 'INTEGRATED_KEYMAPS' +INTEGRATED_MENUS = 'INTEGRATED_MENUS' +INTEGRATED_PREFERENCES = 'INTEGRATED_PREFERENCES' +INTEGRATED_SYNTAXES = 'INTEGRATED_SYNTAXES' + +def integrated_commands(src_dir, build_dir): + return { + 'type': INTEGRATED_COMMANDS, + 'payload': { + 'src_dir': src_dir, + 'build_dir': build_dir, + } + } + +def integrated_keymaps(src_dir, build_dir): + return { + 'type': INTEGRATED_KEYMAPS, + 'payload': { + 'src_dir': src_dir, + 'build_dir': build_dir, + } + } + +def integrated_menus(src_dir, build_dir): + return { + 'type': INTEGRATED_MENUS, + 'payload': { + 'src_dir': src_dir, + 'build_dir': build_dir, + } + } + +def integrated_preferences(src_dir, build_dir): + return { + 'type': INTEGRATED_PREFERENCES, + 'payload': { + 'src_dir': src_dir, + 'build_dir': build_dir, + } + } + +def integrated_syntaxes(src_dir, build_dir): + return { + 'type': INTEGRATED_SYNTAXES, + 'payload': { + 'src_dir': src_dir, + 'build_dir': build_dir, + } + } diff --git a/system/events/settings.py b/system/events/settings.py new file mode 100644 index 00000000..aa2af4dc --- /dev/null +++ b/system/events/settings.py @@ -0,0 +1,26 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +SETTINGS_LOADED = 'SETTINGS_LOADED' +SETTINGS_UPDATED = 'SETTINGS_UPDATED' + +def settings_loaded(settings): + return { + 'type': SETTINGS_LOADED, + 'payload': settings, + } + +def settings_updated(settings): + return { + 'type': SETTINGS_UPDATED, + 'payload': settings, + } diff --git a/system/events/stopped_watching.py b/system/events/stopped_watching.py new file mode 100644 index 00000000..c284192f --- /dev/null +++ b/system/events/stopped_watching.py @@ -0,0 +1,32 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +STOPPED_WATCHING_COMMANDS = 'STOPPED_WATCHING_COMMANDS' +STOPPED_WATCHING_KEYMAPS = 'STOPPED_WATCHING_KEYMAPS' +STOPPED_WATCHING_MENUS = 'STOPPED_WATCHING_MENUS' +STOPPED_WATCHING_PREFERENCES = 'STOPPED_WATCHING_PREFERENCES' +STOPPED_WATCHING_SYNTAXES = 'STOPPED_WATCHING_SYNTAXES' + +def stopped_watching_commands(): + return {'type': STOPPED_WATCHING_COMMANDS} + +def stopped_watching_keymaps(): + return {'type': STOPPED_WATCHING_KEYMAPS} + +def stopped_watching_menus(): + return {'type': STOPPED_WATCHING_MENUS} + +def stopped_watching_preferences(): + return {'type': STOPPED_WATCHING_PREFERENCES} + +def stopped_watching_syntaxes(): + return {'type': STOPPED_WATCHING_SYNTAXES} diff --git a/system/events/watching.py b/system/events/watching.py new file mode 100644 index 00000000..3c84a257 --- /dev/null +++ b/system/events/watching.py @@ -0,0 +1,32 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +WATCHING_COMMANDS = 'WATCHING_COMMANDS' +WATCHING_KEYMAPS = 'WATCHING_KEYMAPS' +WATCHING_MENUS = 'WATCHING_MENUS' +WATCHING_PREFERENCES = 'WATCHING_PREFERENCES' +WATCHING_SYNTAXES = 'WATCHING_SYNTAXES' + +def watching_commands(): + return {'type': WATCHING_COMMANDS} + +def watching_keymaps(): + return {'type': WATCHING_KEYMAPS} + +def watching_menus(): + return {'type': WATCHING_MENUS} + +def watching_preferences(): + return {'type': WATCHING_PREFERENCES} + +def watching_syntaxes(): + return {'type': WATCHING_SYNTAXES} diff --git a/system/headers/__init__.py b/system/headers/__init__.py new file mode 100644 index 00000000..a4dc5fdc --- /dev/null +++ b/system/headers/__init__.py @@ -0,0 +1,51 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from os.path import ( + dirname, + join, +) + +from borela import read_text_file +from Naomi.system import package_relpath + +def command(src_dir): + return read_header('command.txt', src_dir) + +def keymap(src_dir): + return read_header('keymap.txt', src_dir) + +def menu(src_dir): + return read_header('menu.txt', src_dir) + +def plist(): + return read_header('plist.txt') + +def preferences(src_dir): + return read_header('preferences.txt', src_dir) + +def read_header(file_name, src_dir=None): + template = read_text_file(join(dirname(__file__), file_name)) + + if src_dir: + return template.replace( + '$1', + # Just to make sure the paths in headers always use forward slashes + # to prevent build files from showing up on git when compiling on + # another platform. + package_relpath(src_dir).replace('\\', '/') + ) + + return template + +def syntax(src_dir): + return read_header('syntax.txt', src_dir) diff --git a/system/headers/command.txt b/system/headers/command.txt new file mode 100644 index 00000000..49cc0e00 --- /dev/null +++ b/system/headers/command.txt @@ -0,0 +1,20 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +//////////////////////////////////////////////////////////////////////////////// +// +// This code was auto generated, be aware that changes to this file will be +// lost on the next build. To contribute, edit the files in: +// +// $1 +// +//////////////////////////////////////////////////////////////////////////////// diff --git a/system/headers/keymap.txt b/system/headers/keymap.txt new file mode 100644 index 00000000..49cc0e00 --- /dev/null +++ b/system/headers/keymap.txt @@ -0,0 +1,20 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +//////////////////////////////////////////////////////////////////////////////// +// +// This code was auto generated, be aware that changes to this file will be +// lost on the next build. To contribute, edit the files in: +// +// $1 +// +//////////////////////////////////////////////////////////////////////////////// diff --git a/system/headers/menu.txt b/system/headers/menu.txt new file mode 100644 index 00000000..49cc0e00 --- /dev/null +++ b/system/headers/menu.txt @@ -0,0 +1,20 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +//////////////////////////////////////////////////////////////////////////////// +// +// This code was auto generated, be aware that changes to this file will be +// lost on the next build. To contribute, edit the files in: +// +// $1 +// +//////////////////////////////////////////////////////////////////////////////// diff --git a/system/headers/plist.txt b/system/headers/plist.txt new file mode 100644 index 00000000..b22bca2d --- /dev/null +++ b/system/headers/plist.txt @@ -0,0 +1,2 @@ + + diff --git a/system/headers/preferences.txt b/system/headers/preferences.txt new file mode 100644 index 00000000..ddb1191e --- /dev/null +++ b/system/headers/preferences.txt @@ -0,0 +1,21 @@ + + diff --git a/system/headers/syntax.txt b/system/headers/syntax.txt new file mode 100644 index 00000000..62b8e462 --- /dev/null +++ b/system/headers/syntax.txt @@ -0,0 +1,21 @@ +Licensed under the Apache License, Version 2.0 (the “License”); you may not +use this file except in compliance with the License. You may obtain a copy of +the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +License for the specific language governing permissions and limitations under +the License. + +############################################################################## + + This code was auto generated, be aware that changes to this file will be + lost on the next build. To contribute, edit the entry point and files + requested by it: + + $1 + +############################################################################## diff --git a/system/integration.py b/system/integration.py new file mode 100644 index 00000000..975a869a --- /dev/null +++ b/system/integration.py @@ -0,0 +1,36 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .events import ( + integrated_commands, + integrated_keymaps, + integrated_menus, + integrated_preferences, + integrated_syntaxes, +) + +from .event_bus import EVENT_BUS + +def integrate_commands(src_dir, build_dir): + EVENT_BUS.emit(integrated_commands(src_dir, build_dir)) + +def integrate_keymaps(src_dir, build_dir): + EVENT_BUS.emit(integrated_keymaps(src_dir, build_dir)) + +def integrate_menus(src_dir, build_dir): + EVENT_BUS.emit(integrated_menus(src_dir, build_dir)) + +def integrate_preferences(src_dir, build_dir): + EVENT_BUS.emit(integrated_preferences(src_dir, build_dir)) + +def integrate_syntaxes(src_dir, build_dir): + EVENT_BUS.emit(integrated_syntaxes(src_dir, build_dir)) diff --git a/system/logging.py b/system/logging.py new file mode 100644 index 00000000..2ebe36d6 --- /dev/null +++ b/system/logging.py @@ -0,0 +1,32 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from borela.logging import log as borela_log +from borela.logging import set_log_level # noqa + +def log(level, message): + borela_log('NAOMI', level, message) + +def log_critical(message): + log('CRITICAL', message) + +def log_debug(message): + log('DEBUG', message) + +def log_error(message): + log('ERROR', message) + +def log_info(message): + log('INFO', message) + +def log_warning(message): + log('WARNING', message) diff --git a/system/path.py b/system/path.py new file mode 100644 index 00000000..57540384 --- /dev/null +++ b/system/path.py @@ -0,0 +1,30 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from os.path import ( + dirname, + join, + realpath, + relpath, +) + +from .state_store import STATE_STORE + +PACKAGE_PATH = realpath(join(dirname(__file__), '..', '..')) + +# Calculates the relative path to the package’s root. +def package_relpath(path): + return relpath(path, PACKAGE_PATH) + +def packages_dir(): + return PACKAGE_PATH + diff --git a/system/state_reducers/building.py b/system/state_reducers/building.py new file mode 100644 index 00000000..cf873b70 --- /dev/null +++ b/system/state_reducers/building.py @@ -0,0 +1,97 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from Naomi.system.events import ( + FINISHED_BUILDING_COMMANDS, + FINISHED_BUILDING_KEYMAPS, + FINISHED_BUILDING_MENUS, + FINISHED_BUILDING_PREFERENCES, + FINISHED_BUILDING_SYNTAXES, + + BUILDING_COMMANDS, + BUILDING_KEYMAPS, + BUILDING_MENUS, + BUILDING_PREFERENCES, + BUILDING_SYNTAXES, +) + +INITIAL_STATE = { + 'working': False, + 'commands': False, + 'keymaps': False, + 'menus': False, + 'preferences': False, + 'syntaxes': False, +} + +EVENTS = [ + FINISHED_BUILDING_COMMANDS, + FINISHED_BUILDING_KEYMAPS, + FINISHED_BUILDING_MENUS, + FINISHED_BUILDING_PREFERENCES, + FINISHED_BUILDING_SYNTAXES, + + BUILDING_COMMANDS, + BUILDING_KEYMAPS, + BUILDING_MENUS, + BUILDING_PREFERENCES, + BUILDING_SYNTAXES, +] + +def reducer(state=INITIAL_STATE, event=None): + if event is None or event['type'] not in EVENTS: + return state + + # This dictionary will be simple, deep copy won’t be necessary. + state = dict(state) + + # NOT building. + if event['type'] == FINISHED_BUILDING_COMMANDS: + state['commands'] = False + + if event['type'] == FINISHED_BUILDING_KEYMAPS: + state['keymaps'] = False + + if event['type'] == FINISHED_BUILDING_MENUS: + state['menus'] = False + + if event['type'] == FINISHED_BUILDING_PREFERENCES: + state['preferences'] = False + + if event['type'] == FINISHED_BUILDING_SYNTAXES: + state['syntaxes'] = False + + # Building. + if event['type'] == BUILDING_COMMANDS: + state['commands'] = True + + if event['type'] == BUILDING_KEYMAPS: + state['keymaps'] = True + + if event['type'] == BUILDING_MENUS: + state['menus'] = True + + if event['type'] == BUILDING_PREFERENCES: + state['preferences'] = True + + if event['type'] == BUILDING_SYNTAXES: + state['syntaxes'] = True + + state['working'] = ( + state['commands'] + or state['keymaps'] + or state['menus'] + or state['preferences'] + or state['syntaxes'] + ) + + return state diff --git a/system/state_reducers/integrated.py b/system/state_reducers/integrated.py new file mode 100644 index 00000000..f7631295 --- /dev/null +++ b/system/state_reducers/integrated.py @@ -0,0 +1,60 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from Naomi.system.events import ( + INTEGRATED_COMMANDS, + INTEGRATED_KEYMAPS, + INTEGRATED_MENUS, + INTEGRATED_PREFERENCES, + INTEGRATED_SYNTAXES, +) + +from copy import deepcopy + +INITIAL_STATE = { + 'commands': [], + 'keymaps': [], + 'menus': [], + 'preferences': [], + 'syntaxes': [], +} + +EVENTS = [ + INTEGRATED_COMMANDS, + INTEGRATED_KEYMAPS, + INTEGRATED_MENUS, + INTEGRATED_PREFERENCES, + INTEGRATED_SYNTAXES, +] + +def reducer(state=INITIAL_STATE, event=None): + if event is None or event['type'] not in EVENTS: + return state + + state = deepcopy(state) + + if event['type'] == INTEGRATED_COMMANDS: + state['commands'].append(event['payload']) + + if event['type'] == INTEGRATED_KEYMAPS: + state['keymaps'].append(event['payload']) + + if event['type'] == INTEGRATED_MENUS: + state['menus'].append(event['payload']) + + if event['type'] == INTEGRATED_PREFERENCES: + state['preferences'].append(event['payload']) + + if event['type'] == INTEGRATED_SYNTAXES: + state['syntaxes'].append(event['payload']) + + return state diff --git a/system/state_reducers/settings.py b/system/state_reducers/settings.py new file mode 100644 index 00000000..5ea76077 --- /dev/null +++ b/system/state_reducers/settings.py @@ -0,0 +1,52 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from Naomi.system.events import ( + SETTINGS_LOADED, + SETTINGS_UPDATED, +) + +from Naomi.system import set_log_level + +SETTINGS_EVENTS = [ + SETTINGS_LOADED, + SETTINGS_UPDATED, +] + +VALID_LOG_LEVELS = [ + 'CRITICAL', + 'ERROR', + 'WARNING', + 'INFO', + 'DEBUG', +] + +def log_level_from_settings(settings): + result = settings.get('log_level', 'INFO').upper() + if result not in VALID_LOG_LEVELS: + return 'INFO' + return result + +def reducer(state={}, event=None): + if event is None or event['type'] not in SETTINGS_EVENTS: + return state + + SETTINGS = event['payload'] + + log_level = log_level_from_settings(SETTINGS) + set_log_level(log_level) + + new_settings = {} + new_settings['log_level'] = log_level + new_settings['syntaxes'] = SETTINGS.get('syntaxes', []) + + return new_settings diff --git a/system/state_reducers/watching.py b/system/state_reducers/watching.py new file mode 100644 index 00000000..ae815022 --- /dev/null +++ b/system/state_reducers/watching.py @@ -0,0 +1,97 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from Naomi.system.events import ( + STOPPED_WATCHING_COMMANDS, + STOPPED_WATCHING_KEYMAPS, + STOPPED_WATCHING_MENUS, + STOPPED_WATCHING_PREFERENCES, + STOPPED_WATCHING_SYNTAXES, + + WATCHING_COMMANDS, + WATCHING_KEYMAPS, + WATCHING_MENUS, + WATCHING_PREFERENCES, + WATCHING_SYNTAXES, +) + +INITIAL_STATE = { + 'working': False, + 'commands': False, + 'keymaps': False, + 'menus': False, + 'preferences': False, + 'syntaxes': False, +} + +EVENTS = [ + STOPPED_WATCHING_COMMANDS, + STOPPED_WATCHING_KEYMAPS, + STOPPED_WATCHING_MENUS, + STOPPED_WATCHING_PREFERENCES, + STOPPED_WATCHING_SYNTAXES, + + WATCHING_COMMANDS, + WATCHING_KEYMAPS, + WATCHING_MENUS, + WATCHING_PREFERENCES, + WATCHING_SYNTAXES, +] + +def reducer(state=INITIAL_STATE, event=None): + if event is None or event['type'] not in EVENTS: + return state + + # This dictionary will be simple, deep copy won’t be necessary. + state = dict(state) + + # NOT Watching. + if event['type'] == STOPPED_WATCHING_COMMANDS: + state['commands'] = False + + if event['type'] == STOPPED_WATCHING_KEYMAPS: + state['keymaps'] = False + + if event['type'] == STOPPED_WATCHING_MENUS: + state['menus'] = False + + if event['type'] == STOPPED_WATCHING_PREFERENCES: + state['preferences'] = False + + if event['type'] == STOPPED_WATCHING_SYNTAXES: + state['syntaxes'] = False + + # Watching. + if event['type'] == WATCHING_COMMANDS: + state['commands'] = True + + if event['type'] == WATCHING_KEYMAPS: + state['keymaps'] = True + + if event['type'] == WATCHING_MENUS: + state['menus'] = True + + if event['type'] == WATCHING_PREFERENCES: + state['preferences'] = True + + if event['type'] == WATCHING_SYNTAXES: + state['syntaxes'] = True + + state['working'] = ( + state['commands'] + or state['keymaps'] + or state['menus'] + or state['preferences'] + or state['syntaxes'] + ) + + return state diff --git a/system/state_store.py b/system/state_store.py new file mode 100644 index 00000000..026af8a8 --- /dev/null +++ b/system/state_store.py @@ -0,0 +1,31 @@ +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +from .event_bus import EVENT_BUS +from borela import StateStore + +# Reducers. +from .state_reducers.building import reducer as building_reducer +from .state_reducers.integrated import reducer as integrated_reducer +from .state_reducers.settings import reducer as settings_reducer +from .state_reducers.watching import reducer as watching_reducer + +# Store that holds the plugins’ state. +STATE_STORE = StateStore( + building=building_reducer, + integrated=integrated_reducer, + settings=settings_reducer, + watching=watching_reducer, +) + +# Listen to all events to modify the store through the reducers. +EVENT_BUS.on_any(lambda event: STATE_STORE.apply(event)) diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index bf72dbf4..00000000 --- a/tests/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. diff --git a/tests/old-tests/fjsx15/flowtype/old_test_type-aliasing.js b/tests/old-tests/fjsx15/flowtype/old_test_type-aliasing.js deleted file mode 100644 index 54aabe90..00000000 --- a/tests/old-tests/fjsx15/flowtype/old_test_type-aliasing.js +++ /dev/null @@ -1,232 +0,0 @@ -// SYNTAX TEST "Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax" - -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - - type Alias = SomeType; -// ^^^^ .keyword.declaration.type-aliasing.flow -// ^^^^^ .entity.name.type.flow -// ^ .keyword.operator.other.assignment.flow -// ^^^^^^^^ .entity.name.type.flow -// ^ .punctuation.terminator.js - type Alias = SomeType[]; -// ^^^^ .keyword.declaration.type-aliasing.flow -// ^^^^^ .entity.name.type.flow -// ^ .keyword.operator.other.assignment.flow -// ^^^^^^^^ .entity.name.type.flow -// ^ .punctuation.definition.array.begin.flow -// ^ .punctuation.definition.array.end.flow -// ^ .punctuation.terminator.js - type Alias = SomeType; -// ^^^^ .keyword.declaration.type-aliasing.flow -// ^^^^^ .entity.name.type.flow -// ^ .keyword.operator.other.assignment.flow -// ^^^^^^^^ .entity.name.type.flow -// ^ .punctuation.section.generic.begin.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.section.generic.end.flow -// ^ .punctuation.terminator.js - type Alias = SomeType; -// ^^^^ .keyword.declaration.type-aliasing.flow -// ^^^^^ .entity.name.type.flow -// ^ .keyword.operator.other.assignment.flow -// ^^^^^^^^ .entity.name.type.flow -// ^ .punctuation.section.generic.begin.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.definition.array.begin.flow -// ^ .punctuation.definition.array.end.flow -// ^ .punctuation.section.generic.end.flow -// ^ .punctuation.terminator.js - type Alias = (param:number) => number; -// ^^^^ .keyword.declaration.type-aliasing.flow -// ^^^^^ .entity.name.type.flow -// ^ .keyword.operator.other.assignment.flow -// ^ .punctuation.section.group.begin.flow -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.section.group.end.flow -// ^^ .punctuation.definition.function.result.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.terminator.js - type Alias = (param:number, param:string) => number; -// ^^^^ .keyword.declaration.type-aliasing.flow -// ^^^^^ .entity.name.type.flow -// ^ .keyword.operator.other.assignment.flow -// ^ .punctuation.section.group.begin.flow -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.definition.function.parameters.flow -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.section.group.end.flow -// ^^ .punctuation.definition.function.result.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.terminator.js - type Alias = (param:A, param:B) => C; -// ^^^^ .keyword.declaration.type-aliasing.flow -// ^^^^^ .entity.name.type.flow -// ^ .punctuation.section.generic.begin.flow -// ^ .entity.name.type.flow -// ^ .punctuation.separator.comma.flow -// ^ .entity.name.type.flow -// ^ .punctuation.separator.comma.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.generic.end.flow -// ^ .keyword.operator.other.assignment.flow -// ^ .punctuation.section.group.begin.flow -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.function.parameters.flow -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.group.end.flow -// ^^ .punctuation.definition.function.result.flow -// ^ .entity.name.type.flow -// ^ .punctuation.terminator.js - type Alias = (param:A|B, param:B) => C|B; -// ^^^^ .keyword.declaration.type-aliasing.flow -// ^^^^^ .entity.name.type.flow -// ^ .punctuation.section.generic.begin.flow -// ^ .entity.name.type.flow -// ^ .punctuation.separator.comma.flow -// ^ .entity.name.type.flow -// ^ .punctuation.separator.comma.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.generic.end.flow -// ^ .keyword.operator.other.assignment.flow -// ^ .punctuation.section.group.begin.flow -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .keyword.operator.other.union.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.function.parameters.flow -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.group.end.flow -// ^^ .punctuation.definition.function.result.flow -// ^ .entity.name.type.flow -// ^ .keyword.operator.other.union.flow -// ^ .entity.name.type.flow -// ^ .punctuation.terminator.js - type Alias = (param:?(A|B), param:?B) => ?C; -// ^^^^ .keyword.declaration.type-aliasing.flow -// ^^^^^ .entity.name.type.flow -// ^ .punctuation.section.generic.begin.flow -// ^ .entity.name.type.flow -// ^ .punctuation.separator.comma.flow -// ^ .entity.name.type.flow -// ^ .punctuation.separator.comma.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.generic.end.flow -// ^ .keyword.operator.other.assignment.flow -// ^ .punctuation.section.group.begin.flow -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .keyword.operator.other.nullable.flow -// ^ .punctuation.definition.nullable.begin.flow -// ^ .entity.name.type.flow -// ^ .keyword.operator.other.union.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.nullable.end.flow -// ^ .punctuation.definition.function.parameters.flow -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .keyword.operator.other.nullable.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.group.end.flow -// ^^ .punctuation.definition.function.result.flow -// ^ .keyword.operator.other.nullable.flow -// ^ .entity.name.type.flow -// ^ .punctuation.terminator.js - type Alias = {a:?A, b:?B}; -// ^^^^ .keyword.declaration.type-aliasing.flow -// ^^^^^ .entity.name.type.flow -// ^ .punctuation.section.generic.begin.flow -// ^ .entity.name.type.flow -// ^ .punctuation.separator.comma.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.generic.end.flow -// ^ .keyword.operator.other.assignment.flow -// ^ .punctuation.section.block.begin.flow -// ^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .keyword.operator.other.nullable.flow -// ^ .entity.name.type.flow -// ^ .punctuation.separator.comma.flow -// ^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .keyword.operator.other.nullable.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.block.end.flow -// ^ .punctuation.terminator.js - type Alias = {a:?(A|C), b:?B}; -// ^^^^ .keyword.declaration.type-aliasing.flow -// ^^^^^ .entity.name.type.flow -// ^ .punctuation.section.generic.begin.flow -// ^ .entity.name.type.flow -// ^ .punctuation.separator.comma.flow -// ^ .entity.name.type.flow -// ^ .punctuation.separator.comma.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.generic.end.flow -// ^ .keyword.operator.other.assignment.flow -// ^ .punctuation.section.block.begin.flow -// ^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .keyword.operator.other.nullable.flow -// ^ .punctuation.definition.nullable.begin.flow -// ^ .entity.name.type.flow -// ^ .keyword.operator.other.union.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.nullable.end.flow -// ^ .punctuation.separator.comma.flow -// ^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .keyword.operator.other.nullable.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.block.end.flow -// ^ .punctuation.terminator.js - type Alias = {a:A} & {b:B}; -// ^^^^ .keyword.declaration.type-aliasing.flow -// ^^^^^ .entity.name.type.flow -// ^ .punctuation.section.generic.begin.flow -// ^ .entity.name.type.flow -// ^ .punctuation.separator.comma.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.generic.end.flow -// ^ .keyword.operator.other.assignment.flow -// ^ .punctuation.section.block.begin.flow -// ^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.block.end.flow -// ^ .keyword.operator.other.intersection.flow -// ^ .punctuation.section.block.begin.flow -// ^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.block.end.flow -// ^ .punctuation.terminator.js diff --git a/tests/old-tests/fjsx15/literal/old_test_number.js b/tests/old-tests/fjsx15/literal/old_test_number.js deleted file mode 100644 index bc2941ed..00000000 --- a/tests/old-tests/fjsx15/literal/old_test_number.js +++ /dev/null @@ -1,46 +0,0 @@ -// SYNTAX TEST "Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax" - -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - - 0; -// ^ .constant.numeric.decimal.js - 123; -// ^^^ .constant.numeric.decimal.js - 1_2_3; -// ^^^^^ .constant.numeric.decimal.js - 123_456_789; -// ^^^^^^^^^^^ .constant.numeric.decimal.js - 123.; -// ^^^^ .constant.numeric.float.js - 1_2_3.; -// ^^^^^^ .constant.numeric.float.js - 123_456_789.; -// ^^^^^^^^^^^^ .constant.numeric.float.js - 123.0; -// ^^^^^ .constant.numeric.float.js - .123; -// ^^^^ .constant.numeric.float.js - 0.123; -// ^^^^^ .constant.numeric.float.js - 123e10; -// ^^^^^^ .constant.numeric.float.scientific.js - 123e+10; -// ^^^^^^^ .constant.numeric.float.scientific.js - 123e-10; -// ^^^^^^^ .constant.numeric.float.scientific.js - 0x123; -// ^^^^^ .constant.numeric.hex.js - 0x1_2_3; -// ^^^^^^^ .constant.numeric.hex.js - 0x123_456_789; -// ^^^^^^^^^^^^^ .constant.numeric.hex.js diff --git a/tests/old-tests/fjsx15/literal/old_test_object.js b/tests/old-tests/fjsx15/literal/old_test_object.js deleted file mode 100644 index 487aa271..00000000 --- a/tests/old-tests/fjsx15/literal/old_test_object.js +++ /dev/null @@ -1,149 +0,0 @@ -// SYNTAX TEST "Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax" - -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - - var object = { -// ^^^ .storage.type.js -// ^^^^^^ .variable.other.readwrite.js -// ^ .keyword.operator.other.assignment.js -// ^ .punctuation.section.block.begin.js - property:123, -// ^^^^^^^^ .variable.other.readwrite.js -// ^ .object.js -// ^ .punctuation.binding.js -// ^^^ .constant.numeric.decimal.js -// ^ .punctuation.separator.comma.js - [property]:123, -// ^ .punctuation.section.brackets.begin.js -// ^^^^^^^^ .variable.other.readwrite.js -// ^ .punctuation.section.brackets.end.js -// ^ .punctuation.binding.js -// ^^^ .constant.numeric.decimal.js -// ^ .punctuation.separator.comma.js - [1 + 1 + 1]:123, -// ^ .punctuation.section.brackets.begin.js -// ^ .constant.numeric.decimal.js -// ^ .keyword.operator.arithmetic.js -// ^ .constant.numeric.decimal.js -// ^ .keyword.operator.arithmetic.js -// ^ .constant.numeric.decimal.js -// ^ .punctuation.section.brackets.end.js -// ^ .punctuation.binding.js -// ^^^ .constant.numeric.decimal.js -// ^ .punctuation.separator.comma.js - }; -// ^ .punctuation.section.block.end.js -// ^ .punctuation.terminator.js - var object = { -// ^^^ .storage.type.js -// ^^^^^^ .variable.other.readwrite.js -// ^ .keyword.operator.other.assignment.js -// ^ .punctuation.section.block.begin.js - @decorator -// ^ .punctuation.definition.decorator.js -// ^^^^^^^^^ .entity.name.decorator.js - @decorator(1,'2') -// ^ .punctuation.definition.decorator.js -// ^^^^^^^^^ .entity.name.decorator.js -// ^ .punctuation.definition.decorator.arguments.begin.js -// ^ .constant.numeric.decimal.js -// ^ .punctuation.definition.decorator.arguments.js -// ^^^ .string.quoted.single.js -// ^ .punctuation.definition.string.begin.js -// ^ .punctuation.definition.string.end.js -// ^ .punctuation.definition.decorator.arguments.end.js - constructor(){}, -// ^^^^^^^^^^^ .support.js -// ^^^^^^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js -// ^ .punctuation.separator.comma.js - method(){}, -// ^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js -// ^ .punctuation.separator.comma.js - *method(){}, -// ^ .storage.modifier.js -// ^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js -// ^ .punctuation.separator.comma.js - get property(){}, -// ^^^ .storage.modifier.js -// ^^^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js -// ^ .punctuation.separator.comma.js - set property(){}, -// ^^^ .storage.modifier.js -// ^^^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js -// ^ .punctuation.separator.comma.js - async method(){}, -// ^^^^^ .storage.modifier.js -// ^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js -// ^ .punctuation.separator.comma.js - static method(){}, -// ^^^^^^ .storage.modifier.js -// ^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js -// ^ .punctuation.separator.comma.js - static get property(){}, -// ^^^^^^ .storage.modifier.js -// ^^^ .storage.modifier.js -// ^^^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js -// ^ .punctuation.separator.comma.js - static set property(){}, -// ^^^^^^ .storage.modifier.js -// ^^^ .storage.modifier.js -// ^^^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js -// ^ .punctuation.separator.comma.js - static async method(){}, -// ^^^^^^ .storage.modifier.js -// ^^^^^ .storage.modifier.js -// ^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js -// ^ .punctuation.separator.comma.js - }; -// ^ .punctuation.section.block.end.js -// ^ .punctuation.terminator.js diff --git a/tests/old-tests/fjsx15/literal/string/old_test_double.js b/tests/old-tests/fjsx15/literal/string/old_test_double.js deleted file mode 100644 index 0faecb15..00000000 --- a/tests/old-tests/fjsx15/literal/string/old_test_double.js +++ /dev/null @@ -1,38 +0,0 @@ -// SYNTAX TEST "Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax" - -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - - "Something is 'here'..." -// ^^^^^^^^^^^^^^^^^^^^^^^^ .string.quoted.double.js -// ^ .punctuation.definition.string.begin.js -// ^ .punctuation.definition.string.end.js - "Something is \"here\"..." -// ^^^^^^^^^^^^^^^^^^^^^^^^^^ .string.quoted.double.js -// ^ .punctuation.definition.string.begin.js -// ^^ .constant.character.escape.a.js -// ^^ .constant.character.escape.b.js -// ^ .punctuation.definition.string.end.js - "Escaped: \\\b\f\n\r\t\v\x12\u1234\u{1234}" -// ^^^^^^^^^^^^^^^^^^^^^^^^^ .string.quoted.double.js -// ^ .punctuation.definition.string.begin.js -// ^^ .constant.character.escape.a.js -// ^^ .constant.character.escape.b.js -// ^^ .constant.character.escape.a.js -// ^^ .constant.character.escape.b.js -// ^^ .constant.character.escape.a.js -// ^^ .constant.character.escape.b.js -// ^^ .constant.character.escape.a.js -// ^^^^ .constant.character.escape.b.js -// ^^^^^^ .constant.character.escape.a.js -// ^^^^^^^^ .constant.character.escape.b.js -// ^ .punctuation.definition.string.end.js diff --git a/tests/old-tests/fjsx15/literal/string/old_test_regex.js b/tests/old-tests/fjsx15/literal/string/old_test_regex.js deleted file mode 100644 index 5dc88812..00000000 --- a/tests/old-tests/fjsx15/literal/string/old_test_regex.js +++ /dev/null @@ -1,22 +0,0 @@ -// SYNTAX TEST "Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax" - -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - - /\a\b\c/abcde -// ^^^^^^^^^^^^^ .string.unquoted.regex.js -// ^ .punctuation.definition.string.begin.js -// ^^ .constant.character.escape.a.js -// ^^ .constant.character.escape.b.js -// ^^ .constant.character.escape.a.js -// ^ .punctuation.definition.string.end.js -// ^^^^^ .regex.flag.js diff --git a/tests/old-tests/fjsx15/literal/string/old_test_single.js b/tests/old-tests/fjsx15/literal/string/old_test_single.js deleted file mode 100644 index d1089d95..00000000 --- a/tests/old-tests/fjsx15/literal/string/old_test_single.js +++ /dev/null @@ -1,38 +0,0 @@ -// SYNTAX TEST "Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax" - -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - - 'Something is "here"...' -// ^^^^^^^^^^^^^^^^^^^^^^^^ .string.quoted.single.js -// ^ .punctuation.definition.string.begin.js -// ^ .punctuation.definition.string.end.js - 'Something is \'here\'...' -// ^^^^^^^^^^^^^^^^^^^^^^^^^^ .string.quoted.single.js -// ^ .punctuation.definition.string.begin.js -// ^^ .constant.character.escape.a.js -// ^^ .constant.character.escape.b.js -// ^ .punctuation.definition.string.end.js - 'Escaped: \\\b\f\n\r\t\v\x12\u1234\u{1234}' -// ^^^^^^^^^^^^^^^^^^^^^^^^^ .string.quoted.single.js -// ^ .punctuation.definition.string.begin.js -// ^^ .constant.character.escape.a.js -// ^^ .constant.character.escape.b.js -// ^^ .constant.character.escape.a.js -// ^^ .constant.character.escape.b.js -// ^^ .constant.character.escape.a.js -// ^^ .constant.character.escape.b.js -// ^^ .constant.character.escape.a.js -// ^^^^ .constant.character.escape.b.js -// ^^^^^^ .constant.character.escape.a.js -// ^^^^^^^^ .constant.character.escape.b.js -// ^ .punctuation.definition.string.end.js diff --git a/tests/old-tests/fjsx15/literal/string/old_test_template.js b/tests/old-tests/fjsx15/literal/string/old_test_template.js deleted file mode 100644 index 71543696..00000000 --- a/tests/old-tests/fjsx15/literal/string/old_test_template.js +++ /dev/null @@ -1,72 +0,0 @@ -// SYNTAX TEST "Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax" - -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - - `Something is 'here'...` -// ^^^^^^^^^^^^^^^^^^^^^^^^ .string.template.js -// ^ .punctuation.definition.string.begin.js -// ^ .punctuation.definition.string.end.js - `Something is "here"...` -// ^^^^^^^^^^^^^^^^^^^^^^^^ .string.template.js -// ^ .punctuation.definition.string.begin.js -// ^ .punctuation.definition.string.end.js - `Something is \`here\`...` -// ^^^^^^^^^^^^^^^^^^^^^^^^^^ .string.template.js -// ^ .punctuation.definition.string.begin.js -// ^^ .constant.character.escape.a.js -// ^^ .constant.character.escape.b.js -// ^ .punctuation.definition.string.end.js - `Escaped: \\\b\f\n\r\t\v\x12\u1234\u{1234}` -// ^^^^^^^^^^^^^^^^^^^^^^^^^ .string.template.js -// ^ .punctuation.definition.string.begin.js -// ^^ .constant.character.escape.a.js -// ^^ .constant.character.escape.b.js -// ^^ .constant.character.escape.a.js -// ^^ .constant.character.escape.b.js -// ^^ .constant.character.escape.a.js -// ^^ .constant.character.escape.b.js -// ^^ .constant.character.escape.a.js -// ^^^^ .constant.character.escape.b.js -// ^^^^^^ .constant.character.escape.a.js -// ^^^^^^^^ .constant.character.escape.b.js -// ^ .punctuation.definition.string.end.js - `Embedded variable ${variable}` -// ^^^^^^^^^^^^^^^^^^^ .string.template.js -// ^ .punctuation.definition.string.begin.js -// ^^ - string.template.js -// ^^ .keyword.operator.other.embedded-expression.begin.js -// ^^^^^^^^ .variable.other.readwrite.js -// ^ - string.template.js -// ^ .keyword.operator.other.embedded-expression.end.js -// ^ .string.template.js -// ^ .punctuation.definition.string.end.js - `A${`B${`C`}`}` -// ^^ .string.template.js -// ^ .punctuation.definition.string.begin.js -// ^^ - string.template.js -// ^^ .keyword.operator.other.embedded-expression.begin.js -// ^^ .string.template.js -// ^ .punctuation.definition.string.begin.js -// ^^ - string.template.js -// ^^ .keyword.operator.other.embedded-expression.begin.js -// ^^^ .string.template.js -// ^ .punctuation.definition.string.begin.js -// ^ .punctuation.definition.string.end.js -// ^ - string.template.js -// ^ .keyword.operator.other.embedded-expression.end.js -// ^ .string.template.js -// ^ .punctuation.definition.string.end.js -// ^ - string.template.js -// ^ .keyword.operator.other.embedded-expression.end.js -// ^ .string.template.js -// ^ .punctuation.definition.string.end.js diff --git a/tests/old-tests/fjsx15/old_test_arrow-function.js b/tests/old-tests/fjsx15/old_test_arrow-function.js deleted file mode 100644 index 661954ef..00000000 --- a/tests/old-tests/fjsx15/old_test_arrow-function.js +++ /dev/null @@ -1,114 +0,0 @@ -// SYNTAX TEST "Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax" - -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - - () => {}; -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^^ .punctuation.section.block.arrow.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js -// ^ .punctuation.terminator.js - async () => {}; -// ^^^^^ .storage.modifier.js -// ^^^^^ .keyword.other.async.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^^ .punctuation.section.block.arrow.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - (param, ...param) => {}; -// ^ .punctuation.section.group.begin.js -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.definition.function.parameters.js -// ^^^ .keyword.operator.rest.js -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.section.group.end.js -// ^^ .punctuation.section.block.arrow.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - async (param, ...param) => {}; -// ^^^^^ .storage.modifier.js -// ^^^^^ .keyword.other.async.js -// ^ .punctuation.section.group.begin.js -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.definition.function.parameters.js -// ^^^ .keyword.operator.rest.js -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.section.group.end.js -// ^^ .punctuation.section.block.arrow.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - (param:number, ...param:string):number => {}; -// ^ .punctuation.section.group.begin.js -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.definition.function.parameters.js -// ^^^ .keyword.operator.rest.js -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.section.group.end.js -// ^ .punctuation.binding.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^^ .punctuation.section.block.arrow.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - async (param:number, ...param:string):number => {}; -// ^^^^^ .storage.modifier.js -// ^^^^^ .keyword.other.async.js -// ^ .punctuation.section.group.begin.js -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.definition.function.parameters.js -// ^^^ .keyword.operator.rest.js -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.section.group.end.js -// ^ .punctuation.binding.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^^ .punctuation.section.block.arrow.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - (param:A, ...param:B):C => {}; -// ^ .punctuation.definition.template.parameters.begin.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.template.parameters.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.template.parameters.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.template.parameters.end.flow -// ^ .punctuation.section.group.begin.js -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.function.parameters.js -// ^^^ .keyword.operator.rest.js -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.group.end.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^^ .punctuation.section.block.arrow.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js diff --git a/tests/old-tests/fjsx15/old_test_class.js b/tests/old-tests/fjsx15/old_test_class.js deleted file mode 100644 index 7b67e19c..00000000 --- a/tests/old-tests/fjsx15/old_test_class.js +++ /dev/null @@ -1,242 +0,0 @@ -// SYNTAX TEST "Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax" - -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - - class Foo {} -// ^^^^^ .storage.type.class.js -// ^^^ .entity.name.class.js -// ^ .punctuation.definition.class.body.begin.js -// ^ .punctuation.definition.class.body.end.js - class Foo {} -// ^^^^^ .storage.type.class.js -// ^^^ .entity.name.class.js -// ^ .punctuation.definition.template.parameters.begin.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.template.parameters.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.template.parameters.end.flow -// ^ .punctuation.definition.class.body.begin.js -// ^ .punctuation.definition.class.body.end.js - class Foo extends A.B.C {} -// ^^^^^ .storage.type.class.js -// ^^^ .entity.name.class.js -// ^^^^^^^ .storage.modifier.extends.js -// ^ .entity.name.namespace.a.flow -// ^ .punctuation.definition.namespace.a.flow -// ^ .entity.name.namespace.b.flow -// ^ .punctuation.definition.namespace.b.flow -// ^ .parent.js -// ^ .entity.name.class.js -// ^ .punctuation.definition.class.body.begin.js -// ^ .punctuation.definition.class.body.end.js - class Foo extends A.B.C {} -// ^^^^^ .storage.type.class.js -// ^^^ .entity.name.class.js -// ^ .punctuation.definition.template.parameters.begin.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.template.parameters.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.template.parameters.end.flow -// ^^^^^^^ .storage.modifier.extends.js -// ^ .entity.name.namespace.a.flow -// ^ .punctuation.definition.namespace.a.flow -// ^ .entity.name.namespace.b.flow -// ^ .punctuation.definition.namespace.b.flow -// ^ .parent.js -// ^ .entity.name.class.js -// ^ .punctuation.definition.class.body.begin.js -// ^ .punctuation.definition.class.body.end.js - class Foo { -// ^^^^^ .storage.type.class.js -// ^^^ .entity.name.class.js -// ^ .punctuation.definition.class.body.begin.js - @decorator -// ^ .punctuation.definition.decorator.js -// ^^^^^^^^^ .entity.name.decorator.js - @decorator.decorator -// ^ .punctuation.definition.decorator.js -// ^^^^^^^^^ .entity.name.decorator.js -// ^ .punctuation.definition.decorator.chain.js -// ^^^^^^^^ .entity.name.decorator.js - @decorator(1,'2') -// ^ .punctuation.definition.decorator.js -// ^^^^^^^^^ .entity.name.decorator.js -// ^ .punctuation.definition.decorator.arguments.begin.js -// ^ .constant.numeric.decimal.js -// ^ .punctuation.definition.decorator.arguments.js -// ^^^ .string.quoted.single.js -// ^ .punctuation.definition.string.begin.js -// ^ .punctuation.definition.string.end.js -// ^ .punctuation.definition.decorator.arguments.end.js - @decorator(1,'2').decorator(1,'2') -// ^ .punctuation.definition.decorator.js -// ^^^^^^^^^ .entity.name.decorator.js -// ^ .punctuation.definition.decorator.arguments.begin.js -// ^ .constant.numeric.decimal.js -// ^ .punctuation.definition.decorator.arguments.js -// ^^^ .string.quoted.single.js -// ^ .punctuation.definition.string.begin.js -// ^ .punctuation.definition.string.end.js -// ^ .punctuation.definition.decorator.arguments.end.js -// ^ .punctuation.definition.decorator.chain.js -// ^^^^^^^^^ .entity.name.decorator.js -// ^ .punctuation.definition.decorator.arguments.begin.js -// ^ .constant.numeric.decimal.js -// ^ .punctuation.definition.decorator.arguments.js -// ^^^ .string.quoted.single.js -// ^ .punctuation.definition.string.begin.js -// ^ .punctuation.definition.string.end.js -// ^ .punctuation.definition.decorator.arguments.end.js - static propTypes:number = {initialCount:React.PropTypes.number}; -// ^^^^^^ .storage.modifier.js -// ^^^^^^ .keyword.other.access.js -// ^^^^^^^^^ .variable.other.readwrite.js -// ^ .keyword.operator.other.assignment.js -// ^ .punctuation.section.block.begin.js -// ^^^^^^^^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.js -// ^^^^^ .variable.other.readwrite.js -// ^ .keyword.operator.other.member-access.js -// ^^^^^^^^^ .variable.other.readwrite.js -// ^ .keyword.operator.other.member-access.js -// ^^^^^^ .variable.other.readwrite.js -// ^ .punctuation.section.block.end.js -// ^ .punctuation.terminator.js - static defaultProps = {initialCount:0}; -// ^^^^^^ .storage.modifier.js -// ^^^^^^ .keyword.other.access.js -// ^^^^^^^^^^^^ .variable.other.readwrite.js -// ^ .keyword.operator.other.assignment.js -// ^ .punctuation.section.block.begin.js -// ^^^^^^^^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.js -// ^ .constant.numeric.decimal.js -// ^ .punctuation.section.block.end.js -// ^ .punctuation.terminator.js - state = {count:this.props.initialCount}; -// ^^^^^ .variable.other.readwrite.js -// ^ .keyword.operator.other.assignment.js -// ^ .punctuation.section.block.begin.js -// ^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.js -// ^^^^ .support.core.js -// ^^^^ .variable.other.readwrite.js -// ^ .keyword.operator.other.member-access.js -// ^^^^^ .support.lib.react-js -// ^^^^^ .variable.other.readwrite.js -// ^ .keyword.operator.other.member-access.js -// ^^^^^^^^^^^^ .variable.other.readwrite.js -// ^ .punctuation.section.block.end.js -// ^ .punctuation.terminator.js - constructor(){} -// ^^^^^^^^^^^ .support.js -// ^^^^^^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - method(){} -// ^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - *method(){} -// ^ .storage.modifier.js -// ^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - get property(){} -// ^^^ .storage.modifier.js -// ^^^ .keyword.other.proxy.js -// ^^^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - set property(){} -// ^^^ .storage.modifier.js -// ^^^ .keyword.other.proxy.js -// ^^^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - async method(){} -// ^^^^^ .storage.modifier.js -// ^^^^^ .keyword.other.async.js -// ^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - static method(){} -// ^^^^^^ .storage.modifier.js -// ^^^^^^ .keyword.other.access.js -// ^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - static get property(){} -// ^^^^^^ .storage.modifier.js -// ^^^^^^ .keyword.other.access.js -// ^^^ .storage.modifier.js -// ^^^ .keyword.other.proxy.js -// ^^^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - static set property(){} -// ^^^^^^ .storage.modifier.js -// ^^^^^^ .keyword.other.access.js -// ^^^ .storage.modifier.js -// ^^^ .keyword.other.proxy.js -// ^^^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - static async method(){} -// ^^^^^^ .storage.modifier.js -// ^^^^^^ .keyword.other.access.js -// ^^^^^ .storage.modifier.js -// ^^^^^ .keyword.other.async.js -// ^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - } -// ^ .punctuation.definition.class.body.end.js - class Foo { -// ^^^^^ .storage.type.class.js -// ^^^ .entity.name.class.js -// ^ .punctuation.definition.class.body.begin.js - property:type -// ^^^^^^^^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^^^^ .flow -// ^^^^ .entity.name.type.flow - constructor(){} -// ^^^^^^^^^^^ .support.js -// ^^^^^^^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - } -// ^ .punctuation.definition.class.body.end.js diff --git a/tests/old-tests/fjsx15/old_test_export.js b/tests/old-tests/fjsx15/old_test_export.js deleted file mode 100644 index 5e27cfcd..00000000 --- a/tests/old-tests/fjsx15/old_test_export.js +++ /dev/null @@ -1,46 +0,0 @@ -// SYNTAX TEST "Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax" - -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -export var myVariable = 123 -export default var myVariable = 123 - -export let myVariable = 123 -export default let myVariable = 123 - -export const MY_CONSTANT = 123 -export default const MY_CONSTANT = 123 - -export function myFunction() {} -export default function myFunction() {} - -export class MyClass {} -export default class MyClass {} - -export type MyObject = {} -export default type MyObject = {} - -export typeof target -export default typeof target - -export interface MyInterface {} -export default interface MyInterface {} - -export default 1 + 1 -export { target, target } -export { target as alias, target as alias } - -export * from '...' -export { target, target } from '...' -export { target as alias, target as alias } from '...' -export { default as alias } from '...' diff --git a/tests/old-tests/fjsx15/old_test_function-call.js b/tests/old-tests/fjsx15/old_test_function-call.js deleted file mode 100644 index 53e9ef49..00000000 --- a/tests/old-tests/fjsx15/old_test_function-call.js +++ /dev/null @@ -1,70 +0,0 @@ -// SYNTAX TEST "Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax" - -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - - super(1,2); -// ^^^^^ .support.core.js -// ^^^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .constant.numeric.decimal.js -// ^ .punctuation.separator.comma.js -// ^ .constant.numeric.decimal.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.terminator.js - foo(1,2); -// ^^^ .entity.name.function.js -// ^ .punctuation.section.generic.begin.flow -// ^ .entity.name.type.flow -// ^ .punctuation.separator.comma.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.generic.end.flow -// ^ .punctuation.section.group.begin.js -// ^ .constant.numeric.decimal.js -// ^ .punctuation.separator.comma.js -// ^ .constant.numeric.decimal.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.terminator.js - foo(1,2); -// ^^^ .entity.name.function.js -// ^ .punctuation.section.generic.begin.flow -// ^ .entity.name.type.flow -// ^ .keyword.operator.other.union.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.generic.end.flow -// ^ .punctuation.section.group.begin.js -// ^ .constant.numeric.decimal.js -// ^ .punctuation.separator.comma.js -// ^ .constant.numeric.decimal.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.terminator.js - foo<{a:A} & {b:B}>(1,2); -// ^^^ .entity.name.function.js -// ^ .punctuation.section.generic.begin.flow -// ^ .punctuation.section.block.begin.flow -// ^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.block.end.flow -// ^ .keyword.operator.other.intersection.flow -// ^ .punctuation.section.block.begin.flow -// ^ .variable.other.readwrite.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.block.end.flow -// ^ .punctuation.section.generic.end.flow -// ^ .punctuation.section.group.begin.js -// ^ .constant.numeric.decimal.js -// ^ .punctuation.separator.comma.js -// ^ .constant.numeric.decimal.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.terminator.js diff --git a/tests/old-tests/fjsx15/old_test_function.js b/tests/old-tests/fjsx15/old_test_function.js deleted file mode 100644 index fd77330d..00000000 --- a/tests/old-tests/fjsx15/old_test_function.js +++ /dev/null @@ -1,191 +0,0 @@ -// SYNTAX TEST "Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax" - -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - - function foo() {} -// ^^^^^^^^^^^^^^ .meta.function.declaration.js -// ^^^^^^^^ .storage.type.function.js -// ^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - function *foo() {} -// ^^^^^^^^^^^^^^^ .meta.function.declaration.js -// ^^^^^^^^ .storage.type.function.js -// ^ .storage.modifier.js -// ^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - function foo(param, ...param) {} -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js -// ^^^^^^^^ .storage.type.function.js -// ^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^^^^^ .variable.parameter.function.js -// ^ .punctuation.definition.function.parameters.js -// ^^^ .keyword.operator.rest.js -// ^^^^^ .variable.parameter.function.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - function *foo(param, ...param) {} -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js -// ^^^^^^^^ .storage.type.function.js -// ^ .storage.modifier.js -// ^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^^^^^ .variable.parameter.function.js -// ^ .punctuation.definition.function.parameters.js -// ^^^ .keyword.operator.rest.js -// ^^^^^ .variable.parameter.function.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - function foo(param:number, ...param:string):boolean {} -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js -// ^^^^^^^^ .storage.type.function.js -// ^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^^^^^ .variable.parameter.function.js -// ^ .punctuation.binding.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.definition.function.parameters.js -// ^^^ .keyword.operator.rest.js -// ^^^^^ .variable.parameter.function.js -// ^ .punctuation.binding.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.section.group.end.js -// ^ .punctuation.binding.flow -// ^^^^^^^ .support.type.primitive.flow -// ^^^^^^^ .entity.name.type.flow -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - function foo(param:?number, ...param:?(string|number)):?boolean {} -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js -// ^^^^^^^^ .storage.type.function.js -// ^^^ .entity.name.function.js -// ^ .punctuation.section.group.begin.js -// ^^^^^ .variable.parameter.function.js -// ^ .punctuation.binding.flow -// ^ .keyword.operator.other.nullable.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.definition.function.parameters.js -// ^^^ .keyword.operator.rest.js -// ^^^^^ .variable.parameter.function.js -// ^ .punctuation.binding.flow -// ^ .keyword.operator.other.nullable.flow -// ^ .punctuation.definition.expression.group.begin.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .keyword.operator.other.union.flow -// ^^^^^^ .support.type.primitive.flow -// ^^^^^^ .entity.name.type.flow -// ^ .punctuation.definition.expression.group.end.flow -// ^ .punctuation.section.group.end.js -// ^ .punctuation.binding.flow -// ^ .keyword.operator.other.nullable.flow -// ^^^^^^^ .support.type.primitive.flow -// ^^^^^^^ .entity.name.type.flow -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - function foo(param:A, ...param:B):B {} -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js -// ^^^^^^^^ .storage.type.function.js -// ^^^ .entity.name.function.js -// ^ .punctuation.definition.template.parameters.begin.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.template.parameters.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.template.parameters.end.flow -// ^ .punctuation.section.group.begin.js -// ^^^^^ .variable.parameter.function.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.function.parameters.js -// ^^^ .keyword.operator.rest.js -// ^^^^^ .variable.parameter.function.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.group.end.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - function *foo(param:A, ...param:B):B {} -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js -// ^^^^^^^^ .storage.type.function.js -// ^ .storage.modifier.js -// ^^^ .entity.name.function.js -// ^ .punctuation.definition.template.parameters.begin.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.template.parameters.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.template.parameters.end.flow -// ^ .punctuation.section.group.begin.js -// ^^^^^ .variable.parameter.function.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.function.parameters.js -// ^^^ .keyword.operator.rest.js -// ^^^^^ .variable.parameter.function.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.group.end.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - function () {} -// ^^^^^^^^^^^ .meta.function.declaration.js -// ^^^^^^^^ .storage.type.function.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - function *() {} -// ^^^^^^^^^^^^ .meta.function.declaration.js -// ^^^^^^^^ .storage.type.function.js -// ^ .storage.modifier.js -// ^ .punctuation.section.group.begin.js -// ^ .punctuation.section.group.end.js -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js - function *(param:A, ...param:B):B {} -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js -// ^^^^^^^^ .storage.type.function.js -// ^ .storage.modifier.js -// ^ .punctuation.definition.template.parameters.begin.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.template.parameters.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.template.parameters.end.flow -// ^ .punctuation.section.group.begin.js -// ^^^^^ .variable.parameter.function.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.definition.function.parameters.js -// ^^^ .keyword.operator.rest.js -// ^^^^^ .variable.parameter.function.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.group.end.js -// ^ .punctuation.binding.flow -// ^ .entity.name.type.flow -// ^ .punctuation.section.block.begin.js -// ^ .punctuation.section.block.end.js diff --git a/tests/old-tests/fjsx15/old_test_import.js b/tests/old-tests/fjsx15/old_test_import.js deleted file mode 100644 index 31df77bb..00000000 --- a/tests/old-tests/fjsx15/old_test_import.js +++ /dev/null @@ -1,49 +0,0 @@ -// SYNTAX TEST "Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax" - -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -import '...' - -import { default as alias } from '...' - -import * from '...' -import * as alias from '...' - -import target from '...' -import target as alias from '...' - -import { target, target } from '...' -import { target as alias, target as alias } from '...' - -import target, { target, target } from '...' -import target as alias, { target as alias, target as alias } from '...' - -import type target from '...' -import type target as alias from '...' - -import type { target, target } from '...' -import type { target as alias, target as alias } from '...' - -import type target, { target, target } from '...' -import type target as alias, { target as alias, target as alias } from '...' - -import typeof target from '...' -import typeof { target } from '...' -import typeof { target as alias } from '...' - -import { target, type target, typeof target } from '...' - -declare module "C" { - import type { DT } from "D"; - export type CT = { D: DT }; -} diff --git a/tests/old-tests/html5/attribute/old_test_data.html5 b/tests/old-tests/html5/attribute/old_test_data.html5 deleted file mode 100644 index 18b0461f..00000000 --- a/tests/old-tests/html5/attribute/old_test_data.html5 +++ /dev/null @@ -1,17 +0,0 @@ -// SYNTAX TEST "Packages/Naomi/syntaxes/naomi.html5.sublime-syntax" - -// Licensed under the Apache License, Version 2.0 (the “License”); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -