SwiftGrammar: Enable delimiters and syntax rules to be mutated

This enables easy creation of custom grammars that are based on the Swift one.
This commit is contained in:
John Sundell 2018-09-28 13:52:51 +02:00
parent 30b9300441
commit 98bfad4ea4

View File

@ -9,8 +9,8 @@ import Foundation
/// Grammar for the Swift language. Use this implementation when
/// highlighting Swift code. This is the default grammar.
public struct SwiftGrammar: Grammar {
public let delimiters: CharacterSet
public let syntaxRules: [SyntaxRule]
public var delimiters: CharacterSet
public var syntaxRules: [SyntaxRule]
public init() {
var delimiters = CharacterSet.alphanumerics.inverted