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 A SectionTag represents a regular or inverted section tag such as 0025 {{#section}}...{{/section}} or {{^section}}...{{/section}}. 0026 */ 0027 final class SectionTag: LocatedTag { 0028 let openingToken
Template.swift:265 case let sectionTag as SectionTag:TemplateASTNode.swift:52 let tag: SectionTagTemplateASTNode.swift:79 let tag = SectionTag(innerTemplateAST: templateAST, openingToken: openingToken, innerTemplateString: innerTemplateString): TemplateToken 0029 let innerTemplateAST
SectionTag.swift:33 self.openingToken = openingTokenSectionTag.swift:41 var tagDelimiterPair: TagDelimiterPair { return openingToken.tagDelimiterPair! }SectionTag.swift:44 return "\(openingToken.templateSubstring) at \(openingToken.locationDescription)"SectionTag.swift:44 return "\(openingToken.templateSubstring) at \(openingToken.locationDescription)"SectionTag.swift:54 var templateID: TemplateID? { return openingToken.templateID }SectionTag.swift:55 var lineNumber: Int { return openingToken.lineNumber }: TemplateAST 0030 0031 init
TemplateGenerator.swift:94 renderTemplateAST(section.tag.innerTemplateAST)Template.swift:273 childTemplateAST: sectionTag.innerTemplateAST,SectionTag.swift:32 self.innerTemplateAST = innerTemplateASTSectionTag.swift:48 let renderingEngine = RenderingEngine(templateAST: innerTemplateAST, context: context)(innerTemplateAST: TemplateAST, openingToken: TemplateToken, innerTemplateString: String) { 0032 self.innerTemplateAST = innerTemplateAST 0033 self.openingToken = openingToken 0034 self.innerTemplateString = innerTemplateString 0035 } 0036 0037 // Mark: - Tag protocol 0038 0039 let type: TagType = .Section 0040 let innerTemplateString
TemplateASTNode.swift:79 let tag = SectionTag(innerTemplateAST: templateAST, openingToken: openingToken, innerTemplateString: innerTemplateString): String 0041 var tagDelimiterPair: TagDelimiterPair { return openingToken.tagDelimiterPair! } 0042 0043 var description: String { 0044 return "\(openingToken.templateSubstring) at \(openingToken.locationDescription)" 0045 } 0046 0047 func render(context: Context) throws -> Rendering { 0048 let renderingEngine = RenderingEngine(templateAST: innerTemplateAST, context: context) 0049 return try renderingEngine.render() 0050 } 0051 0052 // Mark: - LocatedTag 0053 0054 var templateID: TemplateID? { return openingToken.templateID } 0055 var lineNumber: Int { return openingToken.lineNumber } 0056 } 0057
SectionTag.swift:34 self.innerTemplateString = innerTemplateString