Moved BindingGenerator from gen html project. It makes more sense here.

This commit is contained in:
2025-10-25 00:06:22 -04:00
parent 58a8419984
commit 603a0aa0e3
141 changed files with 12738 additions and 7 deletions

View File

@@ -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)
}