From 5df3b2bbdfc02ca460340ab18d1935a4bd3c3c39 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Thu, 12 Oct 2017 00:52:44 -0700 Subject: [PATCH] Remove ANTLRError.nullPointer from the Swift runtime. This was copied from the API of the equivalent code in Java when the runtime was ported to Swift. It is meaningless in Swift, and was unused. --- runtime/Swift/Sources/Antlr4/CharStream.swift | 1 - runtime/Swift/Sources/Antlr4/Parser.swift | 2 -- runtime/Swift/Sources/Antlr4/Recognizer.swift | 3 --- runtime/Swift/Sources/Antlr4/TokenStream.swift | 1 - runtime/Swift/Sources/Antlr4/misc/BitSet.swift | 4 ---- runtime/Swift/Sources/Antlr4/misc/exception/ANTLRError.swift | 1 - 6 files changed, 12 deletions(-) diff --git a/runtime/Swift/Sources/Antlr4/CharStream.swift b/runtime/Swift/Sources/Antlr4/CharStream.swift index 81fbf84d6..38e87e109 100644 --- a/runtime/Swift/Sources/Antlr4/CharStream.swift +++ b/runtime/Swift/Sources/Antlr4/CharStream.swift @@ -19,7 +19,6 @@ public protocol CharStream: IntStream { /// - parameter interval: an interval within the stream /// - returns: the text of the specified interval /// - /// - throws: _ANTLRError.nullPointer_ if `interval` is `null` /// - throws: _ANTLRError.illegalArgument_ if `interval.a < 0`, or if /// `interval.b < interval.a - 1`, or if `interval.b` lies at or /// past the end of the stream diff --git a/runtime/Swift/Sources/Antlr4/Parser.swift b/runtime/Swift/Sources/Antlr4/Parser.swift index 6f7f30742..5a4c9257e 100644 --- a/runtime/Swift/Sources/Antlr4/Parser.swift +++ b/runtime/Swift/Sources/Antlr4/Parser.swift @@ -336,8 +336,6 @@ open class Parser: Recognizer { /// /// - Parameter listener: the listener to add /// - /// - Throws: _ANTLRError.nullPointer_ if listener is `null` - /// public func addParseListener(_ listener: ParseTreeListener) { if _parseListeners == nil { _parseListeners = Array() diff --git a/runtime/Swift/Sources/Antlr4/Recognizer.swift b/runtime/Swift/Sources/Antlr4/Recognizer.swift index 9a3acad79..6133bbeea 100644 --- a/runtime/Swift/Sources/Antlr4/Recognizer.swift +++ b/runtime/Swift/Sources/Antlr4/Recognizer.swift @@ -228,9 +228,6 @@ open class Recognizer { return "\(s)" } - /// - /// - Throws: ANTLRError.nullPointer if `listener` is `null`. - /// open func addErrorListener(_ listener: ANTLRErrorListener) { _listeners.append(listener) diff --git a/runtime/Swift/Sources/Antlr4/TokenStream.swift b/runtime/Swift/Sources/Antlr4/TokenStream.swift index ef5834862..536f33b90 100644 --- a/runtime/Swift/Sources/Antlr4/TokenStream.swift +++ b/runtime/Swift/Sources/Antlr4/TokenStream.swift @@ -63,7 +63,6 @@ public protocol TokenStream: IntStream { /// /// - Parameter interval: The interval of tokens within this stream to get text /// for. - /// - Throws: ANTLRError.nullPointer if `interval` is `null` /// - Returns: The text of all tokens within the specified interval in this /// stream. /// diff --git a/runtime/Swift/Sources/Antlr4/misc/BitSet.swift b/runtime/Swift/Sources/Antlr4/misc/BitSet.swift index d2c9b510f..d0056ad0c 100644 --- a/runtime/Swift/Sources/Antlr4/misc/BitSet.swift +++ b/runtime/Swift/Sources/Antlr4/misc/BitSet.swift @@ -32,10 +32,6 @@ import Foundation /// implementation. The length of a bit set relates to logical length /// of a bit set and is defined independently of implementation. /// -/// Unless otherwise noted, passing a null parameter to any of the -/// methods in a `BitSet` will result in a -/// `ANTLRError.nullPointer`. -/// /// A `BitSet` is not safe for multithreaded use without /// external synchronization. /// diff --git a/runtime/Swift/Sources/Antlr4/misc/exception/ANTLRError.swift b/runtime/Swift/Sources/Antlr4/misc/exception/ANTLRError.swift index 2bc300c56..c9df3022e 100644 --- a/runtime/Swift/Sources/Antlr4/misc/exception/ANTLRError.swift +++ b/runtime/Swift/Sources/Antlr4/misc/exception/ANTLRError.swift @@ -14,7 +14,6 @@ import Foundation public enum ANTLRError: Error { - case nullPointer(msg:String) case unsupportedOperation(msg:String) case indexOutOfBounds(msg:String) case illegalState(msg:String)