Skip to content

Commit

Permalink
restrict matching of ColdFusion style tags in script to only match ac…
Browse files Browse the repository at this point in the history
…tual tag names
  • Loading branch information
jcberquist committed Mar 7, 2016
1 parent 31bc2bb commit 6447e8b
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 4 deletions.
2 changes: 2 additions & 0 deletions messages/0.6.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ CFML v0.6.0 Changelog:
- Unquoted tag attribute values should now correctly highlight CFScript contained
between `#` characters

- The matching of ColdFusion style tags in script has been restricted to match only
actual tag names
13 changes: 12 additions & 1 deletion syntaxes/cfml.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -4612,7 +4612,18 @@
<array>
<dict>
<key>begin</key>
<string>(?i)(cf[\w]+)\(</string>
<string>(?x)(?i)
(cf
(?:ajaximport|ajaxproxy|applet|application|argument|associate|authenticate|break|cache|chart|chartdata
|chartseries|col|collection|content|cookie|dbinfo|directory|div|document|documentitem
|documentsection|dump|error|execute|exit|feed|file|flush|form|forward|ftp|graph|graphdata
|header|htmlbody|htmlhead|http|httpparam|image|imap|import|include|index|input|insert|invoke|invokeargument
|layout|layoutarea|ldap|location|lock|log|login|loginuser|logout|loop|mail|mailparam|mailpart|map|mapitem|mediaplayer
|module|object|objectcache|output|pageencoding|pdf|pdfparam|pop|processingdirective|procparam|procresult
|query|queryparam|registry|rethrow|retry|savecontent|schedule|search|select|servlet|servletparam
|setting|silent|sleep|slider|stopwatch|storedproc|table|textinput|thread|throw|timer|trace|transaction
|update|video|videoplayer|videoplayerparam|wddx|window|xml|zip|zipparam)
)\(</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
Expand Down
14 changes: 13 additions & 1 deletion syntaxes/cfscript.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,19 @@ repository:
tag-in-script-cf:
patterns:
- name: meta.tag.script.cf.cfml
begin: (?i)(cf[\w]+)\(
begin: |-
(?x)(?i)
(cf
(?:ajaximport|ajaxproxy|applet|application|argument|associate|authenticate|break|cache|chart|chartdata
|chartseries|col|collection|content|cookie|dbinfo|directory|div|document|documentitem
|documentsection|dump|error|execute|exit|feed|file|flush|form|forward|ftp|graph|graphdata
|header|htmlbody|htmlhead|http|httpparam|image|imap|import|include|index|input|insert|invoke|invokeargument
|layout|layoutarea|ldap|location|lock|log|login|loginuser|logout|loop|mail|mailparam|mailpart|map|mapitem|mediaplayer
|module|object|objectcache|output|pageencoding|pdf|pdfparam|pop|processingdirective|procparam|procresult
|query|queryparam|registry|rethrow|retry|savecontent|schedule|search|select|servlet|servletparam
|setting|silent|sleep|slider|stopwatch|storedproc|table|textinput|thread|throw|timer|trace|transaction
|update|video|videoplayer|videoplayerparam|wddx|window|xml|zip|zipparam)
)\(
beginCaptures:
'1': {name: entity.name.tag.script.cfml}
end: \)
Expand Down
13 changes: 12 additions & 1 deletion syntaxes/cfscript.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3495,7 +3495,18 @@
<array>
<dict>
<key>begin</key>
<string>(?i)(cf[\w]+)\(</string>
<string>(?x)(?i)
(cf
(?:ajaximport|ajaxproxy|applet|application|argument|associate|authenticate|break|cache|chart|chartdata
|chartseries|col|collection|content|cookie|dbinfo|directory|div|document|documentitem
|documentsection|dump|error|execute|exit|feed|file|flush|form|forward|ftp|graph|graphdata
|header|htmlbody|htmlhead|http|httpparam|image|imap|import|include|index|input|insert|invoke|invokeargument
|layout|layoutarea|ldap|location|lock|log|login|loginuser|logout|loop|mail|mailparam|mailpart|map|mapitem|mediaplayer
|module|object|objectcache|output|pageencoding|pdf|pdfparam|pop|processingdirective|procparam|procresult
|query|queryparam|registry|rethrow|retry|savecontent|schedule|search|select|servlet|servletparam
|setting|silent|sleep|slider|stopwatch|storedproc|table|textinput|thread|throw|timer|trace|transaction
|update|video|videoplayer|videoplayerparam|wddx|window|xml|zip|zipparam)
)\(</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
Expand Down
14 changes: 13 additions & 1 deletion syntaxes/cfscript.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,19 @@ contexts:
push: tag-generic-attribute-script
tag-in-script-cf:
- match: (?i)(cf[\w]+)\(
- match: |-
(?x)(?i)
(cf
(?:ajaximport|ajaxproxy|applet|application|argument|associate|authenticate|break|cache|chart|chartdata
|chartseries|col|collection|content|cookie|dbinfo|directory|div|document|documentitem
|documentsection|dump|error|execute|exit|feed|file|flush|form|forward|ftp|graph|graphdata
|header|htmlbody|htmlhead|http|httpparam|image|imap|import|include|index|input|insert|invoke|invokeargument
|layout|layoutarea|ldap|location|lock|log|login|loginuser|logout|loop|mail|mailparam|mailpart|map|mapitem|mediaplayer
|module|object|objectcache|output|pageencoding|pdf|pdfparam|pop|processingdirective|procparam|procresult
|query|queryparam|registry|rethrow|retry|savecontent|schedule|search|select|servlet|servletparam
|setting|silent|sleep|slider|stopwatch|storedproc|table|textinput|thread|throw|timer|trace|transaction
|update|video|videoplayer|videoplayerparam|wddx|window|xml|zip|zipparam)
)\(
captures:
1: entity.name.tag.script.cfml
push:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,7 @@ cfhttp( url = "www.google.com" );
<!--- <- embedding.cfml text.html.cfml source.cfml.script meta.tag.script.cf.cfml entity.name.tag.script.cfml --->
<!--- ^ embedding.cfml text.html.cfml source.cfml.script meta.tag.script.cf.cfml entity.other.attribute-name.cfml --->
cfcExists( someArg = 1 );
<!--- <- embedding.cfml text.html.cfml source.cfml.script meta.function-call.cfml variable.function.cfml --->
<!--- ^ embedding.cfml text.html.cfml source.cfml.script meta.function-call.cfml meta.function-call.arguments.cfml entity.other.function-parameter.cfml --->
</cfscript>
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,7 @@ cfhttp( url = "www.google.com" );
<!--- <- embedding.cfml text.html.cfml source.cfml.script meta.tag.script.cf.cfml entity.name.tag.script.cfml --->
<!--- ^ embedding.cfml text.html.cfml source.cfml.script meta.tag.script.cf.cfml entity.other.attribute-name.cfml --->
cfcExists( someArg = 1 );
<!--- <- embedding.cfml text.html.cfml source.cfml.script meta.function-call.cfml variable.function.cfml --->
<!--- ^ embedding.cfml text.html.cfml source.cfml.script meta.function-call.cfml meta.function-call.arguments.cfml entity.other.function-parameter.cfml --->
</cfscript>

0 comments on commit 6447e8b

Please sign in to comment.