Skip to content

Commit

Permalink
Introduce numberSign, deprecate pound #1
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Apr 30, 2024
1 parent 44e278f commit cc183d1
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions Sources/Flexer/BasicTextCharacterLexer.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// BasicTextCharacterLexer.swift
// Flexer
//
// Created by Matt Massicotte on 2020-04-24.
// Copyright © 2020 Chime Systems Inc. All rights reserved.
//

import Foundation

public protocol StringInitializable {
Expand All @@ -20,7 +12,7 @@ public extension StringInitializable {
}
}

public enum BasicTextCharacterKind: Hashable {
public enum BasicTextCharacterKind: Hashable, Sendable {
case tab
case space
case newline
Expand Down Expand Up @@ -53,7 +45,7 @@ public enum BasicTextCharacterKind: Hashable {
case dollar
case star
case slash
case pound
case numberSign
case pipe
case backslash
case dash
Expand All @@ -65,6 +57,9 @@ public enum BasicTextCharacterKind: Hashable {
case colon
case semicolon
case underscore

@available(*, deprecated, message: "Please use numberSign")
static let pound = BasicTextCharacterKind.numberSign
}

public typealias BasicTextCharacter = Token<BasicTextCharacterKind>
Expand Down Expand Up @@ -148,7 +143,7 @@ public struct BasicTextCharacterSequence: Sequence, StringInitializable, Iterato
case "$": return BasicTextCharacter(kind: .dollar, range: range)
case "*": return BasicTextCharacter(kind: .star, range: range)
case "/": return BasicTextCharacter(kind: .slash, range: range)
case "#": return BasicTextCharacter(kind: .pound, range: range)
case "#": return BasicTextCharacter(kind: .numberSign, range: range)
case "|": return BasicTextCharacter(kind: .pipe, range: range)
case "\\": return BasicTextCharacter(kind: .backslash, range: range)
case "-": return BasicTextCharacter(kind: .dash, range: range)
Expand Down

0 comments on commit cc183d1

Please sign in to comment.