0001 // The MIT License 0002 // 0003 // Copyright (c) 2015 Gwendal Roué 0004 // 0005 // Permission is hereby granted, free of charge, to any person obtaining a copy 0006 // of this software and associated documentation files (the "Software"), to deal 0007 // in the Software without restriction, including without limitation the rights 0008 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 0009 // copies of the Software, and to permit persons to whom the Software is 0010 // furnished to do so, subject to the following conditions: 0011 // 0012 // The above copyright notice and this permission notice shall be included in 0013 // all copies or substantial portions of the Software. 0014 // 0015 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 0016 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 0017 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 0018 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 0019 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 0020 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 0021 // THE SOFTWARE. 0022 0023 /** 0024 VariableTag represents a variable tag such as {{name}} or {{{name}}}. 0025 */ 0026 final class VariableTag: LocatedTag { 0027 let token
TemplateASTNode.swift:58 let tag: VariableTagTemplateASTNode.swift:88 let tag = VariableTag(contentType: contentType, token: token): TemplateToken 0028 let contentType
VariableTag.swift:32 self.token = tokenVariableTag.swift:39 var tagDelimiterPair: TagDelimiterPair { return token.tagDelimiterPair! }VariableTag.swift:42 return "\(token.templateSubstring) at \(token.locationDescription)"VariableTag.swift:42 return "\(token.templateSubstring) at \(token.locationDescription)"VariableTag.swift:52 var templateID: TemplateID? { return token.templateID }VariableTag.swift:53 var lineNumber: Int { return token.lineNumber }: ContentType 0029 0030 init
VariableTag.swift:31 self.contentType = contentTypeVariableTag.swift:47 return Rendering("", contentType)(contentType: ContentType, token: TemplateToken) { 0031 self.contentType = contentType 0032 self.token = token 0033 } 0034 0035 // Mark: - Tag protocol 0036 0037 let type: TagType = .Variable 0038 let innerTemplateString: String = "" 0039 var tagDelimiterPair: TagDelimiterPair { return token.tagDelimiterPair! } 0040 0041 var description: String { 0042 return "\(token.templateSubstring) at \(token.locationDescription)" 0043 } 0044 0045 // Variable have no inner content. 0046 func render(context: Context) throws -> Rendering { 0047 return Rendering("", contentType) 0048 } 0049 0050 // Mark: - LocatedTag 0051 0052 var templateID: TemplateID? { return token.templateID } 0053 var lineNumber: Int { return token.lineNumber } 0054 }
TemplateASTNode.swift:88 let tag = VariableTag(contentType: contentType, token: token)