Skip to content

Commit 6927378

Browse files
committed
Syntax highlighting fixes
1 parent a340ef2 commit 6927378

6 files changed

+52
-27
lines changed

syntaxes/cfml.sublime-syntax

+3-3
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ contexts:
520520
scope: punctuation.definition.template-expression.begin.cfml
521521
push:
522522
- match: '#'
523-
scope: punctuation.definition.template-expression.begin.cfml
523+
scope: punctuation.definition.template-expression.end.cfml
524524
pop: true
525525
- match: (?=.|\n)
526526
push:
@@ -533,7 +533,7 @@ contexts:
533533
scope: punctuation.definition.template-expression.begin.cfml
534534
push:
535535
- match: '#'
536-
scope: punctuation.definition.template-expression.begin.cfml
536+
scope: punctuation.definition.template-expression.end.cfml
537537
pop: true
538538
- match: (?=.|\n)
539539
push:
@@ -551,7 +551,7 @@ contexts:
551551
scope: punctuation.definition.template-expression.begin.cfml
552552
push:
553553
- match: '#'
554-
scope: punctuation.definition.template-expression.begin.cfml
554+
scope: punctuation.definition.template-expression.end.cfml
555555
pop: true
556556
- match: (?=.|\n)
557557
push:

syntaxes/cfscript-in-tags.sublime-syntax

+15-8
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ contexts:
11381138

11391139
tag-in-script-cf:
11401140
- match: |-
1141-
(?x)(?i)(cf(?:ajaximport|ajaxproxy|applet|application|argument|associate|break|cache|calendar|chart
1141+
(?x)(?i)cf(?:ajaximport|ajaxproxy|applet|application|argument|associate|break|cache|calendar|chart
11421142
|chartdata|chartseries|client|clientsettings|col|collection|content|cookie|dbinfo
11431143
|directory|div|document|documentitem|documentsection|dump|error|exchangecalendar
11441144
|exchangeconnection|exchangecontact|exchangefilter|exchangemail|exchangetask|execute
@@ -1152,14 +1152,20 @@ contexts:
11521152
|queryparam|registry|report|reportparam|savecontent|schedule|search|select|setting
11531153
|sharepoint|silent|slider|spreadsheet|sprydataset|storedproc|table|textarea|textinput
11541154
|thread|throw|timer|tooltip|trace|transaction|tree|treeitem|update|wddx|websocket
1155-
|window|xml|zip|zipparam))\(
1156-
captures:
1157-
1: entity.name.tag.script.cfml
1155+
|window|xml|zip|zipparam)(?=\()
1156+
scope: entity.name.tag.script.cfml
11581157
push:
1159-
- meta_scope: meta.tag.script.cf.cfml
1160-
- match: \)
1161-
pop: true
1162-
- include: tag-generic-attribute-cf-script
1158+
- - meta_scope: meta.tag.script.cf.cfml
1159+
- include: immediately-pop
1160+
- - match: \(
1161+
scope: punctuation.section.group.begin.cfml
1162+
set:
1163+
- meta_scope: meta.tag.script.cf.attributes.cfml
1164+
- match: \)
1165+
scope: punctuation.section.group.end.cfml
1166+
pop: true
1167+
- include: tag-generic-attribute-cf-script
1168+
- include: else-pop
11631169
11641170
tag-generic-attribute-cf-script:
11651171
- match: ','
@@ -1372,3 +1378,4 @@ contexts:
13721378
angle-bracket-pop:
13731379
- match: (?=/?>)
13741380
pop: true
1381+

syntaxes/cfscript.sublime-syntax

+14-8
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ contexts:
11421142

11431143
tag-in-script-cf:
11441144
- match: |-
1145-
(?x)(?i)(cf(?:ajaximport|ajaxproxy|applet|application|argument|associate|break|cache|calendar|chart
1145+
(?x)(?i)cf(?:ajaximport|ajaxproxy|applet|application|argument|associate|break|cache|calendar|chart
11461146
|chartdata|chartseries|client|clientsettings|col|collection|content|cookie|dbinfo
11471147
|directory|div|document|documentitem|documentsection|dump|error|exchangecalendar
11481148
|exchangeconnection|exchangecontact|exchangefilter|exchangemail|exchangetask|execute
@@ -1156,14 +1156,20 @@ contexts:
11561156
|queryparam|registry|report|reportparam|savecontent|schedule|search|select|setting
11571157
|sharepoint|silent|slider|spreadsheet|sprydataset|storedproc|table|textarea|textinput
11581158
|thread|throw|timer|tooltip|trace|transaction|tree|treeitem|update|wddx|websocket
1159-
|window|xml|zip|zipparam))\(
1160-
captures:
1161-
1: entity.name.tag.script.cfml
1159+
|window|xml|zip|zipparam)(?=\()
1160+
scope: entity.name.tag.script.cfml
11621161
push:
1163-
- meta_scope: meta.tag.script.cf.cfml
1164-
- match: \)
1165-
pop: true
1166-
- include: tag-generic-attribute-cf-script
1162+
- - meta_scope: meta.tag.script.cf.cfml
1163+
- include: immediately-pop
1164+
- - match: \(
1165+
scope: punctuation.section.group.begin.cfml
1166+
set:
1167+
- meta_scope: meta.tag.script.cf.attributes.cfml
1168+
- match: \)
1169+
scope: punctuation.section.group.end.cfml
1170+
pop: true
1171+
- include: tag-generic-attribute-cf-script
1172+
- include: else-pop
11671173
11681174
tag-generic-attribute-cf-script:
11691175
- match: ','

syntaxes/macros/cfml_macros.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def template_expression(meta_content_scope, clear_scopes=None, html_entities=Fal
163163
'push': [
164164
{
165165
'match': '#',
166-
'scope': 'punctuation.definition.template-expression.begin.cfml',
166+
'scope': 'punctuation.definition.template-expression.end.cfml',
167167
'pop': True,
168168
},
169169
{'match': r'(?=.|\n)', 'push': push_context},

syntaxes/src/cfscript.sublime-syntax.yaml-macros

+12-7
Original file line numberDiff line numberDiff line change
@@ -981,14 +981,19 @@ contexts:
981981

982982
tag-in-script-cf:
983983
- match: !tags |-
984-
(?x)(?i)(cf(?:{tags}))\(
985-
captures:
986-
1: entity.name.tag.script.cfml
984+
(?x)(?i)cf(?:{tags})(?=\()
985+
scope: entity.name.tag.script.cfml
987986
push:
988-
- meta_scope: meta.tag.script.cf.cfml
989-
- match: \)
990-
pop: true
991-
- include: tag-generic-attribute-cf-script
987+
- !meta meta.tag.script.cf.cfml
988+
- - match: '\('
989+
scope: punctuation.section.group.begin.cfml
990+
set:
991+
- meta_scope: meta.tag.script.cf.attributes.cfml
992+
- match: '\)'
993+
scope: punctuation.section.group.end.cfml
994+
pop: true
995+
- include: tag-generic-attribute-cf-script
996+
- include: else-pop
992997

993998
tag-generic-attribute-cf-script:
994999
- match: ','

syntaxes/tests/syntax_test_cfc.cfc

+7
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,19 @@ private numeric function $fixNumber(required any value) {}
253253
this.test();
254254
// ^ punctuation.accessor.cfml
255255
cflock(name:"name-of-lock") {}
256+
// ^ meta.tag.script.cf.cfml meta.tag.script.cf.attributes.cfml punctuation.section.group.begin.cfml
256257
// ^ meta.tag.script.cf.cfml punctuation.separator.key-value.cfml
257258
// ^ meta.string.quoted.double.cfml string.quoted.double.cfml punctuation.definition.string.begin.cfml
258259
// ^^^^^^^^^^^^ meta.string.quoted.double.cfml string.quoted.double.cfml
260+
// ^ meta.tag.script.cf.cfml meta.tag.script.cf.attributes.cfml punctuation.section.group.end.cfml
261+
// ^ meta.block.cfml punctuation.section.block.begin.cfml
259262
test(name:"arg");
260263
// ^^^^ entity.other.function-parameter.cfml
261264
// ^ punctuation.separator.key-value.cfml
262265
}
263266
// <- embedding.cfml source.cfml.script meta.class.body.cfml punctuation.section.block.end.cfml
264267
// <- embedding.cfml source.cfml.script -meta
268+
269+
a = 'a #test# string';
270+
// ^ punctuation.definition.template-expression.begin.cfml
271+
// ^ punctuation.definition.template-expression.end.cfml

0 commit comments

Comments
 (0)