Skip to content

Instantly share code, notes, and snippets.

@breck7
Created October 29, 2019 22:43
Show Gist options
  • Save breck7/d1d6a4bfc184dc3b06aef62d956ce6ac to your computer and use it in GitHub Desktop.
Save breck7/d1d6a4bfc184dc3b06aef62d956ce6ac to your computer and use it in GitHub Desktop.
Syntax that seems to cause a fatal crash in Sublime https://jtree.treenotation.org/designer/#standard%20hakon
%YAML 1.2
---
name: hakon
file_extensions: [hakon]
scope: source.hakon
variables:
anyCell: '[^ ]*'
keywordCell: '[^ ]*'
commentKeywordCell: '(?:comment)'
extraCell: '[^ ]*'
cssValueCell: '[^ ]*'
selectorCell: '[^ ]*'
propertyKeywordCell: '(?:border-bottom-right-radius|transition-timing-function|animation-iteration-count|animation-timing-function|border-bottom-left-radius|border-top-right-radius|border-top-left-radius|background-attachment|background-blend-mode|text-decoration-color|text-decoration-style|overscroll-behavior-x|-webkit-touch-callout|animation-play-state|text-decoration-line|animation-direction|animation-fill-mode|backface-visibility|background-position|border-bottom-color|border-bottom-style|border-bottom-width|border-image-outset|border-image-repeat|border-image-source|hanging-punctuation|list-style-position|transition-duration|transition-property|-webkit-user-select|animation-duration|border-image-slice|border-image-width|border-right-color|border-right-style|border-right-width|perspective-origin|-khtml-user-select|background-origin|background-repeat|border-left-color|border-left-style|border-left-width|column-rule-color|column-rule-style|column-rule-width|counter-increment|page-break-before|page-break-inside|background-color|background-image|border-top-color|border-top-style|border-top-width|font-size-adjust|list-style-image|page-break-after|transform-origin|transition-delay|-ms-touch-action|-moz-user-select|animation-delay|background-clip|background-size|border-collapse|justify-content|list-style-type|text-align-last|text-decoration|transform-style|-ms-user-select|animation-name|border-spacing|flex-direction|letter-spacing|outline-offset|padding-bottom|text-transform|vertical-align|align-content|border-bottom|border-radius|counter-reset|margin-bottom|outline-color|outline-style|outline-width|padding-right|text-overflow|border-color|border-image|border-right|border-style|border-width|caption-side|column-count|column-width|font-stretch|font-variant|margin-right|padding-left|table-layout|text-justify|unicode-bidi|word-spacing|touch-action|align-items|border-left|column-fill|column-rule|column-span|empty-cells|flex-shrink|font-family|font-weight|line-height|margin-left|padding-top|perspective|text-indent|text-shadow|white-space|user-select|align-self|background|border-top|box-shadow|box-sizing|column-gap|flex-basis|@font-face|font-style|@keyframes|list-style|margin-top|max-height|min-height|overflow-x|overflow-y|text-align|transition|visibility|word-break|animation|direction|flex-flow|flex-grow|flex-wrap|font-size|max-width|min-width|nav-index|nav-right|transform|word-wrap|nav-down|nav-left|overflow|position|tab-size|columns|content|display|opacity|outline|padding|z-index|border|bottom|cursor|filter|height|margin|@media|nav-up|quotes|resize|clear|color|float|order|right|width|clip|fill|flex|font|left|all|top)'
errorCell: '[^ ]*'
commentCell: '[^ ]*'
contexts:
main:
- include: 'hakonNode'
- include: 'propertyNode'
- include: 'errorNode'
- include: 'commentNode'
- include: 'selectorNode'
'hakonNode':
- match: undefined
scope: source.hakonNode
'propertyNode':
- match: '^ *(border-bottom-right-radius\|transition-timing-function\|animation-iteration-count\|animation-timing-function\|border-bottom-left-radius\|border-top-right-radius\|border-top-left-radius\|background-attachment\|background-blend-mode\|text-decoration-color\|text-decoration-style\|overscroll-behavior-x\|-webkit-touch-callout\|animation-play-state\|text-decoration-line\|animation-direction\|animation-fill-mode\|backface-visibility\|background-position\|border-bottom-color\|border-bottom-style\|border-bottom-width\|border-image-outset\|border-image-repeat\|border-image-source\|hanging-punctuation\|list-style-position\|transition-duration\|transition-property\|-webkit-user-select\|animation-duration\|border-image-slice\|border-image-width\|border-right-color\|border-right-style\|border-right-width\|perspective-origin\|-khtml-user-select\|background-origin\|background-repeat\|border-left-color\|border-left-style\|border-left-width\|column-rule-color\|column-rule-style\|column-rule-width\|counter-increment\|page-break-before\|page-break-inside\|background-color\|background-image\|border-top-color\|border-top-style\|border-top-width\|font-size-adjust\|list-style-image\|page-break-after\|transform-origin\|transition-delay\|-ms-touch-action\|-moz-user-select\|animation-delay\|background-clip\|background-size\|border-collapse\|justify-content\|list-style-type\|text-align-last\|text-decoration\|transform-style\|-ms-user-select\|animation-name\|border-spacing\|flex-direction\|letter-spacing\|outline-offset\|padding-bottom\|text-transform\|vertical-align\|align-content\|border-bottom\|border-radius\|counter-reset\|margin-bottom\|outline-color\|outline-style\|outline-width\|padding-right\|text-overflow\|border-color\|border-image\|border-right\|border-style\|border-width\|caption-side\|column-count\|column-width\|font-stretch\|font-variant\|margin-right\|padding-left\|table-layout\|text-justify\|unicode-bidi\|word-spacing\|touch-action\|align-items\|border-left\|column-fill\|column-rule\|column-span\|empty-cells\|flex-shrink\|font-family\|font-weight\|line-height\|margin-left\|padding-top\|perspective\|text-indent\|text-shadow\|white-space\|user-select\|align-self\|background\|border-top\|box-shadow\|box-sizing\|column-gap\|flex-basis\|@font-face\|font-style\|@keyframes\|list-style\|margin-top\|max-height\|min-height\|overflow-x\|overflow-y\|text-align\|transition\|visibility\|word-break\|animation\|direction\|flex-flow\|flex-grow\|flex-wrap\|font-size\|max-width\|min-width\|nav-index\|nav-right\|transform\|word-wrap\|nav-down\|nav-left\|overflow\|position\|tab-size\|columns\|content\|display\|opacity\|outline\|padding\|z-index\|border\|bottom\|cursor\|filter\|height\|margin\|@media\|nav-up\|quotes\|resize\|clear\|color\|float\|order\|right\|width\|clip\|fill\|flex\|font\|left\|all\|top)(?: |$)'
scope: variable.function.propertyNode
push:
- match: ({{propertyKeywordCell}})? ?({{cssValueCell}})?
captures:
1: variable.function.propertyKeywordCell
2: constant.numeric.cssValueCell
- match: $
pop: true
'errorNode':
- match: undefined
scope: source.errorNode
push:
- match: ({{errorCell}})?
captures:
1: invalid.errorCell
- match: $
pop: true
'commentNode':
- match: '^ *(comment)(?: |$)'
scope: comment.commentNode
push:
- match: ({{commentKeywordCell}})? ?({{commentCell}})?
captures:
1: comment.commentKeywordCell
2: comment.commentCell
- match: $
pop: true
'selectorNode':
- match: undefined
scope: keyword.control.selectorNode
push:
- match: ({{selectorCell}})?
captures:
1: keyword.control.selectorCell
- match: $
pop: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment