Skip to content

Commit 4faab1b

Browse files
committed
Swift Encoder
1 parent 74ab976 commit 4faab1b

4 files changed

Lines changed: 1737 additions & 6 deletions

File tree

Sources/BMF2Code/BMF2Code.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import LStXML2Code
88
@main
99
public struct BMF2Code {
1010

11-
private static let VERSION = "0.1.0"
11+
public static let VERSION = "0.2.0"
1212

1313

1414
// MARK: main entry point
@@ -22,7 +22,7 @@ public struct BMF2Code {
2222
let project = "workspace/LStXML2Code/"
2323
let xmls = "Tests/LStXML2CodeTests/xml/"
2424
let test = "Lohnsteuer2023AbJuli.xml"
25-
let lang = "Java"
25+
let lang = "Swift"
2626
cmdLineArgs = [CommandLine.arguments[0],"--lang=\(lang)","\(documents)\(project)\(xmls)\(test)"]
2727
}
2828
#endif
@@ -79,7 +79,7 @@ public struct BMF2Code {
7979
// MARK: handling argument
8080
// handwritten parameter evaluation
8181
func evalArgs (arguments : [String], reversedCall : Bool = false) -> [String:String] {
82-
let supportedLang = ["java"]//, "swift"]
82+
let supportedLang = ["java", "swift"]
8383
let supportedLanguages = "\(supportedLang)".replacingOccurrences(of: "[", with: "").replacingOccurrences(of: "]", with: "").replacingOccurrences(of: "\"", with: "")
8484

8585
var result : [String:String] = [:]

Sources/BMF2Code/JavaEncoding.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ open class JavaEncoding : AbstractTreeEncoding {
2525
var result = ""
2626

2727
var intend = 0
28-
public func traverse (node : Node) {
28+
open func traverse (node : Node) {
2929
var output = ""
3030
for _ in 0..<intend {
3131
output.append(" ")
@@ -101,7 +101,7 @@ open class JavaEncoding : AbstractTreeEncoding {
101101
result.append("\(output)\n")
102102
break
103103
case "CONSTANTS" :
104-
// nothing to tdo in Java
104+
// nothing to do in Java
105105
break;
106106
case "CONSTANT" :
107107
// at the moment CONSTANTS use value attribute instead to VARIABLES with default

0 commit comments

Comments
 (0)