Moved BindingGenerator from gen html project. It makes more sense here.
This commit is contained in:
@@ -27,14 +27,16 @@ final class EmptyStringError: Error, Sendable {
|
||||
init() { }
|
||||
}
|
||||
|
||||
final class XmlError: Error, Sendable {
|
||||
final class XmlError: Error, Sendable, CustomStringConvertible {
|
||||
var description: String { get {errorDescription ?? "XMLError"} }
|
||||
|
||||
|
||||
let message: String
|
||||
let line:Int
|
||||
let column:Int
|
||||
|
||||
init(_ message: String, _ line:Int, _ column:Int) {
|
||||
self.message = "\(line):\(column) \(message)"
|
||||
self.message = "\(line):\(column): \(message)"
|
||||
self.line = line
|
||||
self.column = column
|
||||
}
|
||||
@@ -386,6 +388,9 @@ public class XMLParser
|
||||
}*/
|
||||
|
||||
public init?(str:String) {
|
||||
if (str.isEmpty) {
|
||||
return nil
|
||||
}
|
||||
iterator = str.unicodeScalars.makeIterator()
|
||||
position = Position()
|
||||
}
|
||||
@@ -438,6 +443,8 @@ public class XMLParser
|
||||
switch state {
|
||||
case .end_markup:
|
||||
return nil
|
||||
case .data:
|
||||
return nil
|
||||
default:
|
||||
throw XmlError("unexpected end of stream inside markup structure", position.line, position.column)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user