88
99import Foundation
1010
11-
1211public struct Section : Node {
13- public enum Priority : String {
14- case A = " A "
15- case B = " B "
16- case C = " C "
17- }
1812
13+ // MARK: properties
1914 public var index : OrgIndex ?
2015
2116 public var title : String ?
2217 public var stars : Int
2318 public var keyword : String ?
2419 public var priority : Priority ?
20+ public var tags : [ String ] ?
21+ public var content = [ Node] ( )
2522
2623 public var drawers : [ Drawer ] ? {
2724 let ds = content. filter { node in
@@ -31,10 +28,12 @@ public struct Section: Node {
3128 }
3229 return ds
3330 }
34- public var tags : [ String ] ?
3531
36- public var content = [ Node] ( )
32+ public var planning : Planning ? {
33+ return content. first { $0 is Planning } as? Planning
34+ }
3735
36+ // MARK: func
3837 public init ( stars l: Int , title t: String ? , todos: [ String ] ) {
3938 stars = l
4039 // TODO limit charset on tags
@@ -58,6 +57,15 @@ public struct Section: Node {
5857 }
5958}
6059
60+ public struct Planning : Node {
61+ public let keyword : PlanningKeyword
62+ public let timestamp : Timestamp ?
63+
64+ public var description : String {
65+ return " Planning(keyword: \( keyword) , timestamp: \( timestamp) ) "
66+ }
67+ }
68+
6169extension OrgParser {
6270 func parseSection( _ index: OrgIndex ) throws -> Node ? {
6371 skipBlanks ( ) // in a section, you don't care about blanks
0 commit comments