Skip to content

Commit

Permalink
Swift Encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
bastie committed Dec 7, 2023
1 parent 74ab976 commit 4faab1b
Show file tree
Hide file tree
Showing 4 changed files with 1,737 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Sources/BMF2Code/BMF2Code.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import LStXML2Code
@main
public struct BMF2Code {

private static let VERSION = "0.1.0"
public static let VERSION = "0.2.0"


// MARK: main entry point
Expand All @@ -22,7 +22,7 @@ public struct BMF2Code {
let project = "workspace/LStXML2Code/"
let xmls = "Tests/LStXML2CodeTests/xml/"
let test = "Lohnsteuer2023AbJuli.xml"
let lang = "Java"
let lang = "Swift"
cmdLineArgs = [CommandLine.arguments[0],"--lang=\(lang)","\(documents)\(project)\(xmls)\(test)"]
}
#endif
Expand Down Expand Up @@ -79,7 +79,7 @@ public struct BMF2Code {
// MARK: handling argument
// handwritten parameter evaluation
func evalArgs (arguments : [String], reversedCall : Bool = false) -> [String:String] {
let supportedLang = ["java"]//, "swift"]
let supportedLang = ["java", "swift"]
let supportedLanguages = "\(supportedLang)".replacingOccurrences(of: "[", with: "").replacingOccurrences(of: "]", with: "").replacingOccurrences(of: "\"", with: "")

var result : [String:String] = [:]
Expand Down
4 changes: 2 additions & 2 deletions Sources/BMF2Code/JavaEncoding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ open class JavaEncoding : AbstractTreeEncoding {
var result = ""

var intend = 0
public func traverse (node : Node) {
open func traverse (node : Node) {
var output = ""
for _ in 0..<intend {
output.append(" ")
Expand Down Expand Up @@ -101,7 +101,7 @@ open class JavaEncoding : AbstractTreeEncoding {
result.append("\(output)\n")
break
case "CONSTANTS" :
// nothing to tdo in Java
// nothing to do in Java
break;
case "CONSTANT" :
// at the moment CONSTANTS use value attribute instead to VARIABLES with default
Expand Down
Loading

0 comments on commit 4faab1b

Please sign in to comment.