Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supported Scanner API for Swift #1914

Merged
merged 3 commits into from
Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ add_swift_library(Foundation
Foundation/ReferenceConvertible.swift
Foundation/RunLoop.swift
Foundation/Scanner.swift
Foundation/ScannerAPI.swift
Foundation/Set.swift
Foundation/Stream.swift
Foundation/String.swift
Expand Down
4 changes: 4 additions & 0 deletions Foundation.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
03B6F5841F15F339004F25AF /* TestURLProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03B6F5831F15F339004F25AF /* TestURLProtocol.swift */; };
1513A8432044893F00539722 /* FileManager_XDG.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1513A8422044893F00539722 /* FileManager_XDG.swift */; };
1520469B1D8AEABE00D02E36 /* HTTPServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1520469A1D8AEABE00D02E36 /* HTTPServer.swift */; };
153CC8352215E00200BFE8F3 /* ScannerAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 153CC8322214C3D100BFE8F3 /* ScannerAPI.swift */; };
153E951120111DC500F250BE /* CFKnownLocations.h in Headers */ = {isa = PBXBuildFile; fileRef = 153E950F20111DC500F250BE /* CFKnownLocations.h */; settings = {ATTRIBUTES = (Private, ); }; };
153E951220111DC500F250BE /* CFKnownLocations.c in Sources */ = {isa = PBXBuildFile; fileRef = 153E951020111DC500F250BE /* CFKnownLocations.c */; };
15496CF1212CAEBA00450F5A /* CFAttributedStringPriv.h in Headers */ = {isa = PBXBuildFile; fileRef = 15496CF0212CAEBA00450F5A /* CFAttributedStringPriv.h */; };
Expand Down Expand Up @@ -546,6 +547,7 @@
03B6F5831F15F339004F25AF /* TestURLProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestURLProtocol.swift; sourceTree = "<group>"; };
1513A8422044893F00539722 /* FileManager_XDG.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileManager_XDG.swift; sourceTree = "<group>"; };
1520469A1D8AEABE00D02E36 /* HTTPServer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTTPServer.swift; sourceTree = "<group>"; };
153CC8322214C3D100BFE8F3 /* ScannerAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScannerAPI.swift; sourceTree = "<group>"; };
153E950F20111DC500F250BE /* CFKnownLocations.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CFKnownLocations.h; sourceTree = "<group>"; };
153E951020111DC500F250BE /* CFKnownLocations.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = CFKnownLocations.c; sourceTree = "<group>"; };
15496CF0212CAEBA00450F5A /* CFAttributedStringPriv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFAttributedStringPriv.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1851,6 +1853,7 @@
children = (
EADE0B751BD15DFF00C49C64 /* NSRegularExpression.swift */,
EADE0B771BD15DFF00C49C64 /* Scanner.swift */,
153CC8322214C3D100BFE8F3 /* ScannerAPI.swift */,
EADE0B7B1BD15DFF00C49C64 /* NSTextCheckingResult.swift */,
EADE0B4F1BD09E3100C49C64 /* NSAttributedString.swift */,
5BDC3F311BCC5DCB00ED97BB /* NSCharacterSet.swift */,
Expand Down Expand Up @@ -2366,6 +2369,7 @@
5B23AB871CE62D17000DB898 /* Boxing.swift in Sources */,
5BF7AEA41BCD51F9008F214A /* Bundle.swift in Sources */,
5B23AB891CE62D4D000DB898 /* ReferenceConvertible.swift in Sources */,
153CC8352215E00200BFE8F3 /* ScannerAPI.swift in Sources */,
D3E8D6D11C367AB600295652 /* NSSpecialValue.swift in Sources */,
EAB57B721BD1C7A5004AC5C5 /* PortMessage.swift in Sources */,
5BD31D201D5CE8C400563814 /* Bridging.swift in Sources */,
Expand Down
3 changes: 2 additions & 1 deletion Foundation/Decimal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2068,6 +2068,7 @@ extension Scanner {
}

}

public func scanDecimal() -> Decimal? {

var result = Decimal()
Expand All @@ -2076,7 +2077,7 @@ extension Scanner {
let length = string.length
var buf = _NSStringBuffer(string: string, start: self._scanLocation, end: length)

let ds_chars = decimalSep(locale).utf16
let ds_chars = decimalSep(locale as? Locale).utf16
let ds = ds_chars[ds_chars.startIndex]
buf.skip(_skipSet)
var neg = false
Expand Down
Loading