diff --git a/Bittersweet.tmTheme b/Bittersweet.tmTheme deleted file mode 100644 index 2414ec2f..00000000 --- a/Bittersweet.tmTheme +++ /dev/null @@ -1,422 +0,0 @@ - - - - - name - Bittersweet - settings - - - settings - - activeGuide - #9D550FB0 - background - #222b30 - bracketContentsForeground - #866a5aA5 - bracketContentsOptions - underline - bracketsForeground - #866a5aA5 - bracketsOptions - underline - caret - #F8F8F0 - findHighlight - #ea8b2a - findHighlightForeground - #000000 - foreground - #cbd1d2 - invisibles - #3B3A32 - lineHighlight - #3E3D32 - selection - #4b7b91 - selectionBorder - #222218 - tagsOptions - stippled_underline - - - - scope - comment - settings - - fontStyle - - foreground - #4b92a7 - - - - scope - string - settings - - foreground - #9ed670 - - - - scope - constant.numeric - settings - - foreground - #a475bd - - - - scope - constant.language - settings - - foreground - #a475bd - - - - scope - constant.character, constant.other - settings - - foreground - #a475bd - - - - scope - variable - settings - - fontStyle - - - - - scope - keyword - settings - - foreground - #ee88cc - - - - scope - meta.tag, declaration.tag - settings - - fontStyle - - foreground - #ee88cc - - - - scope - storage - settings - - fontStyle - - foreground - #ee88cc - - - - scope - storage.type - settings - - fontStyle - italic - foreground - #07cc95 - - - - scope - entity.name.class - settings - - fontStyle - underline - foreground - #50fa7b - - - - scope - entity.other.inherited-class - settings - - fontStyle - italic underline - foreground - #50fa7b - - - - scope - entity.name.function - settings - - fontStyle - bold - foreground - #63c9ec - - - - scope - variable.parameter - settings - - fontStyle - italic - foreground - #f48d8d - - - - scope - entity.name.tag - settings - - fontStyle - - foreground - #ee88cc - - - - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #50fa7b - - - - scope - support.function - settings - - fontStyle - - foreground - #07cc95 - - - - scope - support.constant - settings - - fontStyle - - foreground - #6bc3d4 - - - - scope - support.type, support.class - settings - - fontStyle - italic bold - foreground - #8abbe7 - - - - scope - support.other.variable - settings - - fontStyle - - - - - scope - invalid - settings - - background - #ee88cc - fontStyle - - foreground - #F8F8F0 - - - - scope - invalid.deprecated - settings - - background - #a475bd - foreground - #F8F8F0 - - - - scope - meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #CFCFC2 - - - - scope - meta.diff, meta.diff.header - settings - - foreground - #6272a4 - - - - scope - markup.deleted - settings - - foreground - #ee88cc - - - - scope - markup.inserted - settings - - foreground - #50fa7b - - - - scope - markup.changed - settings - - foreground - #E6DB74 - - - - scope - constant.numeric.line-number.find-in-files - match - settings - - foreground - #a475bd - - - - scope - entity.name.filename - settings - - foreground - #E6DB74 - - - - scope - message.error - settings - - foreground - #F83333 - - - - scope - .entity.name.function, .keyword.operator.other.computed-function, .punctuation.definition.function - settings - - foreground - #63c9ec - - - - scope - .keyword.modifier.generator - settings - - foreground - #63c9ec - - - - scope - .entity.name.attribute - settings - - foreground - #50fa7b - - - - scope - .entity.name.tag - settings - - foreground - #ee88cc - - - - scope - .punctuation.definition.tag - settings - - foreground - #ee88cc - - - - scope - support entity.name.function, support entity.name.variable - settings - - foreground - #07cc95 - - - - scope - support entity.name.constant - settings - - foreground - #6bc3d4 - - - - scope - support entity.name.type, support entity.name.class - settings - - fontStyle - italic bold - foreground - #8abbe7 - - - - - diff --git a/Boxy Ocean.scsscheme b/Boxy Ocean.scsscheme deleted file mode 100644 index de3dc0c5..00000000 --- a/Boxy Ocean.scsscheme +++ /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. - -@name "Boxy Ocean"; - -@import 'schemes/boxy-ocean/original'; - -@import 'schemes/boxy-ocean/markup/attribute'; -@import 'schemes/boxy-ocean/markup/tag'; -@import 'schemes/boxy-ocean/support'; diff --git a/Boxy Ocean.tmTheme b/Boxy Ocean.tmTheme deleted file mode 100644 index c31fa34b..00000000 --- a/Boxy Ocean.tmTheme +++ /dev/null @@ -1,1199 +0,0 @@ - - - - - name - Boxy Ocean - settings - - - settings - - activeGuide - #ffffff55 - background - #1b2b34 - caret - #cdd3de - foreground - #cdd3de - guide - #ffffff25 - gutter - #1b2b34 - invisibles - #65737e - lineHighlight - #ffffff10 - popupCss - html - popupCss-background-color - #2d3c44 - popupCss-color - #cdd3de - selection - #ffffff16 - selectionBorder - #ffffff16 - stackGuide - #ffffff40 - - - - scope - * a - settings - - color - #6699cc - - - - scope - * .error, * .deleted - settings - - color - #ec5f67 - - - - scope - * .success, * .inserted, * .name - settings - - color - #99c794 - - - - scope - * .warning, * .modified - settings - - color - #fac863 - - - - scope - * .type - settings - - color - #5fb3b3 - font-style - italic - - - - scope - * .param - settings - - color - #f99157 - - - - scope - * .current - settings - - text-decoration - underline - - - - scope - comment, punctuation.definition.comment - settings - - fontStyle - italic - foreground - #65737e - - - - scope - variable, string constant.other.placeholder - settings - - foreground - #cdd3de - - - - scope - invalid - settings - - background - #ec5f67 - foreground - #ffffff - - - - scope - invalid.deprecated - settings - - background - #c594c5 - foreground - #ffffff - - - - scope - keyword, storage.type, storage.modifier - settings - - foreground - #c594c5 - - - - scope - keyword.operator, constant.other.color, punctuation, meta.tag, punctuation.definition.tag, punctuation.separator.inheritance.php, punctuation.definition.tag.html, punctuation.definition.tag.begin.html, punctuation.definition.tag.end.html, punctuation.section.embedded, keyword.other.template, keyword.other.substitution - settings - - foreground - #5fb3b3 - - - - scope - entity.name.tag, meta.tag.sgml, markup.deleted.git_gutter - settings - - foreground - #f07178 - - - - scope - entity.name.function, variable.function, support.function, keyword.other.special-method, meta.block-level - settings - - foreground - #6699cc - - - - scope - support.other.variable, string.other.link - settings - - foreground - #f07178 - - - - scope - constant.numeric, constant.language, support.constant, constant.character, variable.parameter, keyword.other.unit - settings - - foreground - #f99157 - - - - scope - string, constant.other.symbol, constant.other.key, entity.other.inherited-class, markup.heading, markup.inserted.git_gutter, meta.group.braces.curly constant.other.object.key.js string.unquoted.label.js - settings - - fontStyle - - foreground - #99c794 - - - - scope - entity.name.class, entity.name.type.class, support.type, support.class, support.other.namespace.use.php, meta.use.php, support.other.namespace.php, markup.changed.git_gutter - settings - - foreground - #fac863 - - - - scope - entity.name.module.js, variable.import.parameter.js, variable.other.class.js - settings - - foreground - #ec5f67 - - - - scope - variable.language - settings - - fontStyle - italic - foreground - #ec5f67 - - - - scope - entity.name.method.js - settings - - foreground - #6699cc - - - - scope - meta.class-method.js entity.name.function.js, variable.function.constructor - settings - - foreground - #6699cc - - - - scope - entity.other.attribute-name - settings - - foreground - #c594c5 - - - - scope - markup.inserted - settings - - foreground - #99c794 - - - - scope - markup.deleted - settings - - foreground - #ec5f67 - - - - scope - markup.changed - settings - - foreground - #c594c5 - - - - scope - string.regexp - settings - - foreground - #5fb3b3 - - - - scope - constant.character.escape - settings - - foreground - #5fb3b3 - - - - scope - *url*, *link*, *uri* - settings - - fontStyle - underline - - - - scope - constant.numeric.line-number.find-in-files - match - settings - - foreground - #ab7967 - - - - scope - entity.name.filename.find-in-files - settings - - foreground - #99c794 - - - - scope - tag.decorator.js entity.name.tag.js, tag.decorator.js punctuation.definition.tag.js - settings - - fontStyle - italic - foreground - #6699cc - - - - scope - source.js constant.other.object.key.js string.unquoted.label.js - settings - - fontStyle - italic - foreground - #ec5f67 - - - - scope - source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #ec5f67bf - - - - scope - source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #6699ccbf - - - - scope - source.json meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #fac863bf - - - - scope - source.json meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #c594c5bf - - - - scope - source.json meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #f99157 - - - - scope - source.json meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #ec5f67 - - - - scope - source.json meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #6699cc - - - - scope - source.json meta meta.structure.dictionary.json string.quoted.double.json - meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta.structure.dictionary.json punctuation.definition.string - meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #fac863 - - - - scope - source.json meta.structure.dictionary.json string.quoted.double.json - meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json punctuation.definition.string - meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string - settings - - foreground - #c594c5 - - - - scope - text.html.markdown, punctuation.definition.list_item.markdown - settings - - foreground - #cdd3de - - - - scope - text.html.markdown markup.raw.inline - settings - - background - #ffffff08 - foreground - #cdd3decc - - - - scope - text.html.markdown meta.dummy.line-break - settings - - foreground - #ffffff50 - - - - scope - markdown.heading, markup.heading | markup.heading entity.name, markup.heading.markdown punctuation.definition.heading.markdown - settings - - foreground - #f07178 - - - - scope - markup.italic, markup.italic string - settings - - fontStyle - italic - - - - scope - markup.bold, markup.bold string - settings - - fontStyle - bold - - - - scope - markup.bold markup.italic, markup.italic markup.bold, markup.quote markup.bold, markup.bold markup.italic string, markup.italic markup.bold string, markup.quote markup.bold string - settings - - fontStyle - bold italic - - - - scope - markup.underline - settings - - fontStyle - underline - foreground - #99c794 - - - - scope - markup.quote punctuation.definition.blockquote.markdown - settings - - background - #ffffff16 - fontStyle - - foreground - #ffffff16 - - - - scope - markup.quote - settings - - fontStyle - italic - foreground - #65737e - - - - scope - string.other.link.title.markdown - settings - - foreground - #6699cc - - - - scope - string.other.link.description.title.markdown - settings - - foreground - #c594c5 - - - - scope - constant.other.reference.link.markdown - settings - - foreground - #fac863 - - - - scope - markup.raw.block - settings - - background - #ffffff08 - foreground - #cdd3decc - - - - scope - markup.raw.block.fenced.markdown - settings - - background - #ffffff08 - - - - scope - punctuation.definition.fenced.markdown - settings - - background - #ffffff08 - - - - scope - markup.raw.block.fenced.markdown, variable.language.fenced.markdown, punctuation.section.class.end - settings - - foreground - #cdd3de - - - - scope - punctuation.definition.fenced.markdown, meta.definition.language.raw.block.fenced.markdown - settings - - fontStyle - - foreground - #ffffff50 - - - - scope - variable.language.fenced.markdown - settings - - fontStyle - - foreground - #65737e - - - - scope - meta.separator - settings - - background - #ffffff08 - fontStyle - bold - foreground - #65737e - - - - scope - markup.table - settings - - background - #ffffff08 - foreground - #cdd3decc - - - - scope - text.html.markdown punctuation.definition, text.html.markdown.note punctuation.definition.list_item.markdown, markup.table.markdown punctuation.definition.table.vertical-line.markdown, text.html.markdown markup.checkbox.markdown - settings - - fontStyle - - foreground - #ffffff50 - - - - scope - text.html.markdown meta.disable-markdown punctuation.definition - settings - - foreground - #5fb3b3 - - - - scope - punctuation.definition.list_item.todo.done - settings - - foreground - #99c794 - - - - scope - punctuation.definition.list_item.todo.cancelled - settings - - foreground - #ec5f67 - - - - scope - markup.checkbox.markdown markup.checkbox.checked_symbol.markdown - settings - - foreground - #99c794 - - - - scope - markup.admonition.markdown string.other.admonition.title.markdown - settings - - fontStyle - bold - foreground - #cdd3de - - - - scope - markup.admonition.markdown markup.admonition.header.markdown - settings - - background - #bb80b350 - - - - scope - markup.admonition.markdown markup.admonition.body.markdown - settings - - background - #bb80b315 - - - - scope - markup.admonition.markdown punctuation.definition.admonition.markdown, markup.admonition.markdown punctuation.definition.heading, markup.admonition.markdown punctuation.definition.table.vertical-line, markup.admonition.markdown punctuation.definition.table.horizontal-line, markup.admonition.markdown punctuation.definition.table.alignments, markup.admonition.markdown punctuation.definition.heading, markup.admonition.markdown punctuation.definition.bold, markup.admonition.markdown punctuation.definition.italic, markup.admonition.markdown punctuation.definition.list_item, markup.admonition.markdown punctuation.definition.raw, markup.admonition.markdown markup.checkbox.markdown, markup.admonition.markdown punctuation.definition.list_item.todo.pending, markup.admonition.markdown meta.link punctuation.definition, markup.admonition.markdown meta.link.inline markup.underline.link, markup.admonition.markdown meta.link.reference.markdown constant.other.reference.link.markdown, markup.admonition.markdown punctuation.definition.entity.html, markup.admonition.markdown meta.separator.markdown, markup.admonition.markdown markup.table.markdown punctuation.definition.table.vertical-line.markdown, markup.admonition.markdown meta.definition.language.raw.block.fenced.markdown - settings - - foreground - #bb80b375 - - - - scope - markup.admonition.markdown entity.name.admonition.markdown - settings - - fontStyle - bold - foreground - #bb80b3 - - - - scope - markup.admonition.markdown markup.table, markup.admonition.markdown markup.raw, markup.admonition.markdown markup.raw.block.fenced meta.language, markup.admonition.markdown punctuation.definition.blockquote.markdown, markup.admonition.markdown meta.separator, markup.admonition.markdown markup.raw.inline, markup.admonition.markdown markup.raw.block - settings - - background - #bb80b325 - - - - scope - markup.admonition.markdown markup.quote punctuation.definition.blockquote.markdown - settings - - background - #bb80b335 - foreground - #bb80b335 - - - - scope - markup.admonition.markdown.hint markup.admonition.header.markdown - settings - - background - #6699cc50 - - - - scope - markup.admonition.markdown.hint markup.admonition.body.markdown - settings - - background - #6699cc15 - - - - scope - markup.admonition.markdown.hint punctuation.definition.admonition.markdown, markup.admonition.markdown.hint punctuation.definition.heading, markup.admonition.markdown.hint punctuation.definition.table.vertical-line, markup.admonition.markdown.hint punctuation.definition.table.horizontal-line, markup.admonition.markdown.hint punctuation.definition.table.alignments, markup.admonition.markdown.hint punctuation.definition.heading, markup.admonition.markdown.hint punctuation.definition.bold, markup.admonition.markdown.hint punctuation.definition.italic, markup.admonition.markdown.hint punctuation.definition.list_item, markup.admonition.markdown.hint punctuation.definition.raw, markup.admonition.markdown.hint markup.checkbox.markdown, markup.admonition.markdown.hint punctuation.definition.list_item.todo.pending, markup.admonition.markdown.hint meta.link punctuation.definition, markup.admonition.markdown.hint meta.link.inline markup.underline.link, markup.admonition.markdown.hint meta.link.reference.markdown constant.other.reference.link.markdown, markup.admonition.markdown.hint punctuation.definition.entity.html, markup.admonition.markdown.hint meta.separator.markdown, markup.admonition.markdown.hint markup.table.markdown punctuation.definition.table.vertical-line.markdown, markup.admonition.markdown.hint meta.definition.language.raw.block.fenced.markdown - settings - - foreground - #6699cc75 - - - - scope - markup.admonition.markdown.hint entity.name.admonition.markdown - settings - - fontStyle - bold - foreground - #6699cc - - - - scope - markup.admonition.markdown.hint markup.table, markup.admonition.markdown.hint markup.raw, markup.admonition.markdown.hint markup.raw.block.fenced meta.language, markup.admonition.markdown.hint punctuation.definition.blockquote.markdown, markup.admonition.markdown.hint meta.separator, markup.admonition.markdown.hint markup.raw.inline, markup.admonition.markdown.hint markup.raw.block - settings - - background - #6699cc25 - - - - scope - markup.admonition.markdown.hint markup.quote punctuation.definition.blockquote.markdown - settings - - background - #6699cc35 - foreground - #6699cc35 - - - - scope - markup.admonition.markdown.warning markup.admonition.header.markdown - settings - - background - #fac86350 - - - - scope - markup.admonition.markdown.warning markup.admonition.body.markdown - settings - - background - #fac86315 - - - - scope - markup.admonition.markdown.warning punctuation.definition.admonition.markdown, markup.admonition.markdown.warning punctuation.definition.heading, markup.admonition.markdown.warning punctuation.definition.table.vertical-line, markup.admonition.markdown.warning punctuation.definition.table.horizontal-line, markup.admonition.markdown.warning punctuation.definition.table.alignments, markup.admonition.markdown.warning punctuation.definition.heading, markup.admonition.markdown.warning punctuation.definition.bold, markup.admonition.markdown.warning punctuation.definition.italic, markup.admonition.markdown.warning punctuation.definition.list_item, markup.admonition.markdown.warning punctuation.definition.raw, markup.admonition.markdown.warning markup.checkbox.markdown, markup.admonition.markdown.warning punctuation.definition.list_item.todo.pending, markup.admonition.markdown.warning meta.link punctuation.definition, markup.admonition.markdown.warning meta.link.inline markup.underline.link, markup.admonition.markdown.warning meta.link.reference.markdown constant.other.reference.link.markdown, markup.admonition.markdown.warning punctuation.definition.entity.html, markup.admonition.markdown.warning meta.separator.markdown, markup.admonition.markdown.warning markup.table.markdown punctuation.definition.table.vertical-line.markdown, markup.admonition.markdown.warning meta.definition.language.raw.block.fenced.markdown - settings - - foreground - #fac86375 - - - - scope - markup.admonition.markdown.warning entity.name.admonition.markdown - settings - - fontStyle - bold - foreground - #fac863 - - - - scope - markup.admonition.markdown.warning markup.table, markup.admonition.markdown.warning markup.raw, markup.admonition.markdown.warning markup.raw.block.fenced meta.language, markup.admonition.markdown.warning punctuation.definition.blockquote.markdown, markup.admonition.markdown.warning meta.separator, markup.admonition.markdown.warning markup.raw.inline, markup.admonition.markdown.warning markup.raw.block - settings - - background - #fac86325 - - - - scope - markup.admonition.markdown.warning markup.quote punctuation.definition.blockquote.markdown - settings - - background - #fac86335 - foreground - #fac86335 - - - - scope - markup.admonition.markdown.danger markup.admonition.header.markdown - settings - - background - #ec5f6750 - - - - scope - markup.admonition.markdown.danger markup.admonition.body.markdown - settings - - background - #ec5f6715 - - - - scope - markup.admonition.markdown.danger punctuation.definition.admonition.markdown, markup.admonition.markdown.danger punctuation.definition.heading, markup.admonition.markdown.danger punctuation.definition.table.vertical-line, markup.admonition.markdown.danger punctuation.definition.table.horizontal-line, markup.admonition.markdown.danger punctuation.definition.table.alignments, markup.admonition.markdown.danger punctuation.definition.heading, markup.admonition.markdown.danger punctuation.definition.bold, markup.admonition.markdown.danger punctuation.definition.italic, markup.admonition.markdown.danger punctuation.definition.list_item, markup.admonition.markdown.danger punctuation.definition.raw, markup.admonition.markdown.danger markup.checkbox.markdown, markup.admonition.markdown.danger punctuation.definition.list_item.todo.pending, markup.admonition.markdown.danger meta.link punctuation.definition, markup.admonition.markdown.danger meta.link.inline markup.underline.link, markup.admonition.markdown.danger meta.link.reference.markdown constant.other.reference.link.markdown, markup.admonition.markdown.danger punctuation.definition.entity.html, markup.admonition.markdown.danger meta.separator.markdown, markup.admonition.markdown.danger markup.table.markdown punctuation.definition.table.vertical-line.markdown, markup.admonition.markdown.danger meta.definition.language.raw.block.fenced.markdown - settings - - foreground - #ec5f6775 - - - - scope - markup.admonition.markdown.danger entity.name.admonition.markdown - settings - - fontStyle - bold - foreground - #ec5f67 - - - - scope - markup.admonition.markdown.danger markup.table, markup.admonition.markdown.danger markup.raw, markup.admonition.markdown.danger markup.raw.block.fenced meta.language, markup.admonition.markdown.danger punctuation.definition.blockquote.markdown, markup.admonition.markdown.danger meta.separator, markup.admonition.markdown.danger markup.raw.inline, markup.admonition.markdown.danger markup.raw.block - settings - - background - #ec5f6725 - - - - scope - markup.admonition.markdown.danger markup.quote punctuation.definition.blockquote.markdown - settings - - background - #ec5f6735 - foreground - #ec5f6735 - - - - scope - markup.admonition.markdown.attention markup.admonition.header.markdown - settings - - background - #99c79450 - - - - scope - markup.admonition.markdown.attention markup.admonition.body.markdown - settings - - background - #99c79415 - - - - scope - markup.admonition.markdown.attention punctuation.definition.admonition.markdown, markup.admonition.markdown.attention punctuation.definition.heading, markup.admonition.markdown.attention punctuation.definition.table.vertical-line, markup.admonition.markdown.attention punctuation.definition.table.horizontal-line, markup.admonition.markdown.attention punctuation.definition.table.alignments, markup.admonition.markdown.attention punctuation.definition.heading, markup.admonition.markdown.attention punctuation.definition.bold, markup.admonition.markdown.attention punctuation.definition.italic, markup.admonition.markdown.attention punctuation.definition.list_item, markup.admonition.markdown.attention punctuation.definition.raw, markup.admonition.markdown.attention markup.checkbox.markdown, markup.admonition.markdown.attention punctuation.definition.list_item.todo.pending, markup.admonition.markdown.attention meta.link punctuation.definition, markup.admonition.markdown.attention meta.link.inline markup.underline.link, markup.admonition.markdown.attention meta.link.reference.markdown constant.other.reference.link.markdown, markup.admonition.markdown.attention punctuation.definition.entity.html, markup.admonition.markdown.attention meta.separator.markdown, markup.admonition.markdown.attention markup.table.markdown punctuation.definition.table.vertical-line.markdown, markup.admonition.markdown.attention meta.definition.language.raw.block.fenced.markdown - settings - - foreground - #99c79475 - - - - scope - markup.admonition.markdown.attention entity.name.admonition.markdown - settings - - fontStyle - bold - foreground - #99c794 - - - - scope - markup.admonition.markdown.attention markup.table, markup.admonition.markdown.attention markup.raw, markup.admonition.markdown.attention markup.raw.block.fenced meta.language, markup.admonition.markdown.attention punctuation.definition.blockquote.markdown, markup.admonition.markdown.attention meta.separator, markup.admonition.markdown.attention markup.raw.inline, markup.admonition.markdown.attention markup.raw.block - settings - - background - #99c79425 - - - - scope - markup.admonition.markdown.attention markup.quote punctuation.definition.blockquote.markdown - settings - - background - #99c79435 - foreground - #99c79435 - - - - scope - acejump.label - settings - - background - #528bff - foreground - #ffffff - - - - scope - sublimelinter.mark.warning - settings - - foreground - #fac863 - - - - scope - sublimelinter.gutter-mark - settings - - foreground - #ffffff - - - - scope - sublimelinter.mark.error - settings - - foreground - #ec5f67 - - - - scope - markup.ignored.git_gutter - settings - - foreground - #65737e - - - - scope - markup.untracked.git_gutter - settings - - foreground - #65737e - - - - scope - markup.inserted.git_gutter - settings - - foreground - #99c794 - - - - scope - markup.changed.git_gutter - settings - - foreground - #fac863 - - - - scope - markup.deleted.git_gutter - settings - - foreground - #ec5f67 - - - - scope - brackethighlighter.default - settings - - foreground - #c594c5 - - - - scope - brackethighlighter.unmatched - settings - - foreground - #ec5f67 - - - - scope - brackethighlighter.curly - settings - - foreground - #bb80b3 - - - - scope - brackethighlighter.round - settings - - foreground - #fac863 - - - - scope - brackethighlighter.square - settings - - foreground - #6699cc - - - - scope - brackethighlighter.angle - settings - - foreground - #f99157 - - - - scope - brackethighlighter.tag - settings - - foreground - #5fb3b3 - - - - scope - brackethighlighter.quote - settings - - foreground - #99c794 - - - - scope - .entity.name.attribute - settings - - foreground - #c594c5 - - - - scope - .entity.name.tag - settings - - foreground - #5fb3b3 - - - - scope - .punctuation.definition.tag - settings - - foreground - #5fb3b3 - - - - scope - .support .entity.name.class, .support .entity.name.interface, .support .entity.name.function, .support .entity.name.variable, .support .entity.name.constant, .support .entity.name.type, .support .punctuation.definition.class, .support .punctuation.definition.interface, .support .punctuation.definition.function, .support .punctuation.definition.variable, .support .punctuation.definition.constant, .support .punctuation.definition.type - settings - - foreground - #6699cc - - - - uuid - 0e709986-46a0-40a0-b3bf-c8dfe525c455 - - diff --git a/Candyman.scsscheme b/Candyman.scsscheme index d4273576..5e5e1362 100644 --- a/Candyman.scsscheme +++ b/Candyman.scsscheme @@ -12,13 +12,36 @@ @name 'Candyman'; @import 'schemes/candyman/palette'; +@import 'schemes/candyman/repeatString'; +@import 'schemes/candyman/main'; + +// Old scopes. +@import 'schemes/candyman/old'; -@import 'schemes/candyman/html'; -@import 'schemes/candyman/js'; +// New scopes. +@import 'schemes/candyman/annotation'; +@import 'schemes/candyman/array'; +@import 'schemes/candyman/class'; +@import 'schemes/candyman/class/body'; +@import 'schemes/candyman/comment'; +@import 'schemes/candyman/constant'; +@import 'schemes/candyman/destructuring'; +@import 'schemes/candyman/function'; +@import 'schemes/candyman/function-call'; +@import 'schemes/candyman/function/body'; +@import 'schemes/candyman/function/parameters'; +@import 'schemes/candyman/generic'; +@import 'schemes/candyman/global/console'; +@import 'schemes/candyman/global/jest'; @import 'schemes/candyman/json'; -@import 'schemes/candyman/jsx'; -@import 'schemes/candyman/main'; +@import 'schemes/candyman/keyword'; +@import 'schemes/candyman/label'; @import 'schemes/candyman/markup'; -@import 'schemes/candyman/md'; -@import 'schemes/candyman/mql'; -@import 'schemes/candyman/scss'; +@import 'schemes/candyman/modifier'; +@import 'schemes/candyman/namespace'; +@import 'schemes/candyman/number'; +@import 'schemes/candyman/object'; +@import 'schemes/candyman/punctuation'; +@import 'schemes/candyman/string'; +@import 'schemes/candyman/type'; +@import 'schemes/candyman/variable'; diff --git a/Candyman.tmTheme b/Candyman.tmTheme index dde2433b..e0474a79 100644 --- a/Candyman.tmTheme +++ b/Candyman.tmTheme @@ -565,241 +565,187 @@ scope - .entity.name.alias - settings - - foreground - #ffecb3 - - - - scope - .entity.name.ambiguous - settings - - foreground - #ffecb3 - - - - scope - .entity.name.type.array, .punctuation.definition.array - settings - - foreground - #ff9e80 - - - - scope - .punctuation.definition.array.access - settings - - foreground - #ffd180 - - - - scope - .keyword.operator.cast, .punctuation.definition.cast - settings - - foreground - #bcaaa4 - - - - scope - .entity.name.class, .punctuation.definition.class - settings - - foreground - #aed581 - - - - scope - .support .entity.name.class + .entity.name.attribute settings foreground - #ff9e80 + #9ccc65 scope - .punctuation.definition.color + .section.cdata settings foreground - #FFCC8080 + #ff80ab scope - .constant.color + .section.cdata .entity.name settings foreground - #ffcc80 + #ff80ab scope - .comment, .comment .punctuation.definition + .section.cdata .punctuation.definition settings foreground - #607d8b + #FF80ABB2 scope - .comment .entity.email, .comment .entity.link + .entity.name.data-attribute settings foreground - #90a4ae + #ffffff scope - .entity.name.constant, .punctuation.definition.constant + .declaration.doctype settings foreground - #ce93d8 + #ff80ab scope - .support .entity.name.constant + .declaration.doctype .entity.name settings foreground - #ff9e80 + #ff80ab scope - .punctuation.definition.datetime + .declaration.doctype .punctuation.definition.declaration settings foreground - #FFCC8080 + #FF80ABB2 scope - .constant.datetime + .text.html .keyword.operator settings foreground - #ffcc80 + #CE93D8B2 scope - .keyword.operator.other.embedded-expression + .instruction.prolog settings foreground - #CE93D8B2 + #ff80ab scope - .entity.name.enum, .punctuation.definition.enum + .instruction.prolog .entity.name settings foreground - #aed581 + #ff80ab scope - .entity.name.function, .keyword.operator.other.computed-function, .punctuation.definition.function + .instruction.prolog .punctuation.definition.instruction settings foreground - #4fc3f7 + #FF80ABB2 scope - .support .entity.name.function, .support .keyword.operator.other.computed-function, .support .punctuation.definition.function + .source.jsx, .text.html, .text.md, .text.xml settings foreground - #ff9e80 + #BDBDBD66 scope - .function.parameter .entity.name.variable, .function.parameter .punctuation.definition.variable + .punctuation.definition.code-block settings foreground - #ffcc80 + #ff80ab scope - .markup.deleted.git_gutter + .level-1 .entity.name.header, .level-1 .punctuation.definition.header settings foreground - #f36c60 + #ce93d8 scope - .markup.inserted.git_gutter + .level-2 .entity.name.header, .level-2 .punctuation.definition.header settings foreground - #aed581 + #4dd0e1 scope - .markup.changed.git_gutter + .level-3 .entity.name.header, .level-3 .punctuation.definition.header settings foreground - #ff9e80 + #9ccc65 scope - .markup.ignored.git_gutter + .level-4 .entity.name.header, .level-4 .punctuation.definition.header settings foreground - #4dd0e1 + #4db6ac scope - .markup.untracked.git_gutter + .level-5 .entity.name.header, .level-5 .punctuation.definition.header settings foreground - #ffffff + #ffab91 scope - .entity.name.interface, .punctuation.definition.interface + .level-6 .entity.name.header, .level-6 .punctuation.definition.header settings foreground - #aed581 + #ffe082 scope - .support .entity.name.interface + .support .entity.name.property.mql settings foreground @@ -808,7 +754,7 @@ scope - .keyword + .entity.name.selector settings foreground @@ -817,106 +763,97 @@ scope - .storage.type .keyword - settings - - foreground - #b39ddb - - - - scope - .entity.name.label, .punctuation.definition.label + .punctuation.definition.selector settings foreground - #ffffff + #FF80AB80 scope - .storage.modifier .keyword, .storage.modifier .keyword.operator + .extension .entity.name.selector settings foreground - #b39ddb + #e0e0e0 scope - .entity.name.namespace + .extension .punctuation.definition.selector settings foreground - #bcaaa4 + #E0E0E0B2 scope - .punctuation.definition.namespace + .entity.name.selector.class settings foreground - #BCAAA480 + #4dd0e1 scope - .constant.numeric + .punctuation.definition.selector.class settings foreground - #ffcc80 + #4DD0E1B2 scope - .constant.numeric.float + .entity.name.selector.id settings foreground - #ce93d8 + #ec407a scope - .constant.numeric.binary + .punctuation.definition.selector.id settings foreground - #4dd0e1 + #EC407AB2 scope - .constant.numeric.octal + .entity.name.selector.placeholder settings foreground - #dce775 + #ffcc80 scope - .constant.numeric.hex + .punctuation.definition.selector.placeholder settings foreground - #e0e0e0 + #FFCC8080 scope - .punctuation.definition.object + .entity.name.selector.tag settings foreground - #aed581 + #bcaaa4 scope - .object .keyword.operator + .source.css .support .entity.name.attribute, .source.scss .support .entity.name.attribute settings foreground @@ -925,52 +862,52 @@ scope - .object.property .entity.name.variable + .source.css .extension .entity.name.attribute, .source.scss .extension .entity.name.attribute settings foreground - #bcaaa4 + #e0e0e0 scope - .keyword.operator + .entity.name.mixin, .punctuation.definition.mixin settings foreground - #5af158 + #4fc3f7 scope - .word .keyword.operator + .source.scss .keyword.operator.other.comma, .source.scss .keyword.operator.other.association, .source.scss .keyword.other.terminator settings foreground - #ff80ab + #ffffff scope - .keyword.preprocessor + .source.scss .punctuation.definition.body settings foreground - #ffcc80 + #ffffff scope - .punctuation.definition + source.scss .keyword.modifier.unit settings foreground - #ffecb3 + #ff9e80 scope - .punctuation.definition.expression.group.b + .source.scss .declaration .entity.name.variable settings foreground @@ -979,115 +916,108 @@ scope - .punctuation.definition.control - settings - - foreground - #ff80ab - - - - scope - .punctuation.definition.extend-list.separator, .punctuation.definition.implement-list.separator + .meta.annotation .variable.annotation, .meta.annotation .punctuation.definition settings + fontStyle + italic foreground - #ce93d8 + #ea80fc scope - .string.unquoted.regex, .string.unquoted.regex .punctuation.definition + .entity.name.class settings foreground - #26a69a + #aed581 scope - .string + .entity.other.inherited-class settings foreground - #f36c60 + #ea80fc scope - .string .punctuation.definition + .comment, .comment .punctuation.definition settings foreground - #F36C6080 + #607d8b scope - .constant.character + .comment .entity.email, .comment .entity.link settings foreground - #f36c60 + #cfd8dc scope - .constant.character.escape.a + .entity.name.constant settings foreground - #80deea + #ce93d8 scope - .constant.character.escape.b + .variable.other.constant, .punctuation.definition.constant settings foreground - #aed581 + #e0e0e0 scope - .string .variable.a .entity.name.variable, .string .variable.a .punctuation.definition.variable, .string .variable.a .keyword.operator + .support.constant settings foreground - #ce93d8 + #ea80fc scope - .string .variable.b .entity.name.variable, .string .variable.b .punctuation.definition.variable, .string .variable.b .keyword.operator + .constant.language settings foreground - #f06292 + #f36c60 scope - .string .variable .array.key + .constant.language.infinity, .constant.language.nan settings foreground - #a1887f + #ea80fc scope - .entity.name.struct, .punctuation.definition.struct + .constant.language.boolean settings foreground - #aed581 + #72d572 scope - .support .entity.name.struct + .meta.destructuring.object.key settings foreground @@ -1096,778 +1026,832 @@ scope - .punctuation.definition.template + .entity.name.function settings + fontStyle + italic foreground - #bcaaa4 + #64b5f6 scope - .entity.name.trait, .punctuation.definition.trait + .variable.function settings foreground - #aed581 + #64b5f6 scope - .support .entity.name.trait + .support.function settings + fontStyle + italic foreground - #ff9e80 + #ea80fc scope - .entity.name.type, .punctuation.definition.type + .storage.type.function.arrow settings + fontStyle + bold foreground - #aed581 + #4fc3f7 scope - .support .entity.name.type, .support .punctuation.definition.type + .variable.parameter.function settings foreground - #ff9e80 + #ffe082 scope - .entity.name.unknown + .variable.parameter.generic settings + fontStyle + foreground - #ffecb3 + #ea80fc scope - .entity.name.variable, .punctuation.definition.variable + .support.function.console.error settings - fontStyle - foreground - #bdbdbd + #f36c60 scope - .support .entity.name.variable, .support .punctuation.definition.variable + .support.function.console.info settings foreground - #ff9e80 + #4db6ac scope - .comment .entity.name.alias + .support.function.console.log settings foreground - #FFECB3B2 + #bcaaa4 scope - .comment .entity.name.class, .comment .punctuation.definition.class + .support.function.console.warn settings foreground - #AED581B2 + #ff8a65 scope - .comment .support .entity.name.class + .support.type.object.jest settings foreground - #FF9E80B2 + #f36c60 scope - .comment .entity.name.constant, .comment .punctuation.definition.constant + .support.type.object.jest.matcher.not settings + fontStyle + bold foreground - #CE93D8B2 + #f36c60 scope - .comment .support .entity.name.constant, .comment .support .punctuation.definition.constant + .support.function.jest settings foreground - #FF9E80B2 + #f36c60 scope - .comment .entity.name.function, .comment .punctuation.definition.function + .support.function.jest.matcher settings foreground - #4FC3F7B2 + #ff8a65 scope - .comment .support .entity.name.function, .comment .support .punctuation.definition.function + .support.function.jest.skip, .support.function.jest.only settings + background + #FF8A651A + fontStyle + bold foreground - #FF9E80B2 + #f36c60 scope - .comment .function.parameter .entity.name.variable, .comment .function.parameter .punctuation.definition.variable + .source.json .punctuation.section.dictionary settings foreground - #FFCC80B2 + #ce93d8 scope - .comment .entity.name.namespace + .source.json .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #BCAAA4B2 + #4dd0e1 scope - .comment .punctuation.definition.namespace + .source.json .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #BCAAA466 + #4dd0e1 scope - .comment .import .entity.name.aliased, .comment .import .entity.name.ambiguous + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary settings foreground - #BCAAA4B2 + #4dd0e1 scope - .comment .punctuation.definition.import + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #FFFFFFB2 + #aed581 scope - .comment .entity.name.interface, .comment .punctuation.definition.interface + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #AED581B2 + #aed581 scope - .comment .support .entity.name.interface + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary settings foreground - #FF9E80B2 + #aed581 scope - .comment .keyword, .comment .punctuation.definition.keyword + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #FF80ABB2 + #ff8a65 scope - .comment .statement.modifier .keyword, .comment .statement.modifier .keyword.operator, .comment .statement.modifier .keyword.operator.other, .comment .storage.modifier .keyword, .comment .storage.modifier .keyword.operator, .comment .storage.modifier .keyword.operator.other, .comment .storage.type .keyword, .comment .storage.type .keyword.operator, .comment .storage.type .keyword.operator.other + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #B39DDBB2 + #ff8a65 scope - .comment .entity.name.namespace + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary settings foreground - #BCAAA4B2 + #ff8a65 scope - .comment .punctuation.definition.namespace + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #BCAAA466 + #4db6ac scope - .comment .constant.numeric + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #FFCC80B2 + #4db6ac scope - .comment .constant.numeric.float + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary settings foreground - #CE93D8B2 + #4db6ac scope - .comment .constant.numeric.binary + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #4DD0E1B2 + #f06292 scope - .comment .constant.numeric.octal + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #DCE775B2 + #f06292 scope - .comment .constant.numeric.hex + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary settings foreground - #E0E0E0B2 + #f06292 scope - .comment .keyword.operator + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #5AF158B2 + #ba68c8 scope - .comment .keyword.operator.other.word + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #FF80ABB2 + #ba68c8 scope - .comment .punctuation.definition.expression.group.a + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary settings foreground - #FFECB3B2 + #ba68c8 scope - .comment .punctuation.definition.expression.group.b + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #BCAAA4B2 + #ffd54f scope - .comment .punctuation.definition.control + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #FF80ABB2 + #ffd54f scope - .comment .string + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .punctuation.section.dictionary settings foreground - #F36C60B2 + #ffd54f scope - .comment .string .punctuation.definition + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string settings foreground - #F36C60B2 + #ffd54f scope - .comment .constant.character + .source.json .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary .meta.structure.dictionary.key .string .punctuation.definition.string settings foreground - #F36C60B2 + #ffd54f scope - .comment .constant.character.escape.a + .keyword settings foreground - #80DEEAB2 + #f48fb1 scope - .comment .constant.character.escape.b + .keyword.control.conditional settings + fontStyle + italic foreground - #AED581B2 + #1de9b6 scope - .comment .entity.name.struct, .comment .punctuation.definition.struct + .keyword.control.flow settings + fontStyle + italic foreground - #AED581B2 + #72d572 scope - .comment .support .entity.name.struct + .keyword.control.flow.break.throw settings + fontStyle + bold italic foreground - #FF9E80B2 + #ea80fc scope - .comment .entity.name.type, .comment .punctuation.definition.type + .keyword.control.flow.return settings + fontStyle + bold italic foreground - #AED581B2 + #ea80fc scope - .comment .support .entity.name.type, .comment .support .punctuation.definition.type + .keyword.control.import-export settings + fontStyle + foreground - #FF9E80B2 + #f48fb1 scope - .comment .entity.name.variable, .comment .punctuation.definition.variable + .keyword.control.import-export.as, .keyword.control.import-export.default, .keyword.control.import-export.star settings foreground - #BDBDBDB2 + #b39ddb scope - .comment .support .entity.name.variable, .comment .support .punctuation.definition.variable + .keyword.control.loop settings + fontStyle + italic foreground - #FF9E80B2 + #ff8a65 scope - .entity.name.attribute + .keyword.control.trycatch settings + fontStyle + italic foreground - #9ccc65 + #ff5177 scope - .section.cdata + .keyword.operator settings + fontStyle + bold foreground - #ff80ab + #5af158 scope - .section.cdata .entity.name + .keyword.operator.pipe settings foreground - #ff80ab + #4fc3f7 scope - .section.cdata .punctuation.definition + .keyword.operator.word settings + fontStyle + italic foreground - #FF80ABB2 + #84ffff scope - .entity.name.data-attribute + .keyword.operator.word.of settings foreground - #ffffff + #72d572 scope - .declaration.doctype + .variable.other.label, .entity.name.label settings + fontStyle + bold foreground - #ff80ab + #e0e0e0 scope - .declaration.doctype .entity.name + .meta.tag settings foreground - #ff80ab + #bcaaa4 scope - .declaration.doctype .punctuation.definition.declaration + .entity.other.attribute-name settings + fontStyle + italic foreground - #FF80ABB2 + #72d572 scope - .text.html .keyword.operator + .storage.modifier, .storage.type settings + fontStyle + foreground - #CE93D8B2 + #b39ddb scope - .instruction.prolog + .storage.modifier.extends settings + fontStyle + italic foreground - #ff80ab + #f36c60 scope - .instruction.prolog .entity.name + .variable.other.namespace settings foreground - #ff80ab + #bcaaa4 scope - .instruction.prolog .punctuation.definition.instruction + .storage.type.numeric settings foreground - #FF80ABB2 + #ffd54f scope - .source.jsx, .text.html, .text.md, .text.xml + .constant.numeric settings + fontStyle + foreground - #BDBDBD66 + #ffd54f scope - .punctuation.definition.code-block + .constant.numeric.float settings foreground - #ff80ab + #4dd0e1 scope - .level-1 .entity.name.header, .level-1 .punctuation.definition.header + .constant.numeric.float .punctuation.defintion settings foreground - #ce93d8 + #4dd0e1 scope - .level-2 .entity.name.header, .level-2 .punctuation.definition.header + .constant.numeric.binary settings foreground - #4dd0e1 + #ff8a65 scope - .level-3 .entity.name.header, .level-3 .punctuation.definition.header + .constant.numeric.binary .punctuation.definition settings foreground - #9ccc65 + #ff8a65 scope - .level-4 .entity.name.header, .level-4 .punctuation.definition.header + .constant.numeric.octal settings foreground - #4db6ac + #bcaaa4 scope - .level-5 .entity.name.header, .level-5 .punctuation.definition.header + .constant.numeric.octal .punctuation.definition settings foreground - #ffab91 + #bcaaa4 scope - .level-6 .entity.name.header, .level-6 .punctuation.definition.header + .constant.numeric.hex settings foreground - #ffe082 + #72d572 scope - .support .entity.name.property.mql + .constant.numeric.hex .punctuation.definition settings foreground - #ff9e80 + #72d572 scope - .entity.name.selector + .meta.object-literal.key settings foreground - #ff80ab + #bcaaa4 scope - .punctuation.definition.selector + .punctuation.accessor, .punctuation.separator, .punctuation.terminator settings + fontStyle + bold foreground - #FF80AB80 + #5af158 scope - .extension .entity.name.selector + .punctuation.separator.key-value settings foreground - #e0e0e0 + #ff8a65 scope - .extension .punctuation.definition.selector + .punctuation.definition.tag settings + fontStyle + foreground - #E0E0E0B2 + #a1887f scope - .entity.name.selector.class + .punctuation.definition.template-expression settings + fontStyle + bold foreground - #4dd0e1 + #ff8a65 scope - .punctuation.definition.selector.class + .string settings foreground - #4DD0E1B2 + #dce775 scope - .entity.name.selector.id + .string .punctuation.definition.string settings foreground - #ec407a + #dce775 scope - .punctuation.definition.selector.id + .entity.name.interface, .entity.name.type, .variable.type, .variable.other.type settings foreground - #EC407AB2 + #aed581 scope - .entity.name.selector.placeholder + .support.type settings foreground - #ffcc80 + #b388ff scope - .punctuation.definition.selector.placeholder + .support.type.existential.flow, .support.type.flow settings foreground - #FFCC8080 + #ffab91 scope - .entity.name.selector.tag + .support.type.object settings - foreground - #bcaaa4 + fontStyle + italic scope - .source.css .support .entity.name.attribute, .source.scss .support .entity.name.attribute + .support.type.object.console settings foreground - #aed581 + #72d572 scope - .source.css .extension .entity.name.attribute, .source.scss .extension .entity.name.attribute + .variable.other, .punctuation.definition.variable settings + fontStyle + foreground #e0e0e0 scope - .entity.name.mixin, .punctuation.definition.mixin + .entity.name.variable settings + fontStyle + italic foreground - #4fc3f7 + #e0e0e0 scope - .source.scss .keyword.operator.other.comma, .source.scss .keyword.operator.other.association, .source.scss .keyword.operator.other.terminator + .variable.language.prototype, .variable.language.this settings + fontStyle + italic foreground - #ffffff + #f36c60 scope - .source.scss .punctuation.definition.body + .variable.language.super settings foreground - #ffffff + #ff8a65 scope - source.scss .keyword.modifier.unit + .variable.language.this settings + fontStyle + italic foreground - #ff9e80 + #ea80fc scope - .source.scss .declaration .entity.name.variable + .support.variable settings foreground - #bcaaa4 + #ff9e80 diff --git a/Default.sublime-keymap b/Default.sublime-keymap index 15491f4c..fe2601c4 100644 --- a/Default.sublime-keymap +++ b/Default.sublime-keymap @@ -128,26 +128,4 @@ "args": { "file": "res://Packages/Naomi/macros/delete-to-previous-line.sublime-macro" } -},{ - // Close JSX tag. - "keys": [ "/" ], - "command": "close_tag", - "context": [{ - "key": "setting.auto_close_tags", - "match_all": true - },{ - "key": "preceding_text", - "operator": "regex_match", - "operand": ".*<$" - },{ - "key": "selector", - "operator": "equal", - "operand": "source.jsx - string - comment", - "match_all": true - },{ - "key": "selector", - "operator": "not_equal", - "operand": "keyword.operator.other.embedded.js.end", - "match_all": true - }] }] diff --git a/Monokai.tmTheme b/Monokai.tmTheme deleted file mode 100644 index 9293a7f3..00000000 --- a/Monokai.tmTheme +++ /dev/null @@ -1,449 +0,0 @@ - - - - - name - Monokai - settings - - - settings - - activeGuide - #9D550FB0 - background - #272822 - bracketContentsForeground - #F8F8F2A5 - bracketContentsOptions - underline - bracketsForeground - #F8F8F2A5 - bracketsOptions - underline - caret - #F8F8F0 - findHighlight - #FFE792 - findHighlightForeground - #000000 - foreground - #F8F8F2 - invisibles - #3B3A32 - lineHighlight - #3E3D32 - selection - #49483E - selectionBorder - #222218 - tagsOptions - stippled_underline - - - - scope - comment - settings - - foreground - #75715E - - - - scope - string - settings - - foreground - #E6DB74 - - - - scope - constant.numeric - settings - - foreground - #AE81FF - - - - scope - constant.language - settings - - foreground - #AE81FF - - - - scope - constant.character, constant.other - settings - - foreground - #AE81FF - - - - scope - variable - settings - - fontStyle - - - - - scope - keyword - (source.c keyword.operator | source.cpp keyword.operator | source.objc keyword.operator | source.objcpp keyword.operator), keyword.operator.word - settings - - foreground - #F92672 - - - - scope - variable.other.dollar.only.js - settings - - foreground - #F92672 - - - - scope - storage - settings - - fontStyle - - foreground - #F92672 - - - - scope - storage.type - settings - - fontStyle - italic - foreground - #66D9EF - - - - scope - entity.name - (entity.name.filename | entity.name.section | entity.name.tag | entity.name.label) - settings - - fontStyle - - foreground - #A6E22E - - - - scope - entity.other.inherited-class - settings - - fontStyle - italic underline - foreground - #A6E22E - - - - scope - variable.parameter - (source.c | source.cpp | source.objc | source.objcpp) - settings - - fontStyle - italic - foreground - #FD971F - - - - scope - variable.language - settings - - fontStyle - italic - foreground - #FD971F - - - - scope - entity.name.tag - settings - - fontStyle - - foreground - #F92672 - - - - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #A6E22E - - - - scope - variable.function - settings - - fontStyle - - foreground - #66D9EF - - - - scope - support.function - settings - - fontStyle - - foreground - #66D9EF - - - - scope - support.constant - settings - - fontStyle - - foreground - #66D9EF - - - - scope - support.type, support.class - settings - - fontStyle - italic - foreground - #66D9EF - - - - scope - support.other.variable - settings - - fontStyle - - - - - scope - invalid - settings - - background - #F92672 - fontStyle - - foreground - #F8F8F0 - - - - scope - invalid.deprecated - settings - - background - #AE81FF - foreground - #F8F8F0 - - - - scope - meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #CFCFC2 - - - - scope - string.unquoted.yaml - settings - - foreground - #F8F8F2 - - - - scope - meta.diff, meta.diff.header - settings - - foreground - #75715E - - - - scope - markup.deleted - settings - - foreground - #F92672 - - - - scope - markup.inserted - settings - - foreground - #A6E22E - - - - scope - markup.changed - settings - - foreground - #E6DB74 - - - - scope - constant.numeric.line-number.find-in-files - match - settings - - foreground - #AE81FFA0 - - - - scope - entity.name.filename - settings - - foreground - #E6DB74 - - - - scope - message.error - settings - - foreground - #F83333 - - - - scope - .support .entity.name.attribute.css - settings - - fontStyle - italic - foreground - #66d9ef - - - - scope - .extension .entity.name.attribute.css - settings - - foreground - #66d9ef - - - - scope - .keyword.declaration.class, .keyword.modifier - settings - - foreground - #66d9ef - - - - scope - .entity.name.function - settings - - foreground - #66d9ef - - - - scope - .support .entity.name.function - settings - - foreground - #66d9ef - - - - scope - .function.parameter .entity.name.variable, .function.parameter .punctuation.definition.variable - settings - - foreground - #fd971f - - - - scope - .import .entity.name.ambiguous - settings - - foreground - #f8f8f2 - - - - scope - .entity.name.variable, .punctuation.definition.variable - settings - - fontStyle - - foreground - #f8f8f2 - - - - scope - .support .entity.name.variable, .support .punctuation.definition.variable - settings - - foreground - #66d9ef - - - - - diff --git a/README.md b/README.md index ca5bd7c1..a201ecd4 100644 --- a/README.md +++ b/README.md @@ -29,16 +29,7 @@ The “Packages” directory is located at: ## Usage -**Support for external color schemes is being added as I am syncing the scopes with -the ones in Sublime’s core, if you want to try the modified syntaxes check the -[pull requests section](https://github.com/borela/naomi/pulls).** - -1. Go to the menu `View / Syntax / Naomi / ...` to select the new syntax. -2. Select a color scheme provided in `Preferences / Color Scheme / Naomi`. - -**Notes:** The recommended color scheme is [Candyman][candyman] which covers many -of the scopes and can serve as a starting point if you want to create your own using -[CSScheme][csscheme]. +Go to the menu `View / Syntax / Naomi / ...` to select the new syntax. ### Sublime Linter @@ -54,8 +45,7 @@ To enable [Sublime Linter][sublimeLinter] with the syntaxes available, you need "naomi.html5": "html", "naomi.mql4": "mql", "naomi.php7": "php", - "naomi.scss3": "scss", - "naomi.xml1": "xml" + "naomi.scss3": "scss" } } ``` @@ -72,12 +62,10 @@ To enable [Sublime Linter][sublimeLinter] with the syntaxes available, you need 4. Alt+Shift+] produces ’. * Stable syntaxes: * FJSX15 (Combines ES2015+, Flow, React’s JSX). - * JSON. * HTML 5. * SCSS3. * MQL4. * PHP 7. - * XML 1.0. ## Preview diff --git a/schemes/bittersweet/_original.scss b/schemes/bittersweet/_original.scss deleted file mode 100644 index 849f2065..00000000 --- a/schemes/bittersweet/_original.scss +++ /dev/null @@ -1,169 +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. - -* { - activeGuide: #9D550FB0; - background: #222b30; - bracketContentsForeground: #866a5aA5; - bracketContentsOptions: underline; - bracketsForeground: #866a5aA5; - bracketsOptions: underline; - caret: #F8F8F0; - findHighlight: #ea8b2a; - findHighlightForeground: #000000; - foreground: #cbd1d2; - invisibles: #3B3A32; - lineHighlight: #3E3D32; - selection: #4b7b91; - selectionBorder: #222218; - tagsOptions: stippled_underline; -} - -comment { - fontStyle: none; - foreground: #4b92a7; -} - -string { - foreground: #9ed670; -} - -constant.numeric { - foreground: #a475bd; -} - -constant.language { - foreground: #a475bd; -} - -constant.character, -constant.other { - foreground: #a475bd; -} - -variable { - fontStyle: none; -} - -keyword { - foreground: #ee88cc; -} - -meta.tag, -declaration.tag { - fontStyle: none; - foreground: #ee88cc; -} - -storage { - fontStyle: none; - foreground: #ee88cc; -} - -storage.type { - fontStyle: italic; - foreground: #07cc95; -} - -entity.name.class { - fontStyle: underline; - foreground: #50fa7b; -} - -entity.other.inherited-class { - fontStyle: italic underline; - foreground: #50fa7b; -} - -entity.name.function { - fontStyle: bold; - foreground: #63c9ec; -} - -variable.parameter { - fontStyle: italic; - foreground: #f48d8d; -} - -entity.name.tag { - fontStyle: none; - foreground: #ee88cc; -} - -entity.other.attribute-name { - fontStyle: none; - foreground: #50fa7b; -} - -support.function { - fontStyle: none; - foreground: #07cc95; -} - -support.constant { - fontStyle: none; - foreground: #6bc3d4; -} - -support.type, -support.class { - fontStyle: italic bold; - foreground: #8abbe7; -} - -support.other.variable { - fontStyle: none; -} - -invalid { - fontStyle: none; - foreground: #F8F8F0; - background: #ee88cc; -} - -invalid.deprecated { - foreground: #F8F8F0; - background: #a475bd; -} - -meta.structure.dictionary.json string.quoted.double.json { - foreground: #CFCFC2; -} - -meta.diff, -meta.diff.header { - foreground: #6272a4; -} - -markup.deleted { - foreground: #ee88cc; -} - -markup.inserted { - foreground: #50fa7b; -} - -markup.changed { - foreground: #E6DB74; -} - -constant.numeric.line-number.find-in-files \- match { - foreground: #a475bd; -} - -entity.name.filename { - foreground: #E6DB74; -} - -message.error { - foreground: #F83333; -} diff --git a/schemes/boxy-ocean/_original.scss b/schemes/boxy-ocean/_original.scss deleted file mode 100644 index 8e593b7c..00000000 --- a/schemes/boxy-ocean/_original.scss +++ /dev/null @@ -1,722 +0,0 @@ -@uuid 0e709986-46a0-40a0-b3bf-c8dfe525c455; - -* { - activeGuide: #ffffff55; - background: #1b2b34; - caret: #cdd3de; - foreground: #cdd3de; - guide: #ffffff25; - gutter: #1b2b34; - invisibles: #65737e; - lineHighlight: #ffffff10; - popupCss: html { - background-color: #2d3c44; - color: #cdd3de; - }; - - a { - color: #6699cc; - } - - .error, - .deleted { - color: #ec5f67; - } - - .success, - .inserted, - .name { - color: #99c794; - } - - .warning, - .modified { - color: #fac863; - } - - .type { - color: #5fb3b3; - font-style: italic; - } - - .param { - color: #f99157; - } - - .current { - text-decoration: underline; - } - - selection: #ffffff16; - selectionBorder: #ffffff16; - stackGuide: #ffffff40; -} - -comment, -punctuation.definition.comment { - fontStyle: italic; - foreground: #65737e; -} - -variable, -string constant.other.placeholder { - foreground: #cdd3de; -} - -invalid { - foreground: #ffffff; - background: #ec5f67; -} - -invalid.deprecated { - foreground: #ffffff; - background: #c594c5; -} - -keyword, -storage.type, -storage.modifier { - foreground: #c594c5; -} - -keyword.operator, -constant.other.color, -punctuation, -meta.tag, -punctuation.definition.tag, -punctuation.separator.inheritance.php, -punctuation.definition.tag.html, -punctuation.definition.tag.begin.html, -punctuation.definition.tag.end.html, -punctuation.section.embedded, -keyword.other.template, -keyword.other.substitution { - foreground: #5fb3b3; -} - -entity.name.tag, -meta.tag.sgml, -markup.deleted.git_gutter { - foreground: #f07178; -} - -entity.name.function, -variable.function, -support.function, -keyword.other.special-method, -meta.block-level { - foreground: #6699cc; -} - -support.other.variable, -string.other.link { - foreground: #f07178; -} - -constant.numeric, -constant.language, -support.constant, -constant.character, -variable.parameter, -keyword.other.unit { - foreground: #f99157; -} - -string, -constant.other.symbol, -constant.other.key, -entity.other.inherited-class, -markup.heading, -markup.inserted.git_gutter, -meta.group.braces.curly constant.other.object.key.js string.unquoted.label.js { - fontStyle: none; - foreground: #99c794; -} - -entity.name.class, -entity.name.type.class, -support.type, -support.class, -support.other.namespace.use.php, -meta.use.php, -support.other.namespace.php, -markup.changed.git_gutter { - foreground: #fac863; -} - -entity.name.module.js, -variable.import.parameter.js, -variable.other.class.js { - foreground: #ec5f67; -} - -variable.language { - fontStyle: italic; - foreground: #ec5f67; -} - -entity.name.method.js { - foreground: #6699cc; -} - -meta.class-method.js entity.name.function.js, -variable.function.constructor { - foreground: #6699cc; -} - -entity.other.attribute-name { - foreground: #c594c5; -} - -markup.inserted { - foreground: #99c794; -} - -markup.deleted { - foreground: #ec5f67; -} - -markup.changed { - foreground: #c594c5; -} - -string.regexp { - foreground: #5fb3b3; -} - -constant.character.escape { - foreground: #5fb3b3; -} - -\*url\*, -\*link\*, -\*uri\* { - fontStyle: underline; -} - -constant.numeric.line-number.find-in-files \- match { - foreground: #ab7967; -} - -entity.name.filename.find-in-files { - foreground: #99c794; -} - -tag.decorator.js entity.name.tag.js, -tag.decorator.js punctuation.definition.tag.js { - fontStyle: italic; - foreground: #6699cc; -} - -source.js constant.other.object.key.js string.unquoted.label.js { - fontStyle: italic; - foreground: #ec5f67; -} - -source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json \- meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, -source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string \- meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string { - foreground: #ec5f67bf; -} - -source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json \- meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, -source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string \- meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string { - foreground: #6699ccbf; -} - -source.json meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json \- meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, -source.json meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string \- meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string { - foreground: #fac863bf; -} - -source.json meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json \- meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, -source.json meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string \- meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string { - foreground: #c594c5bf; -} - -source.json meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json \- meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, -source.json meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string \- meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string { - foreground: #f99157; -} - -source.json meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json \- meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, -source.json meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string \- meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string { - foreground: #ec5f67; -} - -source.json meta meta meta meta.structure.dictionary.json string.quoted.double.json \- meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, -source.json meta meta meta meta.structure.dictionary.json punctuation.definition.string \- meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string { - foreground: #6699cc; -} - -source.json meta meta.structure.dictionary.json string.quoted.double.json \- meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, -source.json meta meta.structure.dictionary.json punctuation.definition.string \- meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string { - foreground: #fac863; -} - -source.json meta.structure.dictionary.json string.quoted.double.json \- meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, -source.json meta.structure.dictionary.json punctuation.definition.string \- meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string { - foreground: #c594c5; -} - -text.html.markdown, -punctuation.definition.list_item.markdown { - foreground: #cdd3de; -} - -text.html.markdown markup.raw.inline { - foreground: #cdd3decc; - background: #ffffff08; -} - -text.html.markdown meta.dummy.line-break { - foreground: #ffffff50; -} - -markdown.heading, -markup.heading \| markup.heading entity.name, -markup.heading.markdown punctuation.definition.heading.markdown { - foreground: #f07178; -} - -markup.italic, -markup.italic string { - fontStyle: italic; -} - -markup.bold, -markup.bold string { - fontStyle: bold; -} - -markup.bold markup.italic, -markup.italic markup.bold, -markup.quote markup.bold, -markup.bold markup.italic string, -markup.italic markup.bold string, -markup.quote markup.bold string { - fontStyle: bold italic; -} - -markup.underline { - fontStyle: underline; - foreground: #99c794; -} - -/* -markup.strike { - fontStyle: strike; - foreground: #65737e; -} -*/ - -markup.quote punctuation.definition.blockquote.markdown { - fontStyle: none; - foreground: #ffffff16; - background: #ffffff16; -} - -markup.quote { - fontStyle: italic; - foreground: #65737e; -} - -string.other.link.title.markdown { - foreground: #6699cc; -} - -string.other.link.description.title.markdown { - foreground: #c594c5; -} - -constant.other.reference.link.markdown { - foreground: #fac863; -} - -markup.raw.block { - foreground: #cdd3decc; - background: #ffffff08; -} - -markup.raw.block.fenced.markdown { - background: #ffffff08; -} - -punctuation.definition.fenced.markdown { - background: #ffffff08; -} - -markup.raw.block.fenced.markdown, -variable.language.fenced.markdown, -punctuation.section.class.end { - foreground: #cdd3de; -} - -punctuation.definition.fenced.markdown, -meta.definition.language.raw.block.fenced.markdown { - fontStyle: none; - foreground: #ffffff50; -} - -variable.language.fenced.markdown { - fontStyle: none; - foreground: #65737e; -} - -meta.separator { - fontStyle: bold; - foreground: #65737e; - background: #ffffff08; -} - -markup.table { - foreground: #cdd3decc; - background: #ffffff08; -} - -text.html.markdown punctuation.definition, -text.html.markdown.note punctuation.definition.list_item.markdown, -markup.table.markdown punctuation.definition.table.vertical-line.markdown, -text.html.markdown markup.checkbox.markdown { - fontStyle: none; - foreground: #ffffff50; -} - -text.html.markdown meta.disable-markdown punctuation.definition { - foreground: #5fb3b3; -} - -punctuation.definition.list_item.todo.done { - foreground: #99c794; -} - -punctuation.definition.list_item.todo.cancelled { - foreground: #ec5f67; -} - -markup.checkbox.markdown markup.checkbox.checked_symbol.markdown { - foreground: #99c794; -} - -markup.admonition.markdown string.other.admonition.title.markdown { - fontStyle: bold; - foreground: #cdd3de; -} - -markup.admonition.markdown markup.admonition.header.markdown { - background: #bb80b350; -} - -markup.admonition.markdown markup.admonition.body.markdown { - background: #bb80b315; -} - -markup.admonition.markdown punctuation.definition.admonition.markdown, -markup.admonition.markdown punctuation.definition.heading, -markup.admonition.markdown punctuation.definition.table.vertical-line, -markup.admonition.markdown punctuation.definition.table.horizontal-line, -markup.admonition.markdown punctuation.definition.table.alignments, -markup.admonition.markdown punctuation.definition.heading, -markup.admonition.markdown punctuation.definition.bold, -markup.admonition.markdown punctuation.definition.italic, -markup.admonition.markdown punctuation.definition.list_item, -markup.admonition.markdown punctuation.definition.raw, -markup.admonition.markdown markup.checkbox.markdown, -markup.admonition.markdown punctuation.definition.list_item.todo.pending, -markup.admonition.markdown meta.link punctuation.definition, -markup.admonition.markdown meta.link.inline markup.underline.link, -markup.admonition.markdown meta.link.reference.markdown constant.other.reference.link.markdown, -markup.admonition.markdown punctuation.definition.entity.html, -markup.admonition.markdown meta.separator.markdown, -markup.admonition.markdown markup.table.markdown punctuation.definition.table.vertical-line.markdown, -markup.admonition.markdown meta.definition.language.raw.block.fenced.markdown { - foreground: #bb80b375; -} - -markup.admonition.markdown entity.name.admonition.markdown { - fontStyle: bold; - foreground: #bb80b3; -} - -markup.admonition.markdown markup.table, -markup.admonition.markdown markup.raw, -markup.admonition.markdown markup.raw.block.fenced meta.language, -markup.admonition.markdown punctuation.definition.blockquote.markdown, -markup.admonition.markdown meta.separator, -markup.admonition.markdown markup.raw.inline, -markup.admonition.markdown markup.raw.block { - background: #bb80b325; -} - -markup.admonition.markdown markup.quote punctuation.definition.blockquote.markdown { - foreground: #bb80b335; - background: #bb80b335; -} - -markup.admonition.markdown.hint markup.admonition.header.markdown { - background: #6699cc50; -} - -markup.admonition.markdown.hint markup.admonition.body.markdown { - background: #6699cc15; -} - -markup.admonition.markdown.hint punctuation.definition.admonition.markdown, -markup.admonition.markdown.hint punctuation.definition.heading, -markup.admonition.markdown.hint punctuation.definition.table.vertical-line, -markup.admonition.markdown.hint punctuation.definition.table.horizontal-line, -markup.admonition.markdown.hint punctuation.definition.table.alignments, -markup.admonition.markdown.hint punctuation.definition.heading, -markup.admonition.markdown.hint punctuation.definition.bold, -markup.admonition.markdown.hint punctuation.definition.italic, -markup.admonition.markdown.hint punctuation.definition.list_item, -markup.admonition.markdown.hint punctuation.definition.raw, -markup.admonition.markdown.hint markup.checkbox.markdown, -markup.admonition.markdown.hint punctuation.definition.list_item.todo.pending, -markup.admonition.markdown.hint meta.link punctuation.definition, -markup.admonition.markdown.hint meta.link.inline markup.underline.link, -markup.admonition.markdown.hint meta.link.reference.markdown constant.other.reference.link.markdown, -markup.admonition.markdown.hint punctuation.definition.entity.html, -markup.admonition.markdown.hint meta.separator.markdown, -markup.admonition.markdown.hint markup.table.markdown punctuation.definition.table.vertical-line.markdown, -markup.admonition.markdown.hint meta.definition.language.raw.block.fenced.markdown { - foreground: #6699cc75; -} - -markup.admonition.markdown.hint entity.name.admonition.markdown { - fontStyle: bold; - foreground: #6699cc; -} - -markup.admonition.markdown.hint markup.table, -markup.admonition.markdown.hint markup.raw, -markup.admonition.markdown.hint markup.raw.block.fenced meta.language, -markup.admonition.markdown.hint punctuation.definition.blockquote.markdown, -markup.admonition.markdown.hint meta.separator, -markup.admonition.markdown.hint markup.raw.inline, -markup.admonition.markdown.hint markup.raw.block { - background: #6699cc25; -} - -markup.admonition.markdown.hint markup.quote punctuation.definition.blockquote.markdown { - foreground: #6699cc35; - background: #6699cc35; -} - -markup.admonition.markdown.warning markup.admonition.header.markdown { - background: #fac86350; -} - -markup.admonition.markdown.warning markup.admonition.body.markdown { - background: #fac86315; -} - -markup.admonition.markdown.warning punctuation.definition.admonition.markdown, -markup.admonition.markdown.warning punctuation.definition.heading, -markup.admonition.markdown.warning punctuation.definition.table.vertical-line, -markup.admonition.markdown.warning punctuation.definition.table.horizontal-line, -markup.admonition.markdown.warning punctuation.definition.table.alignments, -markup.admonition.markdown.warning punctuation.definition.heading, -markup.admonition.markdown.warning punctuation.definition.bold, -markup.admonition.markdown.warning punctuation.definition.italic, -markup.admonition.markdown.warning punctuation.definition.list_item, -markup.admonition.markdown.warning punctuation.definition.raw, -markup.admonition.markdown.warning markup.checkbox.markdown, -markup.admonition.markdown.warning punctuation.definition.list_item.todo.pending, -markup.admonition.markdown.warning meta.link punctuation.definition, -markup.admonition.markdown.warning meta.link.inline markup.underline.link, -markup.admonition.markdown.warning meta.link.reference.markdown constant.other.reference.link.markdown, -markup.admonition.markdown.warning punctuation.definition.entity.html, -markup.admonition.markdown.warning meta.separator.markdown, -markup.admonition.markdown.warning markup.table.markdown punctuation.definition.table.vertical-line.markdown, -markup.admonition.markdown.warning meta.definition.language.raw.block.fenced.markdown { - foreground: #fac86375; -} - -markup.admonition.markdown.warning entity.name.admonition.markdown { - fontStyle: bold; - foreground: #fac863; -} - -markup.admonition.markdown.warning markup.table, -markup.admonition.markdown.warning markup.raw, -markup.admonition.markdown.warning markup.raw.block.fenced meta.language, -markup.admonition.markdown.warning punctuation.definition.blockquote.markdown, -markup.admonition.markdown.warning meta.separator, -markup.admonition.markdown.warning markup.raw.inline, -markup.admonition.markdown.warning markup.raw.block { - background: #fac86325; -} - -markup.admonition.markdown.warning markup.quote punctuation.definition.blockquote.markdown { - foreground: #fac86335; - background: #fac86335; -} - -markup.admonition.markdown.danger markup.admonition.header.markdown { - background: #ec5f6750; -} - -markup.admonition.markdown.danger markup.admonition.body.markdown { - background: #ec5f6715; -} - -markup.admonition.markdown.danger punctuation.definition.admonition.markdown, -markup.admonition.markdown.danger punctuation.definition.heading, -markup.admonition.markdown.danger punctuation.definition.table.vertical-line, -markup.admonition.markdown.danger punctuation.definition.table.horizontal-line, -markup.admonition.markdown.danger punctuation.definition.table.alignments, -markup.admonition.markdown.danger punctuation.definition.heading, -markup.admonition.markdown.danger punctuation.definition.bold, -markup.admonition.markdown.danger punctuation.definition.italic, -markup.admonition.markdown.danger punctuation.definition.list_item, -markup.admonition.markdown.danger punctuation.definition.raw, -markup.admonition.markdown.danger markup.checkbox.markdown, -markup.admonition.markdown.danger punctuation.definition.list_item.todo.pending, -markup.admonition.markdown.danger meta.link punctuation.definition, -markup.admonition.markdown.danger meta.link.inline markup.underline.link, -markup.admonition.markdown.danger meta.link.reference.markdown constant.other.reference.link.markdown, -markup.admonition.markdown.danger punctuation.definition.entity.html, -markup.admonition.markdown.danger meta.separator.markdown, -markup.admonition.markdown.danger markup.table.markdown punctuation.definition.table.vertical-line.markdown, -markup.admonition.markdown.danger meta.definition.language.raw.block.fenced.markdown { - foreground: #ec5f6775; -} - -markup.admonition.markdown.danger entity.name.admonition.markdown { - fontStyle: bold; - foreground: #ec5f67; -} - -markup.admonition.markdown.danger markup.table, -markup.admonition.markdown.danger markup.raw, -markup.admonition.markdown.danger markup.raw.block.fenced meta.language, -markup.admonition.markdown.danger punctuation.definition.blockquote.markdown, -markup.admonition.markdown.danger meta.separator, -markup.admonition.markdown.danger markup.raw.inline, -markup.admonition.markdown.danger markup.raw.block { - background: #ec5f6725; -} - -markup.admonition.markdown.danger markup.quote punctuation.definition.blockquote.markdown { - foreground: #ec5f6735; - background: #ec5f6735; -} - -markup.admonition.markdown.attention markup.admonition.header.markdown { - background: #99c79450; -} - -markup.admonition.markdown.attention markup.admonition.body.markdown { - background: #99c79415; -} - -markup.admonition.markdown.attention punctuation.definition.admonition.markdown, -markup.admonition.markdown.attention punctuation.definition.heading, -markup.admonition.markdown.attention punctuation.definition.table.vertical-line, -markup.admonition.markdown.attention punctuation.definition.table.horizontal-line, -markup.admonition.markdown.attention punctuation.definition.table.alignments, -markup.admonition.markdown.attention punctuation.definition.heading, -markup.admonition.markdown.attention punctuation.definition.bold, -markup.admonition.markdown.attention punctuation.definition.italic, -markup.admonition.markdown.attention punctuation.definition.list_item, -markup.admonition.markdown.attention punctuation.definition.raw, -markup.admonition.markdown.attention markup.checkbox.markdown, -markup.admonition.markdown.attention punctuation.definition.list_item.todo.pending, -markup.admonition.markdown.attention meta.link punctuation.definition, -markup.admonition.markdown.attention meta.link.inline markup.underline.link, -markup.admonition.markdown.attention meta.link.reference.markdown constant.other.reference.link.markdown, -markup.admonition.markdown.attention punctuation.definition.entity.html, -markup.admonition.markdown.attention meta.separator.markdown, -markup.admonition.markdown.attention markup.table.markdown punctuation.definition.table.vertical-line.markdown, -markup.admonition.markdown.attention meta.definition.language.raw.block.fenced.markdown { - foreground: #99c79475; -} - -markup.admonition.markdown.attention entity.name.admonition.markdown { - fontStyle: bold; - foreground: #99c794; -} - -markup.admonition.markdown.attention markup.table, -markup.admonition.markdown.attention markup.raw, -markup.admonition.markdown.attention markup.raw.block.fenced meta.language, -markup.admonition.markdown.attention punctuation.definition.blockquote.markdown, -markup.admonition.markdown.attention meta.separator, -markup.admonition.markdown.attention markup.raw.inline, -markup.admonition.markdown.attention markup.raw.block { - background: #99c79425; -} - -markup.admonition.markdown.attention markup.quote punctuation.definition.blockquote.markdown { - foreground: #99c79435; - background: #99c79435; -} - -acejump.label { - foreground: #ffffff; - background: #528bff; -} - -sublimelinter.mark.warning { - foreground: #fac863; -} - -sublimelinter.gutter-mark { - foreground: #ffffff; -} - -sublimelinter.mark.error { - foreground: #ec5f67; -} - -markup.ignored.git_gutter { - foreground: #65737e; -} - -markup.untracked.git_gutter { - foreground: #65737e; -} - -markup.inserted.git_gutter { - foreground: #99c794; -} - -markup.changed.git_gutter { - foreground: #fac863; -} - -markup.deleted.git_gutter { - foreground: #ec5f67; -} - -brackethighlighter.default { - foreground: #c594c5; -} - -brackethighlighter.unmatched { - foreground: #ec5f67; -} - -brackethighlighter.curly { - foreground: #bb80b3; -} - -brackethighlighter.round { - foreground: #fac863; -} - -brackethighlighter.square { - foreground: #6699cc; -} - -brackethighlighter.angle { - foreground: #f99157; -} - -brackethighlighter.tag { - foreground: #5fb3b3; -} - -brackethighlighter.quote { - foreground: #99c794; -} diff --git a/schemes/boxy-ocean/_support.scss b/schemes/boxy-ocean/_support.scss deleted file mode 100644 index 8c276c27..00000000 --- a/schemes/boxy-ocean/_support.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. - -.support { - .entity.name.class, - .entity.name.interface, - .entity.name.function, - .entity.name.variable, - .entity.name.constant, - .entity.name.type, - .punctuation.definition.class, - .punctuation.definition.interface, - .punctuation.definition.function, - .punctuation.definition.variable, - .punctuation.definition.constant, - .punctuation.definition.type { - foreground: #6699cc; - } -} diff --git a/schemes/bittersweet/_support.scss b/schemes/candyman/_annotation.scss similarity index 66% rename from schemes/bittersweet/_support.scss rename to schemes/candyman/_annotation.scss index bfe17004..e2c9047f 100644 --- a/schemes/bittersweet/_support.scss +++ b/schemes/candyman/_annotation.scss @@ -10,19 +10,19 @@ // License for the specific language governing permissions and limitations under // the License. -support { - entity.name.function, - entity.name.variable { - foreground: #07cc95; +.meta.annotation { + .variable.annotation, + .punctuation.definition { + foreground: $purple-a100; + fontStyle: italic; } - entity.name.constant { - foreground: #6bc3d4; - } - - entity.name.type, - entity.name.class { - fontStyle: italic bold; - foreground: #8abbe7; - } +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $purple-a100; +// } +// } +// } } diff --git a/schemes/candyman/_array.scss b/schemes/candyman/_array.scss new file mode 100644 index 00000000..3f3efdd3 --- /dev/null +++ b/schemes/candyman/_array.scss @@ -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. + +// .meta.sequence +// .punctuation { +// &.section.brackets, +// &.separator.comma { +// foreground: $deep-orange-300; +// fontStyle: italic bold; +// } +// } diff --git a/schemes/monokai/_class.scss b/schemes/candyman/_class.scss similarity index 82% rename from schemes/monokai/_class.scss rename to schemes/candyman/_class.scss index 4bcdb271..9d99e81b 100644 --- a/schemes/monokai/_class.scss +++ b/schemes/candyman/_class.scss @@ -10,7 +10,10 @@ // License for the specific language governing permissions and limitations under // the License. -.keyword.declaration.class, -.keyword.modifier { - foreground: #66d9ef; +.entity.name.class { + foreground: $light-green-300; +} + +.entity.other.inherited-class { + foreground: $purple-a100; } diff --git a/schemes/candyman/_comment.scss b/schemes/candyman/_comment.scss new file mode 100644 index 00000000..9becaea4 --- /dev/null +++ b/schemes/candyman/_comment.scss @@ -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. + +.comment, +.comment .punctuation.definition { + foreground: $blue-gray-500; +} + +.comment .entity { + &.email, + &.link { + foreground: $blue-gray-100; + } +} diff --git a/schemes/candyman/_constant.scss b/schemes/candyman/_constant.scss new file mode 100644 index 00000000..8356142b --- /dev/null +++ b/schemes/candyman/_constant.scss @@ -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. + +.entity.name.constant { + foreground: $purple-200; +} + +.variable.other.constant, +.punctuation.definition.constant { + foreground: $gray-300; +} + +.support.constant { + foreground: $purple-a100; +} + +.constant.language { + foreground: $red-300; +} + +.constant.language.infinity, +.constant.language.nan { + foreground: $purple-a100; +} + +.constant.language.boolean { + foreground: $green-200; +} diff --git a/schemes/monokai/_import.scss b/schemes/candyman/_destructuring.scss similarity index 89% rename from schemes/monokai/_import.scss rename to schemes/candyman/_destructuring.scss index 22730d83..b67db353 100644 --- a/schemes/monokai/_import.scss +++ b/schemes/candyman/_destructuring.scss @@ -10,8 +10,6 @@ // License for the specific language governing permissions and limitations under // the License. -.import { - .entity.name.ambiguous { - foreground: #f8f8f2; - } +.meta.destructuring.object.key { + foreground: $deep-orange-a100; } diff --git a/Monokai.scsscheme b/schemes/candyman/_function-call.scss similarity index 52% rename from Monokai.scsscheme rename to schemes/candyman/_function-call.scss index 1e4f0132..213f98cf 100644 --- a/Monokai.scsscheme +++ b/schemes/candyman/_function-call.scss @@ -10,12 +10,27 @@ // License for the specific language governing permissions and limitations under // the License. -@name 'Monokai'; +// .meta.function-call { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $light-blue-300; +// fontStyle: bold; +// } +// } +// } -@import 'schemes/monokai/original'; - -@import 'schemes/monokai/css/attribute'; -@import 'schemes/monokai/class'; -@import 'schemes/monokai/function'; -@import 'schemes/monokai/import'; -@import 'schemes/monokai/variable'; +// // Function call inside groups. +// @for $i from 1 through 7 { +// #{repeatString('meta.group', $i)} +// .meta.function-call +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $light-blue-300; +// fontStyle: bold; +// } +// } +// } +// } diff --git a/schemes/candyman/_function.scss b/schemes/candyman/_function.scss new file mode 100644 index 00000000..b4842673 --- /dev/null +++ b/schemes/candyman/_function.scss @@ -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. + +.entity.name.function { + foreground: $blue-300; + fontStyle: italic; +} + +.variable.function { + foreground: $blue-300; +} + +.support.function { + foreground: $purple-a100; + fontStyle: italic; +} diff --git a/schemes/boxy-ocean/markup/_tag.scss b/schemes/candyman/_generic.scss similarity index 85% rename from schemes/boxy-ocean/markup/_tag.scss rename to schemes/candyman/_generic.scss index fa761e8f..4d1bf422 100644 --- a/schemes/boxy-ocean/markup/_tag.scss +++ b/schemes/candyman/_generic.scss @@ -10,10 +10,7 @@ // License for the specific language governing permissions and limitations under // the License. -.entity.name.tag { - foreground: #5fb3b3; -} - -.punctuation.definition.tag { - foreground: #5fb3b3; +.variable.parameter.generic { + foreground: $purple-a100; + fontStyle: none; } diff --git a/schemes/candyman/_json.scss b/schemes/candyman/_json.scss index 9c072955..9d9122c1 100644 --- a/schemes/candyman/_json.scss +++ b/schemes/candyman/_json.scss @@ -10,11 +10,141 @@ // 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"; +.source.json { + // Root. + .punctuation.section.dictionary { + foreground: $purple-200; + } + + // Level 1. + .meta.structure.dictionary { + .meta.structure.dictionary.key { + .string { + foreground: $cyan-300; + + .punctuation.definition.string { + foreground: $cyan-300; + } + } + } + } + + // Level 2. + #{repeatString('.meta.structure.dictionary', 3)} { + .punctuation.section.dictionary { + foreground: $cyan-300; + } + + .meta.structure.dictionary.key { + .string { + foreground: $light-green-300; + + .punctuation.definition.string { + foreground: $light-green-300; + } + } + } + } + + // Level 3. + #{repeatString('.meta.structure.dictionary', 5)} { + .punctuation.section.dictionary { + foreground: $light-green-300; + } + + .meta.structure.dictionary.key { + .string { + foreground: $deep-orange-300; + + .punctuation.definition.string { + foreground: $deep-orange-300; + } + } + } + } + + // Level 4. + #{repeatString('.meta.structure.dictionary', 7)} { + .punctuation.section.dictionary { + foreground: $deep-orange-300; + } + + .meta.structure.dictionary.key { + .string { + foreground: $teal-300; + + .punctuation.definition.string { + foreground: $teal-300; + } + } + } + } + + // Level 5. + #{repeatString('.meta.structure.dictionary', 9)} { + .punctuation.section.dictionary { + foreground: $teal-300; + } + + .meta.structure.dictionary.key { + .string { + foreground: $pink-300; + + .punctuation.definition.string { + foreground: $pink-300; + } + } + } + } + + // Level 6. + #{repeatString('.meta.structure.dictionary', 11)} { + .punctuation.section.dictionary { + foreground: $pink-300; + } + + .meta.structure.dictionary.key { + .string { + foreground: $purple-300; + + .punctuation.definition.string { + foreground: $purple-300; + } + } + } + } + + // Level 7. + #{repeatString('.meta.structure.dictionary', 13)} { + .punctuation.section.dictionary { + foreground: $purple-300; + } + + .meta.structure.dictionary.key { + .string { + foreground: $amber-300; + + .punctuation.definition.string { + foreground: $amber-300; + } + } + } + } + + // Level 8 - n. + #{repeatString('.meta.structure.dictionary', 15)} { + .punctuation.section.dictionary { + foreground: $amber-300; + } + + .meta.structure.dictionary.key { + .string { + foreground: $amber-300; + + .punctuation.definition.string { + foreground: $amber-300; + } + } + } + } +} diff --git a/schemes/candyman/_keyword.scss b/schemes/candyman/_keyword.scss new file mode 100644 index 00000000..9833759c --- /dev/null +++ b/schemes/candyman/_keyword.scss @@ -0,0 +1,110 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// 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-200; + + &.control { + &.conditional { + foreground: $teal-a400; + fontStyle: italic; + } + + &.flow { + foreground: $green-200; + fontStyle: italic; + + &.break.throw { + foreground: $purple-a100; + fontStyle: bold italic; + } + + &.return { + foreground: $purple-a100; + fontStyle: bold italic; + } + } + + &.import-export { + foreground: $pink-200; + fontStyle: none; + + &.as, + &.default, + &.star { + foreground: $deep-purple-200; + } + } + + &.loop { + foreground: $deep-orange-300; + fontStyle: italic; + } + + &.trycatch { + foreground: $red-a200; + fontStyle: italic; + } + } +} + +.keyword.operator { + foreground: $green-a200; + fontStyle: bold; + + &.pipe { + foreground: $light-blue-300; + } + + &.word { + foreground: $cyan-a100; + fontStyle: italic; + + &.of { + foreground: $green-200; + } + } +} + +// .meta.conditional { +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $brown-200; +// fontStyle: none; +// } +// } +// } + +// .punctuation.section.block { +// foreground: $brown-200; +// fontStyle: none; +// } +// } + +// .meta.loop { +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $orange-300; +// fontStyle: none; +// } +// } +// } + +// .punctuation.section.block { +// foreground: $orange-300; +// fontStyle: none; +// } +// } diff --git a/schemes/candyman/_label.scss b/schemes/candyman/_label.scss new file mode 100644 index 00000000..80e4f0fc --- /dev/null +++ b/schemes/candyman/_label.scss @@ -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. + +.variable.other.label, +.entity.name.label { + foreground: $gray-300; + fontStyle: bold; +} diff --git a/schemes/candyman/_main.scss b/schemes/candyman/_main.scss index b56f9ee4..bfb68022 100644 --- a/schemes/candyman/_main.scss +++ b/schemes/candyman/_main.scss @@ -10,8 +10,6 @@ // License for the specific language governing permissions and limitations under // the License. -@import "palette"; - * { background: $blue-gray-900; foreground: $blue-gray-200; @@ -33,52 +31,3 @@ activeGuide: $blue-gray-600; stackGuide: $blue-gray-800; } - -@import "shared/alias"; -@import "shared/ambiguous"; -@import "shared/array"; -@import "shared/cast"; -@import "shared/class"; -@import "shared/color"; -@import "shared/comment"; -@import "shared/constant"; -@import "shared/datetime"; -@import "shared/embedded-expression"; -@import "shared/enumeration"; -@import "shared/function"; -@import "shared/gitgutter"; -@import "shared/interface"; -@import "shared/keyword"; -@import "shared/label"; -@import "shared/modifier"; -@import "shared/namespace"; -@import "shared/number"; -@import "shared/object"; -@import "shared/operator"; -@import "shared/preprocessor"; -@import "shared/punctuation"; -@import "shared/regex"; -@import "shared/string"; -@import "shared/structure"; -@import "shared/template"; -@import "shared/trait"; -@import "shared/type"; -@import "shared/unknown"; -@import "shared/variable"; - -@import "shared/docblock/alias"; -@import "shared/docblock/class"; -@import "shared/docblock/constant"; -@import "shared/docblock/function"; -@import "shared/docblock/import"; -@import "shared/docblock/interface"; -@import "shared/docblock/keyword"; -@import "shared/docblock/modifier"; -@import "shared/docblock/namespace"; -@import "shared/docblock/number"; -@import "shared/docblock/operator"; -@import "shared/docblock/punctuation"; -@import "shared/docblock/string"; -@import "shared/docblock/structure"; -@import "shared/docblock/type"; -@import "shared/docblock/variable"; diff --git a/schemes/candyman/_markup.scss b/schemes/candyman/_markup.scss index 5464ca3b..0ab323d1 100644 --- a/schemes/candyman/_markup.scss +++ b/schemes/candyman/_markup.scss @@ -10,10 +10,11 @@ // 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"; -@import "markup/text"; +.meta.tag { + foreground: $brown-200; +} + +.entity.other.attribute-name { + foreground: $green-200; + fontStyle: italic; +} diff --git a/schemes/candyman/shared/_modifier.scss b/schemes/candyman/_modifier.scss similarity index 81% rename from schemes/candyman/shared/_modifier.scss rename to schemes/candyman/_modifier.scss index 1668eb26..519e6090 100644 --- a/schemes/candyman/shared/_modifier.scss +++ b/schemes/candyman/_modifier.scss @@ -10,9 +10,15 @@ // License for the specific language governing permissions and limitations under // the License. -.storage.modifier { - .keyword, - .keyword.operator { +.storage { + &.modifier, + &.type { foreground: $deep-purple-200; + fontStyle: none; + } + + &.modifier.extends { + foreground: $red-300; + fontStyle: italic; } } diff --git a/schemes/boxy-ocean/markup/_attribute.scss b/schemes/candyman/_namespace.scss similarity index 91% rename from schemes/boxy-ocean/markup/_attribute.scss rename to schemes/candyman/_namespace.scss index 43628307..075a6a43 100644 --- a/schemes/boxy-ocean/markup/_attribute.scss +++ b/schemes/candyman/_namespace.scss @@ -10,6 +10,6 @@ // License for the specific language governing permissions and limitations under // the License. -.entity.name.attribute { - foreground: #c594c5; +.variable.other.namespace { + foreground: $brown-200; } diff --git a/schemes/candyman/_number.scss b/schemes/candyman/_number.scss new file mode 100644 index 00000000..61b86bd6 --- /dev/null +++ b/schemes/candyman/_number.scss @@ -0,0 +1,48 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +.storage.type.numeric { + foreground: $amber-300; +} + +.constant.numeric { + foreground: $amber-300; + fontStyle: none; + + &.float { + foreground: $cyan-300; + .punctuation.defintion { + foreground: $cyan-300; + } + } + + &.binary { + foreground: $deep-orange-300; + .punctuation.definition { + foreground: $deep-orange-300; + } + } + + &.octal { + foreground: $brown-200; + .punctuation.definition { + foreground: $brown-200; + } + } + + &.hex { + foreground: $green-200; + .punctuation.definition { + foreground: $green-200; + } + } +} diff --git a/schemes/bittersweet/markup/_attribute.scss b/schemes/candyman/_object.scss similarity index 91% rename from schemes/bittersweet/markup/_attribute.scss rename to schemes/candyman/_object.scss index 67b1a57f..ee301b68 100644 --- a/schemes/bittersweet/markup/_attribute.scss +++ b/schemes/candyman/_object.scss @@ -10,6 +10,6 @@ // License for the specific language governing permissions and limitations under // the License. -.entity.name.attribute { - foreground: #50fa7b; +.meta.object-literal.key { + foreground: $brown-200; } diff --git a/schemes/monokai/css/_attribute.scss b/schemes/candyman/_punctuation.scss similarity index 62% rename from schemes/monokai/css/_attribute.scss rename to schemes/candyman/_punctuation.scss index 50992af3..fa49d5a5 100644 --- a/schemes/monokai/css/_attribute.scss +++ b/schemes/candyman/_punctuation.scss @@ -10,15 +10,26 @@ // License for the specific language governing permissions and limitations under // the License. -.support { - .entity.name.attribute.css { - foreground: #66d9ef; - fontStyle: italic; - } -} +.punctuation { + &.accessor, + &.separator, + &.terminator { + foreground: $green-a200; + fontStyle: bold; + } -.extension { - .entity.name.attribute.css { - foreground: #66d9ef; + &.separator.key-value { + foreground: $deep-orange-300; + } + + &.definition { + &.tag { + foreground: $brown-300; + fontStyle: none; + } + &.template-expression { + foreground: $deep-orange-300; + fontStyle: bold; } + } } diff --git a/schemes/monokai/_function.scss b/schemes/candyman/_repeatString.scss similarity index 62% rename from schemes/monokai/_function.scss rename to schemes/candyman/_repeatString.scss index 2f45b5aa..59e5204f 100644 --- a/schemes/monokai/_function.scss +++ b/schemes/candyman/_repeatString.scss @@ -2,7 +2,7 @@ // use this file except in compliance with the License. You may obtain a copy of // the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an “AS IS” BASIS, WITHOUT @@ -10,19 +10,20 @@ // License for the specific language governing permissions and limitations under // the License. -.entity.name.function { - foreground: #66d9ef; -} - -.support { - .entity.name.function { - foreground: #66d9ef; +@function repeatString($string, $times, $separator: ' ') { + @if $times <= 0 { + @return ''; } -} -.function.parameter { - .entity.name.variable, - .punctuation.definition.variable { - foreground: #fd971f; + $i: 0; + $result: ''; + @while $i < $times { + @if $i > 0 { + $result: $result + $separator; + } + $result: $result + $string; + $i: $i + 1; } + + @return $result; } diff --git a/schemes/bittersweet/markup/_tag.scss b/schemes/candyman/_string.scss similarity index 84% rename from schemes/bittersweet/markup/_tag.scss rename to schemes/candyman/_string.scss index 1d98f392..6c82a117 100644 --- a/schemes/bittersweet/markup/_tag.scss +++ b/schemes/candyman/_string.scss @@ -10,10 +10,10 @@ // License for the specific language governing permissions and limitations under // the License. -.entity.name.tag { - foreground: #ee88cc; -} +.string { + foreground: $lime-300; -.punctuation.definition.tag { - foreground: #ee88cc; + .punctuation.definition.string { + foreground: $lime-300; + } } diff --git a/schemes/candyman/_type.scss b/schemes/candyman/_type.scss new file mode 100644 index 00000000..25762d64 --- /dev/null +++ b/schemes/candyman/_type.scss @@ -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. + +.entity.name.interface, +.entity.name.type, +.variable.type, +.variable.other.type { + foreground: $light-green-300; +} + +.support.type { + foreground: $deep-purple-a100; + + &.existential.flow, + &.flow { + foreground: $deep-orange-200; + } + + &.object { + fontStyle: italic; + &.console { + foreground: $green-200; + } + } +} + + +// foreground: $light-green-300; + +// .meta.group { +// .punctuation.separator.comma { +// foreground: $green-a200; +// } +// .punctuation.section.group { +// foreground: $amber-100; +// } +// } + +// .meta.function { +// &.parameters { +// .punctuation.section.group { +// foreground: $light-blue-300; +// } +// } + +// .punctuation.section.block { +// foreground: $light-blue-300; +// } +// .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/monokai/_variable.scss b/schemes/candyman/_variable.scss similarity index 59% rename from schemes/monokai/_variable.scss rename to schemes/candyman/_variable.scss index 0c6fcbb8..b4268c4e 100644 --- a/schemes/monokai/_variable.scss +++ b/schemes/candyman/_variable.scss @@ -10,15 +10,36 @@ // License for the specific language governing permissions and limitations under // the License. -.entity.name.variable, +.variable.other, .punctuation.definition.variable { - foreground: #f8f8f2; + foreground: $gray-300; fontStyle: none; } -.support { - .entity.name.variable, - .punctuation.definition.variable { - foreground: #66d9ef; +.entity.name.variable { + foreground: $gray-300; + fontStyle: italic; +} + +.variable { + &.language { + &.prototype, + &.this { + foreground: $red-300; + fontStyle: italic; + } + + &.super { + foreground: $deep-orange-300; + } + + &.this { + foreground: $purple-a100; + fontStyle: italic; + } } } + +.support.variable { + foreground: $deep-orange-a100; +} diff --git a/Bittersweet.scsscheme b/schemes/candyman/class/_body.scss similarity index 66% rename from Bittersweet.scsscheme rename to schemes/candyman/class/_body.scss index fb286023..a815693a 100644 --- a/Bittersweet.scsscheme +++ b/schemes/candyman/class/_body.scss @@ -10,11 +10,16 @@ // License for the specific language governing permissions and limitations under // the License. -@name "Bittersweet"; +// .meta.class { +// .punctuation.section.block { +// foreground: $light-green-300; +// } +// } -@import 'schemes/bittersweet/original'; - -@import 'schemes/bittersweet/function'; -@import 'schemes/bittersweet/markup/attribute'; -@import 'schemes/bittersweet/markup/tag'; -@import 'schemes/bittersweet/support'; +// @for $i from 1 through 7 { +// #{repeatString('.meta.function .meta.class ', $i)} { +// .punctuation.section.block { +// foreground: $light-green-300; +// } +// } +// } diff --git a/schemes/candyman/function/_body.scss b/schemes/candyman/function/_body.scss new file mode 100644 index 00000000..537b5688 --- /dev/null +++ b/schemes/candyman/function/_body.scss @@ -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. + +.storage.type.function.arrow { + foreground: $light-blue-300; + fontStyle: bold; +} + +// .meta.function { +// .punctuation.section.block { +// foreground: $light-blue-300; +// } +// } + +// @for $i from 1 through 7 { +// #{repeatString('.meta.conditional .meta.function', $i)}, +// #{repeatString('.meta.class .meta.function', $i)}, +// #{repeatString('.meta.loop .meta.function', $i)} { +// .punctuation.section.block { +// foreground: $light-blue-300; +// } +// } +// } diff --git a/schemes/candyman/function/_parameters.scss b/schemes/candyman/function/_parameters.scss new file mode 100644 index 00000000..5922ddb2 --- /dev/null +++ b/schemes/candyman/function/_parameters.scss @@ -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. + +.variable.parameter.function { + foreground: $amber-200; +} + +// .meta.function.parameters { +// .punctuation.section.group { +// foreground: $light-blue-300; +// fontStyle: none; +// } +// } + +// // Function parameters of a function inside groups. +// @for $i from 1 through 7 { +// #{repeatString('meta.group', $i)} +// .meta.function.parameters +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $light-blue-300; +// fontStyle: none; +// } +// } +// } +// } diff --git a/schemes/candyman/global/_console.scss b/schemes/candyman/global/_console.scss new file mode 100644 index 00000000..b8d7080e --- /dev/null +++ b/schemes/candyman/global/_console.scss @@ -0,0 +1,67 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// 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.function.console { + &.error { + foreground: $red-300; + } + + &.info { + foreground: $teal-300; + } + + &.log { + foreground: $brown-200; + } + + &.warn { + foreground: $deep-orange-300; + } +} + +// .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; +// } +// } +// } +// } diff --git a/schemes/candyman/global/_jest.scss b/schemes/candyman/global/_jest.scss new file mode 100644 index 00000000..a90a3b3b --- /dev/null +++ b/schemes/candyman/global/_jest.scss @@ -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. + +.support.type.object.jest { + foreground: $red-300; + + &.matcher.not { + foreground: $red-300; + fontStyle: bold; + } +} + +.support.function.jest { + foreground: $red-300; + + &.matcher { + foreground: $deep-orange-300; + } + + &.skip, + &.only { + foreground: $red-300; + background: rgba($deep-orange-300, .1); + fontStyle: bold; + } +} + +// // Global function call punctuation. +// @for $i from 0 through 7 { +// #{repeatString('.meta.function', $i)} +// .meta.function-call.jest +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $pink-300; +// } +// } +// } +// } + +// // Matcher function call punctuation. +// .meta.function-call.jest.matcher +// .meta.group { +// .punctuation { +// &.section.group, +// &.separator.comma { +// foreground: $green-200; +// } +// } +// } diff --git a/schemes/candyman/old.scss b/schemes/candyman/old.scss new file mode 100644 index 00000000..85ce79cc --- /dev/null +++ b/schemes/candyman/old.scss @@ -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. + +@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/_html.scss b/schemes/candyman/old/_html.scss similarity index 100% rename from schemes/candyman/_html.scss rename to schemes/candyman/old/_html.scss diff --git a/schemes/candyman/_js.scss b/schemes/candyman/old/_js.scss similarity index 100% rename from schemes/candyman/_js.scss rename to schemes/candyman/old/_js.scss diff --git a/schemes/bittersweet/_function.scss b/schemes/candyman/old/_json.scss similarity index 75% rename from schemes/bittersweet/_function.scss rename to schemes/candyman/old/_json.scss index 77291f68..9c072955 100644 --- a/schemes/bittersweet/_function.scss +++ b/schemes/candyman/old/_json.scss @@ -10,12 +10,11 @@ // License for the specific language governing permissions and limitations under // the License. -.entity.name.function, -.keyword.operator.other.computed-function, -.punctuation.definition.function { - foreground: #63c9ec; -} - -.keyword.modifier.generator { - foreground: #63c9ec; -} +@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/_jsx.scss b/schemes/candyman/old/_jsx.scss similarity index 100% rename from schemes/candyman/_jsx.scss rename to schemes/candyman/old/_jsx.scss diff --git a/schemes/candyman/old/_markup.scss b/schemes/candyman/old/_markup.scss new file mode 100644 index 00000000..5464ca3b --- /dev/null +++ b/schemes/candyman/old/_markup.scss @@ -0,0 +1,19 @@ +// Licensed under the Apache License, Version 2.0 (the “License”); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +// 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"; +@import "markup/text"; diff --git a/schemes/candyman/_md.scss b/schemes/candyman/old/_md.scss similarity index 100% rename from schemes/candyman/_md.scss rename to schemes/candyman/old/_md.scss diff --git a/schemes/candyman/_mql.scss b/schemes/candyman/old/_mql.scss similarity index 100% rename from schemes/candyman/_mql.scss rename to schemes/candyman/old/_mql.scss diff --git a/schemes/candyman/_scss.scss b/schemes/candyman/old/_scss.scss similarity index 100% rename from schemes/candyman/_scss.scss rename to schemes/candyman/old/_scss.scss diff --git a/schemes/candyman/html/_embedded.scss b/schemes/candyman/old/html/_embedded.scss similarity index 100% rename from schemes/candyman/html/_embedded.scss rename to schemes/candyman/old/html/_embedded.scss diff --git a/schemes/candyman/html/_form.scss b/schemes/candyman/old/html/_form.scss similarity index 100% rename from schemes/candyman/html/_form.scss rename to schemes/candyman/old/html/_form.scss diff --git a/schemes/candyman/html/_other.scss b/schemes/candyman/old/html/_other.scss similarity index 100% rename from schemes/candyman/html/_other.scss rename to schemes/candyman/old/html/_other.scss diff --git a/schemes/candyman/html/_sectioning-root.scss b/schemes/candyman/old/html/_sectioning-root.scss similarity index 100% rename from schemes/candyman/html/_sectioning-root.scss rename to schemes/candyman/old/html/_sectioning-root.scss diff --git a/schemes/candyman/html/_sectioning.scss b/schemes/candyman/old/html/_sectioning.scss similarity index 100% rename from schemes/candyman/html/_sectioning.scss rename to schemes/candyman/old/html/_sectioning.scss diff --git a/schemes/candyman/html/_style.scss b/schemes/candyman/old/html/_style.scss similarity index 100% rename from schemes/candyman/html/_style.scss rename to schemes/candyman/old/html/_style.scss diff --git a/schemes/candyman/js/_decorator.scss b/schemes/candyman/old/js/_decorator.scss similarity index 100% rename from schemes/candyman/js/_decorator.scss rename to schemes/candyman/old/js/_decorator.scss diff --git a/schemes/candyman/js/_destructuring.scss b/schemes/candyman/old/js/_destructuring.scss similarity index 100% rename from schemes/candyman/js/_destructuring.scss rename to schemes/candyman/old/js/_destructuring.scss diff --git a/schemes/candyman/js/_eslint.scss b/schemes/candyman/old/js/_eslint.scss similarity index 100% rename from schemes/candyman/js/_eslint.scss rename to schemes/candyman/old/js/_eslint.scss diff --git a/schemes/candyman/js/_export.scss b/schemes/candyman/old/js/_export.scss similarity index 100% rename from schemes/candyman/js/_export.scss rename to schemes/candyman/old/js/_export.scss diff --git a/schemes/candyman/js/_import.scss b/schemes/candyman/old/js/_import.scss similarity index 100% rename from schemes/candyman/js/_import.scss rename to schemes/candyman/old/js/_import.scss diff --git a/schemes/candyman/js/_operator.scss b/schemes/candyman/old/js/_operator.scss similarity index 100% rename from schemes/candyman/js/_operator.scss rename to schemes/candyman/old/js/_operator.scss diff --git a/schemes/candyman/js/flowtype/_module.scss b/schemes/candyman/old/js/flowtype/_module.scss similarity index 100% rename from schemes/candyman/js/flowtype/_module.scss rename to schemes/candyman/old/js/flowtype/_module.scss diff --git a/schemes/candyman/js/flowtype/_operator.scss b/schemes/candyman/old/js/flowtype/_operator.scss similarity index 100% rename from schemes/candyman/js/flowtype/_operator.scss rename to schemes/candyman/old/js/flowtype/_operator.scss diff --git a/schemes/candyman/js/flowtype/_punctuation.scss b/schemes/candyman/old/js/flowtype/_punctuation.scss similarity index 100% rename from schemes/candyman/js/flowtype/_punctuation.scss rename to schemes/candyman/old/js/flowtype/_punctuation.scss diff --git a/schemes/candyman/json/_level1.scss b/schemes/candyman/old/json/_level1.scss similarity index 100% rename from schemes/candyman/json/_level1.scss rename to schemes/candyman/old/json/_level1.scss diff --git a/schemes/candyman/json/_level2.scss b/schemes/candyman/old/json/_level2.scss similarity index 100% rename from schemes/candyman/json/_level2.scss rename to schemes/candyman/old/json/_level2.scss diff --git a/schemes/candyman/json/_level3.scss b/schemes/candyman/old/json/_level3.scss similarity index 100% rename from schemes/candyman/json/_level3.scss rename to schemes/candyman/old/json/_level3.scss diff --git a/schemes/candyman/json/_level4.scss b/schemes/candyman/old/json/_level4.scss similarity index 100% rename from schemes/candyman/json/_level4.scss rename to schemes/candyman/old/json/_level4.scss diff --git a/schemes/candyman/json/_level5.scss b/schemes/candyman/old/json/_level5.scss similarity index 100% rename from schemes/candyman/json/_level5.scss rename to schemes/candyman/old/json/_level5.scss diff --git a/schemes/candyman/json/_level6.scss b/schemes/candyman/old/json/_level6.scss similarity index 100% rename from schemes/candyman/json/_level6.scss rename to schemes/candyman/old/json/_level6.scss diff --git a/schemes/candyman/json/_level7.scss b/schemes/candyman/old/json/_level7.scss similarity index 100% rename from schemes/candyman/json/_level7.scss rename to schemes/candyman/old/json/_level7.scss diff --git a/schemes/candyman/json/_operator.scss b/schemes/candyman/old/json/_operator.scss similarity index 100% rename from schemes/candyman/json/_operator.scss rename to schemes/candyman/old/json/_operator.scss diff --git a/schemes/candyman/jsx/_component.scss b/schemes/candyman/old/jsx/_component.scss similarity index 100% rename from schemes/candyman/jsx/_component.scss rename to schemes/candyman/old/jsx/_component.scss diff --git a/schemes/candyman/jsx/_operator.scss b/schemes/candyman/old/jsx/_operator.scss similarity index 100% rename from schemes/candyman/jsx/_operator.scss rename to schemes/candyman/old/jsx/_operator.scss diff --git a/schemes/candyman/markup/_attribute.scss b/schemes/candyman/old/markup/_attribute.scss similarity index 100% rename from schemes/candyman/markup/_attribute.scss rename to schemes/candyman/old/markup/_attribute.scss diff --git a/schemes/candyman/markup/_cdata.scss b/schemes/candyman/old/markup/_cdata.scss similarity index 100% rename from schemes/candyman/markup/_cdata.scss rename to schemes/candyman/old/markup/_cdata.scss diff --git a/schemes/candyman/markup/_data-attribute.scss b/schemes/candyman/old/markup/_data-attribute.scss similarity index 100% rename from schemes/candyman/markup/_data-attribute.scss rename to schemes/candyman/old/markup/_data-attribute.scss diff --git a/schemes/candyman/markup/_doctype.scss b/schemes/candyman/old/markup/_doctype.scss similarity index 100% rename from schemes/candyman/markup/_doctype.scss rename to schemes/candyman/old/markup/_doctype.scss diff --git a/schemes/candyman/markup/_operator.scss b/schemes/candyman/old/markup/_operator.scss similarity index 100% rename from schemes/candyman/markup/_operator.scss rename to schemes/candyman/old/markup/_operator.scss diff --git a/schemes/candyman/markup/_prolog.scss b/schemes/candyman/old/markup/_prolog.scss similarity index 100% rename from schemes/candyman/markup/_prolog.scss rename to schemes/candyman/old/markup/_prolog.scss diff --git a/schemes/candyman/markup/_text.scss b/schemes/candyman/old/markup/_text.scss similarity index 100% rename from schemes/candyman/markup/_text.scss rename to schemes/candyman/old/markup/_text.scss diff --git a/schemes/candyman/md/_code-block.scss b/schemes/candyman/old/md/_code-block.scss similarity index 100% rename from schemes/candyman/md/_code-block.scss rename to schemes/candyman/old/md/_code-block.scss diff --git a/schemes/candyman/md/_header.scss b/schemes/candyman/old/md/_header.scss similarity index 100% rename from schemes/candyman/md/_header.scss rename to schemes/candyman/old/md/_header.scss diff --git a/schemes/candyman/mql/_property.scss b/schemes/candyman/old/mql/_property.scss similarity index 100% rename from schemes/candyman/mql/_property.scss rename to schemes/candyman/old/mql/_property.scss diff --git a/schemes/candyman/scss/_attribute.scss b/schemes/candyman/old/scss/_attribute.scss similarity index 100% rename from schemes/candyman/scss/_attribute.scss rename to schemes/candyman/old/scss/_attribute.scss diff --git a/schemes/candyman/scss/_mixin.scss b/schemes/candyman/old/scss/_mixin.scss similarity index 100% rename from schemes/candyman/scss/_mixin.scss rename to schemes/candyman/old/scss/_mixin.scss diff --git a/schemes/candyman/scss/_operator.scss b/schemes/candyman/old/scss/_operator.scss similarity index 94% rename from schemes/candyman/scss/_operator.scss rename to schemes/candyman/old/scss/_operator.scss index 40d4b406..b5cf5103 100644 --- a/schemes/candyman/scss/_operator.scss +++ b/schemes/candyman/old/scss/_operator.scss @@ -13,7 +13,7 @@ .source.scss { .keyword.operator.other.comma, .keyword.operator.other.association, - .keyword.operator.other.terminator { + .keyword.other.terminator { foreground: $gray-0; } } diff --git a/schemes/candyman/scss/_punctuation.scss b/schemes/candyman/old/scss/_punctuation.scss similarity index 100% rename from schemes/candyman/scss/_punctuation.scss rename to schemes/candyman/old/scss/_punctuation.scss diff --git a/schemes/candyman/scss/_unit.scss b/schemes/candyman/old/scss/_unit.scss similarity index 100% rename from schemes/candyman/scss/_unit.scss rename to schemes/candyman/old/scss/_unit.scss diff --git a/schemes/candyman/scss/_variable.scss b/schemes/candyman/old/scss/_variable.scss similarity index 100% rename from schemes/candyman/scss/_variable.scss rename to schemes/candyman/old/scss/_variable.scss diff --git a/schemes/candyman/scss/selector/_base.scss b/schemes/candyman/old/scss/selector/_base.scss similarity index 100% rename from schemes/candyman/scss/selector/_base.scss rename to schemes/candyman/old/scss/selector/_base.scss diff --git a/schemes/candyman/scss/selector/_class.scss b/schemes/candyman/old/scss/selector/_class.scss similarity index 100% rename from schemes/candyman/scss/selector/_class.scss rename to schemes/candyman/old/scss/selector/_class.scss diff --git a/schemes/candyman/scss/selector/_id.scss b/schemes/candyman/old/scss/selector/_id.scss similarity index 100% rename from schemes/candyman/scss/selector/_id.scss rename to schemes/candyman/old/scss/selector/_id.scss diff --git a/schemes/candyman/scss/selector/_placeholder.scss b/schemes/candyman/old/scss/selector/_placeholder.scss similarity index 100% rename from schemes/candyman/scss/selector/_placeholder.scss rename to schemes/candyman/old/scss/selector/_placeholder.scss diff --git a/schemes/candyman/scss/selector/_tag.scss b/schemes/candyman/old/scss/selector/_tag.scss similarity index 100% rename from schemes/candyman/scss/selector/_tag.scss rename to schemes/candyman/old/scss/selector/_tag.scss diff --git a/schemes/candyman/shared/_alias.scss b/schemes/candyman/old/shared/_alias.scss similarity index 100% rename from schemes/candyman/shared/_alias.scss rename to schemes/candyman/old/shared/_alias.scss diff --git a/schemes/candyman/shared/_ambiguous.scss b/schemes/candyman/old/shared/_ambiguous.scss similarity index 100% rename from schemes/candyman/shared/_ambiguous.scss rename to schemes/candyman/old/shared/_ambiguous.scss diff --git a/schemes/candyman/shared/_array.scss b/schemes/candyman/old/shared/_array.scss similarity index 100% rename from schemes/candyman/shared/_array.scss rename to schemes/candyman/old/shared/_array.scss diff --git a/schemes/candyman/shared/_block-cursor.scss b/schemes/candyman/old/shared/_block-cursor.scss similarity index 100% rename from schemes/candyman/shared/_block-cursor.scss rename to schemes/candyman/old/shared/_block-cursor.scss diff --git a/schemes/candyman/shared/_cast.scss b/schemes/candyman/old/shared/_cast.scss similarity index 100% rename from schemes/candyman/shared/_cast.scss rename to schemes/candyman/old/shared/_cast.scss diff --git a/schemes/candyman/shared/_class.scss b/schemes/candyman/old/shared/_class.scss similarity index 100% rename from schemes/candyman/shared/_class.scss rename to schemes/candyman/old/shared/_class.scss diff --git a/schemes/candyman/shared/_color.scss b/schemes/candyman/old/shared/_color.scss similarity index 100% rename from schemes/candyman/shared/_color.scss rename to schemes/candyman/old/shared/_color.scss diff --git a/schemes/candyman/shared/_comment.scss b/schemes/candyman/old/shared/_comment.scss similarity index 100% rename from schemes/candyman/shared/_comment.scss rename to schemes/candyman/old/shared/_comment.scss diff --git a/schemes/candyman/shared/_constant.scss b/schemes/candyman/old/shared/_constant.scss similarity index 100% rename from schemes/candyman/shared/_constant.scss rename to schemes/candyman/old/shared/_constant.scss diff --git a/schemes/candyman/shared/_datetime.scss b/schemes/candyman/old/shared/_datetime.scss similarity index 100% rename from schemes/candyman/shared/_datetime.scss rename to schemes/candyman/old/shared/_datetime.scss diff --git a/schemes/candyman/shared/_embedded-expression.scss b/schemes/candyman/old/shared/_embedded-expression.scss similarity index 100% rename from schemes/candyman/shared/_embedded-expression.scss rename to schemes/candyman/old/shared/_embedded-expression.scss diff --git a/schemes/candyman/shared/_enumeration.scss b/schemes/candyman/old/shared/_enumeration.scss similarity index 100% rename from schemes/candyman/shared/_enumeration.scss rename to schemes/candyman/old/shared/_enumeration.scss diff --git a/schemes/candyman/shared/_function.scss b/schemes/candyman/old/shared/_function.scss similarity index 92% rename from schemes/candyman/shared/_function.scss rename to schemes/candyman/old/shared/_function.scss index 5360e8c9..164c1f4b 100644 --- a/schemes/candyman/shared/_function.scss +++ b/schemes/candyman/old/shared/_function.scss @@ -10,6 +10,12 @@ // 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 { diff --git a/schemes/candyman/shared/_gitgutter.scss b/schemes/candyman/old/shared/_gitgutter.scss similarity index 100% rename from schemes/candyman/shared/_gitgutter.scss rename to schemes/candyman/old/shared/_gitgutter.scss diff --git a/schemes/candyman/shared/_interface.scss b/schemes/candyman/old/shared/_interface.scss similarity index 100% rename from schemes/candyman/shared/_interface.scss rename to schemes/candyman/old/shared/_interface.scss diff --git a/schemes/candyman/shared/_keyword.scss b/schemes/candyman/old/shared/_keyword.scss similarity index 80% rename from schemes/candyman/shared/_keyword.scss rename to schemes/candyman/old/shared/_keyword.scss index 818b74ef..158305cc 100644 --- a/schemes/candyman/shared/_keyword.scss +++ b/schemes/candyman/old/shared/_keyword.scss @@ -14,7 +14,16 @@ 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/shared/_label.scss b/schemes/candyman/old/shared/_label.scss similarity index 100% rename from schemes/candyman/shared/_label.scss rename to schemes/candyman/old/shared/_label.scss diff --git a/schemes/candyman/shared/_namespace.scss b/schemes/candyman/old/shared/_namespace.scss similarity index 100% rename from schemes/candyman/shared/_namespace.scss rename to schemes/candyman/old/shared/_namespace.scss diff --git a/schemes/candyman/shared/_number.scss b/schemes/candyman/old/shared/_number.scss similarity index 100% rename from schemes/candyman/shared/_number.scss rename to schemes/candyman/old/shared/_number.scss diff --git a/schemes/candyman/shared/_object.scss b/schemes/candyman/old/shared/_object.scss similarity index 100% rename from schemes/candyman/shared/_object.scss rename to schemes/candyman/old/shared/_object.scss diff --git a/schemes/candyman/shared/_operator.scss b/schemes/candyman/old/shared/_operator.scss similarity index 100% rename from schemes/candyman/shared/_operator.scss rename to schemes/candyman/old/shared/_operator.scss diff --git a/schemes/candyman/shared/_preprocessor.scss b/schemes/candyman/old/shared/_preprocessor.scss similarity index 100% rename from schemes/candyman/shared/_preprocessor.scss rename to schemes/candyman/old/shared/_preprocessor.scss diff --git a/schemes/candyman/shared/_punctuation.scss b/schemes/candyman/old/shared/_punctuation.scss similarity index 89% rename from schemes/candyman/shared/_punctuation.scss rename to schemes/candyman/old/shared/_punctuation.scss index 863ec0ea..8991a6e1 100644 --- a/schemes/candyman/shared/_punctuation.scss +++ b/schemes/candyman/old/shared/_punctuation.scss @@ -14,10 +14,11 @@ foreground: $amber-100; } -.punctuation.definition.expression.group.b { - foreground: $brown-200; +.punctuation.other.property.access { + foreground: $light-green-300; } +.punctuation.definition.block, .punctuation.definition.control { foreground: $pink-a100; } diff --git a/schemes/candyman/shared/_regex.scss b/schemes/candyman/old/shared/_regex.scss similarity index 100% rename from schemes/candyman/shared/_regex.scss rename to schemes/candyman/old/shared/_regex.scss diff --git a/schemes/candyman/shared/_string.scss b/schemes/candyman/old/shared/_string.scss similarity index 100% rename from schemes/candyman/shared/_string.scss rename to schemes/candyman/old/shared/_string.scss diff --git a/schemes/candyman/shared/_structure.scss b/schemes/candyman/old/shared/_structure.scss similarity index 100% rename from schemes/candyman/shared/_structure.scss rename to schemes/candyman/old/shared/_structure.scss diff --git a/schemes/candyman/shared/_template.scss b/schemes/candyman/old/shared/_template.scss similarity index 100% rename from schemes/candyman/shared/_template.scss rename to schemes/candyman/old/shared/_template.scss diff --git a/schemes/candyman/shared/_trait.scss b/schemes/candyman/old/shared/_trait.scss similarity index 100% rename from schemes/candyman/shared/_trait.scss rename to schemes/candyman/old/shared/_trait.scss diff --git a/schemes/candyman/shared/_type.scss b/schemes/candyman/old/shared/_type.scss similarity index 100% rename from schemes/candyman/shared/_type.scss rename to schemes/candyman/old/shared/_type.scss diff --git a/schemes/candyman/shared/_unknown.scss b/schemes/candyman/old/shared/_unknown.scss similarity index 100% rename from schemes/candyman/shared/_unknown.scss rename to schemes/candyman/old/shared/_unknown.scss diff --git a/schemes/candyman/shared/_variable.scss b/schemes/candyman/old/shared/_variable.scss similarity index 100% rename from schemes/candyman/shared/_variable.scss rename to schemes/candyman/old/shared/_variable.scss diff --git a/schemes/candyman/shared/docblock/_alias.scss b/schemes/candyman/old/shared/docblock/_alias.scss similarity index 100% rename from schemes/candyman/shared/docblock/_alias.scss rename to schemes/candyman/old/shared/docblock/_alias.scss diff --git a/schemes/candyman/shared/docblock/_class.scss b/schemes/candyman/old/shared/docblock/_class.scss similarity index 100% rename from schemes/candyman/shared/docblock/_class.scss rename to schemes/candyman/old/shared/docblock/_class.scss diff --git a/schemes/candyman/shared/docblock/_constant.scss b/schemes/candyman/old/shared/docblock/_constant.scss similarity index 100% rename from schemes/candyman/shared/docblock/_constant.scss rename to schemes/candyman/old/shared/docblock/_constant.scss diff --git a/schemes/candyman/shared/docblock/_function.scss b/schemes/candyman/old/shared/docblock/_function.scss similarity index 100% rename from schemes/candyman/shared/docblock/_function.scss rename to schemes/candyman/old/shared/docblock/_function.scss diff --git a/schemes/candyman/shared/docblock/_import.scss b/schemes/candyman/old/shared/docblock/_import.scss similarity index 100% rename from schemes/candyman/shared/docblock/_import.scss rename to schemes/candyman/old/shared/docblock/_import.scss diff --git a/schemes/candyman/shared/docblock/_interface.scss b/schemes/candyman/old/shared/docblock/_interface.scss similarity index 100% rename from schemes/candyman/shared/docblock/_interface.scss rename to schemes/candyman/old/shared/docblock/_interface.scss diff --git a/schemes/candyman/shared/docblock/_keyword.scss b/schemes/candyman/old/shared/docblock/_keyword.scss similarity index 100% rename from schemes/candyman/shared/docblock/_keyword.scss rename to schemes/candyman/old/shared/docblock/_keyword.scss diff --git a/schemes/candyman/shared/docblock/_modifier.scss b/schemes/candyman/old/shared/docblock/_modifier.scss similarity index 100% rename from schemes/candyman/shared/docblock/_modifier.scss rename to schemes/candyman/old/shared/docblock/_modifier.scss diff --git a/schemes/candyman/shared/docblock/_namespace.scss b/schemes/candyman/old/shared/docblock/_namespace.scss similarity index 100% rename from schemes/candyman/shared/docblock/_namespace.scss rename to schemes/candyman/old/shared/docblock/_namespace.scss diff --git a/schemes/candyman/shared/docblock/_number.scss b/schemes/candyman/old/shared/docblock/_number.scss similarity index 100% rename from schemes/candyman/shared/docblock/_number.scss rename to schemes/candyman/old/shared/docblock/_number.scss diff --git a/schemes/candyman/shared/docblock/_operator.scss b/schemes/candyman/old/shared/docblock/_operator.scss similarity index 100% rename from schemes/candyman/shared/docblock/_operator.scss rename to schemes/candyman/old/shared/docblock/_operator.scss diff --git a/schemes/candyman/shared/docblock/_punctuation.scss b/schemes/candyman/old/shared/docblock/_punctuation.scss similarity index 100% rename from schemes/candyman/shared/docblock/_punctuation.scss rename to schemes/candyman/old/shared/docblock/_punctuation.scss diff --git a/schemes/candyman/shared/docblock/_string.scss b/schemes/candyman/old/shared/docblock/_string.scss similarity index 100% rename from schemes/candyman/shared/docblock/_string.scss rename to schemes/candyman/old/shared/docblock/_string.scss diff --git a/schemes/candyman/shared/docblock/_structure.scss b/schemes/candyman/old/shared/docblock/_structure.scss similarity index 100% rename from schemes/candyman/shared/docblock/_structure.scss rename to schemes/candyman/old/shared/docblock/_structure.scss diff --git a/schemes/candyman/shared/docblock/_type.scss b/schemes/candyman/old/shared/docblock/_type.scss similarity index 100% rename from schemes/candyman/shared/docblock/_type.scss rename to schemes/candyman/old/shared/docblock/_type.scss diff --git a/schemes/candyman/shared/docblock/_variable.scss b/schemes/candyman/old/shared/docblock/_variable.scss similarity index 100% rename from schemes/candyman/shared/docblock/_variable.scss rename to schemes/candyman/old/shared/docblock/_variable.scss diff --git a/schemes/monokai/_original.scss b/schemes/monokai/_original.scss deleted file mode 100644 index 990d9d4f..00000000 --- a/schemes/monokai/_original.scss +++ /dev/null @@ -1,164 +0,0 @@ -* { - activeGuide: #9D550FB0; - background: #272822; - bracketContentsForeground: #F8F8F2A5; - bracketContentsOptions: underline; - bracketsForeground: #F8F8F2A5; - bracketsOptions: underline; - caret: #F8F8F0; - findHighlight: #FFE792; - findHighlightForeground: #000000; - foreground: #F8F8F2; - invisibles: #3B3A32; - lineHighlight: #3E3D32; - selection: #49483E; - selectionBorder: #222218; - tagsOptions: stippled_underline; -} - -comment { - foreground: #75715E; -} - -string { - foreground: #E6DB74; -} - -constant.numeric { - foreground: #AE81FF; -} - -constant.language { - foreground: #AE81FF; -} - -constant.character, -constant.other { - foreground: #AE81FF; -} - -variable { - fontStyle: none; -} - -keyword \- \(source.c keyword.operator \| source.cpp keyword.operator \| source.objc keyword.operator \| source.objcpp keyword.operator\), -keyword.operator.word { - foreground: #F92672; -} - -variable.other.dollar.only.js { - foreground: #F92672; -} - -storage { - fontStyle: none; - foreground: #F92672; -} - -storage.type { - fontStyle: italic; - foreground: #66D9EF; -} - -entity.name \- \(entity.name.filename \| entity.name.section \| entity.name.tag \| entity.name.label\) { - fontStyle: none; - foreground: #A6E22E; -} - -entity.other.inherited-class { - fontStyle: italic underline; - foreground: #A6E22E; -} - -variable.parameter \- \(source.c \| source.cpp \| source.objc \| source.objcpp\) { - fontStyle: italic; - foreground: #FD971F; -} - -variable.language { - fontStyle: italic; - foreground: #FD971F; -} - -entity.name.tag { - fontStyle: none; - foreground: #F92672; -} - -entity.other.attribute-name { - fontStyle: none; - foreground: #A6E22E; -} - -variable.function { - fontStyle: none; - foreground: #66D9EF; -} - -support.function { - fontStyle: none; - foreground: #66D9EF; -} - -support.constant { - fontStyle: none; - foreground: #66D9EF; -} - -support.type, -support.class { - fontStyle: italic; - foreground: #66D9EF; -} - -support.other.variable { - fontStyle: none; -} - -invalid { - fontStyle: none; - foreground: #F8F8F0; - background: #F92672; -} - -invalid.deprecated { - foreground: #F8F8F0; - background: #AE81FF; -} - -meta.structure.dictionary.json string.quoted.double.json { - foreground: #CFCFC2; -} - -string.unquoted.yaml { - foreground: #F8F8F2; -} - -meta.diff, -meta.diff.header { - foreground: #75715E; -} - -markup.deleted { - foreground: #F92672; -} - -markup.inserted { - foreground: #A6E22E; -} - -markup.changed { - foreground: #E6DB74; -} - -constant.numeric.line-number.find-in-files \- match { - foreground: #AE81FFA0; -} - -entity.name.filename { - foreground: #E6DB74; -} - -message.error { - foreground: #F83333; -} diff --git a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax index c61968c9..d9ac9d04 100644 --- a/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.no-pop.sublime-syntax @@ -22,18 +22,28 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? [^<>]* >) + genericParameters: "{{genericArguments}}" + parameters: | (\( - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \g<-1>? - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \)) flowOperators: | @@ -42,15 +52,15 @@ variables: ) string: | - (?> '.*?' - | ".*?" - | `.*` + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` ) simpleFlowType: | (?> {{string}} | {{commonIdentifier}} - {{templateArguments}}? + {{genericArguments}}? ) flowFunction: | @@ -74,121 +84,39 @@ variables: flowComment: /\*\s*:.*?\*/ - returnType: | + type: | (?> {{flowComment}} - | (?::{{complexType}}) - )? + | :{{complexType}} + ) contexts: main: - # Normal arrow function assigned to variable/constant. - - match: | - (?xi) - \s*((?>const|let|var)\b)? - \s*({{commonIdentifier}}) - \s*(=) - \s*(async)? - (?= - \s*{{templateArguments}}? - \s*{{parameters}} - \s*{{returnType}} - \s*=> - ) - captures: - 1: >- - storage.type.js.fjsx15 - keyword.declaration.variable.js.fjsx15 - 2: entity.name.function.js.fjsx15 - 3: punctuation.definition.function.assignment.js.fjsx1 - 4: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - push: [ - body, - template-and-parameters - ] - # Single parameter arrow function assigned to variable. - - match: | - (?xi) - \s*((?>const|let|var)\b)? - \s*({{commonIdentifier}}) - \s*(=) - \s*(async)? - (?= - \s*{{commonIdentifier}} - \s*{{returnType}} - \s*=> - ) - captures: - 1: >- - storage.type.js.fjsx15 - keyword.declaration.variable.js.fjsx15 - 2: entity.name.function.js.fjsx15 - 3: punctuation.definition.function.assignment.js.fjsx1 - 4: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - push: [ - body, - single-parameter - ] # Normal arrow function. - match: | (?xi) - \s*(async)? (?= - \s*{{templateArguments}}? + (?:\s*async)? + \s*{{genericParameters}}? \s*{{parameters}} - \s*{{returnType}} + \s*{{type}}? \s*=> ) - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - push: [ - body, - template-and-parameters - ] + push: normal-arrow-function # Single parameter. - match: | (?xi) - \s*(async)? (?= + (?:\s*async)? \s*{{commonIdentifier}} - \s*{{returnType}} + \s*{{type}}? \s*=> ) - captures: - 1: keyword.other.async.js.fjsx15 - push: [ - body, - single-parameter - ] - - single-parameter: - - match: (?=\s*=>) - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - # Parameter. - - match: | - (?xi) - ({{commonIdentifier}})(\?)? - captures: - 0: function.parameter.js.fjsx15 - 1: entity.name.variable.js.fjsx15 - 2: keyword.operator.other.optional.flowtype - pop: true - - template-and-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax - - match: "" - pop: true - - body: - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + 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 index 00a3c02a..c7c6e8d9 100644 --- a/syntaxes/fjsx15/arrow-function.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function.sublime-syntax @@ -22,7 +22,7 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? @@ -31,9 +31,17 @@ variables: parameters: | (\( - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \g<-1>? - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \)) flowOperators: | @@ -42,15 +50,15 @@ variables: ) string: | - (?> '.*?' - | ".*?" - | `.*` + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` ) simpleFlowType: | (?> {{string}} | {{commonIdentifier}} - {{templateArguments}}? + {{genericArguments}}? ) flowFunction: | @@ -74,121 +82,44 @@ variables: flowComment: /\*\s*:.*?\*/ - returnType: | + type: | (?> {{flowComment}} - | (?::{{complexType}}) - )? + | :{{complexType}} + ) contexts: main: - # Normal arrow function assigned to variable/constant. - - match: | - (?xi) - \s*((?>const|let|var)\b)? - \s*({{commonIdentifier}}) - \s*(=) - \s*(async)? - (?= - \s*{{templateArguments}}? - \s*{{parameters}} - \s*{{returnType}} - \s*=> - ) - captures: - 1: >- - storage.type.js.fjsx15 - keyword.declaration.variable.js.fjsx15 - 2: entity.name.function.js.fjsx15 - 3: punctuation.definition.function.assignment.js.fjsx1 - 4: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - set: [ - body, - template-and-parameters - ] - # Single parameter arrow function assigned to variable. - - match: | - (?xi) - \s*((?>const|let|var)\b)? - \s*({{commonIdentifier}}) - \s*(=) - \s*(async)? - (?= - \s*{{commonIdentifier}} - \s*{{returnType}} - \s*=> - ) - captures: - 1: >- - storage.type.js.fjsx15 - keyword.declaration.variable.js.fjsx15 - 2: entity.name.function.js.fjsx15 - 3: punctuation.definition.function.assignment.js.fjsx1 - 4: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - set: [ - body, - single-parameter - ] # Normal arrow function. - match: | (?xi) - \s*(async)? (?= - \s*{{templateArguments}}? + (?:\s*async)? + \s*{{genericArguments}}? \s*{{parameters}} - \s*{{returnType}} + \s*{{type}}? \s*=> ) - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - set: [ - body, - template-and-parameters - ] + set: normal-arrow-function # Single parameter. - match: | (?xi) - \s*(async)? (?= + (?:\s*async)? \s*{{commonIdentifier}} - \s*{{returnType}} + \s*{{type}}? \s*=> ) - captures: - 1: keyword.other.async.js.fjsx15 - set: [ - body, - single-parameter - ] - - single-parameter: - - match: (?=\s*=>) - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - # Parameter. - - match: | - (?xi) - ({{commonIdentifier}})(\?)? - captures: - 0: function.parameter.js.fjsx15 - 1: entity.name.variable.js.fjsx15 - 2: keyword.operator.other.optional.flowtype - pop: true - - template-and-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax - - match: "" - pop: true - - body: + 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/parameters.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 index 5ac38dc6..b5b1f8ef 100644 --- a/syntaxes/fjsx15/arrow-function/body.sublime-syntax +++ b/syntaxes/fjsx15/arrow-function/body.sublime-syntax @@ -19,41 +19,38 @@ scope: ... contexts: main: - - match: | - (?x) - \s*(=>) + - match: \s*(=>) captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.body.arrow.js.fjsx15 + 1: storage.type.function.arrow.js.fjsx15 set: possible-multi-statement-body possible-multi-statement-body: - - include: comment + - include: comment-no-pop - match: \s*(\{) captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.body.begin.js.fjsx15 - set: multi-statement-body - - match: (?=\s*\S) - pop: true - - multi-statement-body: + 1: punctuation.section.block.begin.js.fjsx15 + set: close-body + - include: optional-expression + + close-body: + - meta_scope: >- + meta.function.js.fjsx15 + meta.block.js.fjsx15 - match: \s*(}) captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.body.end.js.fjsx15 - pop: true + 1: punctuation.section.block.end.js.fjsx15 + set: optional-expression-tail - match: "" - push: - - include: statement-and-expression - - match: "" - pop: true + push: optional-statements-and-expressions - comment: + optional-statements-and-expressions: + - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax + + comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.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 diff --git a/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax b/syntaxes/fjsx15/arrow-function/parameters.sublime-syntax deleted file mode 100644 index 4d8e09b5..00000000 --- a/syntaxes/fjsx15/arrow-function/parameters.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: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - match: \s*(\() - captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.parameters.begin.js.fjsx15 - set: parameters - - parameters: - - match: \s*(\,) - captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.parameters.js.fjsx15 - - match: \s*(\)) - captures: - 1: >- - arrow.js.fjsx15 - punctuation.definition.function.parameters.end.js.fjsx15 - set: return-type - - match: "" - push: - - match: | - (?x) - (?=\s*(?>,|\))) - pop: true - - include: comment - - include: rest-operator - # Parameter type. - - match: (?=\s*:) - set: associated-type - # Default value. - - match: (?=\s*=) - set: default-value - # Object destructuring. - - match: (?=\s*\{) - set: destructuring-object - # Array destructuring. - - match: (?=\s*\[) - set: destructuring-array - # Reserved word. - - match: \s*(arguments)(?=\W) - captures: - 1: keyword.other.js.fjsx15 - pop: true - # Parameter. - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/simple.sublime-syntax - - associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - default-value: - - match: | - (?x) - (?=\s*(?>,|\))) - pop: true - - match: "" - push: - - include: statement-and-expression - - match: "" - pop: true - - rest-operator: - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.sublime-syntax - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - destructuring-object: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax - - destructuring-array: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax - - return-type: - - include: comment - - match: (?=\s*:) - set: associated-type - - match: "" - pop: true - - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax - - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/typeof.no-pop.sublime-syntax b/syntaxes/fjsx15/async.no-pop.sublime-syntax similarity index 82% rename from syntaxes/fjsx15/flowtype/typeof.no-pop.sublime-syntax rename to syntaxes/fjsx15/async.no-pop.sublime-syntax index 3bb61126..ae3cc9e9 100644 --- a/syntaxes/fjsx15/flowtype/typeof.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/async.no-pop.sublime-syntax @@ -19,11 +19,8 @@ scope: ... contexts: main: - - match: | - (?x)\s* - (typeof) + - match: \s*(async) captures: 1: >- - flowtype - word.flowtype - keyword.operator.other.flowtype + storage.modifier.js.fjsx15 + keyword.other.async.js.fjsx15 diff --git a/syntaxes/fjsx15/class.sublime-syntax b/syntaxes/fjsx15/class.sublime-syntax index 38dc1773..c55cc6df 100644 --- a/syntaxes/fjsx15/class.sublime-syntax +++ b/syntaxes/fjsx15/class.sublime-syntax @@ -26,9 +26,7 @@ contexts: main: - match: \s*(class)\b captures: - 1: >- - storage.type.js.fjsx15 - keyword.declaration.class.js.fjsx15 + 1: storage.type.class.js.fjsx15 set: declaration declaration: @@ -36,28 +34,24 @@ contexts: # Body. - match: (?=\s*\{) set: body - # Template parameters. + # Generic parameters. - match: (?=\s*<) - push: template-parameters + push: generic-parameters # Interfaces. - match: \s*(implements)\b captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.implement.js.fjsx15 + 1: storage.modifier.js.fjsx15 push: [ optional-target-class-or-namespace, - optional-template-arguments, + optional-generic-arguments, target-class-or-namespace ] # Extensions. - match: \s*(extends)\b captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.inherit.js.fjsx15 + 1: storage.modifier.extends.js.fjsx15 push: [ - optional-template-arguments, + optional-generic-arguments, target-class-or-namespace ] # Identifier. @@ -70,17 +64,17 @@ contexts: comment: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - template-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax + generic-parameters: + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.sublime-syntax - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax + type-expression: + - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax body: - include: Packages/Naomi/syntaxes/fjsx15/class/body.sublime-syntax - optional-template-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax + optional-generic-arguments: + - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax - match: "" pop: true @@ -89,19 +83,17 @@ contexts: scope: punctuation.definition.implement-list.separator.js.fjsx15 set: [ optional-target-class-or-namespace, - optional-template-arguments, + optional-generic-arguments, target-class-or-namespace ] - match: (?=\s*\{) pop: true target-class-or-namespace: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/namespace-path.no-pop.sublime-syntax - match: | (?xi) \s*({{commonIdentifier}}) captures: - 1: >- - parent.js.fjsx15 - entity.name.class.js.fjsx15 + 1: entity.other.inherited-class.js.fjsx15 pop: true diff --git a/syntaxes/fjsx15/class/body.sublime-syntax b/syntaxes/fjsx15/class/body.sublime-syntax index 20120ce5..8580c05e 100644 --- a/syntaxes/fjsx15/class/body.sublime-syntax +++ b/syntaxes/fjsx15/class/body.sublime-syntax @@ -19,51 +19,42 @@ scope: ... contexts: main: - - include: comment + - include: comment-no-pop - match: \s*(\{) captures: - 1: punctuation.definition.class.body.begin.js.fjsx15 - set: body + 1: punctuation.section.block.begin.js.fjsx15 + set: [ body-end, statements-and-expressions ] - body: - - include: comment + body-end: + - meta_scope: >- + meta.class.js.fjsx15 + meta.block.js.fjsx15 + - include: comment-no-pop + - match: \s*(?>(,)|(;)) + captures: + 1: punctuation.separator.comma.js.fjsx15 + 2: punctuation.terminator.js.fjsx15 + push: statements-and-expressions - match: \s*(}) captures: - 1: punctuation.definition.class.body.end.js.fjsx15 + 1: punctuation.section.block.end.js.fjsx15 + pop: true + - match: (?=\s*\S) + push: statements-and-expressions + + statements-and-expressions: + - 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#class-properties + - 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*\S) pop: true - - match: "" - push: - # This is necessary because normally these instance variables would be - # accessed using “this” but in the class body we can use the short version. - - match: | - (?x)\s* - ((?> props - | state - ))\b - captures: - 1: >- - support.core.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax - # React’s variables (state, contextTypes, etc...). - - include: Packages/Naomi/syntaxes/fjsx15/react-js.sublime-syntax - # Any methods (including supporting libraries’ methods). - - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - # Flow fields and indexers. - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/field.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax - # Class variables. - - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax - # Any other statement or expression. - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true - comment: + comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/class/method.sublime-syntax b/syntaxes/fjsx15/class/method.sublime-syntax index c1f675c1..4443a497 100644 --- a/syntaxes/fjsx15/class/method.sublime-syntax +++ b/syntaxes/fjsx15/class/method.sublime-syntax @@ -24,155 +24,60 @@ variables: indexer: | (\[ - [^\[\]]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`\[\]]* + ) \g<-1>? - [^\[\]]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`\[\]]* + ) \]) methodIdentifier: | - (?> {{commonIdentifier}} - | '.*?(? '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` | {{indexer}} + | {{commonIdentifier}} ) - modifiers: | - (?: - ((?>\#|async|get|set|static)) - (\s+\g<-2>)* - ) - - templateArguments: | + genericParameters: | (< [^<>]* \g<-1>? [^<>]* >) - parameters: | - (\( - [^()]* - \g<-1>? - [^()]* - \)) - - flowOperators: | - (?> &(?!&) - | \|(?!\|) - ) - - string: | - (?> '.*?' - | ".*?" - | `.*` - ) - - simpleFlowType: | - (?> {{string}} - | {{commonIdentifier}} - {{templateArguments}}? - ) - - flowFunction: | - ( - {{parameters}} - \s*=>\s* - (?> {{simpleFlowType}} - | \g<-2> - ) - ) - - complexType: | - ( - \??\s* - (?> {{simpleFlowType}} - | {{flowFunction}} - ) - \s*{{flowOperators}}? - \s*\g<-5>? - ) - - flowComment: /\*\s*:.*?\*/ - - returnType: | - (?> {{flowComment}} - | (?::{{complexType}}) - )? - contexts: main: + # Method without identifier. + - match: (?=\s*\() + set: declaration # Normal method. - match: | (?xi) (?= - \s*{{modifiers}}? - \s*\*? \s*{{methodIdentifier}} - \s*{{templateArguments}}? + \s*{{genericParameters}}? \s*\( ) - set: [ - declaration, - modifiers - ] - # Method assigned to a class property. - - match: | - (?xi) - (?= - \s*{{commonIdentifier}} - \s*= - \s*{{modifiers}}? - \s*{{templateArguments}}? - \s*{{parameters}}? - \s*{{returnType}}? - \s*=> - ) - set: [ - arrow-function, - declaration - ] - - modifiers: - - match: \s*(\#|static) - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.access.js.fjsx15 - - match: \s*(async)\b - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - - match: | - (?xi)\s* - (get|set)\b - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.proxy.js.fjsx15 - - match: \s*(\*)\b - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.generator.js.fjsx15 - - match: "" - pop: true - - arrow-function: - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax + set: declaration declaration: - - match: \s*(=) - captures: - 1: punctuation.definition.function.assignment.js.fjsx15 - pop: true + - meta_scope: >- + meta.declaration.function.method.js.fjsx15 + meta.function.js.fjsx15 + - include: comment-no-pop # Body. - match: (?=\s*\{) set: body - # Template parameters. + # Generic parameters. - match: (?=\s*<) - push: template-parameters + push: generic-parameters # Parameters. - match: (?=\s*\() push: parameters @@ -181,11 +86,9 @@ contexts: (?x) \s*(constructor)\b captures: - 1: >- - support.js.fjsx15 - entity.name.function.js.fjsx15 + 1: entity.name.function.constructor.js.fjsx15 set: [ - support-body, + optional-support-body, support-parameters ] # React JS’s support methods. @@ -193,26 +96,18 @@ contexts: # Identifier. - match: | (?xi) - \s*(\*)? \s*({{commonIdentifier}}) captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.generator.js.fjsx15 - 2: entity.name.function.js.fjsx15 + 1: entity.name.function.js.fjsx15 # Computed identifier. - match: | (?x) - (?:\s*(\*))? \s*(\[) captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.generator.js.fjsx15 - 2: punctuation.definition.function.identifier.begin.js.fjsx15 - push: computed-identifier + 1: punctuation.definition.function.identifier.begin.js.fjsx15 + push: [ computed-identifier-end, optional-expression ] # String identifiers - - match: (?=(?>'|"|`)) + - match: (?=\s*(?>'|"|`)) push: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax @@ -221,35 +116,36 @@ contexts: - match: (?=\s*\S) pop: true - template-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax + generic-parameters: + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.sublime-syntax parameters: - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax support-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/function/support/parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax body: - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax + + optional-body: + - include: body - match: (?=\s*\S) pop: true - support-body: - - include: Packages/Naomi/syntaxes/fjsx15/function/support/body.sublime-syntax + optional-support-body: + - include: body - match: (?=\s*\S) pop: true - computed-identifier: + computed-identifier-end: - match: \s*(]) captures: 1: punctuation.definition.function.identifier.end.js.fjsx15 pop: true - - match: "" - push: - - match: (?=\s*]) - pop: true - - include: statement-and-expression - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/class/modifier.sublime-syntax b/syntaxes/fjsx15/class/modifier.sublime-syntax new file mode 100644 index 00000000..aa9e8316 --- /dev/null +++ b/syntaxes/fjsx15/class/modifier.sublime-syntax @@ -0,0 +1,63 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY 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: modifiers + + modifiers: + - match: \s*(static)\b(?!\s*:) + captures: + 1: storage.modifier.js.fjsx15 + set: modifier-trap + - match: \s*(\#)(?!\s*:) + captures: + 1: >- + storage.modifier.js.fjsx15 + set: modifier-trap + - match: \s*(async)\b(?!\s*:) + captures: + 1: storage.modifier.js.fjsx15 + set: modifier-trap + - match: | + (?xi)\s* + (get|set)\b(?!\s*:) + captures: + 1: storage.modifier.js.fjsx15 + set: modifier-trap + - match: \s*(\*)(?!\s*:) + captures: + 1: storage.modifier.js.fjsx15 + set: modifier-trap + + modifier-trap: + - include: modifiers + - match: (?=\s*\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 + + method-declaration: + - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax#declaration + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/class/property.sublime-syntax b/syntaxes/fjsx15/class/property.sublime-syntax index d61c4315..2f3c4dbb 100644 --- a/syntaxes/fjsx15/class/property.sublime-syntax +++ b/syntaxes/fjsx15/class/property.sublime-syntax @@ -22,112 +22,38 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - templateArguments: | - (< - [^<>]* - \g<-1>? - [^<>]* - >) - - parameters: | - (\( - [^()]* - \g<-1>? - [^()]* - \)) - - flowOperators: | - (?> &(?!&) - | \|(?!\|) - ) - - string: | - (?> '.*?' - | ".*?" - | `.*` - ) - - simpleFlowType: | - (?> {{string}} - | {{commonIdentifier}} - {{templateArguments}}? - ) - - flowFunction: | - ( - {{parameters}} - \s*=>\s* - (?> {{simpleFlowType}} - | \g<-2> - ) - ) - - complexType: | - ( - \??\s* - (?> {{simpleFlowType}} - | {{flowFunction}} - ) - \s*{{flowOperators}}? - \s*\g<-5>? - ) - - flowComment: /\*\s*:.*?\*/ - - flowType: | - (?> {{flowComment}} - | (?::{{complexType}}) - ) - contexts: main: - # Static variables. - match: | - (?xi)\s* - (static) - (?= - \s+{{commonIdentifier}} - (\s*{{flowType}})? - ) + (?xi) + (?=\s*{{commonIdentifier}}) + set: [ + optional-type-and-value, + identifier + ] + + identifier: + - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax + + optional-type-and-value: + - match: \s*(\?) captures: 1: >- - storage.modifier.js.fjsx15 - keyword.other.access.js.fjsx15 - set: declaration - # Normal variable. - - match: | - (?xi) - (?= - \s+{{commonIdentifier}} - (\s*{{flowType}})? - ) - set: declaration - - declaration: - - include: terminator - - match: (?=\s*$) - pop: true + flow + keyword.operator.other.optional.flow # Type. - match: (?=\s*:) - push: type + push: associated-type # Value. - match: (?=\s*=) + set: optional-expression + # Anything else. + - match: (?=\s*\S) pop: true - # Identifier. - - match: | - (?xi) - (?=\s* - {{commonIdentifier}} - ) - push: - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - terminator: - - include: Packages/Naomi/syntaxes/fjsx15/terminator.sublime-syntax + associated-type: + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/class/support/react-js-method.sublime-syntax b/syntaxes/fjsx15/class/support/react-js-method.sublime-syntax index 94a63898..3e29a6da 100644 --- a/syntaxes/fjsx15/class/support/react-js-method.sublime-syntax +++ b/syntaxes/fjsx15/class/support/react-js-method.sublime-syntax @@ -54,7 +54,7 @@ contexts: pop: true parameters: - - include: Packages/Naomi/syntaxes/fjsx15/function/support/react-js-parameters.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax body: - - include: Packages/Naomi/syntaxes/fjsx15/function/support/react-js-body.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax diff --git a/syntaxes/fjsx15/comment.no-pop.sublime-syntax b/syntaxes/fjsx15/comment.no-pop.sublime-syntax index d7fb1c45..2c260ddb 100644 --- a/syntaxes/fjsx15/comment.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/comment.no-pop.sublime-syntax @@ -19,12 +19,6 @@ scope: ... contexts: main: - - match: | - (?x) - (?=\s*/ - (?> / - | \* - ) - ) + - match: (?=\s*/(?>/|\*)) push: - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax diff --git a/syntaxes/fjsx15/comment.sublime-syntax b/syntaxes/fjsx15/comment.sublime-syntax index 142e4a07..ea73980a 100644 --- a/syntaxes/fjsx15/comment.sublime-syntax +++ b/syntaxes/fjsx15/comment.sublime-syntax @@ -19,8 +19,7 @@ scope: ... contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/eslint.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/prolog.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/comment/flowtype.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/comment/documentation.sublime-syntax + - 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/normal.sublime-syntax diff --git a/syntaxes/fjsx15/comment/documentation.sublime-syntax b/syntaxes/fjsx15/comment/documentation.sublime-syntax deleted file mode 100644 index a27ed19d..00000000 --- a/syntaxes/fjsx15/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.js.fjsx15 - set: content - - content: - - meta_scope: comment.block.documentation.js.fjsx15 - - match: \s*(\*/) - captures: - 1: punctuation.definition.comment.documentation.end.js.fjsx15 - 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.js.fjsx15 - pop: true - - match: '' - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/comment/ndoc.sublime-syntax - - match: (?=\s*\*/) - pop: true diff --git a/syntaxes/fjsx15/eslint.sublime-syntax b/syntaxes/fjsx15/comment/eslint.sublime-syntax similarity index 100% rename from syntaxes/fjsx15/eslint.sublime-syntax rename to syntaxes/fjsx15/comment/eslint.sublime-syntax diff --git a/syntaxes/fjsx15/comment/flowtype.sublime-syntax b/syntaxes/fjsx15/comment/flowtype.sublime-syntax deleted file mode 100644 index 4df1f18a..00000000 --- a/syntaxes/fjsx15/comment/flowtype.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: \s*(/\*\s*::) - captures: - 1: >- - comment.block.flowtype - punctuation.definition.comment.begin.flowtype - set: block - - match: \s*(/\*(?=\s*:)) - captures: - 1: >- - comment.block.flowtype - punctuation.definition.comment.begin.flowtype - set: associated-type - - associated-type: - - meta_content_scope: comment.block.flowtype - - match: \s*(\*/) - captures: - 1: >- - comment.block.flowtype - punctuation.definition.comment.end.js.fjsx15 - 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.js.fjsx15 - pop: true - - match: '' - pop: true - - match: "" - push: - - match: (?=\s*\*\/) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - block: - - meta_content_scope: comment.block.flowtype - - match: \s*(\*/) - captures: - 1: >- - comment.block.flowtype - punctuation.definition.comment.end.js.fjsx15 - 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.js.fjsx15 - pop: true - - match: '' - pop: true - - match: "" - push: - - match: (?=\s*\*\/) - pop: true - - match: \s*(\?)(?=\s*:) - captures: - 1: keyword.operator.other.optional.flowtype - set: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/declare.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/field.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/interface.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/module.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/terminator.sublime-syntax - - link: - - include: Packages/Naomi/syntaxes/shared/link.sublime-syntax - - email: - - include: Packages/Naomi/syntaxes/shared/email.sublime-syntax diff --git a/syntaxes/fjsx15/comment/ndoc.sublime-syntax b/syntaxes/fjsx15/comment/ndoc.sublime-syntax deleted file mode 100644 index 8a857498..00000000 --- a/syntaxes/fjsx15/comment/ndoc.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: - commonIdentifier: | - [_[:alpha:]] - [_[:alnum:]]* - -contexts: - main: - - include: param - - param: - - match: \s*\B(@)(param)\b - captures: - 1: >- - keyword.documentation.js.fjsx15 - punctuation.definition.keyword.begin.js.fjsx15 - 2: keyword.documentation.js.fjsx15 - set: param-args - - param-args: - - include: types-begin-no-pop - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - - types-begin-no-pop: - - match: (?=\s*\{) - push: types-begin - - types-begin: - - match: \s*(\{) - captures: - 1: >- - jsdoc.js.fjsx15 - punctuation.definition.types.begin.js.fjsx15 - set: types - - types: - - match: \s*(}) - captures: - 1: >- - jsdoc.js.fjsx15 - punctuation.definition.types.end.js.fjsx15 - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax diff --git a/syntaxes/fjsx15/comment/normal.sublime-syntax b/syntaxes/fjsx15/comment/normal.sublime-syntax index c25583cb..cd84425b 100644 --- a/syntaxes/fjsx15/comment/normal.sublime-syntax +++ b/syntaxes/fjsx15/comment/normal.sublime-syntax @@ -28,7 +28,7 @@ contexts: - match: \s*(/\*) captures: 1: >- - comment.line.js.fjsx15 + comment.block.js.fjsx15 punctuation.definition.comment.begin.js.fjsx15 set: block @@ -54,7 +54,7 @@ contexts: - match: \s*$\n? scope: meta.block-end.js.fjsx15 pop: true - - match: '' + - match: "" pop: true link: diff --git a/syntaxes/fjsx15/constant.sublime-syntax b/syntaxes/fjsx15/constant.sublime-syntax index 339d500d..96ab279f 100644 --- a/syntaxes/fjsx15/constant.sublime-syntax +++ b/syntaxes/fjsx15/constant.sublime-syntax @@ -24,16 +24,29 @@ variables: contexts: main: + - include: object + - include: normal + + object: + - match: | + (?x)\s* + (\#)? + ({{constantIdentifier}}) + (?=\s*\??\.) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.object.constant.js.fjsx15 + pop: true + + normal: # Single character. - match: | (?x)\s* (\#)? ([_[:upper:]])\b captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.access.js.fjsx15 - 2: entity.name.constant.js.fjsx15 + 1: storage.modifier.js.fjsx15 + 2: variable.other.constant.js.fjsx15 pop: true # Two or more characters. - match: | @@ -46,8 +59,6 @@ contexts: ) ) captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.access.js.fjsx15 - 2: entity.name.constant.js.fjsx15 + 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 index 975c11a0..a45f78fe 100644 --- a/syntaxes/fjsx15/core.sublime-syntax +++ b/syntaxes/fjsx15/core.sublime-syntax @@ -17,18 +17,64 @@ hidden: true scope: ... +variables: + 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 + + symbolFunctions: | + (?> for + | KeyFor + )\b + + contexts: main: - - include: symbol-properties - # Functions. - - include: array-functions - - include: object-functions - - include: math-constants - - include: math-functions - - include: symbol-functions + - 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 @@ -40,190 +86,127 @@ contexts: - include: internationalization - include: web-assembly - function-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax - - match: (?=\S) + escape: + - match: (?=\s*\S) pop: true - optional-template-and-type-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/type/support/arguments.sublime-syntax + pop-now: - match: "" pop: true - array-functions: - - match: | - (?x) - \s*(Array)\b - (?: - \s*(\.)\s* - ((?> from - | isArray - ))\b - )? + arguments: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + + function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - include: pop-now + + console: + - match: \s*(console)\s*(\.) captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 - set: function-arguments + 1: support.type.object.console.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: console-property-or-function - math-constants: - - match: | - (?x) - \s*(Math) - \s*(\.)\s* - ((?> E - | LN(?>10|2) - | LOG(?>10E|2E) - | PI - | SQRT(?>1_2|2) - ))\b + console-property-or-function: + # error + - match: \s*(error)(?=\s*\() captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.constant.js.fjsx15 + 1: support.function.console.error.js.fjsx15 + set: [ + console-error-meta-scope, + arguments + ] + - match: \s*(error) + captures: + 1: support.function.console.error.js.fjsx15 pop: true - - math-functions: - - match: | - (?x) - \s*(Math)\b - (?: - \s*(\.)\s* - ((?> 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 - )? + # info + - match: \s*(info)(?=\s*\() captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 - set: function-arguments - - object-functions: - - match: | - (?x) - \s*(Object)\b - (?: - \s*(\.)\s* - ((?> assign - | create - | definePropert(?>ies|y) - | freeze - | getOwnProperty(?>Descriptors?|Names|Symbols) - | getPrototypeOf - | is(?>Extensible|Frozen|Sealed)? - | keys - | preventExtensions - | seal - | setPrototypeOf - ))\b - )? + 1: support.function.console.info.js.fjsx15 + set: [ + console-info-meta-scope, + arguments + ] + - match: \s*(info) captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 - set: function-arguments - - symbol-functions: - - match: | - (?x) - \s*(Symbol) - \s*(\.)\s* - ((?> for - | KeyFor - ))\b + 1: support.function.console.info.js.fjsx15 + pop: true + # log + - match: \s*(log)(?=\s*\() captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 - set: function-arguments - - symbol-properties: - - match: | - (?x) - \s*(Symbol) - \s*(\.)\s* - ((?> asyncIterator - | hasInstance - | isConcatSpreadable - | iterator - | match - | replace - | search - | species - | split - | toPrimitive - | toStringTag - | unscopables - ))\b + 1: support.function.console.log.js.fjsx15 + set: [ + console-log-meta-scope, + arguments + ] + - match: \s*(log) + captures: + 1: support.function.console.log.js.fjsx15 + pop: true + # warn + - match: \s*(warn)(?=\s*\() captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.constant.js.fjsx15 + 1: support.function.console.warn.js.fjsx15 + set: [ + console-warn-meta-scope, + arguments + ] + - match: \s*(warn) + captures: + 1: support.function.console.warn.js.fjsx15 pop: true + # Anything else. + - include: escape + + 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)\s* - ((?> false - | Infinity - | NaN - | null - | true - | undefined - )) + - match: | + (?x)\s* + (?> (false) + | (Infinity) + | (NaN) + | (null) + | (true) + | (undefined) + ) + 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 + + variables: + - match: \s*(prototype)\b + captures: + 1: variable.language.prototype.js.fjsx15 + pop: true + - match: \s*(super)\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.constant.js.fjsx15 + 1: variable.language.super.js.fjsx15 + pop: true + - match: \s*(this)\b + captures: + 1: variable.language.this.js.fjsx15 pop: true functions: @@ -237,12 +220,34 @@ contexts: )) (?=\s*\() captures: - 1: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 - set: function-arguments + 1: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + + function-properties: + - match: | + (?x) + \s*(function) + \s*(\.) + \s*(sent) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.variable.js.fsjx15 fundamental-objects: + - match: \s*(Object)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: object-property-or-function + - match: \s*(Symbol)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: symbol-property-or-function - match: | (?x)\s* ((?> Boolean @@ -253,17 +258,71 @@ contexts: | Object | RangeError | ReferenceError + | Symbol | SyntaxError | TypeError | URIError ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + 1: support.type.object.js.fjsx15 + pop: true + + import-properties: + - match: | + (?x) + \s*(import) + \s*(\.) + \s*(meta) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.variable.js.fsjx15 + object-property-or-function: + # Function call. + - match: | + (?x) + ({{objectFunctions}}) + (?=\s*\() + captures: + 1: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: | + (?x) + ({{objectFunctions}}) + captures: + 1: support.function.js.fjsx15 + pop: true + + symbol-property-or-function: + # Function call. + - match: | + (?x) + ({{symbolFunctions}}) + (?=\s*\() + captures: + 1: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: | + (?x) + ({{symbolFunctions}}) + captures: + 1: support.function.js.fjsx15 + pop: true numbers-and-dates: + - match: \s*(Math)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: math-property-or-function - match: | (?x)\s* ((?> Date @@ -271,10 +330,40 @@ contexts: | Number ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + 1: support.type.object.js.fjsx15 + pop: true + + math-property-or-function: + # Function call. + - match: | + (?x) + ({{mathFunctions}}) + (?=\s*\() + captures: + 1: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] + # Function reference. + - match: | + (?x) + ({{mathFunctions}}) + captures: + 1: support.function.js.fjsx15 + pop: true + # Constants. + - match: | + (?x)\s* + ((?> E + | LN(?>10|2) + | LOG(?>10E|2E) + | PI + | SQRT(?>1_2|2) + ))\b + captures: + 1: support.constant.js.fjsx15 + pop: true text-processing: - match: | @@ -283,12 +372,15 @@ contexts: | String ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + 1: support.type.object.js.fjsx15 + pop: true indexed-collections: + - match: \s*(Array)\s*(\.) + captures: + 1: support.type.object.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + set: array-property-or-function - match: | (?x)\s* ((?> Array @@ -298,10 +390,22 @@ contexts: | Uint8ClampedArray ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + 1: support.type.object.js.fjsx15 + pop: true + + array-property-or-function: + # Function. + - match: | + (?x)\s* + ((?> from + | isArray + ))\b + captures: + 1: support.function.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] keyed-collections: - match: | @@ -311,10 +415,8 @@ contexts: | Weak(?>Map|Set) ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + 1: support.type.object.js.fjsx15 + pop: true structured-data: - match: | @@ -324,10 +426,8 @@ contexts: | JSON ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + 1: support.type.object.js.fjsx15 + pop: true control-abstraction-objects: - match: | @@ -336,10 +436,8 @@ contexts: | Promise ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + 1: support.type.object.js.fjsx15 + pop: true reflection: - match: | @@ -348,10 +446,8 @@ contexts: | Reflect ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + 1: support.type.object.js.fjsx15 + pop: true internationalization: - match: | @@ -365,14 +461,8 @@ contexts: ))\b )? captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + 1: support.type.object.js.fjsx15 + pop: true web-assembly: - match: | @@ -390,11 +480,5 @@ contexts: ))\b )? captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - set: optional-template-and-type-arguments + 1: support.type.object.js.fjsx15 + pop: true diff --git a/syntaxes/fjsx15/decorator.sublime-syntax b/syntaxes/fjsx15/decorator.sublime-syntax index 76060f51..35bd8334 100644 --- a/syntaxes/fjsx15/decorator.sublime-syntax +++ b/syntaxes/fjsx15/decorator.sublime-syntax @@ -29,8 +29,49 @@ contexts: \s*(@) (?={{decoratorIdentifier}}) captures: - 1: punctuation.definition.decorator.js.fjsx15 - set: identifier + 1: >- + meta.annotation.js.fjsx15 + punctuation.definition.annotation.js.fjsx15 + set: decorator-identifier - identifier: - - include: Packages/Naomi/syntaxes/fjsx15/decorator/identifier.sublime-syntax + decorator-identifier: + # With arguments. + - match: | + (?xi)\s* + ({{decoratorIdentifier}}) + (?=\s*\() + captures: + 1: variable.annotation.js.fjsx15 + set: [ + possible-chain, + meta-scope, + arguments + ] + # Without arguments. + - match: | + (?xi)\s* + ({{decoratorIdentifier}}) + captures: + 1: variable.annotation.js.fjsx15 + set: [ + possible-chain, + meta-scope + ] + + arguments: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + + # The decorator might be followed by a chain of function calls and we want to + # to highlight them as decorators too. + possible-chain: + - match: \s*(\.) + captures: + 1: punctuation.definition.decorator.chain.js.fjsx15 + set: decorator-identifier + - match: (?=\s*\S) + pop: true + + meta-scope: + - meta_scope: meta.annotation.js.fjsx15 + - match: "" + pop: true diff --git a/syntaxes/fjsx15/decorator/arguments.sublime-syntax b/syntaxes/fjsx15/decorator/arguments.sublime-syntax deleted file mode 100644 index f09594e2..00000000 --- a/syntaxes/fjsx15/decorator/arguments.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: \s*(\() - captures: - 1: punctuation.definition.decorator.arguments.begin.js.fjsx15 - set: arguments - - arguments: - - match: \s*(\)) - captures: - 1: punctuation.definition.decorator.arguments.end.js.fjsx15 - pop: true - - match: \s*(\,) - captures: - 1: punctuation.definition.decorator.arguments.js.fjsx15 - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/fjsx15/decorator/identifier.sublime-syntax b/syntaxes/fjsx15/decorator/identifier.sublime-syntax deleted file mode 100644 index c26d407c..00000000 --- a/syntaxes/fjsx15/decorator/identifier.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: - decoratorIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - # With arguments. - - match: | - (?xi)\s* - ({{decoratorIdentifier}}) - (?=\s*\() - captures: - 1: entity.name.decorator.js.fjsx15 - set: [ - possible-chain, - arguments - ] - # Without arguments. - - match: | - (?xi)\s* - ({{decoratorIdentifier}}) - captures: - 1: entity.name.decorator.js.fjsx15 - set: possible-chain - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/decorator/arguments.sublime-syntax - - # The decorator might be followed by a chain of function calls and we want to - # to highlight them as decorators too. - possible-chain: - - match: \s*(\.) - captures: - 1: punctuation.definition.decorator.chain.js.fjsx15 - set: main - - match: (?=\s*\S) - pop: true diff --git a/syntaxes/fjsx15/destructuring/array.sublime-syntax b/syntaxes/fjsx15/destructuring/array.sublime-syntax index 2acd03d3..b3073447 100644 --- a/syntaxes/fjsx15/destructuring/array.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/array.sublime-syntax @@ -21,66 +21,39 @@ contexts: main: - match: \s*(\[) captures: - 1: >- - destructuring.array.js.fjsx15 - punctuation.definition.array.begin.js.fjsx15 - set: items - - items: + 1: punctuation.section.brackets.begin.js.fjsx15 + set: [ + delimiters, + optional-expression, + optional-type, + optional-variable + ] + + delimiters: + - meta_scope: meta.destructuring.array.js.fjsx15 - match: \s*(,) captures: - 1: >- - destructuring.array.js.fjsx15 - punctuation.definition.array.js.fjsx15 + 1: punctuation.separator.comma.js.fjsx15 + push: [ + optional-expression, + optional-type, + optional-variable + ] - match: \s*(]) captures: - 1: >- - destructuring.array.js.fjsx15 - punctuation.definition.array.end.js.fjsx15 + 1: punctuation.section.brackets.end.js.fjsx15 pop: true - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | ] - | \) - ) - ) - pop: true - - include: rest-operator - - include: comment - # Nested destructuring. - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax - # Default value. - - match: (?=\s*=) - set: default-value - # Normal variables and constants. - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax - - rest-operator: - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.sublime-syntax - default-value: - - match: | - (?x) - (?=\s* - (?> , - | ] - ) - ) - pop: true - - match: "" - push: - - include: statement-and-expression - - match: "" - pop: true + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + optional-type: + - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + optional-variable: + - match: (?=\s*[,)\]}]) + 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 index 520e988b..93b753d6 100644 --- a/syntaxes/fjsx15/destructuring/object.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/object.sublime-syntax @@ -26,71 +26,37 @@ contexts: main: - match: \s*(\{) captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.begin.js.fjsx15 - set: items + 1: punctuation.section.block.begin.js.fjsx15 + set: [ delimiters, optional-variable ] - items: + delimiters: + - meta_scope: >- + meta.destructuring.object.js.fjsx15 + meta.block.js.fjsx15 - match: \s*(,) captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.js.fjsx15 + 1: punctuation.separator.comma.js.fjsx15 + push: optional-variable - match: \s*(}) captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.end.js.fjsx15 + 1: punctuation.section.block.end.js.fjsx15 pop: true - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | } - ) - ) - pop: true - - include: rest-operator - - include: comment - # Default value. - - match: (?=\s*=) - set: default-value - # Property. - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object/property.sublime-syntax - # We can assume that the “:” is for a nested destructuring because otherwise - # the previous rule for properties would have consumed it. - - match: \s*(:) - captures: - 1: >- - destructuring.object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - # Nested destructuring. - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax + # Default value. + - match: (?=\s*=) + push: default-value - rest-operator: - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.sublime-syntax - - default-value: - - match: | - (?x) - (?=\s* - (?> , - | } - ) - ) + optional-variable: + - include: comment-no-pop + - match: (?=\s*[,)\]}]) pop: true - - match: "" - push: - - include: statement-and-expression - - match: "" - pop: true + - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax + - 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 + - include: Packages/Naomi/syntaxes/fjsx15/variable-declaration.sublime-syntax#variable-or-constant - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax + default-value: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/destructuring/object/property.sublime-syntax b/syntaxes/fjsx15/destructuring/object/property.sublime-syntax index 62952381..bb2130a0 100644 --- a/syntaxes/fjsx15/destructuring/object/property.sublime-syntax +++ b/syntaxes/fjsx15/destructuring/object/property.sublime-syntax @@ -28,88 +28,63 @@ contexts: - match: (?=\s*(?>'|"|`)) set: [ optional-alias, + meta-key, string ] # Computed property name. - match: \s*(\[) captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.computed-property.begin.js.fjsx15 + 1: punctuation.section.brackets.begin.js.fjsx15 set: [ optional-alias, - computed-property + meta-key, + computed-property-end, + optional-expression ] - # Accessing sub-property. + # Normal property with an alias. - match: | (?xi) \s*({{commonIdentifier}}) - \s*(:) - (?=\s*\{) - captures: - 1: >- - destructuring.object.js.fjsx15 - object.property.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - destructuring.object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 + (?=\s*:) + set: [ + optional-alias, + meta-key + ] + + meta-key: + - meta_scope: meta.destructuring.object.key.js.fjsx15 + - match: "" pop: true - # Aliasing. - - match: | - (?xi) - \s*({{commonIdentifier}}) - \s*(:) - (?=\s*({{commonIdentifier}})) - captures: - 1: >- - destructuring.object.js.fjsx15 - object.property.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - destructuring.object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - push: constant-or-variable - # Normal property. - - include: constant-or-variable - constant-or-variable: - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.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 optional-alias: - - match: | - (?x) - \s*(:) - (?: - \s*({{commonIdentifier}}) - )? + - match: \s*(:) captures: - 1: >- - destructuring.object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - 2: entity.name.variable.js.fjsx15 + 1: punctuation.separator.key-value.js.fjsx15 + set: alias + - match: (?=\s*\S) pop: true - - match: (?=\s*\W) + + alias: + - include: comment-no-pop + - match: (?=\s*\)) 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 - 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 + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - computed-property: + computed-property-end: - match: \s*(]) captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.computed-property.end.js.fjsx15 + 1: punctuation.section.brackets.end.js.fjsx15 pop: true - - match: "" - push: - - match: (?=\s*]) - pop: true - - include: statement-and-expression - - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/export.sublime-syntax b/syntaxes/fjsx15/export.sublime-syntax index c9093b53..7e336051 100644 --- a/syntaxes/fjsx15/export.sublime-syntax +++ b/syntaxes/fjsx15/export.sublime-syntax @@ -22,208 +22,84 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - keywords: | - (?> await - | break - | case - | catch - | class - | const - | continue - | debugger - | delete - | do - | else - | enum - | export - | extends - | finally - | for - | function - | if - | imp(?>lements|ort) - | in(?:stanceof)? - | interface - | let - | new - | package - | private - | protected - | public - | return - | static - | super - | switch - | this - | throw - | try - | typeof - | var - | void - | while - | with - | yield - ) - contexts: main: - # Export multiple types. - - match: | - (?x) - \s*(export) - (?:\s*(opaque))? - \s*(type) - \s*({) - captures: - 1: keyword.control.export.js.fjsx15 - 2: >- - flowtype - storage.type.flowtype - keyword.other.access.flowtype - 3: >- - flowtype - storage.type.flowtype - keyword.declaration.type-aliasing.flowtype - 4: punctuation.definition.export.list.begin.js.fjsx15 - set: types - # Export object literal. - - match: | - (?x) - \s*(export) - \s*(default) - (?=\s*{) + - match: \s*(export) captures: - 1: keyword.control.export.js.fjsx15 - 2: >- - storage.modifier.js.fjsx15 - keyword.control.export.default.js.fjsx15 - set: object-literal - # Export statements. - - match: | - (?x) - \s*(export) - (?= - (?:\s*opaque)? - \s*(?> async - | class - | const - | function - | interface - | let - | type - | var - ) - ) - captures: - 1: keyword.control.export.js.fjsx15 - set: statement-and-expression - # Export default from. - - match: | - (?x) - \s*(export) - \s*(default) - (?=\s*from) - captures: - 1: keyword.control.export.js.fjsx15 - 2: >- - storage.modifier.js.fjsx15 - keyword.control.export.default.js.fjsx15 - set: origin - # Export default. - - match: | - (?x) - \s*(export) - \s*(default) - captures: - 1: keyword.control.export.js.fjsx15 - 2: >- - storage.modifier.js.fjsx15 - keyword.control.export.default.js.fjsx15 - set: statement-and-expression - # Other. - - match: | - (?x) - \s*(export)\b - (?!\s*\.) - captures: - 1: keyword.control.export.js.fjsx15 - set: targets - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + 1: keyword.control.import-export.export.js.fjsx15 + set: possible-statements-and-expressions - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + possible-statements-and-expressions: + - match: (?=\s*(?>[*{]|type(?:of)?)) + set: [ delimiter, optional-target ] + # Default statements and expressions. + - match: \s*(default) + captures: + 1: keyword.control.import-export.default.js.fjsx15 + set: statements-and-expressions + # Other statements. + - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax - object-literal: - - include: Packages/Naomi/syntaxes/fjsx15/literal/object.sublime-syntax + statements-and-expressions: + - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax origin: - - match: \s*(from)\b - captures: - 1: keyword.control.export.origin.js.fjsx15 - set: origin-path - - origin-path: - - 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/fjsx15/import.sublime-syntax#origin - punctuation: - - match: \s*(\{) - captures: - 1: punctuation.definition.export.list.begin.js.fjsx15 - - match: \s*(}) - captures: - 1: punctuation.definition.export.list.end.js.fjsx15 - - match: \s*(,) - captures: - 1: punctuation.definition.export.item.js.fjsx15 + close-block: + - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#close-block - targets: - - include: comment - - include: origin - - include: punctuation - - match: | - (?x) - (?=\s*export) + optional-target: + - match: (?=\s*(?>[,}]|from)) pop: true - - include: sequence - - sequence: - # Default. - - match: \s*(default)\b - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.control.export.default.js.fjsx15 - push: alias + # Type. + - include: Packages/Naomi/syntaxes/flow1/type-export.sublime-syntax # All. - match: \s*(\*) captures: - 1: keyword.operator.other.export.all.js.fjsx15 - push: optional-alias + 1: keyword.control.import-export.star.js.fjsx15 + pop: true + # Multiple targets. + - match: \s*(\{) + captures: + 1: punctuation.section.block.begin.js.fjsx15 + set: [ + close-block, + delimiter, + optional-target + ] + # Aliased. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + (?=\s+as) + captures: + 1: variable.other.readwrite.js.fjsx15 + set: alias # Simple. - match: | (?xi)\s* ({{commonIdentifier}}) captures: - 1: >- - export.js.fjsx15 - entity.name.ambiguous.js.fjsx15 - push: optional-alias + 1: variable.other.readwrite.js.fjsx15 + pop: true - optional-alias: - - match: | - (?x) - (?=\s*(?>,|}|from)) + delimiter: + - match: \s*(,) + captures: + 1: punctuation.separator.comma.js.fjsx15 + push: optional-target + # From. + - include: origin + # Anything else. + - match: (?=\s*\S) pop: true - - include: alias alias: - match: \s*(as)\b captures: - 1: keyword.other.alias.js.fjsx15 + 1: keyword.control.import-export.as.js.fjsx15 set: alias-name alias-name: @@ -231,28 +107,5 @@ contexts: (?xi)\s* ({{commonIdentifier}}) captures: - 1: entity.name.alias.js.fjsx15 - pop: true - - types: - - match: \s*(,) - captures: - 1: punctuation.definition.export.item.js.fjsx15 - - match: \s*(}) - captures: - 1: punctuation.definition.export.list.end.js.fjsx15 + 1: variable.other.readwrite.js.fjsx15 pop: true - - match: "" - push: aliased-type - - aliased-type: - - match: | - (?xi) - (?={{commonIdentifier}}) - set: [ - optional-alias, - simple-type - ] - - simple-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax diff --git a/syntaxes/fjsx15/expression.sublime-syntax b/syntaxes/fjsx15/expression.sublime-syntax new file mode 100644 index 00000000..a7d99866 --- /dev/null +++ b/syntaxes/fjsx15/expression.sublime-syntax @@ -0,0 +1,139 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS 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*(\() + expressionBegin: (?=\s*\S) + +contexts: + main: + - include: comment-no-pop + - include: comma + # At this stage, regex literals will have a higher priority than operators. + - match: (?=\s*/.*?(?? - [^()]* - \)) - -contexts: - main: - - match: | - (?x) - (?={{parameters}}\s*:) - set: [ - return-type, - parameters - ] - - return-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/declare.sublime-syntax b/syntaxes/fjsx15/flowtype/declare.sublime-syntax deleted file mode 100644 index 4e439fd4..00000000 --- a/syntaxes/fjsx15/flowtype/declare.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*(declare)\b - captures: - 1: >- - flowtype - keyword.declaration.js.fjsx15 - set: declarations - - declarations: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/module.sublime-syntax - # Export object literal. - - match: | - (?x) - \s*(export) - \s*(default) - (?=\s*{) - captures: - 1: keyword.control.export.js.fjsx15 - 2: >- - storage.modifier.js.fjsx15 - keyword.control.export.default.js.fjsx15 - set: flow-object - # Norma export. - - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax - # Other statements and expected expressions. - - 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 - - flow-object: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/object.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/field.sublime-syntax b/syntaxes/fjsx15/flowtype/field.sublime-syntax deleted file mode 100644 index 863ff336..00000000 --- a/syntaxes/fjsx15/flowtype/field.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* - (?>(\+)|(-)) - )? - \s*({{commonIdentifier}}) - \s*(\?)? - (?=\s*:) - captures: - 1: >- - flowtype - keyword.operator.other.covariant.flowtype - 2: >- - flowtype - keyword.operator.other.contravariant.flowtype - 3: entity.name.variable.js.fjsx15 - 4: >- - flowtype - keyword.operator.other.optional.flowtype - set: type - - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/function/declaration.sublime-syntax b/syntaxes/fjsx15/flowtype/function/declaration.sublime-syntax deleted file mode 100644 index 86b6d00b..00000000 --- a/syntaxes/fjsx15/flowtype/function/declaration.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: - # Template parameters. - - match: (?=\s*<) - push: template-arguments - # Parameters. - - match: (?=\s*\() - set: [ - return, - parameters - ] - - template-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax - - parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax - - return: - - match: \s*(=>) - captures: - 1: >- - flowtype - punctuation.definition.function.result.flowtype - set: return-type - - return-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax b/syntaxes/fjsx15/flowtype/function/parameters.sublime-syntax deleted file mode 100644 index 6bd8f072..00000000 --- a/syntaxes/fjsx15/flowtype/function/parameters.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: \s*(\() - captures: - 1: >- - flowtype - punctuation.definition.function.parameters.begin.flowtype - set: parameters - - parameters: - - match: \s*(,) - captures: - 1: >- - flowtype - punctuation.definition.function.parameters.flowtype - - match: \s*(\)) - captures: - 1: >- - flowtype - punctuation.definition.function.parameters.end.flowtype - pop: true - - match: "" - push: - - include: comment - # Rest. - - match: \s*(\.{3}) - captures: - 1: >- - flowtype - keyword.operator.other.rest.flowtype - # Parameter. - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/simple.sublime-syntax - # Type after parameter. - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - # Type highlighted without the parameter. - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/interface.sublime-syntax b/syntaxes/fjsx15/flowtype/interface.sublime-syntax deleted file mode 100644 index 4ac118ad..00000000 --- a/syntaxes/fjsx15/flowtype/interface.sublime-syntax +++ /dev/null @@ -1,122 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS 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*(interface)\b - captures: - 1: >- - flowtype - storage.type.flowtype - keyword.declaration.interface.flowtype - set: identifier - - identifier: - - include: comment - - match: (?=\s*extends\b) - set: [ - body, - extension - ] - - match: (?=\s*\{) - set: body - # Actual identifier. - - match: (?xi)\s*({{commonIdentifier}}) - captures: - 1: >- - flowtype - entity.name.interface.flowtype - set: optional-template-parameters - - extension: - - include: comment - - match: \s*(extends)\b - captures: - 1: >- - flowtype - storage.modifier.flowtype - keyword.extension.flowtype - set: type - - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax - - template-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax - - optional-template-parameters: - - include: comment - - match: (?=\s*<) - set: [ - optional-extension, - template-parameters - ] - - match: (?=\s*extends\b) - set: [ - body, - extension - ] - - match: (?=\s*\{) - set: body - - optional-extension: - - include: comment - - match: (?=\s*extends\b) - set: [ - body, - extension - ] - - match: (?=\s*\{) - set: body - - body: - - include: comment - - match: \s*(\{) - captures: - 1: >- - flowtype - punctuation.definition.interface.body.begin.flowtype - set: body-content - - body-content: - - include: comment - - match: \s*(}) - captures: - 1: >- - flowtype - punctuation.definition.interface.body.end.flowtype - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/field.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax b/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax deleted file mode 100644 index 6529c008..00000000 --- a/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax +++ /dev/null @@ -1,88 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS 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: - # Namespace delimited by dots. - - match: | - (?xi)\s* - (?> - (?:\b - ({{commonIdentifier}})(\??\.) - ({{commonIdentifier}})(\??\.) - ) - | - (?:\b({{commonIdentifier}})(\??\.)) - ) - captures: - 1: >- - flowtype - entity.name.namespace.a.flowtype - 2: >- - flowtype - punctuation.definition.namespace.a.flowtype - 3: >- - flowtype - entity.name.namespace.b.flowtype - 4: >- - flowtype - punctuation.definition.namespace.b.flowtype - 5: >- - flowtype - entity.name.namespace.a.flowtype - 6: >- - flowtype - punctuation.definition.namespace.a.flowtype - # Namespace delimited by dollar signs. - - match: | - (?xi)\s* - (?> - (?:\b - ({{commonIdentifier}})(\$) - ({{commonIdentifier}})(\$) - ) - | - (?:\b({{commonIdentifier}})(\$)) - ) - captures: - 1: >- - flowtype - entity.name.namespace.a.flowtype - 2: >- - flowtype - punctuation.definition.namespace.a.flowtype - 3: >- - flowtype - entity.name.namespace.b.flowtype - 4: >- - flowtype - punctuation.definition.namespace.b.flowtype - 5: >- - flowtype - entity.name.namespace.a.flowtype - 6: >- - flowtype - punctuation.definition.namespace.a.flowtype diff --git a/syntaxes/fjsx15/flowtype/simple.sublime-syntax b/syntaxes/fjsx15/flowtype/simple.sublime-syntax deleted file mode 100644 index a7d831bd..00000000 --- a/syntaxes/fjsx15/flowtype/simple.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: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/namespace-path.no-pop.sublime-syntax - # Predefined types. - - match: | - (?x)\s*\b - ((?> any - | Array - | [Bb]oolean - | false - | Function - | Generator - | mixed - | [Nn]umber - | null - | Object - | [Ss]tring - | true - | undefined - | void - ))\b - captures: - 1: >- - flowtype - support.flowtype - entity.name.type.flowtype - set: optional-template-or-array-shorthand - # Other types. - - match: | - (?xi)\s* - ({{commonIdentifier}}) - captures: - 1: >- - flowtype - entity.name.type.flowtype - set: optional-template-or-array-shorthand - - optional-template-or-array-shorthand: - - include: array-shorthand - - include: template - - match: "" - pop: true - - array-shorthand: - - match: | - (?x)\s* - (\[)\s*(]) - captures: - 1: >- - flowtype - punctuation.definition.array.begin.flowtype - 2: >- - flowtype - punctuation.definition.array.end.flowtype - pop: true - - template: - - match: (?=<) - set: [ - optional-array-shorthand, - template-arguments - ] - - optional-array-shorthand: - - include: array-shorthand - - match: (?=\S) - pop: true - - template-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax b/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax deleted file mode 100644 index 27a627f2..00000000 --- a/syntaxes/fjsx15/flowtype/template/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: >- - flowtype - punctuation.definition.template.arguments.begin.flowtype - set: arguments - - arguments: - - match: \s*(,) - captures: - 1: >- - flowtype - punctuation.definition.template.arguments.flowtype - - match: \s*(>) - captures: - 1: >- - flowtype - punctuation.definition.template.arguments.end.flowtype - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax b/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax deleted file mode 100644 index d8e6b8b7..00000000 --- a/syntaxes/fjsx15/flowtype/template/parameters.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: >- - flowtype - punctuation.definition.template.parameters.begin.flowtype - set: parameters - - parameters: - - match: \s*(,) - captures: - 1: >- - flowtype - punctuation.definition.template.parameters.flowtype - - match: \s*(>) - captures: - 1: >- - flowtype - punctuation.definition.template.parameters.end.flowtype - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/fjsx15/flowtype/type.sublime-syntax b/syntaxes/fjsx15/flowtype/type.sublime-syntax deleted file mode 100644 index a92bae9b..00000000 --- a/syntaxes/fjsx15/flowtype/type.sublime-syntax +++ /dev/null @@ -1,238 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS 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:]]* - - templateArguments: | - (< - [^<>]* - \g<-1>? - [^<>]* - >) - - parameters: | - (\( - [^()]* - \g<-1>? - [^()]* - \)) - - flowFunction: | - {{parameters}} - \s*=>\s* - - expressionGroupBegin: | - (\() - -contexts: - main: - - include: operators - # Function. - - match: | - (?xi) - (?=\s* - {{templateArguments}}? - {{flowFunction}} - ) - set: [ - optional-operator, - function-declaration - ] - # Open new expression group. - - match: | - (?xi)\s* - {{expressionGroupBegin}} - captures: - 1: punctuation.definition.expression.group.a.begin.js.fjsx15 - set: open-b-close-a - # Expression contents. - - match: (?=\s*\S) - set: [ - optional-operator, - type-definitions - ] - - open-a-close-b: - - include: function-no-pop - # Open new expression group. - - match: | - (?xi)\s* - {{expressionGroupBegin}} - captures: - 1: punctuation.definition.expression.group.a.begin.js.fjsx15 - push: open-b-close-a - # Close current expression group. - - match: \s*(\)) - captures: - 1: punctuation.definition.expression.group.b.end.js.fjsx15 - set: optional-operator - # Expression contents. - - match: (?=\s*\S) - push: [ - optional-operator, - type-definitions - ] - - open-b-close-a: - - include: function-no-pop - # Open new expression group. - - match: | - (?xi)\s* - {{expressionGroupBegin}} - captures: - 1: punctuation.definition.expression.group.b.begin.js.fjsx15 - push: open-a-close-b - # Close current expression group. - - match: \s*(\)) - captures: - 1: punctuation.definition.expression.group.a.end.js.fjsx15 - set: optional-operator - # Expression contents. - - match: (?=\s*\S) - push: [ - optional-operator, - type-definitions - ] - - function-no-pop: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax - - function-declaration: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/declaration.sublime-syntax - - type-definitions: - - include: comment - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/typeof.no-pop.sublime-syntax - # Enveloped nullable. - - match: | - (?x) - \s*(\?) - \s*(\() - captures: - 1: >- - flowtype - keyword.operator.other.nullable.flowtype - 2: >- - flowtype - punctuation.definition.nullable.begin.flowtype - set: [ - enveloped-nullable-end, - main - ] - # Nullable. - - match: \s*(\?) - captures: - 1: >- - flowtype - keyword.operator.other.nullable.flowtype - # Utility operators. - - match: | - (?x)\s* - (Class)\b - captures: - 1: >- - flowtype - keyword.operator.other.utility.flowtype - set: template - # Utility operators preceded by $. - - match: | - (?x)\s* - (\$ - (?> Abstract - | Diff - | Exact - | Keys - | ObjMap - | PropertyType - | ReadOnly(?:Array)? - | Shape - | Supertype - | Subtype - )\b - ) - captures: - 1: >- - flowtype - keyword.operator.other.utility.flowtype - set: template - # Existential. - - match: \s*(\*) - captures: - 1: >- - flowtype - keyword.operator.other.existential.flowtype - pop: true - # Normal type. - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function.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/fjsx15/flowtype/object.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/tuple.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax - - optional-operator: - - include: operators - - match: (?=\s*\S) - pop: true - - operators: - - include: comment - - include: co-contravariant - # Intersection. - - match: | - (?x) - \s*(&) - (?!(?>&|=)) - captures: - 1: >- - flowtype - keyword.operator.other.intersection.flowtype - set: main - # Union. - - match: | - (?x) - \s*(\|) - (?!(?>\||=|\s*})) - captures: - 1: >- - flowtype - keyword.operator.other.union.flowtype - set: main - - enveloped-nullable-end: - - match: \s*(\)) - captures: - 1: >- - flowtype - punctuation.definition.nullable.end.flowtype - pop: true - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - co-contravariant: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax - - template: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/function-call.sublime-syntax b/syntaxes/fjsx15/function-call.sublime-syntax index 15f2c895..564d5410 100644 --- a/syntaxes/fjsx15/function-call.sublime-syntax +++ b/syntaxes/fjsx15/function-call.sublime-syntax @@ -22,7 +22,7 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? @@ -31,23 +31,23 @@ variables: contexts: main: - # Function call at the result of an expression. - - match: | - (?x) - (?<=\)|]|}|"|'|`) - (?=\s*\() - set: optional-chain-and-arguments - # Template function. + # Generic function call. - match: | (?xi) (?= \s*\#? \s*{{commonIdentifier}} - \s*{{templateArguments}} + \s*{{genericArguments}} \s*(\?\.)? \s*\( ) - set: modifier-and-name + set: [ + meta-scope, + arguments, + generic-arguments, + identifier, + optional-modifier + ] # Simple function call. - match: | (?xi) @@ -57,57 +57,35 @@ contexts: \s*(\?\.)? \s*\( ) - set: modifier-and-name + set: [ + meta-scope, + arguments, + identifier, + optional-modifier + ] - modifier-and-name: - # Private modifier. + optional-modifier: - match: \s*(\#) captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.access.js.fjsx15 - # Support identifier. - - match: | - (?x)\s* - ((?> constructor - | super - ))\b - captures: - 1: >- - support.js.fjsx15 - entity.name.function.js.fjsx15 - set: [ - optional-chain-and-support-arguments, - possible-template-arguments - ] - # Identifier. + 1: storage.modifier.js.fjsx15 + - match: (?=\s*\S) + pop: true + + identifier: - match: | (?xi) \s*({{commonIdentifier}}) captures: - 1: entity.name.function.js.fjsx15 - set: [ - optional-chain-and-arguments, - possible-template-arguments - ] - - possible-template-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax - - match: "" + 1: variable.function.js.fjsx15 pop: true - optional-chain-and-arguments: - # Optional chain operator. - - match: \s*(\?\.) - captures: - 1: keyword.operator.other.optional-chain.js.fjsx15 - # Actual arguments. - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + generic-arguments: + - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax - optional-chain-and-support-arguments: - # Optional chain operator. - - match: \s*(\?\.) - captures: - 1: keyword.operator.other.optional-chain.js.fjsx15 - # Actual arguments. - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax + arguments: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + + meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - match: "" + pop: true diff --git a/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax deleted file mode 100644 index 9b2d6c61..00000000 --- a/syntaxes/fjsx15/function-call/support/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: >- - support.core.js.fjsx15 - punctuation.definition.function.arguments.begin.js.fjsx15 - set: arguments - - arguments: - - match: \s*(\)) - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.arguments.end.js.fjsx15 - pop: true - - match: \s*(,) - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.arguments.js.fjsx15 - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax b/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax deleted file mode 100644 index 0f658f33..00000000 --- a/syntaxes/fjsx15/function-call/support/jest-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: >- - support.lib.jest.fjsx15 - punctuation.definition.function.arguments.begin.js.fjsx15 - set: arguments - - arguments: - - match: \s*(\)) - captures: - 1: >- - support.lib.jest.fjsx15 - punctuation.definition.function.arguments.end.js.fjsx15 - pop: true - - match: \s*(,) - captures: - 1: >- - support.lib.jest.fjsx15 - punctuation.definition.function.arguments.js.fjsx15 - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/fjsx15/function-expression.sublime-syntax b/syntaxes/fjsx15/function-expression.sublime-syntax new file mode 100644 index 00000000..d39bacb0 --- /dev/null +++ b/syntaxes/fjsx15/function-expression.sublime-syntax @@ -0,0 +1,80 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS 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) + (?=\s* + (?:async\s+)? + function\b + ) + set: [ + declaration, + keyword + ] + + keyword: + - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax + - match: \s*(function) + captures: + 1: storage.type.function.js.fjsx15 + pop: true + + declaration: + - meta_scope: meta.function.js.fjsx15 + - include: comment-no-pop + # Body. + - match: (?=\s*\{) + set: body + # Generic parameters. + - match: (?=\s*<) + push: generic-parameters + # Parameters. + - match: (?=\s*\() + push: parameters + # Identifier. + - match: | + (?xi)\s* + (\*)? + (?:\s*({{commonIdentifier}}))? + captures: + 1: storage.modifier.js.fjsx15 + 2: entity.name.function.js.fjsx15 + # None of the expected items matched, it probably ended. + - match: (?=\s*\S) + pop: true + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + generic-parameters: + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.sublime-syntax + + parameters: + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.sublime-syntax + + body: + - include: Packages/Naomi/syntaxes/fjsx15/function/body.sublime-syntax diff --git a/syntaxes/fjsx15/function.sublime-syntax b/syntaxes/fjsx15/function.sublime-syntax index 58b5d965..cc84f2cf 100644 --- a/syntaxes/fjsx15/function.sublime-syntax +++ b/syntaxes/fjsx15/function.sublime-syntax @@ -24,54 +24,72 @@ variables: contexts: main: + - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax#function-properties - match: | - (?x)\s* - (?: - (async)\s+ - )? - \b(function)\b + (?x) + (?=\s* + (?:async\s+)? + function\b + ) + set: [ + declaration, + keyword + ] + + keyword: + - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax + - match: \s*(function) captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.async.js.fjsx15 - 2: >- - storage.type.js.fjsx15 - keyword.declaration.function.js.fjsx15 - set: declaration + 1: storage.type.function.js.fjsx15 + pop: true declaration: - - include: comment + - meta_scope: >- + meta.declaration.function.js.fjsx15 + meta.function.js.fjsx15 + - include: comment-no-pop # Body. - match: (?=\s*\{) set: body - # Template parameters. + # Generic parameters. - match: (?=\s*<) - push: template-parameters + push: generic-parameters # Parameters. - match: (?=\s*\() - push: parameters + set: [ + optional-body, + meta-declaration-scope, + parameters + ] # Identifier. - match: | (?xi)\s* (\*)? - (?: - \s* - ({{commonIdentifier}}) - )? + (?:\s*({{commonIdentifier}}))? captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.generator.js.fjsx15 + 1: storage.modifier.js.fjsx15 2: entity.name.function.js.fjsx15 # None of the expected items matched, it probably ended. - match: (?=\s*\S) pop: true - comment: + meta-declaration-scope: + - meta_scope: meta.declaration.function.js.fjsx15 + - match: "" + pop: true + + optional-body: + - match: (?=\s*\{) + set: body + # Anything else. + - match: (?=\s*\S) + pop: true + + comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - template-parameters: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/parameters.sublime-syntax + generic-parameters: + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.sublime-syntax 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 index 114587ac..913d8b55 100644 --- a/syntaxes/fjsx15/function/body.sublime-syntax +++ b/syntaxes/fjsx15/function/body.sublime-syntax @@ -21,16 +21,22 @@ contexts: main: - match: \s*(\{) captures: - 1: punctuation.definition.function.body.begin.js.fjsx15 - set: body-content + 1: punctuation.section.block.begin.js.fjsx15 + set: [ + close-body, + optional-statements-and-expressions + ] - body-content: + close-body: + - meta_scope: >- + meta.function.js.fjsx15 + meta.block.js.fjsx15 - match: \s*(}) captures: - 1: punctuation.definition.function.body.end.js.fjsx15 + 1: punctuation.section.block.end.js.fjsx15 pop: true - match: "" - push: - - match: (?=\s*}) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + push: optional-statements-and-expressions + + optional-statements-and-expressions: + - include: Packages/Naomi/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax new file mode 100644 index 00000000..5d7a45a5 --- /dev/null +++ b/syntaxes/fjsx15/function/parameter/destructuring/array.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\[) + captures: + 1: >- + destructuring.array.js.fjsx15 + punctuation.definition.array.begin.js.fjsx15 + set: [ delimiters, optional-parameter ] + + delimiters: + - match: \s*(,) + captures: + 1: >- + destructuring.array.js.fjsx15 + punctuation.definition.array.js.fjsx15 + push: optional-parameter + - match: \s*(]) + captures: + 1: >- + destructuring.array.js.fjsx15 + punctuation.definition.array.end.js.fjsx15 + set: optional-type-and-default-value + + optional-parameter: + - include: comment-no-pop + - match: (?=\s*[,)\]}]) + 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: (?=\s*,) + pop: true + - include: Packages/Naomi/syntaxes/flow1/associated-type.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax new file mode 100644 index 00000000..609047aa --- /dev/null +++ b/syntaxes/fjsx15/function/parameter/destructuring/object.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: \s*(\{) + captures: + 1: >- + destructuring.object.js.fjsx15 + punctuation.definition.object.begin.js.fjsx15 + set: [ delimiters, optional-parameter ] + + delimiters: + - match: \s*(,) + captures: + 1: >- + destructuring.object.js.fjsx15 + punctuation.definition.object.js.fjsx15 + push: optional-parameter + - match: \s*(}) + captures: + 1: >- + destructuring.object.js.fjsx15 + punctuation.definition.object.end.js.fjsx15 + set: optional-type-and-default-value + + optional-parameter: + - include: comment-no-pop + - match: (?=\s*[,)\]}]) + 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: (?=\s*,) + pop: true + - include: Packages/Naomi/syntaxes/flow1/associated-type.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + diff --git a/syntaxes/fjsx15/function/parameters/destructuring/object/property.sublime-syntax b/syntaxes/fjsx15/function/parameter/destructuring/object/property.sublime-syntax similarity index 60% rename from syntaxes/fjsx15/function/parameters/destructuring/object/property.sublime-syntax rename to syntaxes/fjsx15/function/parameter/destructuring/object/property.sublime-syntax index e2f1f00e..08aa51ba 100644 --- a/syntaxes/fjsx15/function/parameters/destructuring/object/property.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/destructuring/object/property.sublime-syntax @@ -38,83 +38,54 @@ contexts: punctuation.definition.object.computed-property.begin.js.fjsx15 set: [ optional-alias, - computed-property + computed-property-end, + optional-expression ] # Normal property with an alias. - match: | (?xi) \s*({{commonIdentifier}}) - \s*(:) - \s*({{commonIdentifier}}) - captures: - 1: >- - destructuring.object.js.fjsx15 - object.property.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - destructuring.object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - 3: >- - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true - # Nested destructuring. - - match: | - (?xi)\s* - ({{commonIdentifier}}) (?=\s*:) captures: 1: >- destructuring.object.js.fjsx15 object.property.js.fjsx15 entity.name.variable.js.fjsx15 - pop: true - # Normal property. - - match: | - (?xi)\s* - ({{commonIdentifier}}) - (?!\s*:) - captures: - 1: >- - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true + set: optional-alias + + 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 optional-alias: - - match: | - (?x) - \s*(:) - (?: - \s*({{commonIdentifier}}) - )? + - match: \s*(:) captures: 1: >- destructuring.object.js.fjsx15 keyword.operator.other.association.js.fjsx15 - 2: >- - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 + set: optional-parameter + - match: (?=\s*\S) pop: true - - match: (?=\s*\W) + + optional-parameter: + - include: comment-no-pop + - match: (?=\s*\)) 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 - 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 + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - computed-property: + computed-property-end: - match: \s*(]) captures: 1: >- destructuring.object.js.fjsx15 punctuation.definition.object.computed-property.end.js.fjsx15 pop: true - - match: "" - push: - - match: (?=\s*]) - pop: true - - include: statement-and-expression - - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/goto.sublime-syntax b/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax similarity index 77% rename from syntaxes/fjsx15/goto.sublime-syntax rename to syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax index 970d1a8c..9a8f5147 100644 --- a/syntaxes/fjsx15/goto.sublime-syntax +++ b/syntaxes/fjsx15/function/parameter/simple.no-pop.sublime-syntax @@ -24,15 +24,13 @@ variables: contexts: main: - - match: \s*(goto) - captures: - 1: keyword.control.js.fjsx15 - set: label - - label: - match: | (?xi) - ({{commonIdentifier}}) - captures: - 1: entity.name.label.js.fjsx15 - pop: true + (?= + \s*(?:\.{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 new file mode 100644 index 00000000..90d4ac4f --- /dev/null +++ b/syntaxes/fjsx15/function/parameter/simple.sublime-syntax @@ -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 + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + genericArguments: | + (< + [^<>]* + \g<-1>? + [^<>]* + >) + + parameters: | + (\( + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) + \g<-1>? + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) + \)) + + flowOperators: | + (?> &(?!&) + | \|(?!\|) + ) + + string: | + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + ) + + simpleFlowType: | + (?> {{string}} + | {{commonIdentifier}} + {{genericArguments}}? + ) + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> {{simpleFlowType}} + | \g<-2> + ) + ) + + complexType: | + ( + \??\s* + (?> {{simpleFlowType}} + | {{flowFunction}} + ) + \s*{{flowOperators}}? + \s*\g<-5>? + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | :{{complexType}} + ) + +contexts: + main: + # With default value. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + (?= + \s*{{type}}? + \s*= + ) + captures: + 1: variable.parameter.function.js.fjsx15 + set: [ + optional-default-value, + optional-modifier-and-type + ] + # Normal parameter. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 0: meta.function.parameter.js.fjsx15 + 1: variable.parameter.function.js.fjsx15 + set: optional-modifier-and-type + + optional-modifier-and-type: + - include: Packages/Naomi/syntaxes/flow1/optional-modifier.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax + + optional-default-value: + - meta_scope: >- + meta.function.parameter.js.fjsx15 + meta.function.parameter.optional.js.fjsx15 + - match: (?=\s*(?>[,;:)\]}]|=>)) + pop: true + - match: "" + push: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + - match: "" + pop: true diff --git a/syntaxes/xml1/element/attributes.sublime-syntax b/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax similarity index 81% rename from syntaxes/xml1/element/attributes.sublime-syntax rename to syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax index 8b7872ab..3fb63dbe 100644 --- a/syntaxes/xml1/element/attributes.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax @@ -19,8 +19,8 @@ scope: ... contexts: main: - - match: "" - push: - - include: Packages/Naomi/syntaxes/xml1/attribute.sublime-syntax - - match: \s* - pop: true + - match: (?=\s*\() + 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 index 9762b2e8..fb3fcdb7 100644 --- a/syntaxes/fjsx15/function/parameters.sublime-syntax +++ b/syntaxes/fjsx15/function/parameters.sublime-syntax @@ -21,30 +21,34 @@ contexts: main: - match: \s*(\() captures: - 1: punctuation.definition.function.parameters.begin.js.fjsx15 - set: parameters + 1: punctuation.section.group.begin.js.fjsx15 + set: [ delimiters, optional-parameter ] - parameters: + delimiters: + - meta_scope: >- + meta.function.parameters.js.fjsx15 + meta.group.js.fjsx15 + - include: comment-no-pop - match: \s*(\,) captures: - 1: punctuation.definition.function.parameters.js.fjsx15 + 1: punctuation.separator.comma.js.fjsx15 + push: optional-parameter - match: \s*(\)) captures: - 1: punctuation.definition.function.parameters.end.js.fjsx15 - set: return-type - - match: "" - push: - - match: | - (?x) - (?=\s*(?>,|\))) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/content.sublime-syntax - - associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - return-type: - - match: (?=\s*:) - set: associated-type - - match: "" + 1: punctuation.section.group.end.js.fjsx15 + set: optional-return-type + + optional-parameter: + - include: comment-no-pop + - match: (?=\s*[,)]) 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 + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + optional-return-type: + - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters/content.sublime-syntax b/syntaxes/fjsx15/function/parameters/content.sublime-syntax deleted file mode 100644 index 3ae770f3..00000000 --- a/syntaxes/fjsx15/function/parameters/content.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: ... - -variables: - commonIdentifier: | - [$_[:alpha:]] - [$_[:alnum:]]* - -contexts: - main: - - include: comment - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.sublime-syntax - # Parameter type. - - match: (?=\s*:) - set: associated-type - # Default value. - - match: (?=\s*=) - set: default-value - # Object destructuring. - - match: (?=\s*\{) - set: destructuring-object - # Array destructuring. - - match: (?=\s*\[) - set: destructuring-array - # Reserved word. - - match: \s*(arguments)(?=\W) - captures: - 1: keyword.other.js.fjsx15 - pop: true - # Parameter. - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/simple.sublime-syntax - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - destructuring-object: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax - - destructuring-array: - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax - - default-value: - - match: | - (?x) - (?=\s*(?>,|\))) - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax b/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax deleted file mode 100644 index 7fae6c7c..00000000 --- a/syntaxes/fjsx15/function/parameters/destructuring/array.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: - - match: \s*(\[) - captures: - 1: >- - destructuring.array.js.fjsx15 - punctuation.definition.array.begin.js.fjsx15 - set: items - - items: - - match: \s*(,) - captures: - 1: >- - destructuring.array.js.fjsx15 - punctuation.definition.array.js.fjsx15 - - match: \s*(]) - captures: - 1: >- - destructuring.array.js.fjsx15 - punctuation.definition.array.end.js.fjsx15 - pop: true - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | ] - | \) - ) - ) - pop: true - - include: rest-operator - - include: comment - # Nested destructuring. - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax - # Default value. - - match: (?=\s*=) - set: default-value - # Normal variables. - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/array/variable.sublime-syntax - - rest-operator: - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.sublime-syntax - - default-value: - - match: | - (?x) - (?=\s* - (?> , - | ] - ) - ) - pop: true - - match: "" - push: - - include: statement-and-expression - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax b/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax deleted file mode 100644 index c5764d27..00000000 --- a/syntaxes/fjsx15/function/parameters/destructuring/object.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: \s*(\{) - captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.begin.js.fjsx15 - set: items - - items: - - match: \s*(,) - captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.js.fjsx15 - - match: \s*(}) - captures: - 1: >- - destructuring.object.js.fjsx15 - punctuation.definition.object.end.js.fjsx15 - pop: true - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | } - ) - ) - pop: true - - include: rest-operator - - include: comment - # Default value. - - match: (?=\s*=) - set: default-value - # Property. - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/object/property.sublime-syntax - # We can assume that the “:” is for a nested destructuring because otherwise - # the previous rule for properties would have consumed it. - - match: \s*(:) - captures: - 1: >- - destructuring.object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - # Nested destructuring. - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/array.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/destructuring/object.sublime-syntax - - rest-operator: - - include: Packages/Naomi/syntaxes/fjsx15/operator/rest.sublime-syntax - - default-value: - - match: | - (?x) - (?=\s* - (?> , - | } - ) - ) - pop: true - - match: "" - push: - - include: statement-and-expression - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function/support/body.sublime-syntax b/syntaxes/fjsx15/function/support/body.sublime-syntax deleted file mode 100644 index dc80c1ea..00000000 --- a/syntaxes/fjsx15/function/support/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: - - match: \s*(\{) - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.body.begin.js.fjsx15 - set: body-content - - body-content: - - match: \s*(}) - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.body.end.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - diff --git a/syntaxes/fjsx15/function/support/parameters.sublime-syntax b/syntaxes/fjsx15/function/support/parameters.sublime-syntax deleted file mode 100644 index 7217a4b7..00000000 --- a/syntaxes/fjsx15/function/support/parameters.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: - - match: \s*(\() - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.parameters.begin.js.fjsx15 - set: parameters - - parameters: - - match: \s*(\,) - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.parameters.js.fjsx15 - - match: \s*(\)) - captures: - 1: >- - support.core.js.fjsx15 - punctuation.definition.function.parameters.end.js.fjsx15 - set: return-type - - match: "" - push: - - match: | - (?x) - (?=\s*(?>,|\))) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/content.sublime-syntax - - associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - return-type: - - match: (?=\s*:) - set: associated-type - - match: "" - pop: true diff --git a/syntaxes/fjsx15/function/support/react-js-body.sublime-syntax b/syntaxes/fjsx15/function/support/react-js-body.sublime-syntax deleted file mode 100644 index 3a492346..00000000 --- a/syntaxes/fjsx15/function/support/react-js-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: - - match: \s*(\{) - captures: - 1: >- - support.lib.react-js.js.fjsx15 - punctuation.definition.function.body.begin.js.fjsx15 - set: body-content - - body-content: - - match: \s*(}) - captures: - 1: >- - support.lib.react-js.js.fjsx15 - punctuation.definition.function.body.end.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - diff --git a/syntaxes/fjsx15/function/support/react-js-parameters.sublime-syntax b/syntaxes/fjsx15/function/support/react-js-parameters.sublime-syntax deleted file mode 100644 index 0f6e37cb..00000000 --- a/syntaxes/fjsx15/function/support/react-js-parameters.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: - - match: \s*(\() - captures: - 1: >- - support.lib.react-js.js.fjsx15 - punctuation.definition.function.parameters.begin.js.fjsx15 - set: parameters - - parameters: - - match: \s*(\,) - captures: - 1: >- - support.lib.react-js.js.fjsx15 - punctuation.definition.function.parameters.js.fjsx15 - - match: \s*(\)) - captures: - 1: >- - support.lib.react-js.js.fjsx15 - punctuation.definition.function.parameters.end.js.fjsx15 - set: return-type - - match: "" - push: - - match: | - (?x) - (?=\s*(?>,|\))) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/function/parameters/content.sublime-syntax - - associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - return-type: - - match: (?=\s*:) - set: associated-type - - match: "" - pop: true diff --git a/syntaxes/fjsx15/global.sublime-syntax b/syntaxes/fjsx15/global.sublime-syntax deleted file mode 100644 index 268d43a3..00000000 --- a/syntaxes/fjsx15/global.sublime-syntax +++ /dev/null @@ -1,302 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS 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:]]* - -# This file will include global variables/classes that are available in NodeJS -# and browsers. -contexts: - main: - - include: simple-class - - include: complex-class - - include: simple-function - - include: complex-function - - include: simple-variable - - include: complex-variable - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax - - member-access-operator: - - match: \s*(\.) - captures: - 1: keyword.operator.other.member-access.js.fjsx15 - - simple-class: - - match: | - (?x)\s* - ((?> Array(?:Buffer)? - | Boolean - | DataView - | Date - | Error - | EvalError - | Float32Array - | Float64Array - | Function - | Generator - | GeneratorFunction - | Infinity - | Int16Array - | Int32Array - | Int8Array - | InternalError - | JSON - | Map - | Math - | Number - | Object - | Promise - | Proxy - | RangeError - | ReferenceError - | Reflect - | RegExp - | Set - | String - | Symbol - | SyntaxError - | TypeError - | TypedArray - | URIError - | Uint16Array - | Uint32Array - | Uint8Array - | Uint8ClampedArray - | WeakMap - | WeakSet - ))\b - captures: - 1: >- - support.js.fjsx15 - entity.name.class.js.fjsx15 - set: optional-constructor - - complex-class: - - match: | - (?x)\s* - (?= - (?> Intl.Collator - | Intl.DateTimeFormat - | Intl.NumberFormat - | Intl - )\b - ) - set: complex-class-components - - complex-class-components: - - include: member-access-operator - - match: | - (?x)\s* - ((?> Intl - | Collator - | DateTimeFormat - | NumberFormat - ))\b - captures: - 1: >- - support.js.fjsx15 - entity.name.class.js.fjsx15 - set: optional-constructor - - optional-constructor: - - include: arguments - - match: "" - pop: true - - simple-variable: - - match: | - (?x)\s* - ((?> __dirname - | __filename - ))\b - captures: - 1: >- - support.js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true - - complex-variable: - - match: | - (?x)\s* - (?= - (?> env - | module(?:\.(?>exports|parent))? - | process\. - (?> arch - | argv - | config - | connected - ) - | window(?:\.onload)? - )\b - ) - set: complex-variable-components - - complex-variable-components: - - include: member-access-operator - - include: global-variable - - match: "" - pop: true - - simple-function: - - match: | - (?x)\s* - ((?> decodeURI(?:Component)? - | encodeURI(?:Component)? - | eval - | isFinite - | isNaN - | parseFloat - | parseInt - | require - | setImmediate - | setInterval - | setTimeout - | toString - | uneval - )) - (?=\s*\() - captures: - 1: >- - support.js.fjsx15 - entity.name.function.js.fjsx15 - set: arguments - - complex-function: - - match: | - (?x)\s* - (?= - (?> console\. - (?> assert - | dir - | error - | info - | log - | timeEnd - | time - | trace - | warn - ) - | document\. - (?> addEventListener - | adoptNode - | close - | createAttribute - | createComment - | createDocumentFragment - | createElement - | createTextNode - | getElementById - | getElementByClassName - | getElementsByName - | getElementsByTagName - | hasFocus - | importNode - | normalize(?:Document)? - | open - | querySelector(?:all)? - | removeEventListener - | renameNode - | write(?:ln)? - ) - | process\. - (?> exit - | stderr\.write - | stdout\.write - | on - ) - | window\. - (?> addEventListener - | - ) - ) - \s*\( - ) - set: complex-function-components - - complex-function-components: - - include: arguments - - include: member-access-operator - - include: global-variable - - match: | - (?x)\s* - ((?> addEventListener - | adoptNode - | assert - | close - | createAttribute - | createComment - | createDocumentFragment - | createElement - | createTextNode - | dir - | error - | exit - | getElementByClassName - | getElementById - | getElementsByName - | getElementsByTagName - | hasFocus - | importNode - | info - | log - | normalize(?:Document)? - | on - | open - | querySelector(?:all)? - | removeEventListener - | renameNode - | time - | timeEnd - | trace - | warn - | write(?:ln)? - ))\b - captures: - 1: >- - support.js.fjsx15 - entity.name.function.js.fjsx15 - - global-variable: - - match: | - (?x)\s* - ((?> arch - | argv - | config - | connected - | console - | document - | env - | exports - | filename - | module - | onload - | parent - | process - | stdout - | window - ))\b - captures: - 1: >- - support.js.fjsx15 - entity.name.variable.js.fjsx15 diff --git a/syntaxes/fjsx15/import.sublime-syntax b/syntaxes/fjsx15/import.sublime-syntax index 108cd0c1..620d4f49 100644 --- a/syntaxes/fjsx15/import.sublime-syntax +++ b/syntaxes/fjsx15/import.sublime-syntax @@ -22,50 +22,54 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - templateArguments: | - (< - [^<>]* - \g<-1>? - [^<>]* - >) - contexts: main: + - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax#import-properties # Dynamic import. - match: | (?x)\s* (import)\b (?=\s*\() captures: - 1: keyword.control.import.js.fjsx15 - set: function-arguments + 1: support.function.import.js.fjsx15 + set: [ + function-call-meta-scope, + arguments + ] # Import the entire module. - match: | (?x)\s* (import)\b (?=\s*(?>"|'|`)) captures: - 1: keyword.control.import.js.fjsx15 + 1: keyword.control.import-export.import.js.fjsx15 set: origin-path # Other. - match: | (?x) \s*(import)\b - (?!\s*\.) captures: - 1: keyword.control.import.js.fjsx15 - set: targets + 1: keyword.control.import-export.import.js.fjsx15 + set: [ + delimiter, + optional-target + ] - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + function-call-meta-scope: + - meta_scope: meta.function-call.js.fjsx15 + - match: "" + pop: true + + arguments: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax - function-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/arguments.sublime-syntax + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax origin: - match: \s*(from)\b captures: - 1: keyword.control.import.origin.js.fjsx15 + 1: keyword.control.import-export.origin.js.fjsx15 set: origin-path origin-path: @@ -73,98 +77,62 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - punctuation: - - match: \s*(\{) - captures: - 1: punctuation.definition.import.list.begin.js.fjsx15 + close-block: - match: \s*(}) captures: - 1: punctuation.definition.import.list.end.js.fjsx15 - - match: \s*(,) - captures: - 1: punctuation.definition.import.item.js.fjsx15 - - targets: - - include: comment - - include: origin - - include: punctuation - - match: "" - push: - - include: sequence - - match: "" - pop: true + 1: punctuation.section.block.end.js.fjsx15 + pop: true - sequence: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/typeof.no-pop.sublime-syntax + optional-target: + - match: (?=\s*(?>[,}]|from)) + pop: true # Type. - - match: \s*(type)\b - captures: - 1: >- - storage.type.flowtype - keyword.declaration.type-aliasing.flowtype - set: types - # Default. - - match: \s*(default)\b - captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.control.export.default.js.fjsx15 - set: optional-alias + - include: Packages/Naomi/syntaxes/flow1/type-import.sublime-syntax # All. - match: \s*(\*) captures: - 1: keyword.operator.other.import.all.js.fjsx15 - set: optional-alias - # Simple. + 1: keyword.control.import-export.star.js.fjsx15 + pop: true + # Multiple targets. + - match: \s*(\{) + captures: + 1: punctuation.section.block.begin.js.fjsx15 + set: [ + close-block, + delimiter, + optional-target + ] + # Aliased. - match: | (?xi)\s* ({{commonIdentifier}}) + (?=\s+as) captures: - 1: >- - import.js.fjsx15 - entity.name.ambiguous.js.fjsx15 - set: optional-alias - - types: - - include: aliased-type - - match: \s*(}) + 1: variable.other.readwrite.js.fjsx15 + set: alias + # Simple. + - match: | + (?xi)\s* + ({{commonIdentifier}}) captures: - 1: punctuation.definition.import.list.end.js.fjsx15 + 1: entity.name.variable.js.fjsx15 pop: true - - match: \s*(\{) - captures: - 1: punctuation.definition.import.list.begin.js.fjsx15 - push: - - include: aliased-type - - match: \s*(,) - captures: - 1: punctuation.definition.import.item.js.fjsx15 - - match: (?=\s*}) - pop: true - - aliased-type: - - match: | - (?xi) - (?={{commonIdentifier}}) - set: [ - optional-alias, - simple-type - ] - - simple-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax - optional-alias: - - match: | - (?x) - (?=\s*(?>,|}|from)) + delimiter: + - match: \s*(,) + captures: + 1: punctuation.separator.comma.js.fjsx15 + push: optional-target + # From. + - include: origin + # Anything else. + - match: (?=\s*\S) pop: true - - include: alias alias: - match: \s*(as)\b captures: - 1: keyword.other.alias.js.fjsx15 + 1: keyword.control.import-export.as.js.fjsx15 set: alias-name alias-name: @@ -172,5 +140,5 @@ contexts: (?xi)\s* ({{commonIdentifier}}) captures: - 1: entity.name.alias.js.fjsx15 + 1: entity.name.variable.js.fjsx15 pop: true diff --git a/syntaxes/fjsx15/jest.sublime-syntax b/syntaxes/fjsx15/jest.sublime-syntax index 3e27f704..4a717f70 100644 --- a/syntaxes/fjsx15/jest.sublime-syntax +++ b/syntaxes/fjsx15/jest.sublime-syntax @@ -19,55 +19,98 @@ scope: ... contexts: main: - - include: core - - include: matchers - - include: jest-fn - - arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/jest-arguments.sublime-syntax - - jest-fn: + # jest. - match: | (?x) (?- - support.lib.jest.fjsx15 - entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.lib.jest.fjsx15 - entity.name.function.js.fjsx15 - set: arguments - - core: + 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 - | expect | it | test )) - (?:(.)((?>only|skip)))? - (?=\s*\() captures: - 1: >- - support.lib.jest.fjsx15 - entity.name.function.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.lib.jest.fjsx15 - entity.name.function.js.fjsx15 - set: arguments + 1: support.function.jest.fn.js.fjsx15 + set: [ + meta-scope, + arguments, + optional-skip-only + ] + # expect + - match: (?- - support.lib.jest.fjsx15 - entity.name.function.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.lib.jest.fjsx15 - entity.name.function.js.fjsx15 - set: arguments + 1: support.function.jest.matcher.fjsx15 + set: [ + matcher-meta-scope, + arguments + ] diff --git a/syntaxes/fjsx15/jsx1.sublime-syntax b/syntaxes/fjsx15/jsx1.sublime-syntax index 215ed80c..9e7f40f2 100644 --- a/syntaxes/fjsx15/jsx1.sublime-syntax +++ b/syntaxes/fjsx15/jsx1.sublime-syntax @@ -26,52 +26,35 @@ contexts: main: - match: | (?xi) - (?=\s* - <{{commonIdentifier}} - (?>\s|>|/>) - ) + (?=\s*<(?>>|{{commonIdentifier}})) with_prototype: # Single line comment. - - match: (\{\s*/\*)(.*)(\*/\s*}) + - match: \s*(\{\s*/\*)(.*)(\*/\s*}) captures: 1: >- - source.jsx - comment.block.js.fjsx15 - punctuation.definition.comment.begin.js.fjsx15 - 2: >- - source.jsx - comment.block.js.fjsx15 + comment.block.jsx.jsx1 + punctuation.definition.comment.begin.jsx.jsx1 + 2: comment.block.jsx.jsx1 3: >- - source.jsx - comment.block.js.fjsx15 - punctuation.definition.comment.end.js.fjsx15 + comment.block.jsx.jsx1 + punctuation.definition.comment.end.jsx.jsx1 # Embedded javascript. - - match: (\{) + - match: \s*(\{) captures: - 1: >- - source.jsx.jsx1 - keyword.operator.other.embedded.js.begin.jsx.jsx1 - push: embedded-js - set: jsx - - jsx: - - clear_scopes: true - - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax + 1: punctuation.definition.generic-expression.begin.jsx.jsx1 + push: [ + embedded-js-close, + optional-expression + ] + set: [ Packages/Naomi/syntaxes/naomi.jsx1.sublime-syntax ] - embedded-js: + embedded-js-close: - clear_scopes: true - - meta_content_scope: source.js.fjsx15 - - match: (\s*)(})(\n*) + - meta_scope: source.js.fjsx15 + - match: \s*(}) captures: - 1: source.js.fjsx15 - 2: >- - source.jsx.jsx1 - keyword.operator.other.embedded.js.end.jsx.jsx1 - 3: source.jsx.jsx1 + 1: punctuation.definition.generic-expression.end.jsx.jsx1 pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/literal.sublime-syntax b/syntaxes/fjsx15/literal.sublime-syntax index e5b6119c..818dabae 100644 --- a/syntaxes/fjsx15/literal.sublime-syntax +++ b/syntaxes/fjsx15/literal.sublime-syntax @@ -19,10 +19,10 @@ 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/regex.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/literal/number.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 index 9fdc2426..fd460d76 100644 --- a/syntaxes/fjsx15/literal/array.sublime-syntax +++ b/syntaxes/fjsx15/literal/array.sublime-syntax @@ -19,30 +19,21 @@ scope: ... contexts: main: - - match: | - (?x) - \s*(\[) - (?! - [^;]*?] - \s*=[^=] - ) + - match: \s*(\[) captures: - 1: punctuation.definition.array.begin.js.fjsx15 - set: items + 1: punctuation.section.brackets.begin.js.fjsx15 + set: [ delimiters, optional-expression ] - items: - - match: \s*(,) - captures: - 1: punctuation.definition.array.js.fjsx15 - - include: end - - match: "" - push: - - match: (?=\s*(?>,|])) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - end: + delimiters: + - meta_scope: meta.sequence.js.fjsx15 - match: \s*(]) captures: - 1: punctuation.definition.array.end.js.fjsx15 + 1: punctuation.section.brackets.end.js.fjsx15 pop: true + - match: \s*(,) + captures: + 1: 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 index 9941241d..9723219e 100644 --- a/syntaxes/fjsx15/literal/number.sublime-syntax +++ b/syntaxes/fjsx15/literal/number.sublime-syntax @@ -51,19 +51,29 @@ contexts: pop: true integer: - - match: \s*(0[bB][01_]+) + - match: \s*(0[bB])([01_]+) captures: - 1: constant.numeric.binary.js.fjsx15 + 1: >- + constant.numeric.binary.js.fjsx15 + punctuation.definition.numeric.js.fjsx15 + 2: constant.numeric.binary.js.fjsx15 pop: true - - match: \s*(0[oO][0-7]+) + - match: \s*(0[oO])([0-7]+) captures: - 1: constant.numeric.octal.js.fjsx15 + 1: >- + constant.numeric.octal.js.fjsx15 + punctuation.definition.numeric.js.fjsx15 + 2: constant.numeric.octal.js.fjsx15 pop: true - - match: (?i)\s*(0[xX][0-9a-f_]+) + - match: (?i)\s*(0[xX])([0-9a-f_]+) captures: - 1: constant.numeric.hex.js.fjsx15 + 1: >- + constant.numeric.hex.js.fjsx15 + punctuation.definition.numeric.js.fjsx15 + 2: constant.numeric.hex.js.fjsx15 pop: true - - match: \s*([1-9][0-9_]*|0) + - match: \s*([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 index 50241bcd..ebd98a66 100644 --- a/syntaxes/fjsx15/literal/object.sublime-syntax +++ b/syntaxes/fjsx15/literal/object.sublime-syntax @@ -28,83 +28,48 @@ variables: contexts: main: - # Empty object literal. - - match: | - (?x)\s* - ({)\s*(}) - captures: - 1: punctuation.definition.object.begin.js.fjsx15 - 2: punctuation.definition.object.end.js.fjsx15 - pop: true - # Normal object literal. - match: \s*({) - scope: punctuation.definition.object.begin.js.fjsx15 - set: declaration + scope: punctuation.section.block.begin.js.fjsx15 + set: [ delimiters, statements-and-expressions ] - declaration: + delimiters: + - meta_scope: >- + meta.object-literal.js.fjsx15 + meta.block.js.fjsx15 + - include: comment-no-pop - match: \s*(,) captures: - 1: punctuation.definition.object.js.fjsx15 + 1: punctuation.separator.comma.js.fjsx15 + push: statements-and-expressions - match: \s*(}) captures: - 1: punctuation.definition.object.end.js.fjsx15 + 1: punctuation.section.block.end.js.fjsx15 pop: true - - match: "" - push: - - match: | - (?x) - (?=\s* - (?> , - | } - ) - ) - pop: true - - include: comment - - include: spread-operator - # Associated value. - - match: \s*(:) - scope: >- - object.js.fjsx15 - keyword.operator.other.association.js.fjsx15 - set: associated-value - # Decorators. - - include: Packages/Naomi/syntaxes/fjsx15/decorator.sublime-syntax - # Methods. - - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - # Simple constant. - - match: | - (?x)\s* - (?={{constantIdentifier}}\s*(?>,|}|$)) - set: constant - # Simple variable. - - match: | - (?xi)\s* - (?={{commonIdentifier}}\s*(?>,|}|$)) - set: variable - # Property. - - include: Packages/Naomi/syntaxes/fjsx15/literal/object/property.sublime-syntax - # Other expressions. - - include: statement-and-expression - associated-value: - - match: | - (?x) - (?=\s*(?>,|})) + statements-and-expressions: + - include: comment-no-pop + - match: (?=\s*[,}]) pop: true - - match: "" - push: - - include: statement-and-expression - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax - - spread-operator: + # Spread. - include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax + # Method. + - include: Packages/Naomi/syntaxes/fjsx15/class/modifier.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax + # Simple constant. + - match: | + (?x)\s* + (?={{constantIdentifier}}\s*(?>,|}|$)) + set: constant + # Simple variable. + - match: | + (?xi)\s* + (?={{commonIdentifier}}\s*(?>,|}|$)) + set: variable + # Property. + - include: Packages/Naomi/syntaxes/fjsx15/literal/object/property.sublime-syntax - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-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 diff --git a/syntaxes/fjsx15/literal/object/property.sublime-syntax b/syntaxes/fjsx15/literal/object/property.sublime-syntax index 3a50d346..852ad624 100644 --- a/syntaxes/fjsx15/literal/object/property.sublime-syntax +++ b/syntaxes/fjsx15/literal/object/property.sublime-syntax @@ -26,18 +26,198 @@ variables: [$_[:upper:]] [$_[:upper:][:digit:]]* + indexer: | + (\[ + [^\[\]]* + \g<-1>? + [^\[\]]* + \]) + + methodIdentifier: | + (?> '.*?(?]* + \g<-1>? + [^<>]* + >) + + genericParameters: "{{genericArguments}}" + + parameters: | + (\( + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) + \g<-1>? + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) + \)) + + flowOperators: | + (?> &(?!&) + | \|(?!\|) + ) + + string: | + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + ) + + simpleFlowType: | + (?> {{string}} + | {{commonIdentifier}} + {{genericArguments}}? + ) + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> {{simpleFlowType}} + | \g<-2> + ) + ) + + complexType: | + ( + \??\s* + (?> {{simpleFlowType}} + | {{flowFunction}} + ) + \s*{{flowOperators}}? + \s*\g<-5>? + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | :{{complexType}} + ) + contexts: main: - - include: constant - - include: variable - # String property name. - - match: (?=\s*(?>'|"|`)) - set: string + # Function assigned to property. + - match: | + (?xi) + (?= + \s*{{commonIdentifier}} + \s*: + (?:\s*async\b)? + \s*function + ) + set: [ + function-declaration, + function-keyword, + method-identifier + ] + # Single parameter arrow function assigned to property. + - match: | + (?xi) + (?= + \s*{{commonIdentifier}} + \s*: + (?:\s*async\b)? + \s*{{commonIdentifier}} + \s*{{type}}? + \s*=> + ) + set: [ + arrow-function, + method-identifier + ] + # Arrow function assigned to property. + - match: | + (?xi) + (?= + \s*{{commonIdentifier}} + \s*: + (?:\s*async\b)? + \s*{{genericParameters}}? + \s*{{parameters}} + \s*=> + ) + set: [ + arrow-function, + method-identifier + ] # Computed property name. - match: \s*(\[) captures: - 1: punctuation.definition.object.computed-property.begin.js.fjsx15 - set: computed-property + 1: punctuation.section.brackets.begin.js.fjsx15 + set: [ + associated-value, + computed-key-meta-scope, + computed-property-end, + optional-expression + ] + # String. + - match: (?=\s*['"`]) + set: [ + associated-value, + key-meta-scope, + string + ] + # Simple property. + - include: constant + - include: variable + + escape: + - match: "" + pop: true + + key-meta-scope: + - meta_scope: meta.object-literal.key.js.fjsx15 + - include: escape + + computed-key-meta-scope: + - meta_scope: >- + meta.object-literal.key.js.fjsx15 + meta.object-literal.key.computed.js.fjsx15 + - include: escape + + method-identifier: + - match: | + (?xi) + \s*({{commonIdentifier}}) + \s*(:) + captures: + 1: entity.name.function.js.fjsx15 + 2: punctuation.separator.key-value.js.fjsx15 + pop: true + + arrow-function: + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax + + function-keyword: + - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax#keyword + + function-declaration: + - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax#declaration + + computed-property-end: + - match: \s*(\]) + captures: + 1: punctuation.section.brackets.end.js.fjsx15 + 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 constant: # Single character. @@ -45,10 +225,8 @@ contexts: (?x)\s* ([_[:upper:]])\b captures: - 1: >- - object.property.js.fjsx15 - entity.name.constant.js.fjsx15 - pop: true + 1: meta.object-literal.key.uppercase.js.fjsx15 + set: associated-value # Two or more characters. - match: | (?x)\s* @@ -59,10 +237,8 @@ contexts: ) ) captures: - 1: >- - object.property.js.fjsx15 - entity.name.constant.js.fjsx15 - pop: true + 1: meta.object-literal.key.uppercase.js.fjsx15 + set: associated-value variable: # Single character. @@ -72,10 +248,8 @@ contexts: | [_[:alpha:]]\b )) captures: - 1: >- - object.property.js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true + 1: meta.object-literal.key.js.fjsx15 + set: associated-value # Two or more characters. - match: | (?xi)\s* @@ -86,26 +260,14 @@ contexts: ) ) captures: - 1: >- - object.property.js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true + 1: meta.object-literal.key.js.fjsx15 + set: associated-value - 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 + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - computed-property: - - match: \s*(\]) + associated-value: + - match: \s*(:) captures: - 1: punctuation.definition.object.computed-property.end.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*]) - pop: true - - include: statement-and-expression - - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + 1: punctuation.separator.key-value.js.fjsx15 + set: optional-expression diff --git a/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax b/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax index fd3dff87..27923d8a 100644 --- a/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax @@ -40,28 +40,23 @@ contexts: 1: >- string.quoted.double.js.fjsx15 punctuation.definition.string.begin.js.fjsx15 - with_prototype: - - match: (?- - string.quoted.double.js.fjsx15 - punctuation.definition.string.end.js.fjsx15 - pop: true - set: escape-a + set: string trap: - meta_content_scope: context.trap - escape-a: - - meta_content_scope: string.quoted.double.js.fjsx15 - - match: (?xi){{doubleQuotedEscapeSequences}} - scope: constant.character.escape.a.js.fjsx15 - set: escape-b - - escape-b: + string: - meta_content_scope: string.quoted.double.js.fjsx15 + # New line trap. + - match: (?- + string.quoted.double.js.fjsx15 + punctuation.definition.string.end.js.fjsx15 + pop: true + # Escape. - match: (?xi){{doubleQuotedEscapeSequences}} - scope: constant.character.escape.b.js.fjsx15 - set: escape-a + scope: constant.character.escape.js.fjsx15 diff --git a/syntaxes/fjsx15/literal/string/regex.sublime-syntax b/syntaxes/fjsx15/literal/string/regex.sublime-syntax index 5d0ab226..5ab225a9 100644 --- a/syntaxes/fjsx15/literal/string/regex.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/regex.sublime-syntax @@ -19,83 +19,25 @@ scope: ... contexts: main: - # Regex literals are a bit hard to predict and there are some cases where - # this pattern will fail, for example: - # - # if (something) /regex/.exec(x); - # - # It’s impossible to know that the closing parenthesis is closing the - # statement’s header, that would only be possible with a parser. - # - # http://stackoverflow.com/questions/5519596/when-parsing-javascript-what-determines-the-meaning-of-a-slash - match: | (?x) - (?<= ^ - | \. - | , - | ; - | \( - | \{ - | } - | \[ - | < - | > - | = - | \+ - | - - | \& - | \| - | \^ - | ! - | ~ - | \? - | : - | / - | case - | export - | import - | in - | instanceof - | new - | return - | throw - | typeof - | yield - ) \s*/ (?= .*? (?- - string.unquoted.regex.js.fjsx15 - punctuation.definition.string.begin.js.fjsx15 - set: escape-a + scope: punctuation.definition.string.begin.js.fjsx15 + set: regex + + regex: + - meta_scope: string.regexp.js.fjsx15 + - include: Packages/JavaScript/Regular Expressions (JavaScript).sublime-syntax + - include: regex-end regex-end: - - match: | - (?x) - (/) - ([a-z]{0,5}) + - match: (/)([a-z]{0,5}) captures: - 0: string.unquoted.regex.js.fjsx15 1: punctuation.definition.string.end.js.fjsx15 2: regex.flag.js.fjsx15 pop: true - - escape-a: - - meta_content_scope: string.unquoted.regex.js.fjsx15 - - match: \\. - scope: constant.character.escape.a.js.fjsx15 - set: escape-b - # If the slash was not consumed before, it probably is the end of the regex. - - include: regex-end - - escape-b: - - meta_content_scope: string.unquoted.regex.js.fjsx15 - - match: \\. - scope: constant.character.escape.b.js.fjsx15 - set: escape-a - # If the slash was not consumed before, it probably is the end of the regex. - - include: regex-end diff --git a/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax b/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax index df5c8bcb..77461540 100644 --- a/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/single-quoted.sublime-syntax @@ -40,28 +40,23 @@ contexts: 1: >- string.quoted.single.js.fjsx15 punctuation.definition.string.begin.js.fjsx15 - with_prototype: - - match: (?- - string.quoted.single.js.fjsx15 - punctuation.definition.string.end.js.fjsx15 - pop: true - set: escape-a + set: string trap: - meta_content_scope: context.trap - escape-a: - - meta_content_scope: string.quoted.single.js.fjsx15 - - match: (?xi){{singleQuotedEscapeSequences}} - scope: constant.character.escape.a.js.fjsx15 - set: escape-b - - escape-b: + string: - meta_content_scope: string.quoted.single.js.fjsx15 + # New line trap. + - match: (?- + string.quoted.single.js.fjsx15 + punctuation.definition.string.end.js.fjsx15 + pop: true + # Escape. - match: (?xi){{singleQuotedEscapeSequences}} - scope: constant.character.escape.b.js.fjsx15 - set: escape-a + scope: constant.character.escape.js.fjsx15 diff --git a/syntaxes/fjsx15/literal/string/template.sublime-syntax b/syntaxes/fjsx15/literal/string/template.sublime-syntax index 38fc5436..2fd5f273 100644 --- a/syntaxes/fjsx15/literal/string/template.sublime-syntax +++ b/syntaxes/fjsx15/literal/string/template.sublime-syntax @@ -44,47 +44,34 @@ contexts: \s*({{commonIdentifier}})? \s*(\`) captures: - 0: string.template.js.fjsx15 1: entity.name.function.tag.js.fjsx15 2: punctuation.definition.string.begin.js.fjsx15 - set: escape-a + set: string - escape-a: - - meta_content_scope: string.template.js.fjsx15 - - match: (?xi){{escapeSequences}} - scope: constant.character.escape.a.js.fjsx15 - set: escape-b - - include: embedded-expression - - include: template-end - - escape-b: - - meta_content_scope: string.template.js.fjsx15 + string: + - 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.b.js.fjsx15 - set: escape-a - - include: embedded-expression - - include: template-end - - embedded-expression: - - match: \$\{ - scope: keyword.operator.other.embedded-expression.begin.js.fjsx15 - push: embedded-content + scope: constant.character.escape.js.fjsx15 + # # Embedded expression. + - match: \s*(\$\{) + captures: + 1: punctuation.definition.template-expression.begin.js.fjsx15 + push: [ close-embedded-expression, embedded-content ] - embedded-content: + close-embedded-expression: - clear_scopes: true - - meta_scope: source.js.fjsx15 - - match: \} - scope: keyword.operator.other.embedded-expression.end.js.fjsx15 + - meta_scope: >- + source.js.fjsx15 + meta.template-expression.js.fjsx15 + - match: \s*(}) + captures: + 1: punctuation.definition.template-expression.end.js.fjsx15 pop: true - - match: "" - push: - - match: (?=}) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - template-end: - - match: \` - scope: >- - string.template.js.fjsx15 - punctuation.definition.string.end.js.fjsx15 - pop: true + embedded-content: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/node-js.sublime-syntax b/syntaxes/fjsx15/node-js.sublime-syntax index 55364a6e..a2a31cd8 100644 --- a/syntaxes/fjsx15/node-js.sublime-syntax +++ b/syntaxes/fjsx15/node-js.sublime-syntax @@ -26,7 +26,7 @@ contexts: - include: constants function-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax module: - match: | @@ -39,13 +39,9 @@ contexts: ))\b )? captures: - 1: >- - support.env.node-js.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.env.node-js.js.fjsx15 - entity.name.variable.js.fjsx15 + 1: support.type.object.module.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.type.object.module.js.fjsx15 pop: true process: @@ -74,13 +70,9 @@ contexts: ))\b ) captures: - 1: >- - support.env.node-js.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.env.node-js.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.type.object.module.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.js.fjsx15 set: function-arguments # Variables. - match: | @@ -105,13 +97,9 @@ contexts: ))\b )? captures: - 1: >- - support.env.node-js.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.env.node-js.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.type.object.module.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.variable.js.fjsx15 pop: true functions: @@ -121,13 +109,7 @@ contexts: | require ))\b captures: - 1: >- - support.env.node-js.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.env.node-js.js.fjsx15 - entity.name.class.js.fjsx15 + 1: support.function.js.fjsx15 set: function-arguments constants: @@ -137,7 +119,5 @@ contexts: | __filename ))\b captures: - 1: >- - support.env.node-js.js.fjsx15 - entity.name.constant.js.fjsx15 + 1: support.variable.js.fjsx15 pop: true diff --git a/syntaxes/fjsx15/operator.sublime-syntax b/syntaxes/fjsx15/operator.sublime-syntax index 8aaa7c10..17ea3fa5 100644 --- a/syntaxes/fjsx15/operator.sublime-syntax +++ b/syntaxes/fjsx15/operator.sublime-syntax @@ -19,14 +19,25 @@ scope: ... contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/operator/comma.sublime-syntax + # 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/spread.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/comparison.sublime-syntax - include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/shebang.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/relational.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/other.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/logical.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/operator/bitwise.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 index 5fed0924..e892b0eb 100644 --- a/syntaxes/fjsx15/operator/arithmetic.sublime-syntax +++ b/syntaxes/fjsx15/operator/arithmetic.sublime-syntax @@ -35,16 +35,16 @@ contexts: - match: | (?x)\s* ( - (?> -- - | -=? - | \+\+ - | \+=? - | \*\* - | \*=? + (?> [-][-=]? + | [+][+=]? + | [*][*=]? | /=? | %=? ) ) captures: 1: keyword.operator.arithmetic.js.fjsx15 - pop: true + 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 index 2a92f5e3..0b6e8232 100644 --- a/syntaxes/fjsx15/operator/assignment.sublime-syntax +++ b/syntaxes/fjsx15/operator/assignment.sublime-syntax @@ -22,7 +22,7 @@ contexts: - match: \s*(=) captures: 1: keyword.operator.other.assignment.js.fjsx15 - set: statement-and-expression + set: optional-expression - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/xml1/literal/string/double-quoted.sublime-syntax b/syntaxes/fjsx15/operator/await.sublime-syntax similarity index 69% rename from syntaxes/xml1/literal/string/double-quoted.sublime-syntax rename to syntaxes/fjsx15/operator/await.sublime-syntax index 7b59043d..7fc0a072 100644 --- a/syntaxes/xml1/literal/string/double-quoted.sublime-syntax +++ b/syntaxes/fjsx15/operator/await.sublime-syntax @@ -19,14 +19,16 @@ scope: ... contexts: main: - - match: \s*(\") + - match: \s*(await)\b captures: - 1: punctuation.definition.string.begin.xml.xml1 - set: string + 1: keyword.control.flow.await.js.fjsx15 + set: optional-expression - string: - - meta_scope: string.quoted.double.xml.xml1 - - match: \s*(\") + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + + just-pop: + - match: \s*(await)\b captures: - 1: punctuation.definition.string.end.xml.xml1 + 1: keyword.control.flow.await.js.fjsx15 pop: true diff --git a/syntaxes/fjsx15/operator/bitwise.sublime-syntax b/syntaxes/fjsx15/operator/bitwise.sublime-syntax index d664f0d5..5f4baf04 100644 --- a/syntaxes/fjsx15/operator/bitwise.sublime-syntax +++ b/syntaxes/fjsx15/operator/bitwise.sublime-syntax @@ -49,4 +49,7 @@ contexts: ) captures: 1: keyword.operator.bitwise.js.fjsx15 - pop: true + 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 index 5833627d..37e1134b 100644 --- a/syntaxes/fjsx15/operator/comma.sublime-syntax +++ b/syntaxes/fjsx15/operator/comma.sublime-syntax @@ -21,8 +21,8 @@ contexts: main: - match: \s*(,) captures: - 1: keyword.operator.other.comma.js.fjsx15 - set: statement-and-expression + 1: punctuation.separator.comma.js.fjsx15 + set: optional-expression - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + 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 index 9fbd58ed..737708b4 100644 --- a/syntaxes/fjsx15/operator/comparison.sublime-syntax +++ b/syntaxes/fjsx15/operator/comparison.sublime-syntax @@ -42,4 +42,7 @@ contexts: ) captures: 1: keyword.operator.comparison.js.fjsx15 - pop: true + 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 new file mode 100644 index 00000000..cbd319ca --- /dev/null +++ b/syntaxes/fjsx15/operator/delete.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(delete) + captures: + 1: keyword.operator.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 new file mode 100644 index 00000000..add41981 --- /dev/null +++ b/syntaxes/fjsx15/operator/in.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(in)\b + captures: + 1: keyword.other.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 index c60a87b4..744cffd0 100644 --- a/syntaxes/fjsx15/operator/logical.sublime-syntax +++ b/syntaxes/fjsx15/operator/logical.sublime-syntax @@ -34,4 +34,7 @@ contexts: ) captures: 1: keyword.operator.logical.js.fjsx15 - pop: true + 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 new file mode 100644 index 00000000..7b05a527 --- /dev/null +++ b/syntaxes/fjsx15/operator/new.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + # new.target + - match: | + (?xi) + \s*(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)\s* + (new) + (?=\s+{{commonIdentifier}}) + captures: + 1: keyword.operator.word.new.js.fjsx15 + set: [ + meta-instance-call-constructor-scope, + optional-arguments, + type + ] + # Any other expression after the keyword. + - match: (?i)\s*(new)\b + captures: + 1: keyword.operator.word.new.js.fjsx15 + set: [ + meta-instance-scope, + optional-expression + ] + + escape: + - match: "" + pop: true + + meta-instance-scope: + - meta_scope: meta.instance.js.fjsx15 + - include: escape + + meta-instance-call-constructor-scope: + - meta_scope: meta.instance.constructor.js.fjsx15 + - meta_content_scope: meta.function-call.constructor.js.fjsx15 + - include: escape + + type: + - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax + # Other constructors. + - match: | + (?xi) + \s*({{commonIdentifier}}) + captures: + 1: variable.other.type.js.fjsx15 + pop: true + + optional-arguments: + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + - match: (?=\s*\S) + pop: true + + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/xml1/attribute/value.sublime-syntax b/syntaxes/fjsx15/operator/of.sublime-syntax similarity index 68% rename from syntaxes/xml1/attribute/value.sublime-syntax rename to syntaxes/fjsx15/operator/of.sublime-syntax index e288b21f..61347d21 100644 --- a/syntaxes/xml1/attribute/value.sublime-syntax +++ b/syntaxes/fjsx15/operator/of.sublime-syntax @@ -19,11 +19,11 @@ scope: ... contexts: main: - - match: \s*(\=) + # Technically there’s no “of” operator, but this will simplify for loops. + - match: \s*(of)\b captures: - 1: keyword.operator.other.assignment.xml.xml1 - set: value + 1: keyword.operator.word.of.js.fjsx15 + set: optional-expression - value: - - include: Packages/Naomi/syntaxes/xml1/literal/string/double-quoted.sublime-syntax - - include: Packages/Naomi/syntaxes/xml1/literal/string/single-quoted.sublime-syntax + 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 index ff6c134a..c7b55617 100644 --- a/syntaxes/fjsx15/operator/other.sublime-syntax +++ b/syntaxes/fjsx15/operator/other.sublime-syntax @@ -20,78 +20,42 @@ scope: ... contexts: # | Operator | Description | # |:----------:|:--------------------| - # | typeof | | - # | void | | # | ... | Spread. | # | :: | Bind. | - # | . | Member access. | + # | . | Accessor. | # | ?. | Optional chain. | # | ?? | Nullish coalescing. | # | ? | Ternary. | main: - - match: \s*(typeof)\b - captures: - 1: >- - word.js.fjsx15 - keyword.operator.other.js.fjsx15 - pop: true - - match: \s*(void)\b - captures: - 1: >- - word.js.fjsx15 - keyword.operator.other.void.js.fjsx15 - pop: true - match: \s*(\:{2}) captures: - 1: keyword.operator.other.bind.js.fjsx15 - pop: true + 1: keyword.operator.bind.js.fjsx15 + set: optional-expression - match: \s*(\?\?) captures: - 1: keyword.operator.other.nullish-coalescing.js.fjsx15 - pop: true + 1: keyword.operator.nullish-coalescing.js.fjsx15 + set: optional-expression - match: \s*(\?\.) captures: - 1: keyword.operator.other.optional-chain.js.fjsx15 - set: member-access - - match: \s*(\?) + 1: punctuation.accessor.optional-chain.js.fjsx15 + set: optional-expression + - match: \s*(\.)(?!\.) captures: - 1: keyword.operator.other.ternary.js.fjsx15 - set: ternary-condition - - match: \s*(\.) + 1: punctuation.accessor.js.fjsx15 + set: optional-expression + - match: \s*(\?) captures: - 1: keyword.operator.other.member-access.js.fjsx15 - set: member-access + 1: keyword.operator.ternary.js.fjsx15 + set: [ + ternary-else, + optional-expression + ] - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - ternary-condition: + ternary-else: - match: \s*(:) captures: - 1: keyword.operator.other.ternary.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*:) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - member-access: - - include: comment - # Jest “not”. - - match: | - (?x) - \s*(not\b) - (?=\s*\.) - captures: - 1: >- - support.lib.jest.fjsx15 - entity.name.function.js.fjsx15 - pop: true - # Other members. - - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/jest.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/global.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/function-call.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax + 1: keyword.operator.ternary.js.fjsx15 + set: optional-expression diff --git a/syntaxes/fjsx15/operator/pipe.sublime-syntax b/syntaxes/fjsx15/operator/pipe.sublime-syntax index 5acc13f6..04dacd9b 100644 --- a/syntaxes/fjsx15/operator/pipe.sublime-syntax +++ b/syntaxes/fjsx15/operator/pipe.sublime-syntax @@ -26,25 +26,38 @@ contexts: main: - match: \s*(\|>) captures: - 1: keyword.operator.other.pipe.js.fjsx15 - set: function-or-expression + 1: keyword.operator.pipe.js.fjsx15 + set: target - function-or-expression: + other-expressions: + - match: (?=\s*\S) + pop: true + + target: - include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax # Await keyword. - - match: | - (?x)\s* - (await)\b + - match: \s*(await)\b captures: - 1: keyword.control.js.fjsx15 - pop: true + 1: keyword.control.flow.js.fjsx15 + set: function-identifier + # Simple identifier. + - match: | + (?xi) + (?= + \s*{{commonIdentifier}}\s* + (?>\|>|$) + ) + set: function-identifier + - include: other-expressions + + function-identifier: # Simple function. - match: | (?xi)\s* ({{commonIdentifier}}) captures: - 1: entity.name.function.js.fjsx15 + 1: >- + meta.function-call.js.fjsx15 + variable.function.js.fjsx15 pop: true - # Other expressions. - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - + - include: other-expressions diff --git a/syntaxes/fjsx15/operator/relational.sublime-syntax b/syntaxes/fjsx15/operator/relational.sublime-syntax index 99983fe8..60ab362d 100644 --- a/syntaxes/fjsx15/operator/relational.sublime-syntax +++ b/syntaxes/fjsx15/operator/relational.sublime-syntax @@ -24,13 +24,16 @@ contexts: 1: >- word.js.fjsx15 keyword.operator.relational.js.fjsx15 - set: type + set: optional-type-expression - match: \s*(in)\b captures: 1: >- word.js.fjsx15 keyword.operator.relational.js.fjsx15 - pop: true + set: optional-expression - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax + + optional-type-expression: + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax b/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax new file mode 100644 index 00000000..495c74ee --- /dev/null +++ b/syntaxes/fjsx15/operator/rest.no-pop.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*\.{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 index e6bfce85..eed379f7 100644 --- a/syntaxes/fjsx15/operator/rest.sublime-syntax +++ b/syntaxes/fjsx15/operator/rest.sublime-syntax @@ -21,5 +21,5 @@ contexts: main: - match: \s*(\.{3}) captures: - 1: keyword.operator.other.rest.js.fjsx15 + 1: keyword.operator.rest.js.fjsx15 pop: true diff --git a/syntaxes/fjsx15/operator/spread.sublime-syntax b/syntaxes/fjsx15/operator/spread.sublime-syntax index be33bdb1..803cbc8e 100644 --- a/syntaxes/fjsx15/operator/spread.sublime-syntax +++ b/syntaxes/fjsx15/operator/spread.sublime-syntax @@ -21,8 +21,8 @@ contexts: main: - match: \s*(\.{3}) captures: - 1: keyword.operator.other.spread.js.fjsx15 - set: statement-and-expression + 1: keyword.operator.spread.js.fjsx15 + set: optional-expression - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax diff --git a/syntaxes/fjsx15/terminator.sublime-syntax b/syntaxes/fjsx15/operator/terminator.sublime-syntax similarity index 76% rename from syntaxes/fjsx15/terminator.sublime-syntax rename to syntaxes/fjsx15/operator/terminator.sublime-syntax index 187e0ecc..784b1282 100644 --- a/syntaxes/fjsx15/terminator.sublime-syntax +++ b/syntaxes/fjsx15/operator/terminator.sublime-syntax @@ -21,5 +21,11 @@ contexts: main: - match: \s*(;) captures: - 1: keyword.operator.other.terminator.js.fjsx15 + 1: keyword.other.terminator.js.fjsx15 + set: entry-point + + entry-point: + - include: main + - match: (?=\s*[,:)\]}]) pop: true + - include: Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax diff --git a/syntaxes/fjsx15/function/parameters/simple.sublime-syntax b/syntaxes/fjsx15/operator/typeof.sublime-syntax similarity index 66% rename from syntaxes/fjsx15/function/parameters/simple.sublime-syntax rename to syntaxes/fjsx15/operator/typeof.sublime-syntax index 2acfcb52..418b2899 100644 --- a/syntaxes/fjsx15/function/parameters/simple.sublime-syntax +++ b/syntaxes/fjsx15/operator/typeof.sublime-syntax @@ -24,14 +24,19 @@ variables: contexts: main: + # Type after typeof. - match: | (?xi)\s* - ({{commonIdentifier}})(\?)? + (typeof) + (?=\s+{{commonIdentifier}}) captures: - 1: >- - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - flowtype - keyword.operator.other.optional.flowtype + 1: keyword.operator.word.typeof.js.fjsx15 + set: type + # Any other expression after the keyword. + - match: (?i)\s*(typeof)\b + captures: + 1: keyword.operator.word.typeof.js.fjsx15 pop: true + + type: + - include: Packages/Naomi/syntaxes/fjsx15/operator/new.sublime-syntax#type diff --git a/syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax b/syntaxes/fjsx15/operator/void.sublime-syntax similarity index 72% rename from syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax rename to syntaxes/fjsx15/operator/void.sublime-syntax index 755ead14..5533c1be 100644 --- a/syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax +++ b/syntaxes/fjsx15/operator/void.sublime-syntax @@ -19,13 +19,12 @@ scope: ... contexts: main: - - match: \s*(\+)(?!(?>\+|=)) + - match: \s*(void)\b captures: 1: >- - flowtype - keyword.operator.other.covariant.flowtype - - match: \s*(-)(?!(?>-|=)) - captures: - 1: >- - flowtype - keyword.operator.other.contravariant.flowtype + word.js.fjsx15 + keyword.operator.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 new file mode 100644 index 00000000..781f6ada --- /dev/null +++ b/syntaxes/fjsx15/optional-expression.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - include: expression-escape + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + + expression-escape: + - match: (?=\s*[,;:)\]}]) + pop: true diff --git a/syntaxes/fjsx15/other-keywords.sublime-syntax b/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax similarity index 84% rename from syntaxes/fjsx15/other-keywords.sublime-syntax rename to syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax index da8560b9..a5f2b2d9 100644 --- a/syntaxes/fjsx15/other-keywords.sublime-syntax +++ b/syntaxes/fjsx15/optional-statements-and-expressions.sublime-syntax @@ -19,10 +19,6 @@ scope: ... contexts: main: - - match: | - (?x)\s* - (?> delete - | of - )\b - scope: keyword.other.js.fjsx15 + - match: (?=\s*[)\]}]) pop: true + - include: Packages/Naomi/syntaxes/naomi.fjsx15.sublime-syntax diff --git a/syntaxes/fjsx15/array-access.sublime-syntax b/syntaxes/fjsx15/property-access.sublime-syntax similarity index 64% rename from syntaxes/fjsx15/array-access.sublime-syntax rename to syntaxes/fjsx15/property-access.sublime-syntax index 9e2eec87..d8ca909b 100644 --- a/syntaxes/fjsx15/array-access.sublime-syntax +++ b/syntaxes/fjsx15/property-access.sublime-syntax @@ -19,25 +19,19 @@ scope: ... contexts: main: - - match: | - (?x) - (?<= [$_[:alnum:]] - | ] - | \) - ) - (? props | state ))\b captures: - 1: >- - support.core.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 + 1: support.type.object.js.fjsx15 + set: optional-property-type-and-value + + instance-variables: + - match: | + (?x) + \s*(this) + \s*(\.)\s* + ((?> props + | state + ))\b + captures: + 1: variable.language.this.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.type.object.js.fjsx15 pop: true static-variables: @@ -58,13 +65,9 @@ contexts: | propTypes ))\b captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.other.access.js.fjsx15 - 2: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 - pop: true + 1: storage.modifier.js.fjsx15 + 2: support.type.object.fjsx15 + set: optional-property-type-and-value proptypes: # Function call. @@ -82,17 +85,11 @@ contexts: )) (?=\s*\() captures: - 1: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 - 4: keyword.operator.other.member-access.js.fjsx15 - 5: >- - support.lib.react-js.fjsx15 - entity.name.function.js.fjsx15 + 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: arguments # Normal. - match: | @@ -118,21 +115,13 @@ contexts: (isRequired\b) )? captures: - 1: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 - 4: keyword.operator.other.member-access.js.fjsx15 - 5: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 - 6: keyword.operator.other.member-access.js.fjsx15 - 7: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 + 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.variable.fjsx15 pop: true # “isRequired” after function call. - match: | @@ -141,10 +130,8 @@ contexts: \s*(\.)\s* (isRequired\b) captures: - 1: keyword.operator.other.member-access.js.fjsx15 - 2: >- - support.lib.react-js.fjsx15 - entity.name.variable.js.fjsx15 + 1: punctuation.accessor.js.fjsx15 + 2: support.variable.fjsx15 pop: true functions: @@ -159,13 +146,9 @@ contexts: | isValidElement ))\b captures: - 1: >- - support.lib.react-js.fjsx15 - entity.name.function.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.lib.react-js.fjsx15 - entity.name.function.js.fjsx15 + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 set: arguments # Component functions. - match: | @@ -176,13 +159,9 @@ contexts: | setState ))\b captures: - 1: >- - support.core.fjsx15 - entity.name.variable.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.lib.react-js.fjsx15 - entity.name.function.js.fjsx15 + 1: variable.language.this.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 set: arguments react-dom-functions: @@ -195,11 +174,7 @@ contexts: | unmountComponentAtNode ))\b captures: - 1: >- - support.lib.react-js.fjsx15 - entity.name.function.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.lib.react-js.fjsx15 - entity.name.function.js.fjsx15 + 1: support.type.object.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.fjsx15 set: arguments diff --git a/syntaxes/fjsx15/statement-and-expression.sublime-syntax b/syntaxes/fjsx15/statement-and-expression.sublime-syntax deleted file mode 100644 index 47b0aea1..00000000 --- a/syntaxes/fjsx15/statement-and-expression.sublime-syntax +++ /dev/null @@ -1,137 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS 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: | - (?- + meta.block.js.fjsx15 + punctuation.section.block.begin.js.fjsx15 + set: [ + block-end, + optional-statements-and-expressions + ] + + block-end: + - meta_content_scope: meta.block.js.fjsx15 + - match: \s*(}) + captures: + 1: >- + meta.block.js.fjsx15 + punctuation.section.block.end.js.fjsx15 + pop: true + - match: "" + push: optional-statements-and-expressions + + break-continue: + - match: | + (?xi) + \s*(?>(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 + + debugger: + - match: \s*(debugger)\b + captures: + 1: keyword.other.js.fjsx15 + pop: true + + do-while: + - match: \s*(do)\b + captures: + 1: keyword.control.loop.js.fjsx15 + pop: true + - match: \s*(while)\b + captures: + 1: keyword.control.loop.js.fjsx15 + set: optional-expression + + empty: + - match: \s*(;) + captures: + 1: punctuation.terminator.js.fjsx15 + pop: true + + for: + - match: \s*(for)\b + captures: + 1: >- + meta.loop.for.js.fjsx15 + keyword.control.loop.js.fjsx15 + set: [ + meta-loop-for, + optional-statements-and-expressions, + statements-and-expressions-header, + optional-await + ] + + if-else: + - match: \s*(if)\b + captures: + 1: >- + meta.conditional.js.fjsx15 + keyword.control.conditional.js.fjsx15 + set: [ + meta-conditional, + optional-statements-and-expressions, + optional-expression + ] + - match: \s*(else)\b + captures: + 1: >- + meta.conditional.js.fjsx15 + keyword.control.conditional.js.fjsx15 + set: [ + meta-conditional, + optional-else-if + ] + + optional-else-if: + - include: no-meta-if + - include: optional-statements-and-expressions + + no-meta-if: + - match: \s*(if)\b + captures: + 1: keyword.control.conditional.js.fjsx15 + set: [ + optional-statements-and-expressions, + optional-expression + ] + + label: + - match: | + (?xi) + \s*({{commonIdentifier}}) + \s*(:) + captures: + 1: entity.name.label.js.fjsx15 + 2: punctuation.separator.js.fjsx15 + set: optional-statements-and-expressions + + return: + - match: \s*(return)\b + captures: + 1: keyword.control.flow.return.js.fjsx15 + set: asi-checked-optional-expression + + switch-case: + - match: \s*(switch)\b + captures: + 1: keyword.control.switch.js.fjsx15 + set: [ + meta-switch, + optional-expression + ] + - match: \s*(case)\b + captures: + 1: keyword.control.switch.js.fjsx15 + set: [ + colon, + optional-expression + ] + + colon: + - match: \s*(:) + captures: + 1: punctuation.separator.js.fjsx15 + pop: true + + throw: + - match: \s*(throw)\b + captures: + 1: keyword.control.flow.break.throw.js.fjsx15 + set: asi-checked-optional-expression + + try-catch-finally: + - match: \s*(try)\b + captures: + 1: keyword.control.trycatch.js.fjsx15 + pop: true + - match: \s*(catch)\b + captures: + 1: keyword.control.trycatch.js.fjsx15 + set: optional-expression + - match: \s*(finally)\b + captures: + 1: keyword.control.trycatch.js.fjsx15 + pop: true + + yield: + - match: \s*(yield)\b + captures: + 1: keyword.control.flow.js.fjsx15 + set: optional-expression diff --git a/syntaxes/fjsx15/statement/bodied.sublime-syntax b/syntaxes/fjsx15/statement/bodied.sublime-syntax deleted file mode 100644 index 1aa169f6..00000000 --- a/syntaxes/fjsx15/statement/bodied.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: ... - -contexts: - main: - # Body only. - - match: | - (?x)\s* - ((?> do - | else - | finally - | try - ))\b - captures: - 1: keyword.control.js.fjsx15 - set: body - # Optional header. - - match: | - (?x)\s*\b - (catch)\b - captures: - 1: keyword.control.js.fjsx15 - set: [ - body, - optional-header - ] - # Header and body. - - match: | - (?x)\s*\b - ((?> if - | elseif - | for - | while - | switch - ))\b - (?:\s+ - (await) - )? - captures: - 1: keyword.control.js.fjsx15 - 2: keyword.control.js.fjsx15 - set: [ - body, - header - ] - - optional-header: - - match: (?=\s*\{) - pop: true - - match: (?=\s*\() - set: header - - header: - - match: \s*(\() - captures: - 1: punctuation.definition.control.header.begin.js.fjsx15 - set: header-content - - header-content: - - match: \s*(\)) - captures: - 1: punctuation.definition.control.header.end.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*\)) - pop: true - - include: statement-and-expression - - terminator: - - match: \s*(;) - captures: - 1: keyword.operator.other.terminator.js.fjsx15 - pop: true - - body: - - match: \s*(\{) - captures: - 1: punctuation.definition.control.body.begin.js.fjsx15 - set: body-content - - include: statement-and-expression - - body-content: - - match: \s*(}) - captures: - 1: punctuation.definition.control.body.end.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: statement-and-expression - - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/statement/hanging.sublime-syntax b/syntaxes/fjsx15/statement/hanging.sublime-syntax deleted file mode 100644 index 131ccedb..00000000 --- a/syntaxes/fjsx15/statement/hanging.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* - ((?> case - | default - ))\b - captures: - 1: keyword.control.js.fjsx15 - set: operator - - operator: - - match: \s*(:) - captures: - 1: keyword.operator.other.js.fjsx15 - set: optional-body - - match: "" - push: - - include: statement-and-expression - - optional-body: - - match: \s*(\{) - captures: - 1: punctuation.definition.control.body.begin.js.fjsx15 - set: body-content - - match: (?=\S) - pop: true - - body-content: - - match: \s*(}) - captures: - 1: punctuation.definition.control.body.end.js.fjsx15 - pop: true - - match: "" - push: - - match: (?=\s*}) - pop: true - - include: statement-and-expression - - statement-and-expression: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax diff --git a/syntaxes/fjsx15/statement/label.sublime-syntax b/syntaxes/fjsx15/statement/label.sublime-syntax deleted file mode 100644 index 32c9b60b..00000000 --- a/syntaxes/fjsx15/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}}) - (? return - | throw - ))\b - captures: - 1: keyword.control.flow-break.js.fjsx15 - pop: true - - match: | - (?x)\s* - ((?> await - | default - | delete - ))\b - captures: - 1: keyword.control.js.fjsx15 - pop: true - - break-continue: - - match: | - (?x)\s* - ((?> break - | continue - ))\b - captures: - 1: keyword.control.flow-break.js.fjsx15 - set: optional-label - - optional-label: - - match: | - (?xi)\s* - ({{commonIdentifier}}) - (? \s*(\*) - | \b - ) - captures: - 1: keyword.control.js.fjsx15 - 2: >- - statement.modifier.js.fjsx15 - keyword.operator.other.generator.js.fjsx15 - pop: true diff --git a/syntaxes/fjsx15/type/arguments.sublime-syntax b/syntaxes/fjsx15/type/arguments.sublime-syntax index 5796a880..70d43479 100644 --- a/syntaxes/fjsx15/type/arguments.sublime-syntax +++ b/syntaxes/fjsx15/type/arguments.sublime-syntax @@ -34,6 +34,6 @@ contexts: 1: punctuation.definition.type.arguments.js.fjsx15 - match: "" push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # - 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 index 09f83d0d..25f8e8c5 100644 --- a/syntaxes/fjsx15/type/support/arguments.sublime-syntax +++ b/syntaxes/fjsx15/type/support/arguments.sublime-syntax @@ -40,6 +40,6 @@ contexts: punctuation.definition.type.arguments.js.fjsx15 - match: "" push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + # - 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 index b76b1a10..162eabd2 100644 --- a/syntaxes/fjsx15/variable-declaration.sublime-syntax +++ b/syntaxes/fjsx15/variable-declaration.sublime-syntax @@ -17,88 +17,181 @@ hidden: true scope: ... +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + + constantIdentifier: | + [$_[:upper:]] + [$_[:upper:][:digit:]]* + + genericArguments: | + (< + [^<>]* + \g<-1>? + [^<>]* + >) + + parameters: | + (\( + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) + \g<-1>? + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) + \)) + + flowOperators: | + (?> &(?!&) + | \|(?!\|) + ) + + string: | + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + ) + + simpleFlowType: | + (?> {{string}} + | {{commonIdentifier}} + {{genericArguments}}? + ) + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> {{simpleFlowType}} + | \g<-2> + ) + ) + + complexType: | + ( + \??\s* + (?> {{simpleFlowType}} + | {{flowFunction}} + ) + \s*{{flowOperators}}? + \s*\g<-5>? + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | :{{complexType}} + ) + contexts: main: - # Destructuring object. - - match: | - (?x) - (?=\s* - (?> const - | let - | var - )\s+\{ - ) - set: [ - punctuation, - destructuring-object, - keyword - ] - # Destructuring array. - - match: | - (?x) - (?=\s* - (?> const - | let - | var - )\s+\[ - ) - set: [ - punctuation, - destructuring-array, - keyword - ] - # Simple variable. - match: | (?x) - (?=\s* - (?> const - | let - | var - )\s+ - ) + (?=\s*(?>const|let|var)\b) set: [ - punctuation, + optional-type-and-initial-value, variable-or-constant, keyword ] - comment: + comment-no-pop: - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax - destructuring-object: - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/object.sublime-syntax + optional-expression: + - include: Packages/Naomi/syntaxes/fjsx15/optional-expression.sublime-syntax - destructuring-array: - - include: Packages/Naomi/syntaxes/fjsx15/destructuring/array.sublime-syntax + associated-type: + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax + + optional-type-and-initial-value: + - meta_scope: meta.declaration.variable.js.fjsx15 + - match: (?=\s*:) + push: associated-type + - match: \s*(,) + captures: + 1: punctuation.separator.js.fjsx15 + push: variable-or-constant + - match: (?=\s*=) + push: optional-expression + - match: (?=\s*\S) + pop: true keyword: - - include: comment - match: | (?x)\s* - ( - (?> const - | let - | var - ) - ) + ((?>const|let|var)) captures: - 1: >- - storage.type.js.fjsx15 - keyword.declaration.variable.js.fjsx15 + 1: storage.type.js.fjsx15 pop: true variable-or-constant: - - include: comment - - include: Packages/Naomi/syntaxes/fjsx15/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/variable.sublime-syntax + - 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 - punctuation: - - include: comment - - match: (?=\s*:) - set: type - - match: "" + optional-type: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax + + constant: + # Single character. + - match: | + (?x)\s* + (\#)? + ([_[:upper:]])\b + captures: + 1: storage.modifier.js.fjsx15 + 2: entity.name.constant.js.fjsx15 + pop: true + # Two or more characters. + - match: | + (?x)\s* + (\#)? + ( + {{constantIdentifier}} + (?> \$\B + | [_[:upper:][:digit:]]\b + ) + ) + captures: + 1: storage.modifier.js.fjsx15 + 2: entity.name.constant.js.fjsx15 pop: true - type: - - include: comment - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax + variable: + # Single character. + - match: | + (?xi)\s* + (\#)? + ((?> \$\B + | [_[:alpha:]]\b + )) + captures: + 1: storage.modifier.js.fjsx15 + 2: entity.name.variable.js.fjsx15 + pop: true + # Two or more characters. + - match: | + (?xi)\s* + (\#)? + ( + {{commonIdentifier}} + (?> \$\B + | [_[:alnum:]]\b + ) + ) + captures: + 1: storage.modifier.js.fjsx15 + 2: entity.name.variable.js.fjsx15 + pop: true diff --git a/syntaxes/fjsx15/variable.sublime-syntax b/syntaxes/fjsx15/variable.sublime-syntax index 02ab64b7..ef572181 100644 --- a/syntaxes/fjsx15/variable.sublime-syntax +++ b/syntaxes/fjsx15/variable.sublime-syntax @@ -22,12 +22,186 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* + genericArguments: | + (< + [^<>]* + \g<-1>? + [^<>]* + >) + + parameters: | + (\( + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) + \g<-1>? + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) + \)) + + flowOperators: | + (?> &(?!&) + | \|(?!\|) + ) + + string: | + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + ) + + simpleFlowType: | + (?> {{string}} + | {{commonIdentifier}} + {{genericArguments}}? + ) + + flowFunction: | + ( + {{parameters}} + \s*=>\s* + (?> {{simpleFlowType}} + | \g<-2> + ) + ) + + complexType: | + ( + \??\s* + (?> {{simpleFlowType}} + | {{flowFunction}} + ) + \s*{{flowOperators}}? + \s*\g<-5>? + ) + + flowComment: /\*\s*:.*?\*/ + + type: | + (?> {{flowComment}} + | :{{complexType}} + ) + contexts: main: - - include: support-variable - - include: common-variable + - include: object + - include: simple + + function-assigned-to-variable: + # Normal arrow function assigned to variable. + - match: | + (?x) + (?= + \s*{{commonIdentifier}} + \s*{{type}}? + \s*= + \s*(?:async\b)? + \s*{{genericArguments}}? + \s*{{parameters}} + \s*{{type}}? + \s*=> + ) + set: [ + normal-arrow-function, + assignment, + optional-type, + function-identifier + ] + # Single parameter arrow function assigned to variable. + - match: | + (?x) + (?= + \s*{{commonIdentifier}} + \s*{{type}}? + \s*= + \s*(?:async\b)? + \s*{{commonIdentifier}} + \s*{{type}}? + \s*=> + ) + set: [ + single-parameter-arrow-function, + assignment, + optional-type, + function-identifier + ] + # Function assigned to variable. + - match: | + (?x) + (?= + \s*{{commonIdentifier}} + \s*{{type}}? + \s*= + \s*(?:async\b)? + \s*function + ) + set: [ + function, + assignment, + optional-type, + function-identifier + ] + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + function: + - meta_scope: meta.function.declaration.js.fjsx15 + - include: Packages/Naomi/syntaxes/fjsx15/function.sublime-syntax + + assignment: + - match: \s*(=) + captures: + 1: keyword.operator.assignment.js.fjsx15 + pop: true + + function-identifier: + - match: | + (?xi) + \s*({{commonIdentifier}}) + captures: + 1: entity.name.function.js.fjsx15 + pop: true + + arrow-body: + - include: Packages/Naomi/syntaxes/fjsx15/arrow-function/body.sublime-syntax + + normal-arrow-function: + - meta_scope: meta.function.declaration.js.fjsx15 + - include: Packages/Naomi/syntaxes/fjsx15/async.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/function/parameters.no-pop.sublime-syntax + - match: (?=\s*=>) + set: arrow-body + + single-parameter-arrow-function: + - meta_scope: meta.function.declaration.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: (?=\s*=>) + set: arrow-body + + optional-type: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/flow1/optional-associated-type.sublime-syntax + + object: + - match: | + (?xi)\s* + (\#)? + ({{commonIdentifier}}) + (?=\s*\??\.) + captures: + 1: storage.modifier.js.fjsx15 + 2: variable.other.object.js.fjsx15 + pop: true - common-variable: + simple: # Single character. - match: | (?xi)\s* @@ -36,10 +210,8 @@ contexts: | [_[:alpha:]]\b )) captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.access.js.fjsx15 - 2: entity.name.variable.js.fjsx15 + 1: storage.modifier.js.fjsx15 + 2: variable.other.readwrite.js.fjsx15 pop: true # Two or more characters. - match: | @@ -52,20 +224,6 @@ contexts: ) ) captures: - 1: >- - storage.modifier.js.fjsx15 - keyword.operator.other.access.js.fjsx15 - 2: entity.name.variable.js.fjsx15 - pop: true - - support-variable: - - match: | - (?xi)\s* - ((?> super - | this - ))\b - captures: - 1: >- - support.js.fjsx15 - entity.name.variable.js.fjsx15 + 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 index 7a4f60c9..fc3e66c6 100644 --- a/syntaxes/fjsx15/web.sublime-syntax +++ b/syntaxes/fjsx15/web.sublime-syntax @@ -19,41 +19,15 @@ scope: ... contexts: main: - - include: console-functions - include: document-functions + - include: document-properties - include: window-functions - function-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/function-call/support/arguments.sublime-syntax - - console-functions: - - match: | - (?x) - \s*(console)\b - (?: - \s*(\.)\s* - ((?> assert - | clear - | count - | error - | group(?>Collapsed|End)? - | info - | log - | table - | time(?>End|Stamp)? - | trace - | warn - ))\b - ) - captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 - set: function-arguments + optional-generic-and-arguments: + - include: Packages/Naomi/syntaxes/flow1/generic/arguments.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax + - match: (?=\s*\S) + pop: true document-functions: - match: | @@ -104,14 +78,118 @@ contexts: ))\b ) captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 - set: function-arguments + 1: support.type.object.dom.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.js.fjsx15 + set: optional-generic-and-arguments + + document-properties: + - match: | + (?x) + \s*(document)\b + (?: + \s*(\.)\s* + ((?> 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 + ) + captures: + 1: support.type.object.dom.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.variable.js.fjsx15 + pop: true window-functions: - match: | @@ -164,11 +242,7 @@ contexts: ))\b ) captures: - 1: >- - support.core.js.fjsx15 - entity.name.class.js.fjsx15 - 2: keyword.operator.other.member-access.js.fjsx15 - 3: >- - support.core.js.fjsx15 - entity.name.function.js.fjsx15 - set: function-arguments + 1: support.type.object.dom.js.fjsx15 + 2: punctuation.accessor.js.fjsx15 + 3: support.function.js.fjsx15 + set: optional-generic-and-arguments diff --git a/syntaxes/xml1/attribute.sublime-syntax b/syntaxes/flow1/associated-type.no-pop.sublime-syntax similarity index 81% rename from syntaxes/xml1/attribute.sublime-syntax rename to syntaxes/flow1/associated-type.no-pop.sublime-syntax index 79a9069e..5bed4a82 100644 --- a/syntaxes/xml1/attribute.sublime-syntax +++ b/syntaxes/flow1/associated-type.no-pop.sublime-syntax @@ -19,5 +19,8 @@ scope: ... contexts: main: - - include: Packages/Naomi/syntaxes/xml1/attribute/normal.sublime-syntax - - include: Packages/Naomi/syntaxes/xml1/attribute/value.sublime-syntax + - match: (?=\s*:) + push: associated-type + + associated-type: + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax b/syntaxes/flow1/associated-type.sublime-syntax similarity index 77% rename from syntaxes/fjsx15/flowtype/associated-type.sublime-syntax rename to syntaxes/flow1/associated-type.sublime-syntax index e8366a48..b6f000a9 100644 --- a/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax +++ b/syntaxes/flow1/associated-type.sublime-syntax @@ -21,10 +21,8 @@ contexts: main: - match: \s*(:) captures: - 1: >- - flowtype - keyword.operator.other.association.flowtype - set: type + 1: keyword.operator.other.flow + set: optional-type-expression - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax + 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 new file mode 100644 index 00000000..0f5bdf16 --- /dev/null +++ b/syntaxes/flow1/cast.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(:) + captures: + 1: 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 new file mode 100644 index 00000000..df3ccdb4 --- /dev/null +++ b/syntaxes/flow1/comment.sublime-syntax @@ -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 + +scope: ... + +contexts: + main: + - match: \s*(/\*\s*::) + captures: + 1: >- + comment.block.flow + punctuation.definition.comment.begin.flow + set: [ block-end, statements-and-expressions ] + - match: \s*(/\*(?=\s*:)) + captures: + 1: >- + comment.block.flow + punctuation.definition.comment.begin.flow + set: [ block-end, associated-type ] + + block-end: + - meta_scope: comment.block.flow + - match: \s*(\*/) + captures: + 1: >- + comment.block.flow + punctuation.definition.comment.end.js.fjsx15 + 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.js.fjsx15 + pop: true + - match: '' + pop: true + + associated-type: + - match: (?=\s*\*\/) + pop: true + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax + + statements-and-expressions: + - match: (?=\s*\*\/) + pop: true + - match: "" + push: + - match: \s*(;) + captures: + 1: keyword.other.terminator.js.fjsx15 + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax + - 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/class/property.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/indexer.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/export.sublime-syntax + - match: "" + pop: true diff --git a/syntaxes/flow1/declare.sublime-syntax b/syntaxes/flow1/declare.sublime-syntax new file mode 100644 index 00000000..92595b42 --- /dev/null +++ b/syntaxes/flow1/declare.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(declare)\b + captures: + 1: keyword.declaration.flow + set: possible-module + + possible-module: + - include: Packages/Naomi/syntaxes/flow1/module.sublime-syntax + - match: (?=\s*\S) + pop: true diff --git a/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax b/syntaxes/flow1/function.no-pop.sublime-syntax similarity index 72% rename from syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax rename to syntaxes/flow1/function.no-pop.sublime-syntax index 5de1cf89..32b0fbcc 100644 --- a/syntaxes/fjsx15/flowtype/function.no-pop.sublime-syntax +++ b/syntaxes/flow1/function.no-pop.sublime-syntax @@ -18,7 +18,7 @@ hidden: true scope: ... variables: - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? @@ -27,9 +27,17 @@ variables: parameters: | (\( - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \g<-1>? - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \)) flowFunction: | @@ -41,10 +49,10 @@ contexts: - match: | (?xi) (?=\s* - {{templateArguments}}? + {{genericArguments}}? {{flowFunction}} ) push: declaration declaration: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/declaration.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/function.sublime-syntax#declaration diff --git a/syntaxes/fjsx15/flowtype/function.sublime-syntax b/syntaxes/flow1/function.sublime-syntax similarity index 50% rename from syntaxes/fjsx15/flowtype/function.sublime-syntax rename to syntaxes/flow1/function.sublime-syntax index 8a2da9a0..5a532b90 100644 --- a/syntaxes/fjsx15/flowtype/function.sublime-syntax +++ b/syntaxes/flow1/function.sublime-syntax @@ -18,7 +18,7 @@ hidden: true scope: ... variables: - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? @@ -27,9 +27,17 @@ variables: parameters: | (\( - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \g<-1>? - [^()]* + (?> '(?:\'|[^'])*' + | "(?:\"|[^"])*" + | `(?:\`|[^`])*` + | [^'"`()]* + ) \)) flowFunction: | @@ -41,10 +49,33 @@ contexts: - match: | (?xi) (?=\s* - {{templateArguments}}? + {{genericArguments}}? {{flowFunction}} ) set: declaration declaration: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/function/declaration.sublime-syntax + # Generic parameters. + - match: (?=\s*<) + push: generic-parameters + # Parameters. + - match: (?=\s*\() + set: [ + return, + parameters + ] + + generic-parameters: + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.sublime-syntax + + parameters: + - include: Packages/Naomi/syntaxes/flow1/function/parameters.sublime-syntax + + return: + - match: \s*(=>) + captures: + 1: storage.type.function.arrow.flow + set: optional-type-expression + + optional-type-expression: + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax b/syntaxes/flow1/function/parameters.sublime-syntax similarity index 54% rename from syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax rename to syntaxes/flow1/function/parameters.sublime-syntax index 0f658f33..52754349 100644 --- a/syntaxes/fjsx15/function-call/support/react-js-arguments.sublime-syntax +++ b/syntaxes/flow1/function/parameters.sublime-syntax @@ -21,25 +21,26 @@ contexts: main: - match: \s*(\() captures: - 1: >- - support.lib.jest.fjsx15 - punctuation.definition.function.arguments.begin.js.fjsx15 - set: arguments + 1: punctuation.section.group.begin.flow + set: [ delimiters, optional-parameter ] - arguments: + delimiters: + - match: \s*(,) + captures: + 1: punctuation.separator.comma.flow + push: optional-parameter - match: \s*(\)) captures: - 1: >- - support.lib.jest.fjsx15 - punctuation.definition.function.arguments.end.js.fjsx15 + 1: punctuation.section.group.end.flow pop: true - - match: \s*(,) + + optional-parameter: + - meta_scope: meta.function.parameters.js.fjsx15 + # Rest. + - match: \s*(\.{3}) captures: - 1: >- - support.lib.jest.fjsx15 - punctuation.definition.function.arguments.js.fjsx15 - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true + 1: 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/fjsx15/flowtype/function/parameters/simple.sublime-syntax b/syntaxes/flow1/function/parameters/simple.sublime-syntax similarity index 77% rename from syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax rename to syntaxes/flow1/function/parameters/simple.sublime-syntax index 68e71023..efe6147c 100644 --- a/syntaxes/fjsx15/flowtype/function/parameters/simple.sublime-syntax +++ b/syntaxes/flow1/function/parameters/simple.sublime-syntax @@ -29,11 +29,9 @@ contexts: ({{commonIdentifier}})(\?)? (?=\s*:) captures: - 1: >- - flowtype - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - flowtype - keyword.operator.other.optional.flowtype - pop: true + 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/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax b/syntaxes/flow1/generic/arguments.no-pop.sublime-syntax similarity index 80% rename from syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax rename to syntaxes/flow1/generic/arguments.no-pop.sublime-syntax index b5d117dd..ac51d6d2 100644 --- a/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax +++ b/syntaxes/flow1/generic/arguments.no-pop.sublime-syntax @@ -20,8 +20,7 @@ scope: ... contexts: main: - match: (?=\s*<) - captures: - push: template-arguments + push: arguments - template-arguments: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.sublime-syntax + arguments: + - include: Packages/Naomi/syntaxes/flow1/generic/arguments.sublime-syntax diff --git a/syntaxes/fjsx15/function-call/arguments.sublime-syntax b/syntaxes/flow1/generic/arguments.sublime-syntax similarity index 61% rename from syntaxes/fjsx15/function-call/arguments.sublime-syntax rename to syntaxes/flow1/generic/arguments.sublime-syntax index a01bac49..6e4ef8aa 100644 --- a/syntaxes/fjsx15/function-call/arguments.sublime-syntax +++ b/syntaxes/flow1/generic/arguments.sublime-syntax @@ -19,21 +19,21 @@ scope: ... contexts: main: - - match: \s*(\() + - match: \s*(<) captures: - 1: punctuation.definition.function.arguments.begin.js.fjsx15 - set: arguments + 1: punctuation.section.generic.begin.flow + set: [ delimiters, optional-type-expression ] - arguments: - - match: \s*(\)) - captures: - 1: punctuation.definition.function.arguments.end.js.fjsx15 - pop: true + delimiters: + - meta_scope: meta.generic.flow - match: \s*(,) captures: - 1: punctuation.definition.function.arguments.js.fjsx15 - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true + 1: punctuation.separator.comma.flow + push: optional-type-expression + - match: \s*(>) + captures: + 1: punctuation.section.generic.end.flow + pop: true + + optional-type-expression: + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/xml1/element/content.sublime-syntax b/syntaxes/flow1/generic/parameters.no-pop.sublime-syntax similarity index 81% rename from syntaxes/xml1/element/content.sublime-syntax rename to syntaxes/flow1/generic/parameters.no-pop.sublime-syntax index e7bdf26c..86009db2 100644 --- a/syntaxes/xml1/element/content.sublime-syntax +++ b/syntaxes/flow1/generic/parameters.no-pop.sublime-syntax @@ -19,8 +19,8 @@ scope: ... contexts: main: - - match: "" - push: - - include: Packages/Naomi/syntaxes/xml1/element.sublime-syntax - - match: \s* - pop: true + - match: (?=\s*<) + push: parameters + + parameters: + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.sublime-syntax diff --git a/syntaxes/fjsx15/new.sublime-syntax b/syntaxes/flow1/generic/parameters.sublime-syntax similarity index 54% rename from syntaxes/fjsx15/new.sublime-syntax rename to syntaxes/flow1/generic/parameters.sublime-syntax index 8c2ca140..d54e9684 100644 --- a/syntaxes/fjsx15/new.sublime-syntax +++ b/syntaxes/flow1/generic/parameters.sublime-syntax @@ -24,35 +24,34 @@ variables: contexts: main: - # Type after new. - - match: | - (?xi)\s* - (new) - (?=\s+{{commonIdentifier}}) - captures: - 1: keyword.other.js.fjsx15 - set: [ - optional-template-and-args, - type - ] - # Any other expression after the keyword. - - match: (?i)\s*(new)\b + - match: \s*(<) captures: - 1: keyword.other.js.fjsx15 - pop: true + 1: punctuation.definition.generic.begin.flow + set: [ delimiters, generic-identifier ] - type: - - include: Packages/Naomi/syntaxes/fjsx15/core.sublime-syntax - # Other constructors. + generic-identifier: - match: | (?xi) \s*({{commonIdentifier}}) captures: - 1: entity.name.class.js.fjsx15 + 1: variable.parameter.generic.flow + set: optional-refinement + + optional-refinement: + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax + - match: (?=\s*\S) pop: true - optional-template-and-args: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/template/arguments.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/type/arguments.sublime-syntax - - match: "" + delimiters: + - meta_scope: meta.generic.flow + - match: \s*(,) + captures: + 1: punctuation.separator.comma.flow + set: [ delimiters, generic-identifier ] + - match: \s*(>) + captures: + 1: punctuation.definition.generic.end.flow pop: true + + optional-type-expression: + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/indexer.sublime-syntax b/syntaxes/flow1/indexer.sublime-syntax similarity index 55% rename from syntaxes/fjsx15/flowtype/indexer.sublime-syntax rename to syntaxes/flow1/indexer.sublime-syntax index f8a0145c..b9d42e6a 100644 --- a/syntaxes/fjsx15/flowtype/indexer.sublime-syntax +++ b/syntaxes/flow1/indexer.sublime-syntax @@ -22,56 +22,39 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - constantIdentifier: | - [$_[:upper:]] - [$_[:upper:][:digit:]]* - contexts: main: - - match: | - (?x)^ - (?:\s* - (?>(\+)|(-)) - )? - \s*(\[) + - match: \s*(\[) captures: - 1: >- - flowtype - keyword.operator.other.covariant.flowtype - 2: >- - flowtype - keyword.operator.other.contravariant.flowtype - 3: >- - flowtype - punctuation.definition.object.indexer.flowtype + 1: punctuation.section.brackets.begin.flow set: [ - associated-type, + optional-associated-type, indexer-end, - named-or-anonymous + optional-name ] indexer-end: - match: \s*(]) captures: - 1: >- - flowtype - punctuation.definition.object.indexer.flowtype + 1: punctuation.section.brackets.end.flow pop: true - named-or-anonymous: - - include: comment + type-expression: + - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax + + 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)\s* ({{commonIdentifier}})(\?)? (?=\s*:) captures: - 1: >- - function.parameter.js.fjsx15 - entity.name.variable.js.fjsx15 - 2: >- - flowtype - keyword.operator.other.optional.flowtype + 1: variable.parameter.function.js.fjsx15 + 2: storage.modifier.optional.flow set: associated-type # Strings. - match: (?=\s*(?>'|"|`)) @@ -79,8 +62,9 @@ contexts: associated-type, string ] - # Simple type. - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax + # Other type expressions. + - match: (?=\s*\S) + set: type-expression string: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax @@ -88,10 +72,7 @@ contexts: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/template.sublime-syntax associated-type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/flow1/interface.sublime-syntax b/syntaxes/flow1/interface.sublime-syntax new file mode 100644 index 00000000..b9b23a72 --- /dev/null +++ b/syntaxes/flow1/interface.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: \s*(interface)\b + captures: + 1: storage.type.interface.flow + set: declaration + + declaration: + - include: comment-no-pop + # Extension. + - match: \s*(extends)\b + captures: + 1: storage.modifier.extends.flow + push: optional-type-expression + # Generic parameters. + - match: (?=\s*<) + push: generic-parameters + # Body. + - match: (?=\s*\{) + set: body + # Identifier. + - match: (?xi)\s*({{commonIdentifier}}) + captures: + 1: entity.name.interface.flow + + optional-type-expression: + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax + + generic-parameters: + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.sublime-syntax + + body: + - include: comment-no-pop + - match: \s*(\{) + captures: + 1: punctuation.section.block.begin.flow + set: [ body-end, statements-and-expressions ] + + body-end: + - include: comment-no-pop + - match: \s*(?>(,)|(;)) + captures: + 1: punctuation.separator.comma.flow + 2: punctuation.terminator.flow + push: statements-and-expressions + - match: \s*(}) + captures: + 1: punctuation.section.brackets.end.flow + pop: true + - match: (?=\s*\S) + push: statements-and-expressions + + statements-and-expressions: + - match: (?=\s*}) + pop: true + - 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/flow1/indexer.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/class/property.sublime-syntax + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/module.sublime-syntax b/syntaxes/flow1/module.sublime-syntax similarity index 57% rename from syntaxes/fjsx15/flowtype/module.sublime-syntax rename to syntaxes/flow1/module.sublime-syntax index e74b1fa8..83d6327d 100644 --- a/syntaxes/fjsx15/flowtype/module.sublime-syntax +++ b/syntaxes/flow1/module.sublime-syntax @@ -24,18 +24,30 @@ variables: contexts: main: - - match: | - (?xi)\s* - (module) - captures: - 1: >- - flowtype - storage.type.flowtype - keyword.declaration.type-aliasing.flowtype + # Common JS module. + - match: (?=\s*module\s*.\s*exports) set: [ - body, - identifier + object-literal, + association, + common-js-module ] + # ES module. + - match: \s*(module) + captures: + 1: storage.type.module.flow + set: identifier + + common-js-module: + - include: Packages/Naomi/syntaxes/fjsx15/node-js.sublime-syntax#module + + association: + - match: \s*(:) + captures: + 1: keyword.operator.other.flow + pop: true + + object-literal: + - include: Packages/Naomi/syntaxes/fjsx15/literal/object.sublime-syntax identifier: - include: Packages/Naomi/syntaxes/fjsx15/literal/string/double-quoted.sublime-syntax @@ -45,33 +57,5 @@ contexts: (?xi)\a* ({{commonIdentifier}}) captures: - 1: >- - flowtype - entity.name.module.flowtype + 1: entity.name.module.flow pop: true - - body: - - include: comment - - match: \s*(\{) - captures: - 1: >- - flowtype - punctuation.definition.module.body.begin.flowtype - set: body-content - - body-content: - - include: comment - - match: \s*(}) - captures: - 1: >- - flowtype - punctuation.definition.module.body.end.flowtype - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/flow1/namespace-path.no-pop.sublime-syntax b/syntaxes/flow1/namespace-path.no-pop.sublime-syntax new file mode 100644 index 00000000..0e0c916b --- /dev/null +++ b/syntaxes/flow1/namespace-path.no-pop.sublime-syntax @@ -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. + +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) + \s*({{commonIdentifier}})\s* + (?> (\?\.) + | (\.) + ) + captures: + 1: variable.other.namespace.flow + 2: punctuation.accessor.optional-chain.flow + 3: punctuation.accessor.flow diff --git a/syntaxes/fjsx15/flowtype/object.sublime-syntax b/syntaxes/flow1/object.sublime-syntax similarity index 60% rename from syntaxes/fjsx15/flowtype/object.sublime-syntax rename to syntaxes/flow1/object.sublime-syntax index 699284a4..292d724b 100644 --- a/syntaxes/fjsx15/flowtype/object.sublime-syntax +++ b/syntaxes/flow1/object.sublime-syntax @@ -31,62 +31,46 @@ contexts: # Exact. - match: \s*({)\s*(\|) captures: - 1: >- - flowtype - punctuation.definition.object.begin.flowtype - 2: >- - flowtype - punctuation.definition.object.begin.flowtype - set: declaration + 1: punctuation.section.block.begin.flow + 2: punctuation.section.block.begin.flow + set: [ delimiters, optional-property-or-method ] # Normal. - match: \s*({) captures: - 1: >- - flowtype - punctuation.definition.object.begin.flowtype - set: declaration + 1: punctuation.section.block.begin.flow + set: [ delimiters, optional-property-or-method ] - declaration: - - match: \s*(,|;) + delimiters: + - match: \s*(?:(,)|(;)) captures: - 1: >- - flowtype - punctuation.definition.object.flowtype + 1: punctuation.separator.comma.flow + 2: punctuation.terminator.flow + push: optional-property-or-method # Exact. - match: \s*(\|)\s*(}) captures: - 1: >- - flowtype - punctuation.definition.object.end.flowtype - 2: >- - flowtype - punctuation.definition.object.end.flowtype + 1: punctuation.section.block.end.flow + 2: punctuation.section.block.end.flow pop: true # Normal. - match: \s*(}) captures: - 1: >- - flowtype - punctuation.definition.object.end.flowtype + 1: punctuation.section.block.end.flow pop: true - - match: "" - push: - - include: comment - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/co-contravariant.no-pop.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/indexer.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/callable.sublime-syntax - - include: Packages/Naomi/syntaxes/fjsx15/class/method.sublime-syntax - - include: property - - match: "" - pop: true - property: + optional-property-or-method: + - include: comment-no-pop + - match: (?=\s*[|}]) + pop: true + - 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: (?=\s*(?>'|"|`)) set: [ - type, + associated-type, string ] @@ -101,9 +85,9 @@ contexts: object.property.js.fjsx15 entity.name.constant.js.fjsx15 2: >- - flowtype - keyword.operator.other.optional.flowtype - set: type + flow + keyword.operator.other.optional.flow + set: associated-type # Two or more characters. - match: | (?x)\s* @@ -119,9 +103,9 @@ contexts: object.property.js.fjsx15 entity.name.constant.js.fjsx15 2: >- - flowtype - keyword.operator.other.optional.flowtype - set: type + flow + keyword.operator.other.optional.flow + set: associated-type variable: # Single character. @@ -136,9 +120,9 @@ contexts: object.property.js.fjsx15 entity.name.variable.js.fjsx15 2: >- - flowtype - keyword.operator.other.optional.flowtype - set: type + flow + keyword.operator.other.optional.flow + set: associated-type # Two or more characters. - match: | (?xi)\s* @@ -154,18 +138,17 @@ contexts: object.property.js.fjsx15 entity.name.variable.js.fjsx15 2: >- - flowtype - keyword.operator.other.optional.flowtype - set: type + flow + keyword.operator.other.optional.flow + set: associated-type 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: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - comment: - - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax + associated-type: + - include: Packages/Naomi/syntaxes/flow1/associated-type.sublime-syntax + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax diff --git a/syntaxes/flow1/operator.sublime-syntax b/syntaxes/flow1/operator.sublime-syntax new file mode 100644 index 00000000..5176c675 --- /dev/null +++ b/syntaxes/flow1/operator.sublime-syntax @@ -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. + +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/xml1/attribute/normal.sublime-syntax b/syntaxes/flow1/operator/array-shorthand.sublime-syntax similarity index 78% rename from syntaxes/xml1/attribute/normal.sublime-syntax rename to syntaxes/flow1/operator/array-shorthand.sublime-syntax index 5dd9acfb..490fe04f 100644 --- a/syntaxes/xml1/attribute/normal.sublime-syntax +++ b/syntaxes/flow1/operator/array-shorthand.sublime-syntax @@ -17,16 +17,11 @@ hidden: true scope: ... -variables: - commonIdentifier: | - [_:[:alpha:]] - [_:[:alnum:]\-.]* - contexts: main: - - match: | - (?xi) - \s*({{commonIdentifier}}) + - match: \s*((\[)\s*(])) captures: - 1: entity.name.attribute.xml.xml1 + 1: meta.sequence.flow + 2: punctuation.section.brackets.begin.flow + 3: punctuation.section.brackets.end.flow pop: true diff --git a/syntaxes/json1/comment.no-pop.sublime-syntax b/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax similarity index 81% rename from syntaxes/json1/comment.no-pop.sublime-syntax rename to syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax index 4772b82c..89e077ac 100644 --- a/syntaxes/json1/comment.no-pop.sublime-syntax +++ b/syntaxes/flow1/operator/contravariant.no-pop.sublime-syntax @@ -19,8 +19,6 @@ scope: ... contexts: main: - - match: | - (?x) - (?=(?>\/\/|\/\*|\#)) - push: - - include: Packages/Naomi/syntaxes/json1/comment.sublime-syntax + - match: \s*(-) + captures: + 1: storage.modifier.contravariant.flow diff --git a/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax b/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax new file mode 100644 index 00000000..0aa791db --- /dev/null +++ b/syntaxes/flow1/operator/covariant.no-pop.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\+) + captures: + 1: storage.modifier.covariant.flow diff --git a/syntaxes/flow1/operator/intersection.sublime-syntax b/syntaxes/flow1/operator/intersection.sublime-syntax new file mode 100644 index 00000000..3417a007 --- /dev/null +++ b/syntaxes/flow1/operator/intersection.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(&) + captures: + 1: 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 new file mode 100644 index 00000000..75e41965 --- /dev/null +++ b/syntaxes/flow1/operator/nullable.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\?) + captures: + 1: 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/fjsx15/flowtype/cast.sublime-syntax b/syntaxes/flow1/operator/typeof.sublime-syntax similarity index 76% rename from syntaxes/fjsx15/flowtype/cast.sublime-syntax rename to syntaxes/flow1/operator/typeof.sublime-syntax index 042a7ae3..a8e3cf41 100644 --- a/syntaxes/fjsx15/flowtype/cast.sublime-syntax +++ b/syntaxes/flow1/operator/typeof.sublime-syntax @@ -19,14 +19,10 @@ scope: ... contexts: main: - - match: | - (?x) - \s*(:) + - match: (?i)\s*(typeof)\b captures: - 1: >- - flowtype - keyword.operator.other.cast.flowtype + 1: keyword.operator.word.typeof.flow set: type type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax + - 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 new file mode 100644 index 00000000..25470536 --- /dev/null +++ b/syntaxes/flow1/operator/union.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\|) + captures: + 1: 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 new file mode 100644 index 00000000..ff57aa9a --- /dev/null +++ b/syntaxes/flow1/optional-associated-type.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*:) + set: associated-type + - match: (?=\s*\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 new file mode 100644 index 00000000..92f4ffda --- /dev/null +++ b/syntaxes/flow1/optional-modifier.no-pop.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*\?) + 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 new file mode 100644 index 00000000..cdec777e --- /dev/null +++ b/syntaxes/flow1/optional-modifier.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - match: \s*(\?) + captures: + 1: storage.modifier.optional.flow + pop: true diff --git a/syntaxes/flow1/optional-type-expression.sublime-syntax b/syntaxes/flow1/optional-type-expression.sublime-syntax new file mode 100644 index 00000000..7ea24d30 --- /dev/null +++ b/syntaxes/flow1/optional-type-expression.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +contexts: + main: + - match: (?=\s*[>,;:)\]}]) + pop: true + - include: Packages/Naomi/syntaxes/flow1/type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/prolog.sublime-syntax b/syntaxes/flow1/prolog.sublime-syntax similarity index 91% rename from syntaxes/fjsx15/flowtype/prolog.sublime-syntax rename to syntaxes/flow1/prolog.sublime-syntax index 0f46fe80..20ec908f 100644 --- a/syntaxes/fjsx15/flowtype/prolog.sublime-syntax +++ b/syntaxes/flow1/prolog.sublime-syntax @@ -25,7 +25,5 @@ contexts: | \/\*\s*@flow\s\*\/ )) captures: - 1: >- - flowtype - keyword.other.prolog.flowtype + 1: keyword.other.prolog.flow pop: true diff --git a/syntaxes/fjsx15/function/parameters/destructuring/array/variable.sublime-syntax b/syntaxes/flow1/simple.sublime-syntax similarity index 55% rename from syntaxes/fjsx15/function/parameters/destructuring/array/variable.sublime-syntax rename to syntaxes/flow1/simple.sublime-syntax index 35da5307..83ed2765 100644 --- a/syntaxes/fjsx15/function/parameters/destructuring/array/variable.sublime-syntax +++ b/syntaxes/flow1/simple.sublime-syntax @@ -24,30 +24,37 @@ variables: contexts: main: - # Single character. + - include: Packages/Naomi/syntaxes/flow1/namespace-path.no-pop.sublime-syntax + # Existential. + - match: \s*(\*) + captures: + 1: support.type.existential.flow + pop: true + # Predefined types. - match: | - (?xi)\s* - ((?> \$\B - | [_[:alpha:]]\b - )) + (?x)\s*\b + ((?> any + | Array + | [Bb]oolean + | false + | Function + | Generator + | mixed + | [Nn]umber + | null + | Object + | [Ss]tring + | true + | undefined + | void + ))\b captures: - 1: >- - function.parameter.js.fjsx15 - destructuring.array.js.fjsx15 - entity.name.variable.js.fjsx15 + 1: support.type.flow pop: true - # Two or more characters. + # Other types. - match: | (?xi)\s* - ( - {{commonIdentifier}} - (?> \$\B - | [_[:alnum:]]\b - ) - ) + ({{commonIdentifier}}) captures: - 1: >- - function.parameter.js.fjsx15 - destructuring.array.js.fjsx15 - entity.name.variable.js.fjsx15 + 1: variable.other.type.flow pop: true diff --git a/syntaxes/fjsx15/flowtype/tuple.sublime-syntax b/syntaxes/flow1/tuple.sublime-syntax similarity index 63% rename from syntaxes/fjsx15/flowtype/tuple.sublime-syntax rename to syntaxes/flow1/tuple.sublime-syntax index 348c802a..e0e648c1 100644 --- a/syntaxes/fjsx15/flowtype/tuple.sublime-syntax +++ b/syntaxes/flow1/tuple.sublime-syntax @@ -21,25 +21,18 @@ contexts: main: - match: \s*(\[) captures: - 1: >- - flowtype - punctuation.definition.array.begin.flowtype - set: items + 1: punctuation.section.brackets.flow + set: [ delimiters, optional-type-expression ] - items: + delimiters: - match: \s*(,) captures: - 1: >- - flowtype - punctuation.definition.array.flowtype + 1: punctuation.separator.flow + push: optional-type-expression - match: \s*(]) captures: - 1: >- - flowtype - punctuation.definition.array.end.flowtype + 1: punctuation.section.brackets.end.flow pop: true - - match: "" - push: - - match: (?=\,|]) - pop: true - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax + + optional-type-expression: + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax diff --git a/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax b/syntaxes/flow1/type-aliasing.sublime-syntax similarity index 56% rename from syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax rename to syntaxes/flow1/type-aliasing.sublime-syntax index 56eecae1..5cfcc112 100644 --- a/syntaxes/fjsx15/flowtype/type-aliasing.sublime-syntax +++ b/syntaxes/flow1/type-aliasing.sublime-syntax @@ -22,7 +22,7 @@ variables: [$_[:alpha:]] [$_[:alnum:]]* - templateArguments: | + genericArguments: | (< [^<>]* \g<-1>? @@ -37,42 +37,40 @@ contexts: (type)\b (?=\s+ {{commonIdentifier}} - {{templateArguments}}? + {{genericArguments}}? ) captures: - 1: >- - flowtype - storage.type.flowtype - keyword.other.access.flowtype - 2: >- - flowtype - storage.type.flowtype - keyword.declaration.type-aliasing.flowtype + 1: storage.modifier.opaque.flow + 2: storage.type.flow set: [ punctuation, - optional-constraint, identifier ] identifier: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/simple.sublime-syntax - - optional-constraint: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/associated-type.sublime-syntax - - match: (?=\s*\S) + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: entity.name.type.flow pop: true punctuation: + - meta_scope: meta.declaration.type.flow + - include: Packages/Naomi/syntaxes/flow1/generic/parameters.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/flow1/associated-type.no-pop.sublime-syntax - match: \s*(=) captures: - 1: >- - flowtype - keyword.operator.other.assignment.flowtype - set: type - # Anything other than the assignment symbol here will terminate the type - # declaration. - - match: (?=\s*\S) - pop: true + 1: keyword.operator.other.assignment.flow + set: [ + meta-scope, + optional-type-expression + ] - type: - - include: Packages/Naomi/syntaxes/fjsx15/flowtype/type.sublime-syntax + optional-type-expression: + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.sublime-syntax + + meta-scope: + - meta_scope: meta.declaration.type.flow + - match: "" + pop: true diff --git a/syntaxes/flow1/type-export.sublime-syntax b/syntaxes/flow1/type-export.sublime-syntax new file mode 100644 index 00000000..d63666f9 --- /dev/null +++ b/syntaxes/flow1/type-export.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: \s*(typeof)\b + captures: + 1: keyword.operator.word.typeof.flow + set: optional-target + - match: \s*(type)\b + captures: + 1: storage.type.flow + set: optional-target + + optional-target: + - match: (?=\s*(?>[,}]|from)) + pop: true + # Multiple targets. + - match: \s*(\{) + captures: + 1: punctuation.section.block.begin.js.fjsx15 + set: [ + close-block, + delimiter, + optional-target + ] + # Aliased. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + (?=\s+as) + captures: + 1: variable.other.type.js.fjsx15 + set: alias + # Simple. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: variable.other.type.js.fjsx15 + pop: true + + delimiter: + - match: \s*(,) + captures: + 1: punctuation.separator.comma.js.fjsx15 + push: optional-target + # From. + - include: origin + # Anything else. + - match: (?=\s*\S) + pop: true + + origin: + - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#origin + + close-block: + - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#close-block + + alias: + - match: \s*(as)\b + captures: + 1: keyword.control.import-export.as.js.fjsx15 + set: alias-name + + alias-name: + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: variable.other.type.js.fjsx15 + pop: true diff --git a/syntaxes/flow1/type-expression.sublime-syntax b/syntaxes/flow1/type-expression.sublime-syntax new file mode 100644 index 00000000..3c96b0d3 --- /dev/null +++ b/syntaxes/flow1/type-expression.sublime-syntax @@ -0,0 +1,92 @@ +%YAML1.2 +--- + +# Licensed under the Apache License, Version 2.0 (the “License”); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT +# WARRANTIES OR CONDITIONS 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*(\() + expressionBegin: (?=\s*\S) + +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: "{{expressionGroupBegin}}" + captures: + 1: punctuation.section.group.begin.flow + set: open-group + # Start of the type expression. + - match: "{{expressionBegin}}" + set: [ optional-tail, head ] + + comment-no-pop: + - include: Packages/Naomi/syntaxes/fjsx15/comment.no-pop.sublime-syntax + + optional-type-expression: + - include: Packages/Naomi/syntaxes/flow1/optional-type-expression.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: "{{expressionGroupBegin}}" + captures: + 1: punctuation.section.group.begin.flow + push: open-group + # Close the current type expression group. + - include: close-group + # Start of the type expression. + - match: "{{expressionBegin}}" + push: optional-type-expression + + close-group: + - match: \s*(\)) + captures: + 1: punctuation.section.group.end.flow + set: optional-tail + + head: + - include: comment-no-pop + - include: Packages/Naomi/syntaxes/flow1/function.sublime-syntax + - 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 + + optional-tail: + - include: comment-no-pop + # Array shorthand or generic arguments. + - match: (?=\s*[\[<]) + set: [ optional-tail, tail ] + # Other operators. + - include: Packages/Naomi/syntaxes/flow1/operator.sublime-syntax + # Anything else not expected. + - match: (?=\s*\S) + pop: true + + 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 new file mode 100644 index 00000000..48e631cf --- /dev/null +++ b/syntaxes/flow1/type-import.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_[:alnum:]]* + +contexts: + main: + - match: \s*(typeof)\b + captures: + 1: keyword.operator.word.typeof.flow + set: optional-target + - match: \s*(type)\b + captures: + 1: storage.type.flow + set: optional-target + + optional-target: + - match: (?=\s*(?>[,}]|from)) + pop: true + # Multiple targets. + - match: \s*(\{) + captures: + 1: punctuation.section.block.begin.js.fjsx15 + set: [ + close-block, + delimiter, + optional-target + ] + # Aliased. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + (?=\s+as) + captures: + 1: variable.other.type.js.fjsx15 + set: alias + # Simple. + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: entity.name.type.js.fjsx15 + pop: true + + delimiter: + - match: \s*(,) + captures: + 1: punctuation.separator.comma.js.fjsx15 + push: optional-target + # From. + - include: origin + # Anything else. + - match: (?=\s*\S) + pop: true + + origin: + - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#origin + + close-block: + - include: Packages/Naomi/syntaxes/fjsx15/import.sublime-syntax#close-block + + alias: + - match: \s*(as)\b + captures: + 1: keyword.control.import-export.as.js.fjsx15 + set: alias-name + + alias-name: + - match: | + (?xi)\s* + ({{commonIdentifier}}) + captures: + 1: entity.name.type.js.fjsx15 + pop: true diff --git a/syntaxes/json1/comment.sublime-syntax b/syntaxes/json1/comment.sublime-syntax deleted file mode 100644 index 570898b2..00000000 --- a/syntaxes/json1/comment.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: \s*(\/\/|\#) - captures: - 1: punctuation.definition.comment.begin.json.json1 - set: line - - match: \s*(\/\*) - captures: - 1: punctuation.definition.comment.begin.json.json1 - set: block - - line: - - meta_scope: comment.line.json.json1 - - include: email - - include: link - - match: \s*$ - pop: true - - block: - - meta_scope: comment.block.json.json1 - - include: email - - include: link - - match: \s*(\*\/) - captures: - 1: punctuation.comment.end.json.json1 - pop: true - - link: - - include: Packages/Naomi/syntaxes/shared/link.sublime-syntax - - email: - - include: Packages/Naomi/syntaxes/shared/email.sublime-syntax diff --git a/syntaxes/json1/literal/array.sublime-syntax b/syntaxes/json1/literal/array.sublime-syntax deleted file mode 100644 index 14004337..00000000 --- a/syntaxes/json1/literal/array.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: \s*(\[) - scope: punctuation.definition.array.begin.json.json1 - set: items - - items: - - match: \s*(\,) - captures: - 1: punctuation.definition.array.json.json1 - - match: \s*(\]) - captures: - 1: punctuation.definition.array.end.json.json1 - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/json1/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/array.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/object/level-1.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/json1/literal/number.sublime-syntax b/syntaxes/json1/literal/number.sublime-syntax deleted file mode 100644 index 298ed272..00000000 --- a/syntaxes/json1/literal/number.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: ... - -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.json.json1 - pop: true - - match: (?x)\s*({{literalFloat}}) - captures: - 1: constant.numeric.float.json.json1 - pop: true - - integer: - - match: \s*(0b[01]+) - captures: - 1: constant.numeric.binary.json.json1 - pop: true - - match: \s*(0o[0-7]+) - captures: - 1: constant.numeric.octal.json.json1 - pop: true - - match: (?i)\s*(0[x][0-9a-f]+) - captures: - 1: constant.numeric.hex.json.json1 - pop: true - - match: \s*([1-9][0-9]*|0) - captures: - 1: constant.numeric.decimal.json.json1 - pop: true diff --git a/syntaxes/json1/literal/object/level-1.sublime-syntax b/syntaxes/json1/literal/object/level-1.sublime-syntax deleted file mode 100644 index cc65b856..00000000 --- a/syntaxes/json1/literal/object/level-1.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: \s*(\{) - captures: - 1: punctuation.definition.object.begin.json.json1 - set: items - - items: - - meta_scope: >- - level-1.json.json1 - level-a.json.json1 - - include: comment - - match: \s*(,) - captures: - 1: punctuation.definition.object.json.json1 - - match: \s*(\}) - captures: - 1: punctuation.definition.object.end.json.json1 - pop: true - # Value. - - match: \s*(:) - captures: - 1: >- - object.json.json1 - keyword.operator.other.association.json.json1 - push: value - # Key. - - match: (?=\s*") - push: key - - key: - - include: comment - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - value: - - clear_scopes: true - - meta_scope: source.json.json1 - - include: comment - - match: | - (?x) - (?=\s* - (?> , - | \] - | \} - ) - ) - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/json1/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/array.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/object/level-2.sublime-syntax - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/json1/comment.no-pop.sublime-syntax diff --git a/syntaxes/json1/literal/object/level-2.sublime-syntax b/syntaxes/json1/literal/object/level-2.sublime-syntax deleted file mode 100644 index bdb05dc1..00000000 --- a/syntaxes/json1/literal/object/level-2.sublime-syntax +++ /dev/null @@ -1,77 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY 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.object.begin.json.json1 - set: items - - items: - - meta_scope: >- - level-2.json.json1 - level-b.json.json1 - - include: comment - - match: \s*(,) - captures: - 1: punctuation.definition.object.json.json1 - - match: \s*(\}) - captures: - 1: punctuation.definition.object.end.json.json1 - pop: true - # Value. - - match: \s*(:) - captures: - 1: >- - object.json.json1 - keyword.operator.other.association.json.json1 - push: value - # Key. - - match: (?=\s*") - push: key - - key: - - include: comment - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - value: - - clear_scopes: true - - include: comment - - match: | - (?x) - (?=\s* - (?> , - | \] - | \} - ) - ) - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/json1/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/array.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/object/level-3.sublime-syntax - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/json1/comment.no-pop.sublime-syntax diff --git a/syntaxes/json1/literal/object/level-3.sublime-syntax b/syntaxes/json1/literal/object/level-3.sublime-syntax deleted file mode 100644 index bf71dcba..00000000 --- a/syntaxes/json1/literal/object/level-3.sublime-syntax +++ /dev/null @@ -1,77 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY 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.object.begin.json.json1 - set: items - - items: - - meta_scope: >- - level-3.json.json1 - level-a.json.json1 - - include: comment - - match: \s*(,) - captures: - 1: punctuation.definition.object.json.json1 - - match: \s*(\}) - captures: - 1: punctuation.definition.object.end.json.json1 - pop: true - # Value. - - match: \s*(:) - captures: - 1: >- - object.json.json1 - keyword.operator.other.association.json.json1 - push: value - # Key. - - match: (?=\s*") - push: key - - key: - - include: comment - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - value: - - clear_scopes: true - - include: comment - - match: | - (?x) - (?=\s* - (?> , - | \] - | \} - ) - ) - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/json1/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/array.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/object/level-4.sublime-syntax - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/json1/comment.no-pop.sublime-syntax diff --git a/syntaxes/json1/literal/object/level-4.sublime-syntax b/syntaxes/json1/literal/object/level-4.sublime-syntax deleted file mode 100644 index 2f7ce8eb..00000000 --- a/syntaxes/json1/literal/object/level-4.sublime-syntax +++ /dev/null @@ -1,77 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY 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.object.begin.json.json1 - set: items - - items: - - meta_scope: >- - level-4.json.json1 - level-b.json.json1 - - include: comment - - match: \s*(,) - captures: - 1: punctuation.definition.object.json.json1 - - match: \s*(\}) - captures: - 1: punctuation.definition.object.end.json.json1 - pop: true - # Value. - - match: \s*(:) - captures: - 1: >- - object.json.json1 - keyword.operator.other.association.json.json1 - push: value - # Key. - - match: (?=\s*") - push: key - - key: - - include: comment - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - value: - - clear_scopes: true - - include: comment - - match: | - (?x) - (?=\s* - (?> , - | \] - | \} - ) - ) - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/json1/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/array.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/object/level-5.sublime-syntax - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/json1/comment.no-pop.sublime-syntax diff --git a/syntaxes/json1/literal/object/level-5.sublime-syntax b/syntaxes/json1/literal/object/level-5.sublime-syntax deleted file mode 100644 index cfc4498f..00000000 --- a/syntaxes/json1/literal/object/level-5.sublime-syntax +++ /dev/null @@ -1,77 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY 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.object.begin.json.json1 - set: items - - items: - - meta_scope: >- - level-5.json.json1 - level-a.json.json1 - - include: comment - - match: \s*(,) - captures: - 1: punctuation.definition.object.json.json1 - - match: \s*(\}) - captures: - 1: punctuation.definition.object.end.json.json1 - pop: true - # Value. - - match: \s*(:) - captures: - 1: >- - object.json.json1 - keyword.operator.other.association.json.json1 - push: value - # Key. - - match: (?=\s*") - push: key - - key: - - include: comment - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - value: - - clear_scopes: true - - include: comment - - match: | - (?x) - (?=\s* - (?> , - | \] - | \} - ) - ) - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/json1/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/array.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/object/level-6.sublime-syntax - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/json1/comment.no-pop.sublime-syntax diff --git a/syntaxes/json1/literal/object/level-6.sublime-syntax b/syntaxes/json1/literal/object/level-6.sublime-syntax deleted file mode 100644 index a356ae1b..00000000 --- a/syntaxes/json1/literal/object/level-6.sublime-syntax +++ /dev/null @@ -1,77 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY 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.object.begin.json.json1 - set: items - - items: - - meta_scope: >- - level-6.json.json1 - level-b.json.json1 - - include: comment - - match: \s*(,) - captures: - 1: punctuation.definition.object.json.json1 - - match: \s*(\}) - captures: - 1: punctuation.definition.object.end.json.json1 - pop: true - # Value. - - match: \s*(:) - captures: - 1: >- - object.json.json1 - keyword.operator.other.association.json.json1 - push: value - # Key. - - match: (?=\s*") - push: key - - key: - - include: comment - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - value: - - clear_scopes: true - - include: comment - - match: | - (?x) - (?=\s* - (?> , - | \] - | \} - ) - ) - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/json1/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/array.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/object/level-7.sublime-syntax - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/json1/comment.no-pop.sublime-syntax diff --git a/syntaxes/json1/literal/object/level-7.sublime-syntax b/syntaxes/json1/literal/object/level-7.sublime-syntax deleted file mode 100644 index 40fa1f28..00000000 --- a/syntaxes/json1/literal/object/level-7.sublime-syntax +++ /dev/null @@ -1,77 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY 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.object.begin.json.json1 - set: items - - items: - - meta_scope: >- - level-7.json.json1 - level-a.json.json1 - - include: comment - - match: \s*(,) - captures: - 1: punctuation.definition.object.json.json1 - - match: \s*(\}) - captures: - 1: punctuation.definition.object.end.json.json1 - pop: true - # Value. - - match: \s*(:) - captures: - 1: >- - object.json.json1 - keyword.operator.other.association.json.json1 - push: value - # Key. - - match: (?=\s*") - push: key - - key: - - include: comment - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - value: - - clear_scopes: true - - include: comment - - match: | - (?x) - (?=\s* - (?> , - | \] - | \} - ) - ) - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/json1/constant.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/number.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/string.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/array.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/object/level-1.sublime-syntax - - match: "" - pop: true - - comment: - - include: Packages/Naomi/syntaxes/json1/comment.no-pop.sublime-syntax diff --git a/syntaxes/json1/literal/string.sublime-syntax b/syntaxes/json1/literal/string.sublime-syntax deleted file mode 100644 index aa11591f..00000000 --- a/syntaxes/json1/literal/string.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: - hexEscapedChar: | - x[a-f0-9]{2} - - unicodeEscapedChar: | - (?> u[a-f0-9]{4} - | u\{[a-f0-9]+\} - ) - - doubleQuotedEscapeSequences: | - \\ - (?> ["\\bfnrtv] - | {{hexEscapedChar}} - | {{unicodeEscapedChar}} - ) - -contexts: - main: - - match: \s*(") - captures: - 1: >- - string.quoted.double.json.json1 - punctuation.definition.string.begin.json.json1 - with_prototype: - - match: (?- - string.quoted.double.json.json1 - punctuation.definition.string.end.json.json1 - pop: true - set: escape-a - - trap: - - meta_content_scope: context.trap - - escape-a: - - meta_content_scope: string.quoted.double.json.json1 - - match: (?xi){{doubleQuotedEscapeSequences}} - scope: constant.character.escape.a.json.json1 - set: escape-b - - escape-b: - - meta_content_scope: string.quoted.double.json.json1 - - match: (?xi){{doubleQuotedEscapeSequences}} - scope: constant.character.escape.b.json.json1 - set: escape-a diff --git a/syntaxes/jsx1/attribute.sublime-syntax b/syntaxes/jsx1/attribute.sublime-syntax index f7ab826d..775ec899 100644 --- a/syntaxes/jsx1/attribute.sublime-syntax +++ b/syntaxes/jsx1/attribute.sublime-syntax @@ -18,33 +18,61 @@ hidden: true scope: ... variables: - commonIdentifier: | + attributeIdentifier: | [_[:alpha:]] [._\-[:alnum:]]* contexts: main: + # className. - match: | (?xi)\s* - ({{commonIdentifier}}) + (className) captures: - 1: entity.name.attribute.jsx.jsx1 + 1: entity.other.attribute-name.class.html.jsx.jsx1 set: optional-value + # style. + - match: | + (?xi)\s* + (style) + captures: + 1: entity.other.attribute-name.style.html.jsx.jsx1 + set: optional-value + # Attribute with value. + - match: | + (?xi)\s* + ({{attributeIdentifier}}) + (?=\s*=) + captures: + 1: entity.other.attribute-name.html.jsx.jsx1 + set: optional-value + # Simple attribute. + - match: | + (?xi)\s* + ({{attributeIdentifier}}) + captures: + 1: entity.other.attribute-name.html.jsx.jsx1 + pop: true + + escape: + - match: (?=\s*\S) + pop: true optional-value: + - meta_scope: meta.attribute-with-value.html.jsx.jsx1 # Normal value. - match: \s*(=) captures: - 1: keyword.operator.other.assignment.jsx.jsx1 - set: value + 1: punctuation.separator.key-value.html.jsx.jsx1 + push: value # Anything else. - - match: "" - pop: true + - include: escape value: + - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax - include: Packages/Naomi/syntaxes/jsx1/literal/string/single-quoted.sublime-syntax - - match: "" - pop: true + # Anything else. + - include: escape diff --git a/syntaxes/jsx1/component.no-pop.sublime-syntax b/syntaxes/jsx1/component.no-pop.sublime-syntax new file mode 100644 index 00000000..76b32c0c --- /dev/null +++ b/syntaxes/jsx1/component.no-pop.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +variables: + componentIdentifier: | + [[:upper:]] + [$_.:[:alnum:]]* + + attributeIdentifier: | + [_[:alpha:]] + [._\-[:alnum:]]* + +contexts: + main: + - match: | + (?x) + \s*(<) + \s*({{componentIdentifier}}) + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.component.html.jsx.jsx1 + push: [ + meta-scope, + closing-tag, + open-tag, + optional-attribute + ] + + meta-scope: + - meta_scope: meta.tag.other.component.html.jsx.jsx1 + - match: "" + pop: true + + closing-tag: + - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax#closing-tag + + open-tag: + - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax#open-tag + + optional-attribute: + - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax#optional-attribute diff --git a/syntaxes/jsx1/component.sublime-syntax b/syntaxes/jsx1/component.sublime-syntax index 58724a1e..d5678de8 100644 --- a/syntaxes/jsx1/component.sublime-syntax +++ b/syntaxes/jsx1/component.sublime-syntax @@ -22,77 +22,86 @@ variables: [[:upper:]] [$_.:[:alnum:]]* + attributeIdentifier: | + [_[:alpha:]] + [._\-[:alnum:]]* + contexts: main: - match: | - (?x)\s* - (<) - ({{componentIdentifier}}) + (?x) + \s*(<) + \s*({{componentIdentifier}}) captures: - 1: >- - component.jsx.jsx1 - punctuation.definition.tag.begin.jsx.jsx1 - 2: >- - component.jsx.jsx1 - entity.name.tag.jsx.jsx1 + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.component.html.jsx.jsx1 set: [ - content, - attributes + meta-scope, + closing-tag, + open-tag, + optional-attribute ] - attributes: + meta-scope: + - meta_scope: meta.tag.other.component.html.jsx.jsx1 + - match: "" + pop: true + + attribute: + - include: Packages/Naomi/syntaxes/jsx1/attribute.sublime-syntax + + optional-attribute: + - include: attribute + - match: (?=\s*\S) + pop: true + + open-tag: # Self closing tag. - match: (?=\s*/>) + captures: + 1: punctuation.definition.tag.end.html.jsx.jsx1 pop: true - # Normal tag. + # Normal closing tag. - match: \s*(>) captures: - 1: >- - component.jsx.jsx1 - punctuation.definition.tag.end.jsx.jsx1 + 1: punctuation.definition.tag.end.html.jsx.jsx1 + # pop: true + set: optional-content + # Attribute. + - match: | + (?xi) + (?=\s*{{attributeIdentifier}}) + push: attribute + + optional-content: + # Closing tag. + - match: (?=\s*) captures: - 1: >- - source.jsx.fjsx15 - component.jsx.jsx1 - punctuation.definition.tag.end.jsx.jsx1 + 1: punctuation.definition.tag.end.html.jsx.jsx1 pop: true # Closing tag. - match: | (?x)\s* - () + (()) captures: - 1: >- - component.jsx.jsx1 - punctuation.definition.tag.begin.jsx.jsx1 - 2: >- - component.jsx.jsx1 - entity.name.tag.jsx.jsx1 - 3: >- - component.jsx.jsx1 - punctuation.definition.tag.end.jsx.jsx1 + 1: meta.tag.close.html.jsx.jsx1 + 2: punctuation.definition.tag.begin.html.jsx.jsx1 + 3: entity.name.tag.component.html.jsx.jsx1 + 4: punctuation.definition.tag.end.html.jsx.jsx1 pop: true - # Sub tags. - - match: "" - push: - - clear_scopes: true - - include: main - - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax - - match: | - (?x) - (?=\s*(?>/>|<)) - pop: true - - match: .|\n - scope: source.jsx diff --git a/syntaxes/jsx1/element.no-pop.sublime-syntax b/syntaxes/jsx1/element.no-pop.sublime-syntax new file mode 100644 index 00000000..cce400ae --- /dev/null +++ b/syntaxes/jsx1/element.no-pop.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +variables: + elementIdentifier: | + [$_[:alpha:]] + [$_.:[:alnum:]]* + + attributeIdentifier: | + [_[:alpha:]] + [._\-[:alnum:]]* + +contexts: + main: + # html, head, body. + - match: | + (?x) + \s*(<) + \s*(body|head|html)\b + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.structure.html.jsx.jsx1 + push: [ + meta-scope-structure, + closing-tag, + open-tag, + optional-attribute + ] + # a. + - match: | + (?x) + \s*(<) + \s*(a)\b + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.a.html.jsx.jsx1 + push: [ + meta-scope-a, + closing-tag, + open-tag, + optional-attribute + ] + # Other tags. + - match: | + (?x) + \s*(<) + \s*({{elementIdentifier}}) + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.html.jsx.jsx1 + push: [ + meta-scope-other, + closing-tag, + open-tag, + optional-attribute + ] + + meta-scope-structure: + - meta_scope: meta.tag.structure.html.jsx.jsx1 + - match: "" + pop: true + + meta-scope-a: + - meta_scope: meta.tag.inline.a.html.jsx.jsx1 + - match: "" + pop: true + + meta-scope-other: + - meta_scope: meta.tag.other.html.jsx.jsx1 + - match: "" + pop: true + + closing-tag: + - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax#closing-tag + + open-tag: + - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax#open-tag + + optional-attribute: + - include: Packages/Naomi/syntaxes/jsx1/element.sublime-syntax#optional-attribute diff --git a/syntaxes/jsx1/element.sublime-syntax b/syntaxes/jsx1/element.sublime-syntax index 041ef079..8ced77cf 100644 --- a/syntaxes/jsx1/element.sublime-syntax +++ b/syntaxes/jsx1/element.sublime-syntax @@ -18,66 +18,138 @@ hidden: true scope: ... variables: - commonIdentifier: | + elementIdentifier: | [$_[:alpha:]] [$_.:[:alnum:]]* + attributeIdentifier: | + [_[:alpha:]] + [._\-[:alnum:]]* + contexts: main: + # html, head, body. + - match: | + (?x) + \s*(<) + \s*(body|head|html)\b + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.structure.html.jsx.jsx1 + set: [ + meta-scope-structure, + closing-tag, + open-tag, + optional-attribute + ] + # a. + - match: | + (?x) + \s*(<) + \s*(a)\b + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.a.html.jsx.jsx1 + set: [ + meta-scope-a, + closing-tag, + open-tag, + optional-attribute + ] + # div. + - match: | + (?x) + \s*(<) + \s*(div)\b + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.block.any.html.jsx.jsx1 + set: [ + meta-scope-block-any, + closing-tag, + open-tag, + optional-attribute + ] + # span. + - match: | + (?x) + \s*(<) + \s*(span)\b + captures: + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.inline.any.html.jsx.jsx1 + set: [ + meta-scope-inline-any, + closing-tag, + open-tag, + optional-attribute + ] + # Other tags. - match: | - (?xi)\s* - (<) - ({{commonIdentifier}}) + (?x) + \s*(<) + \s*({{elementIdentifier}}) captures: - 1: punctuation.definition.tag.begin.jsx.jsx1 - 2: entity.name.tag.jsx.jsx1 + 1: punctuation.definition.tag.begin.html.jsx.jsx1 + 2: entity.name.tag.html.jsx.jsx1 set: [ - content, - attributes + meta-scope-other, + closing-tag, + open-tag, + optional-attribute ] - attributes: - # Self closing tag. - - match: (?=\s*/>) + meta-scope-structure: + - meta_scope: meta.tag.structure.html.jsx.jsx1 + - match: "" pop: true - # Normal tag. - - match: \s*(>) - captures: - 1: punctuation.definition.tag.end.jsx.jsx1 + + meta-scope-a: + - meta_scope: meta.tag.inline.a.html.jsx.jsx1 + - match: "" pop: true - # Attributes. + + meta-scope-block-any: + - meta_scope: meta.tag.block.any.html.jsx.jsx1 - match: "" - push: - - include: Packages/Naomi/syntaxes/jsx1/attribute.sublime-syntax - - match: "" - pop: true + pop: true - content: - - clear_scopes: true - - meta_scope: source.jsx.jsx1 - # Self closing tag. - - match: \s*(/>) - captures: - 1: punctuation.definition.tag.end.jsx.jsx1 + meta-scope-inline-any: + - meta_scope: meta.tag.inline.any.html.jsx.jsx1 + - match: "" + pop: true + + meta-scope-other: + - meta_scope: meta.tag.other.html.jsx.jsx1 + - match: "" pop: true + + attribute: + - include: Packages/Naomi/syntaxes/jsx1/attribute.sublime-syntax + + optional-attribute: + - include: attribute + - match: (?=\s*\S) + pop: true + + open-tag: + - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax#open-tag + + optional-content: # Closing tag. - - match: | - (?x)\s* - () - captures: - 1: punctuation.definition.tag.begin.jsx.jsx1 - 2: entity.name.tag.jsx.jsx1 - 3: punctuation.definition.tag.end.jsx.jsx1 + - match: (?=\s*/>|<)) + # Simple text. + - match: . pop: true - - match: .|\n - scope: source.jsx + + closing-tag: + - include: Packages/Naomi/syntaxes/jsx1/component.sublime-syntax#closing-tag diff --git a/syntaxes/jsx1/fragment.no-pop.sublime-syntax b/syntaxes/jsx1/fragment.no-pop.sublime-syntax new file mode 100644 index 00000000..c024b6d8 --- /dev/null +++ b/syntaxes/jsx1/fragment.no-pop.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_.:[:alnum:]]* + +contexts: + main: + - match: \s*(<)(>) + captures: + 1: punctuation.definition.tag.begin.jsx.jsx1 + 2: punctuation.definition.tag.end.jsx.jsx1 + push: [ + meta-scope, + closing-tag + ] + + meta-scope: + - meta_scope: meta.tag.other.fragment.jsx.jsx1 + - match: "" + pop: true + + closing-tag: + - include: Packages/Naomi/syntaxes/jsx1/fragment.sublime-syntax#closing-tag diff --git a/syntaxes/jsx1/fragment.sublime-syntax b/syntaxes/jsx1/fragment.sublime-syntax new file mode 100644 index 00000000..72fa8558 --- /dev/null +++ b/syntaxes/jsx1/fragment.sublime-syntax @@ -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. + +hidden: true + +scope: ... + +variables: + commonIdentifier: | + [$_[:alpha:]] + [$_.:[:alnum:]]* + +contexts: + main: + - match: \s*(<)(>) + captures: + 1: punctuation.definition.tag.begin.jsx.jsx1 + 2: punctuation.definition.tag.end.jsx.jsx1 + set: [ + meta-scope, + closing-tag, + optional-content + ] + + meta-scope: + - meta_scope: meta.tag.other.fragment.jsx.jsx1 + - match: "" + pop: true + + optional-content: + # Closing tag. + - match: (?=\s*)) + captures: + 1: meta.tag.close.jsx.jsx1 + 2: punctuation.definition.tag.begin.jsx.jsx1 + 3: punctuation.definition.tag.end.jsx.jsx1 + pop: true diff --git a/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax b/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax index eb571657..881fc97a 100644 --- a/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax +++ b/syntaxes/jsx1/literal/string/double-quoted.sublime-syntax @@ -21,12 +21,12 @@ contexts: main: - match: \s*(\") captures: - 1: punctuation.definition.string.begin.jsx.jsx1 + 1: punctuation.definition.string.begin.html.html.jsx.jsx1 set: string string: - - meta_scope: string.quoted.single.jsx.jsx1 + - meta_scope: string.quoted.double.html.html.jsx.jsx1 - match: \s*(\") captures: - 1: punctuation.definition.string.end.jsx.jsx1 + 1: 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 index 9c876c82..e8590507 100644 --- a/syntaxes/jsx1/literal/string/single-quoted.sublime-syntax +++ b/syntaxes/jsx1/literal/string/single-quoted.sublime-syntax @@ -21,12 +21,12 @@ contexts: main: - match: \s*(\') captures: - 1: punctuation.definition.string.begin.jsx.jsx1 + 1: punctuation.definition.string.begin.html.jsx.jsx1 set: string string: - - meta_scope: string.quoted.single.jsx.jsx1 + - meta_scope: string.quoted.single.html.jsx.jsx1 - match: \s*(\') captures: - 1: punctuation.definition.string.end.jsx.jsx1 + 1: punctuation.definition.string.end.html.jsx.jsx1 pop: true diff --git a/syntaxes/mql4/statement/bodied.sublime-syntax b/syntaxes/mql4/statement/bodied.sublime-syntax index 07d39fed..ca4ea6f3 100644 --- a/syntaxes/mql4/statement/bodied.sublime-syntax +++ b/syntaxes/mql4/statement/bodied.sublime-syntax @@ -78,7 +78,7 @@ contexts: terminator: - match: \s*(;) captures: - 1: keyword.operator.other.terminator.mql.mql4 + 1: keyword.other.terminator.mql.mql4 pop: true body: diff --git a/syntaxes/mql4/terminator.sublime-syntax b/syntaxes/mql4/terminator.sublime-syntax index 94d80d9c..666ee3ef 100644 --- a/syntaxes/mql4/terminator.sublime-syntax +++ b/syntaxes/mql4/terminator.sublime-syntax @@ -21,5 +21,5 @@ contexts: main: - match: \s*(;) captures: - 1: keyword.operator.other.terminator.mql.mql4 + 1: keyword.other.terminator.mql.mql4 pop: true diff --git a/syntaxes/naomi.fjsx15.sublime-syntax b/syntaxes/naomi.fjsx15.sublime-syntax index a3f16aab..299281b2 100644 --- a/syntaxes/naomi.fjsx15.sublime-syntax +++ b/syntaxes/naomi.fjsx15.sublime-syntax @@ -26,4 +26,6 @@ scope: source.js.fjsx15 contexts: main: - - include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/comment.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/statement.sublime-syntax + - include: Packages/Naomi/syntaxes/fjsx15/expression.sublime-syntax diff --git a/syntaxes/naomi.json1.sublime-syntax b/syntaxes/naomi.json1.sublime-syntax deleted file mode 100644 index 40fc2569..00000000 --- a/syntaxes/naomi.json1.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. - -name: JSON - -file_extensions: - - json - - package.json - - sublime-keymap - - sublime-macro - -scope: source.json.json1 - -contexts: - main: - - include: Packages/Naomi/syntaxes/json1/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/array.sublime-syntax - - include: Packages/Naomi/syntaxes/json1/literal/object/level-1.sublime-syntax diff --git a/syntaxes/json1/constant.sublime-syntax b/syntaxes/naomi.jsx1.sublime-syntax similarity index 67% rename from syntaxes/json1/constant.sublime-syntax rename to syntaxes/naomi.jsx1.sublime-syntax index 7d6b79a9..7a715035 100644 --- a/syntaxes/json1/constant.sublime-syntax +++ b/syntaxes/naomi.jsx1.sublime-syntax @@ -15,20 +15,13 @@ hidden: true -scope: ... +scope: text.html.basic.jsx.jsx1 contexts: main: - - match: | - (?xi) - (?> false - | Infinity - | NaN - | null - | true - | undefined - ) - scope: >- - support.json.json1 - entity.name.constant.json.json1 + - clear_scopes: true + - include: Packages/Naomi/syntaxes/jsx1/fragment.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/jsx1/component.no-pop.sublime-syntax + - include: Packages/Naomi/syntaxes/jsx1/element.no-pop.sublime-syntax + - match: "" pop: true diff --git a/syntaxes/naomi.xml1.sublime-syntax b/syntaxes/naomi.xml1.sublime-syntax deleted file mode 100644 index fdc2e205..00000000 --- a/syntaxes/naomi.xml1.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. - -name: XML 1.0 - -file_extensions: - - dtml - - opml - - rss - - svg - - tld - - tmPreferences - - tmTheme - - sublime-snippet - - xml - - xsd - - xslt - -first_line_match: <\?xml - -scope: text.xml.xml1 - -contexts: - main: - - include: Packages/Naomi/syntaxes/xml1/element.sublime-syntax diff --git a/syntaxes/php7/statement/bodied.sublime-syntax b/syntaxes/php7/statement/bodied.sublime-syntax index 7762c4fc..8a9e89cd 100644 --- a/syntaxes/php7/statement/bodied.sublime-syntax +++ b/syntaxes/php7/statement/bodied.sublime-syntax @@ -73,7 +73,7 @@ contexts: terminator: - match: \s*(;) captures: - 1: keyword.operator.other.terminator.php.php7 + 1: keyword.other.terminator.php.php7 pop: true body: diff --git a/syntaxes/php7/terminator.sublime-syntax b/syntaxes/php7/terminator.sublime-syntax index e6ba8333..3da8bf1d 100644 --- a/syntaxes/php7/terminator.sublime-syntax +++ b/syntaxes/php7/terminator.sublime-syntax @@ -21,5 +21,5 @@ contexts: main: - match: \s*(;) captures: - 1: keyword.operator.other.terminator.php.php7 + 1: keyword.other.terminator.php.php7 pop: true diff --git a/syntaxes/scss3/terminator.sublime-syntax b/syntaxes/scss3/terminator.sublime-syntax index daf4ae96..04213a84 100644 --- a/syntaxes/scss3/terminator.sublime-syntax +++ b/syntaxes/scss3/terminator.sublime-syntax @@ -21,5 +21,5 @@ contexts: main: - match: \s*(;) captures: - 1: keyword.operator.other.terminator.scss.scss3 + 1: keyword.other.terminator.scss.scss3 pop: true diff --git a/syntaxes/xml1/element.sublime-syntax b/syntaxes/xml1/element.sublime-syntax deleted file mode 100644 index 969d2e5b..00000000 --- a/syntaxes/xml1/element.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/xml1/element/comment.sublime-syntax - - include: Packages/Naomi/syntaxes/xml1/element/prolog.sublime-syntax - - include: Packages/Naomi/syntaxes/xml1/element/doctype.sublime-syntax - - include: Packages/Naomi/syntaxes/xml1/element/cdata.sublime-syntax - - include: Packages/Naomi/syntaxes/xml1/element/normal.sublime-syntax diff --git a/syntaxes/xml1/element/cdata.sublime-syntax b/syntaxes/xml1/element/cdata.sublime-syntax deleted file mode 100644 index 9282007f..00000000 --- a/syntaxes/xml1/element/cdata.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*(- - meta.tag.xml.xml1 - section.cdata.xml.xml1 - punctuation.definition.section.begin.xml.xml1 - 2: >- - meta.tag.xml.xml1 - section.cdata.xml.xml1 - entity.name.cdata.xml.xml1 - 3: >- - meta.tag.xml.xml1 - section.cdata.xml.xml1 - punctuation.definition.section.begin.xml.xml1 - set: content - - content: - - match: \s*(]]>) - captures: - 1: >- - meta.tag.xml.xml1 - section.cdata.xml.xml1 - punctuation.definition.section.end.xml.xml1 - pop: true diff --git a/syntaxes/xml1/element/comment.sublime-syntax b/syntaxes/xml1/element/comment.sublime-syntax deleted file mode 100644 index 5893015c..00000000 --- a/syntaxes/xml1/element/comment.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: \s*() - captures: - 1: >- - meta.tag.xml.xml1 - punctuation.comment.end.xml.xml1 - punctuation.definition.tag.end.xml.xml1 - pop: true - - link: - - include: Packages/Naomi/syntaxes/shared/link.sublime-syntax - - email: - - include: Packages/Naomi/syntaxes/shared/email.sublime-syntax diff --git a/syntaxes/xml1/element/doctype.sublime-syntax b/syntaxes/xml1/element/doctype.sublime-syntax deleted file mode 100644 index 359afb2e..00000000 --- a/syntaxes/xml1/element/doctype.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: \s*() - captures: - 1: >- - declaration.doctype.xml.xml1 - punctuation.definition.declaration.begin.xml.xml1 - 2: >- - declaration.doctype.xml.xml1 - entity.name.other.xml.xml1 - 3: >- - declaration.doctype.xml.xml1 - punctuation.definition.declaration.end.xml.xml1 - pop: true diff --git a/syntaxes/xml1/element/normal.sublime-syntax b/syntaxes/xml1/element/normal.sublime-syntax deleted file mode 100644 index c65b9be3..00000000 --- a/syntaxes/xml1/element/normal.sublime-syntax +++ /dev/null @@ -1,93 +0,0 @@ -%YAML1.2 ---- - -# Licensed under the Apache License, Version 2.0 (the “License”); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT -# WARRANTIES OR CONDITIONS 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: >- - meta.tag.xml.xml1 - tag.xml.xml1 - punctuation.definition.tag.begin.xml.xml1 - set: tag-name - - tag-name: - - match: | - (?xi)\s* - ({{commonIdentifier}}) - captures: - 1: >- - meta.tag.xml.xml1 - tag.xml.xml1 - entity.name.tag.xml.xml1 - set: [ - content, - attributes - ] - - attributes: - - match: (?=\s*/>) - pop: true - - match: \s*(>) - captures: - 1: >- - meta.tag.xml.xml1 - tag.xml.xml1 - punctuation.definition.tag.end.xml.xml1 - pop: true - - include: Packages/Naomi/syntaxes/xml1/element/attributes.sublime-syntax - - content: - - match: \s*(/>) - captures: - 1: >- - meta.tag.xml.xml1 - tag.xml.xml1 - punctuation.definition.tag.end.xml.xml1 - pop: true - - match: | - (?x)\s* - () - captures: - 1: >- - meta.tag.xml.xml1 - tag.close.xml.xml1 - punctuation.definition.tag.begin.xml.xml1 - 2: >- - meta.tag.xml.xml1 - tag.close.xml.xml1 - entity.name.tag.xml.xml1 - 3: >- - meta.tag.xml.xml1 - tag.close.xml.xml1 - punctuation.definition.tag.end.xml.xml1 - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/xml1/element.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/xml1/element/prolog.sublime-syntax b/syntaxes/xml1/element/prolog.sublime-syntax deleted file mode 100644 index 221f9157..00000000 --- a/syntaxes/xml1/element/prolog.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: \s*(<\?)(xml) - captures: - 1: >- - instruction.prolog.xml.xml1 - punctuation.definition.instruction.begin.xml.xml1 - 2: >- - instruction.prolog.xml.xml1 - entity.name.instruction.xml.xml1 - set: prolog - - prolog: - - match: \s*(\?>) - captures: - 1: >- - instruction.prolog.xml.xml1 - punctuation.definition.instruction.end.xml.xml1 - pop: true - - match: "" - push: - - include: Packages/Naomi/syntaxes/xml1/attribute.sublime-syntax - - match: "" - pop: true diff --git a/syntaxes/xml1/literal/string/single-quoted.sublime-syntax b/syntaxes/xml1/literal/string/single-quoted.sublime-syntax deleted file mode 100644 index ab0f5233..00000000 --- a/syntaxes/xml1/literal/string/single-quoted.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: \s*(\') - captures: - 1: punctuation.definition.string.begin.xml.xml1 - set: string - - string: - - meta_scope: string.quoted.single.xml.xml1 - - match: \s*(\') - captures: - 1: punctuation.definition.string.end.xml.xml1 - pop: true diff --git a/tests/syntaxes/fjsx15/destructuring/syntax_test_array.js b/tests/syntaxes/fjsx15/destructuring/syntax_test_array.js index 496e651d..afb3af2c 100644 --- a/tests/syntaxes/fjsx15/destructuring/syntax_test_array.js +++ b/tests/syntaxes/fjsx15/destructuring/syntax_test_array.js @@ -33,7 +33,7 @@ // ^ .punctuation.definition.array.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.array.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 let [a=0,...b=0]:[number,number] = [1,2]; // ^^^ .keyword.declaration.variable.js.fjsx15 // ^ .destructuring.array.js.fjsx15 @@ -63,7 +63,7 @@ // ^ .punctuation.definition.array.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.array.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 let [[a=0,...b=0]] = [[1,2]]; // ^^^ .keyword.declaration.variable.js.fjsx15 // ^ .destructuring.array.js.fjsx15 @@ -91,7 +91,7 @@ // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.array.end.js.fjsx15 // ^ .punctuation.definition.array.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 let [[a=0,...b=0]]:[[number,number]] = [[1,2]]; // ^^^ .keyword.declaration.variable.js.fjsx15 // ^ .destructuring.array.js.fjsx15 @@ -129,7 +129,7 @@ // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.array.end.js.fjsx15 // ^ .punctuation.definition.array.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 function foo([a=0,...b=0]){} // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^^^ .entity.name.function.js.fjsx15 diff --git a/tests/syntaxes/fjsx15/destructuring/syntax_test_object.js b/tests/syntaxes/fjsx15/destructuring/syntax_test_object.js index 20c0f436..9a9d9f2c 100644 --- a/tests/syntaxes/fjsx15/destructuring/syntax_test_object.js +++ b/tests/syntaxes/fjsx15/destructuring/syntax_test_object.js @@ -42,7 +42,7 @@ // ^ .keyword.operator.other.association.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 let {a=0,...b=0} = {a:1,b:2}; // ^^^ .keyword.declaration.variable.js.fjsx15 // ^ .destructuring.object.js.fjsx15 @@ -72,7 +72,7 @@ // ^ .keyword.operator.other.association.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 let {a=0,...b=0}:{a:number,b:number} = {a:1,b:2}; // ^^^ .keyword.declaration.variable.js.fjsx15 // ^ .destructuring.object.js.fjsx15 @@ -102,7 +102,7 @@ // ^ .punctuation.definition.object.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 let {a:{a=0,...b=0}} = {a:{a:1,a:2}}; // ^^^ .keyword.declaration.variable.js.fjsx15 // ^ .destructuring.object.js.fjsx15 @@ -142,7 +142,7 @@ // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 let {a:{a=0,...b=0}}:{a:{a:number,b:number}} = {a:{a:1,b:2}}; // ^^^ .keyword.declaration.variable.js.fjsx15 // ^ .destructuring.object.js.fjsx15 @@ -192,7 +192,7 @@ // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 function foo({a=0,...b=0}){} // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^^^ .entity.name.function.js.fjsx15 diff --git a/tests/syntaxes/fjsx15/flowtype/syntax_test_type-aliasing.js b/tests/syntaxes/fjsx15/flowtype/syntax_test_type-aliasing.js index aa02851c..a00e2115 100644 --- a/tests/syntaxes/fjsx15/flowtype/syntax_test_type-aliasing.js +++ b/tests/syntaxes/fjsx15/flowtype/syntax_test_type-aliasing.js @@ -17,7 +17,7 @@ // ^^^^^ .entity.name.type.flowtype // ^ .keyword.operator.other.assignment.flowtype // ^^^^^^^^ .entity.name.type.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = SomeType[]; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -25,7 +25,7 @@ // ^^^^^^^^ .entity.name.type.flowtype // ^ .punctuation.definition.array.begin.flowtype // ^ .punctuation.definition.array.end.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = SomeType; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -35,7 +35,7 @@ // ^^^^^^ .support.flowtype // ^^^^^^ .entity.name.type.flowtype // ^ .punctuation.definition.template.arguments.end.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = SomeType; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -47,7 +47,7 @@ // ^ .punctuation.definition.array.begin.flowtype // ^ .punctuation.definition.array.end.flowtype // ^ .punctuation.definition.template.arguments.end.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = (param:number) => number; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -61,7 +61,7 @@ // ^^ .punctuation.definition.function.result.flowtype // ^^^^^^ .support.flowtype // ^^^^^^ .entity.name.type.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = (param:number, param:string) => number; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -80,7 +80,7 @@ // ^^ .punctuation.definition.function.result.flowtype // ^^^^^^ .support.flowtype // ^^^^^^ .entity.name.type.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = (param:A, param:B) => C; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -103,7 +103,7 @@ // ^ .punctuation.definition.function.parameters.end.flowtype // ^^ .punctuation.definition.function.result.flowtype // ^ .entity.name.type.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = (param:A|B, param:B) => C|B; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -130,7 +130,7 @@ // ^ .entity.name.type.flowtype // ^ .keyword.operator.other.union.flowtype // ^ .entity.name.type.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = (param:?(A|B), param:?B) => ?C; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -160,7 +160,7 @@ // ^^ .punctuation.definition.function.result.flowtype // ^ .keyword.operator.other.nullable.flowtype // ^ .entity.name.type.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = {a:?A, b:?B}; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -181,7 +181,7 @@ // ^ .keyword.operator.other.nullable.flowtype // ^ .entity.name.type.flowtype // ^ .punctuation.definition.object.end.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = {a:?(A|C), b:?B}; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -208,7 +208,7 @@ // ^ .keyword.operator.other.nullable.flowtype // ^ .entity.name.type.flowtype // ^ .punctuation.definition.object.end.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 type Alias = {a:A} & {b:B}; // ^^^^ .keyword.declaration.type-aliasing.flowtype // ^^^^^ .entity.name.type.flowtype @@ -229,4 +229,4 @@ // ^ .keyword.operator.other.association.flowtype // ^ .entity.name.type.flowtype // ^ .punctuation.definition.object.end.flowtype -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 diff --git a/tests/syntaxes/fjsx15/literal/syntax_test_number.js b/tests/syntaxes/fjsx15/literal/syntax_test_number.js index bacd351e..0a52838f 100644 --- a/tests/syntaxes/fjsx15/literal/syntax_test_number.js +++ b/tests/syntaxes/fjsx15/literal/syntax_test_number.js @@ -12,35 +12,35 @@ // License for the specific language governing permissions and limitations under // the License. - 0 + 0; // ^ .constant.numeric.decimal.js.fjsx15 - 123 + 123; // ^^^ .constant.numeric.decimal.js.fjsx15 - 1_2_3 + 1_2_3; // ^^^^^ .constant.numeric.decimal.js.fjsx15 - 123_456_789 + 123_456_789; // ^^^^^^^^^^^ .constant.numeric.decimal.js.fjsx15 - 123. + 123.; // ^^^^ .constant.numeric.float.js.fjsx15 - 1_2_3. + 1_2_3.; // ^^^^^^ .constant.numeric.float.js.fjsx15 - 123_456_789. + 123_456_789.; // ^^^^^^^^^^^^ .constant.numeric.float.js.fjsx15 - 123.0 + 123.0; // ^^^^^ .constant.numeric.float.js.fjsx15 - .123 + .123; // ^^^^ .constant.numeric.float.js.fjsx15 - 0.123 + 0.123; // ^^^^^ .constant.numeric.float.js.fjsx15 - 123e10 + 123e10; // ^^^^^^ .constant.numeric.float.scientific.js.fjsx15 - 123e+10 + 123e+10; // ^^^^^^^ .constant.numeric.float.scientific.js.fjsx15 - 123e-10 + 123e-10; // ^^^^^^^ .constant.numeric.float.scientific.js.fjsx15 - 0x123 + 0x123; // ^^^^^ .constant.numeric.hex.js.fjsx15 - 0x1_2_3 + 0x1_2_3; // ^^^^^^^ .constant.numeric.hex.js.fjsx15 - 0x123_456_789 + 0x123_456_789; // ^^^^^^^^^^^^^ .constant.numeric.hex.js.fjsx15 diff --git a/tests/syntaxes/fjsx15/literal/syntax_test_object.js b/tests/syntaxes/fjsx15/literal/syntax_test_object.js index 53156ff6..24261a99 100644 --- a/tests/syntaxes/fjsx15/literal/syntax_test_object.js +++ b/tests/syntaxes/fjsx15/literal/syntax_test_object.js @@ -44,7 +44,7 @@ // ^ .punctuation.definition.object.js.fjsx15 }; // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 var object = { // ^^^ .storage.type.js.fjsx15 // ^^^ .keyword.declaration.variable.js.fjsx15 @@ -159,4 +159,4 @@ // ^ .punctuation.definition.object.js.fjsx15 }; // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 diff --git a/tests/syntaxes/fjsx15/syntax_test_arrow-function.js b/tests/syntaxes/fjsx15/syntax_test_arrow-function.js index c966003b..ae094f76 100644 --- a/tests/syntaxes/fjsx15/syntax_test_arrow-function.js +++ b/tests/syntaxes/fjsx15/syntax_test_arrow-function.js @@ -12,13 +12,14 @@ // License for the specific language governing permissions and limitations under // the License. - () => {} + () => {}; // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 // ^ .punctuation.definition.function.parameters.end.js.fjsx15 // ^^ .punctuation.definition.function.body.arrow.js.fjsx15 // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 - async () => {} +// ^ .keyword.other.terminator.js.fjsx15 + async () => {}; // ^^^^^ .storage.modifier.js.fjsx15 // ^^^^^ .keyword.other.async.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 @@ -26,7 +27,7 @@ // ^^ .punctuation.definition.function.body.arrow.js.fjsx15 // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 - (param, ...param) => {} + (param, ...param) => {}; // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 // ^^^^^ .entity.name.variable.js.fjsx15 // ^ .punctuation.definition.function.parameters.js.fjsx15 @@ -36,7 +37,7 @@ // ^^ .punctuation.definition.function.body.arrow.js.fjsx15 // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 - async (param, ...param) => {} + async (param, ...param) => {}; // ^^^^^ .storage.modifier.js.fjsx15 // ^^^^^ .keyword.other.async.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 @@ -48,7 +49,7 @@ // ^^ .punctuation.definition.function.body.arrow.js.fjsx15 // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 - (param:number, ...param:string):number => {} + (param:number, ...param:string):number => {}; // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 // ^^^^^ .entity.name.variable.js.fjsx15 // ^ .keyword.operator.other.association.flowtype @@ -67,7 +68,7 @@ // ^^ .punctuation.definition.function.body.arrow.js.fjsx15 // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 - async (param:number, ...param:string):number => {} + async (param:number, ...param:string):number => {}; // ^^^^^ .storage.modifier.js.fjsx15 // ^^^^^ .keyword.other.async.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 @@ -88,7 +89,7 @@ // ^^ .punctuation.definition.function.body.arrow.js.fjsx15 // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 - (param:A, ...param:B):C => {} + (param:A, ...param:B):C => {}; // ^ .punctuation.definition.template.parameters.begin.flowtype // ^ .entity.name.type.flowtype // ^ .punctuation.definition.template.parameters.flowtype diff --git a/tests/syntaxes/fjsx15/syntax_test_class.js b/tests/syntaxes/fjsx15/syntax_test_class.js index 5ed64e9e..ab96ec41 100644 --- a/tests/syntaxes/fjsx15/syntax_test_class.js +++ b/tests/syntaxes/fjsx15/syntax_test_class.js @@ -111,7 +111,7 @@ // ^ .keyword.operator.other.member-access.js.fjsx15 // ^^^^^^ .entity.name.variable.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 static defaultProps = {initialCount:0}; // ^^^^^^ .storage.modifier.js.fjsx15 // ^^^^^^ .keyword.other.access.js.fjsx15 @@ -122,7 +122,7 @@ // ^ .keyword.operator.other.association.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 state = {count:this.props.initialCount}; // ^^^^^ .entity.name.variable.js.fjsx15 // ^ .keyword.operator.other.assignment.js.fjsx15 @@ -137,7 +137,7 @@ // ^ .keyword.operator.other.member-access.js.fjsx15 // ^^^^^^^^^^^^ .entity.name.variable.js.fjsx15 // ^ .punctuation.definition.object.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 constructor(){} // ^^^^^^^^^^^ .support.js.fjsx15 // ^^^^^^^^^^^ .entity.name.function.js.fjsx15 diff --git a/tests/syntaxes/fjsx15/syntax_test_function-call.js b/tests/syntaxes/fjsx15/syntax_test_function-call.js index 05ee54a8..1d745a15 100644 --- a/tests/syntaxes/fjsx15/syntax_test_function-call.js +++ b/tests/syntaxes/fjsx15/syntax_test_function-call.js @@ -13,14 +13,14 @@ // the License. super(1,2); -// ^^^^^ .support.js.fjsx15 +// ^^^^^ .support.core.js.fjsx15 // ^^^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.function.arguments.begin.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.function.arguments.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.function.arguments.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 foo(1,2); // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.template.arguments.begin.flowtype @@ -33,7 +33,7 @@ // ^ .punctuation.definition.function.arguments.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.function.arguments.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 foo(1,2); // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.template.arguments.begin.flowtype @@ -46,7 +46,7 @@ // ^ .punctuation.definition.function.arguments.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.function.arguments.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 foo<{a:A} & {b:B}>(1,2); // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.template.arguments.begin.flowtype @@ -67,4 +67,4 @@ // ^ .punctuation.definition.function.arguments.js.fjsx15 // ^ .constant.numeric.decimal.js.fjsx15 // ^ .punctuation.definition.function.arguments.end.js.fjsx15 -// ^ .keyword.operator.other.terminator.js.fjsx15 +// ^ .keyword.other.terminator.js.fjsx15 diff --git a/tests/syntaxes/fjsx15/syntax_test_function.js b/tests/syntaxes/fjsx15/syntax_test_function.js index 8912e6de..5ce8c2a5 100644 --- a/tests/syntaxes/fjsx15/syntax_test_function.js +++ b/tests/syntaxes/fjsx15/syntax_test_function.js @@ -13,6 +13,7 @@ // the License. function foo() {} +// ^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 @@ -20,6 +21,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function *foo() {} +// ^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^ .storage.modifier.js.fjsx15 // ^ .keyword.operator.other.generator.js.fjsx15 @@ -29,6 +31,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function foo(param, ...param) {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 @@ -40,6 +43,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function *foo(param, ...param) {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^ .storage.modifier.js.fjsx15 // ^ .keyword.operator.other.generator.js.fjsx15 @@ -53,6 +57,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function foo(param:number, ...param:string):boolean {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 @@ -73,6 +78,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function foo(param:?number, ...param:?(string|number)):?boolean {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 @@ -86,13 +92,13 @@ // ^^^^^ .entity.name.variable.js.fjsx15 // ^ .keyword.operator.other.association.flowtype // ^ .keyword.operator.other.nullable.flowtype -// ^ .punctuation.definition.nullable.begin.flowtype +// ^ .punctuation.definition.expression.group.begin.flowtype // ^^^^^^ .support.flowtype // ^^^^^^ .entity.name.type.flowtype // ^ .keyword.operator.other.union.flowtype // ^^^^^^ .support.flowtype // ^^^^^^ .entity.name.type.flowtype -// ^ .punctuation.definition.nullable.end.flowtype +// ^ .punctuation.definition.expression.group.end.flowtype // ^ .punctuation.definition.function.parameters.end.js.fjsx15 // ^ .keyword.operator.other.association.flowtype // ^ .keyword.operator.other.nullable.flowtype @@ -101,6 +107,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function foo(param:A, ...param:B):B {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^^^ .entity.name.function.js.fjsx15 // ^ .punctuation.definition.template.parameters.begin.flowtype @@ -123,6 +130,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function *foo(param:A, ...param:B):B {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^ .storage.modifier.js.fjsx15 // ^ .keyword.operator.other.generator.js.fjsx15 @@ -147,12 +155,14 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function () {} +// ^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^ .punctuation.definition.function.parameters.begin.js.fjsx15 // ^ .punctuation.definition.function.parameters.end.js.fjsx15 // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function *() {} +// ^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^ .storage.modifier.js.fjsx15 // ^ .keyword.operator.other.generator.js.fjsx15 @@ -161,6 +171,7 @@ // ^ .punctuation.definition.function.body.begin.js.fjsx15 // ^ .punctuation.definition.function.body.end.js.fjsx15 function *(param:A, ...param:B):B {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .meta.function.declaration.js.fjsx15 // ^^^^^^^^ .keyword.declaration.function.js.fjsx15 // ^ .storage.modifier.js.fjsx15 // ^ .keyword.operator.other.generator.js.fjsx15 diff --git a/tests/syntaxes/mql4/syntax_test_input.mq4 b/tests/syntaxes/mql4/syntax_test_input.mq4 index eb438ece..18498cd7 100644 --- a/tests/syntaxes/mql4/syntax_test_input.mq4 +++ b/tests/syntaxes/mql4/syntax_test_input.mq4 @@ -22,7 +22,7 @@ // ^^^ string.content.mql.mql4 // ^ punctuation.definition.string.begin.mql.mql4 // ^ punctuation.definition.string.end.mql.mql4 -// ^ keyword.operator.other.terminator.mql.mql4 +// ^ keyword.other.terminator.mql.mql4 input Custom identifier = "..."; // ^^^^^ keyword.input.mql.mql4 // ^^^^^^ entity.name.type.mql.mql4 @@ -32,4 +32,4 @@ // ^^^ string.content.mql.mql4 // ^ punctuation.definition.string.begin.mql.mql4 // ^ punctuation.definition.string.end.mql.mql4 -// ^ keyword.operator.other.terminator.mql.mql4 +// ^ keyword.other.terminator.mql.mql4 diff --git a/tests/syntaxes/php7/syntax_test_use.php7 b/tests/syntaxes/php7/syntax_test_use.php7 index dd5e92eb..8f928325 100644 --- a/tests/syntaxes/php7/syntax_test_use.php7 +++ b/tests/syntaxes/php7/syntax_test_use.php7 @@ -18,7 +18,7 @@ // ^ punctuation.definition.namespace.a.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.ambiguous.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^ entity.name.ambiguous.php.php7 @@ -29,7 +29,7 @@ // ^ punctuation.definition.namespace.a.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.ambiguous.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^ entity.name.ambiguous.php.php7 @@ -39,7 +39,7 @@ // ^^^ keyword.import.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.ambiguous.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^ entity.name.ambiguous.php.php7 @@ -49,7 +49,7 @@ // ^^ keyword.import.alias.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.ambiguous.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^ entity.name.ambiguous.php.php7 @@ -61,7 +61,7 @@ // ^ punctuation.definition.namespace.a.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.function.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^^ entity.name.function.php.php7 @@ -73,7 +73,7 @@ // ^ punctuation.definition.namespace.a.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.function.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^ entity.name.function.php.php7 @@ -84,7 +84,7 @@ // ^^^^^^^^ keyword.import.function.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.function.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^^ entity.name.function.php.php7 @@ -95,7 +95,7 @@ // ^^ keyword.import.alias.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.function.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^^ entity.name.function.php.php7 @@ -107,7 +107,7 @@ // ^ punctuation.definition.namespace.a.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.constant.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^^ entity.name.constant.php.php7 @@ -119,7 +119,7 @@ // ^ punctuation.definition.namespace.a.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.constant.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^^ entity.name.constant.php.php7 @@ -130,7 +130,7 @@ // ^^^^^ keyword.import.constant.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.constant.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^^ entity.name.constant.php.php7 @@ -141,7 +141,7 @@ // ^^ keyword.import.alias.php.php7 // ^ punctuation.definition.namespace.b.php.php7 // ^ punctuation.definition.constant.php.php7 -// ^ keyword.operator.other.terminator.php.php7 +// ^ keyword.other.terminator.php.php7 // ^^^^^^^^^ entity.name.namespace.a.php.php7 // ^^^^^^^^^ entity.name.namespace.b.php.php7 // ^^^^^^^^^^ entity.name.constant.php.php7