You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// - maping makes unneccessary copies and hurts throughput
26
+
// - interpolation hurts performance, a lot less than maping but still noticeable
27
+
// - adding strings (concatenation) is faster than interpolation
28
+
// - calculating the size of the result than assigning the contents in a String is significantly worse than interpolation and concatenation
29
+
// - calculating the size of the result than assigning the contents in a Data is about the same performance, if not faster, as SwiftHTMLKit native solution with interpolation/concatenation
context.diagnose(Diagnostic(node: child, message:ErrorDiagnostic(id:"unallowedExpression", message:"Expression not allowed. String interpolation is required when encoding runtime values."), fixIts:[
context.diagnose(Diagnostic(node: key_element, message:ErrorDiagnostic(id:"spacesNotAllowedInAttributeDeclaration", message:"Spaces are not allowed in attribute declaration.")))
101
+
context.diagnose(Diagnostic(node: key_element, message:DiagnosticMsg(id:"spacesNotAllowedInAttributeDeclaration", message:"Spaces are not allowed in attribute declaration.")))
98
102
}elseiflet value:String= value {
99
103
if keys.contains(key){
100
-
context.diagnose(Diagnostic(node: key_element, message:ErrorDiagnostic(id:"globalAttributeAlreadyDefined", message:"Global attribute is already defined.")))
104
+
context.diagnose(Diagnostic(node: key_element, message:DiagnosticMsg(id:"globalAttributeAlreadyDefined", message:"Global attribute is already defined.")))
101
105
}else{
102
106
attributes.append(key +(value.isEmpty ?"":"=\\\""+ value +"\\\""))
varstring:String=(elementType ==.html ?"<!DOCTYPE html>":"")+"<"+ tag + data.attributes +">"+ data.innerHTML
132
-
if !isVoid {
133
-
string +="</"+ tag +">"
126
+
context.diagnose(Diagnostic(node: child, message:DiagnosticMsg(id:"unallowedExpression", message:"Expression not allowed. String interpolation is required when encoding runtime values."), fixIts:[
context.diagnose(Diagnostic(node: $0, message:ErrorDiagnostic(id:"characterNotAllowedInDeclaration", message:"Character \""+ separator +"\" is not allowed when declaring values for \""+ key +"\".")))
231
+
context.diagnose(Diagnostic(node: $0, message:DiagnosticMsg(id:"characterNotAllowedInDeclaration", message:"Character \""+ separator +"\" is not allowed when declaring values for \""+ key +"\".")))
context.diagnose(Diagnostic(node: expression, message:ErrorDiagnostic(id:"unsafeInterpolation", message:"Interpolation may introduce raw HTML elements.", severity:.warning)))
262
+
context.diagnose(Diagnostic(node: expression, message:DiagnosticMsg(id:"unsafeInterpolation", message:"Interpolation may introduce raw HTML elements.", severity:.warning)))
0 commit comments