@@ -12,10 +12,10 @@ import Foundation
12
12
13
13
Iterates over user input. Creates formatted strings from it. Extracts value specified by mask format.
14
14
15
- Provided mask format string is translated by the ``` Compiler` `` class into a set of states, which define the formatting
15
+ Provided mask format string is translated by the ``Compiler`` class into a set of states, which define the formatting
16
16
and value extraction.
17
17
18
- - seealso: ``` Compiler``` , ``` State``` and ``` CaretString` `` classes.
18
+ - seealso: ``Compiler``, ``State`` and ``CaretString`` classes.
19
19
*/
20
20
public class Mask : CustomDebugStringConvertible , CustomStringConvertible {
21
21
@@ -60,7 +60,7 @@ public class Mask: CustomDebugStringConvertible, CustomStringConvertible {
60
60
}
61
61
62
62
/**
63
- Produce a reversed ``` Result``` with reversed formatted text (``` CaretString` ``) and reversed extracted value.
63
+ Produce a reversed ``Mask/ Result`` with reversed formatted text (``CaretString``) and reversed extracted value.
64
64
*/
65
65
func reversed( ) -> Result {
66
66
return Result (
@@ -80,11 +80,11 @@ public class Mask: CustomDebugStringConvertible, CustomStringConvertible {
80
80
Constructor.
81
81
82
82
- parameter format: mask format.
83
- - parameter customNotations: a list of custom rules to compile square bracket ```[]`` ` groups of format symbols.
83
+ - parameter customNotations: a list of custom rules to compile square bracket `[] ` groups of format symbols.
84
84
85
- - returns: Initialized ``` Mask` `` instance.
85
+ - returns: Initialized ``Mask`` instance.
86
86
87
- - throws: ``` CompilerError` `` if format string is incorrect.
87
+ - throws: ``Compiler/ CompilerError`` if format string is incorrect.
88
88
*/
89
89
public required init ( format: String , customNotations: [ Notation ] = [ ] ) throws {
90
90
self . initialState = try Compiler ( customNotations: customNotations) . compile ( formatString: format)
@@ -93,10 +93,10 @@ public class Mask: CustomDebugStringConvertible, CustomStringConvertible {
93
93
/**
94
94
Constructor.
95
95
96
- Operates over own ``` Mask``` cache where initialized ``` Mask` `` objects are stored under corresponding format key:
97
- ``` [format : mask]`` `
96
+ Operates over own ``Mask`` cache where initialized ``Mask`` objects are stored under corresponding format key:
97
+ `[format : mask]`
98
98
99
- - returns: Previously cached ``` Mask` `` object for requested format string. If such it doesn't exist in cache, the
99
+ - returns: Previously cached ``Mask`` object for requested format string. If such it doesn't exist in cache, the
100
100
object is constructed, cached and returned.
101
101
*/
102
102
public class func getOrCreate( withFormat format: String , customNotations: [ Notation ] = [ ] ) throws -> Mask {
@@ -113,10 +113,10 @@ public class Mask: CustomDebugStringConvertible, CustomStringConvertible {
113
113
Check your mask format is valid.
114
114
115
115
- parameter format: mask format.
116
- - parameter customNotations: a list of custom rules to compile square bracket ```[]`` ` groups of format symbols.
116
+ - parameter customNotations: a list of custom rules to compile square bracket `[] ` groups of format symbols.
117
117
118
- - returns: ``` true``` if this format coupled with custom notations will compile into a working ``` Mask` `` object.
119
- Otherwise ``` false`` `.
118
+ - returns: `true` if this format coupled with custom notations will compile into a working ``Mask`` object.
119
+ Otherwise `false`.
120
120
*/
121
121
public class func isValid( format: String , customNotations: [ Notation ] = [ ] ) -> Bool {
122
122
return nil != ( try ? self . init ( format: format, customNotations: customNotations) )
@@ -300,10 +300,10 @@ public class Mask: CustomDebugStringConvertible, CustomStringConvertible {
300
300
301
301
/**
302
302
While scanning through the input string in the `.apply(…)` method, the mask builds a graph of autocompletion steps.
303
- This graph accumulates the results of `.autocomplete()` calls for each consecutive `State`, acting as a `stack` of
304
- `Next` object instances.
303
+ This graph accumulates the results of `.autocomplete()` calls for each consecutive `` State` `, acting as a `stack` of
304
+ `` Next` ` object instances.
305
305
306
- Each time the `State` returns `null` for its `.autocomplete()`, the graph resets empty.
306
+ Each time the `` State` ` returns `null` for its `.autocomplete()`, the graph resets empty.
307
307
*/
308
308
private struct AutocompletionStack {
309
309
private var stack = [ Next] ( )
0 commit comments