on master help sign in
Manually convert Crystal.sublime-syntax
commitcef04665eb82c3c777dc1ce88fcc36b1fea74597 authorsharkdp <davidpeter@web.de> dateMon 1 Jun 2020, 09:54 (6 years ago) parent76569b9
1 file changed+4−3
assets/syntaxes/02_Extra/Crystal.sublime-syntax+4−3
assets/syntaxes/02_Extra/Crystal.sublime-syntax+4−3
@@ -108,7 +108,7 @@ contexts:
108108 - match: (?<!\.)\belse(\s)+if\b
109109 comment: else if is a common mistake carried over from other languages. it works if you put in a second end, but it’s never what you want.
110110 scope: invalid.deprecated.crystal
111− - match: '(?<!\.)\b(BEGIN|alias|as|begin|case|select|abstract|class|END|ensure|for|fun|if|ifdef|in|lib|module|of|out|private|protected|rescue|struct|with|union|enum|macro|then|type|unless|until|while)\b(?![?!])'
111+ - match: '(?<!\.)\b(BEGIN|alias|as|begin|case|select|abstract|class|END|ensure|for|fun|if|ifdef|in|lib|module|of|out|private|protected|rescue|struct|with|union|enum|macro|then|unless|until|while)\b(?![?!])|(?<!\.)\btype\b\s*(?=[A-Z])'
112112 comment: everything being a reserved word, not a value and needing a 'end' is a..
113113 scope: keyword.control.primary.crystal
114114 - match: '(?<!\.)\b(when|else|elsif)\b(?![?!])'
@@ -131,7 +131,7 @@ contexts:
131131 scope: keyword.control.pseudo-method.crystal
132132 - match: '\b(nil|true|false)\b(?![?!])'
133133 scope: constant.language.crystal
134− - match: '\b(__(DIR|FILE|LINE|END_LINE)__|self)\b(?![?!])'
134+ - match: '\b(__(DIR|FILE|LINE|END_LINE)__|self)\b(?![?!])|self[?]'
135135 scope: variable.language.crystal
136136 - match: '\b(initialize|new|loop|include|extend|raise|getter|setter|property|class_getter|class_setter|class_property|describe|context|it|with|delegate|def_hash|def_equals|def_equals_and_hash|forward_missing_to|record|assert_responds_to|spawn|annotation|verbatim)\b[!?]?'
137137 comment: everything being a method but having a special function is a..
@@ -190,7 +190,7 @@ contexts:
190190 push:
191191 - meta_scope: meta.function.method.with-arguments.crystal
192192 - meta_content_scope: variable.parameter.function.crystal
193− - match: \)\s*$|\)\s*:|\)\s*;
193+ - match: \)
194194 captures:
195195 0: punctuation.definition.parameters.crystal
196196 pop: true
@@ -705,6 +705,7 @@ contexts:
705705 0: punctuation.definition.string.end.crystal
706706 pop: true
707707 - include: heredoc
708+ - include: scope:text.html.basic
708709 - include: scope:source.js
709710 - include: interpolated_crystal
710711 - include: escaped_char