From cc183d142a0eee9cfa2f9c26a038fa11a524e5b7 Mon Sep 17 00:00:00 2001 From: Matt <85322+mattmassicotte@users.noreply.github.com> Date: Tue, 30 Apr 2024 06:14:14 -0400 Subject: [PATCH] Introduce numberSign, deprecate pound #1 --- Sources/Flexer/BasicTextCharacterLexer.swift | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Sources/Flexer/BasicTextCharacterLexer.swift b/Sources/Flexer/BasicTextCharacterLexer.swift index 28421cb..110503a 100644 --- a/Sources/Flexer/BasicTextCharacterLexer.swift +++ b/Sources/Flexer/BasicTextCharacterLexer.swift @@ -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 { @@ -20,7 +12,7 @@ public extension StringInitializable { } } -public enum BasicTextCharacterKind: Hashable { +public enum BasicTextCharacterKind: Hashable, Sendable { case tab case space case newline @@ -53,7 +45,7 @@ public enum BasicTextCharacterKind: Hashable { case dollar case star case slash - case pound + case numberSign case pipe case backslash case dash @@ -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 @@ -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)