@@ -88,17 +88,15 @@ module Templating {
8888 * which cancels out the benefit of HTML escaping.
8989 */
9090 predicate isInCodeAttribute ( ) {
91- exists ( TopLevel code |
92- code = getParent ( ) .( HTML:: Attribute ) .getCodeInAttribute ( )
93- |
91+ exists ( TopLevel code | code = getParent ( ) .( HTML:: Attribute ) .getCodeInAttribute ( ) |
9492 code instanceof EventHandlerCode or
9593 code instanceof JavaScriptURL
9694 )
9795 }
9896
9997 /** Holds if this placeholder occurs in JS code. */
100- predicate isInCodeContext ( ) {
101- isInScriptTag ( ) or isInCodeAttribute ( )
98+ predicate isInCodeContext ( ) { isInScriptTag ( ) or isInCodeAttribute ( ) }
99+
102100 /**
103101 * Holds if this placeholder occurs in the definition of another template, which means the output
104102 * is susceptible to code injection.
@@ -115,9 +113,7 @@ module Templating {
115113 * Holds if this occurs in generated code as an expression or statement,
116114 * that is, without being enclosed in a string literal or similar.
117115 */
118- predicate isInPlainCodeContext ( ) {
119- this = any ( GeneratedCodeExpr e ) .getPlaceholderTag ( )
120- }
116+ predicate isInPlainCodeContext ( ) { this = any ( GeneratedCodeExpr e ) .getPlaceholderTag ( ) }
121117 }
122118
123119 /**
@@ -175,7 +171,7 @@ module Templating {
175171 */
176172 class TemplateInstantiaton extends DataFlow:: Node {
177173 TemplateInstantiaton:: Range range ;
178-
174+
179175 TemplateInstantiaton ( ) { this = range }
180176
181177 /** Gets a data flow node that refers to the instantiated template string, if any. */
@@ -201,13 +197,13 @@ module Templating {
201197 abstract class Range extends DataFlow:: Node {
202198 /** Gets a data flow node that refers to the instantiated template, if any. */
203199 abstract DataFlow:: SourceNode getOutput ( ) ;
204-
200+
205201 /** Gets a data flow node that refers a template file to be instantiated, if any. */
206202 abstract DataFlow:: Node getTemplateFileNode ( ) ;
207-
203+
208204 /** Gets a data flow node that refers to the contents of the template to be instantiated, if any. */
209205 abstract DataFlow:: Node getTemplateContentNode ( ) ;
210-
206+
211207 /** Gets a data flow node that refers to an object whose properties become variables in the template. */
212208 abstract DataFlow:: Node getTemplateParamsNode ( ) ;
213209 }
@@ -291,9 +287,7 @@ module Templating {
291287
292288 /** Get file argument of a template instantiation, seen as a template file reference. */
293289 private class DefaultTemplateFileReference extends TemplateFileReference {
294- DefaultTemplateFileReference ( ) {
295- this = any ( TemplateInstantiaton inst ) .getTemplateFileNode ( )
296- }
290+ DefaultTemplateFileReference ( ) { this = any ( TemplateInstantiaton inst ) .getTemplateFileNode ( ) }
297291 }
298292
299293 /**
@@ -478,20 +472,18 @@ module Templating {
478472 private class MustacheStyleSyntax extends TemplateSyntax {
479473 MustacheStyleSyntax ( ) { this = "mustache" }
480474
481- override string getRawInterpolationRegexp ( ) {
482- result = "(?s)\\{\\{\\{(.*?)\\}\\}\\}"
483- }
475+ override string getRawInterpolationRegexp ( ) { result = "(?s)\\{\\{\\{(.*?)\\}\\}\\}" }
484476
485- override string getEscapingInterpolationRegexp ( ) {
486- result = "(?s)\\{\\{[^{](.*?)\\}\\}"
487- }
477+ override string getEscapingInterpolationRegexp ( ) { result = "(?s)\\{\\{[^{](.*?)\\}\\}" }
488478
489- override string getAFileExtension ( ) {
490- result = "hbs"
491- }
479+ override string getAFileExtension ( ) { result = "hbs" }
492480
493481 override string getAPackageName ( ) {
494- result = [ "mustache" , "handlebars" , "hbs" , "express-hbs" , "swig" , "swig-templates" , "hogan" , "hogan.js" , "nunjucks" ]
482+ result =
483+ [
484+ "mustache" , "handlebars" , "hbs" , "express-hbs" , "swig" , "swig-templates" , "hogan" ,
485+ "hogan.js" , "nunjucks"
486+ ]
495487 }
496488 }
497489
@@ -502,21 +494,13 @@ module Templating {
502494 private class EjsStyleSyntax extends TemplateSyntax {
503495 EjsStyleSyntax ( ) { this = "ejs" }
504496
505- override string getRawInterpolationRegexp ( ) {
506- result = "(?s)<%-(.*?)%>"
507- }
497+ override string getRawInterpolationRegexp ( ) { result = "(?s)<%-(.*?)%>" }
508498
509- override string getEscapingInterpolationRegexp ( ) {
510- result = "(?s)<%=(.*?)%>"
511- }
499+ override string getEscapingInterpolationRegexp ( ) { result = "(?s)<%=(.*?)%>" }
512500
513- override string getAFileExtension ( ) {
514- result = "ejs"
515- }
501+ override string getAFileExtension ( ) { result = "ejs" }
516502
517- override string getAPackageName ( ) {
518- result = "ejs"
519- }
503+ override string getAPackageName ( ) { result = "ejs" }
520504 }
521505
522506 private TemplateSyntax getOwnTemplateSyntaxInFolder ( Folder f ) {
0 commit comments