Commit a6be2b03 authored by Johannes Schriewer's avatar Johannes Schriewer

Make it compile in snapshot 04-12

parent d6ea8b9f
Pipeline #1514 failed with stage
......@@ -138,7 +138,7 @@ final public class Package {
for next in dependencies {
guard let depName = next.string else { fatalError("Non-string dependency \(next)")}
guard let nextTask = task.package.tasks[depName] else { fatalError("Can't find so-called task \(depName)")}
let nextGraph = prunedDependencyGraph(nextTask)
let nextGraph = prunedDependencyGraph(task: nextTask)
for nextItem in nextGraph {
let filteredTasks = pruned.filter() {$0.qualifiedName == nextItem.qualifiedName}
if filteredTasks.count >= 1 { continue }
......@@ -301,7 +301,7 @@ final public class Package {
guard let overlay = declaredOverlays[overlayName] else {
fatalError("Can't find overlay named \(overlayName) in \(declaredOverlays)")
}
again = again || task.applyOverlay(overlayName, overlay: overlay)
again = again || task.applyOverlay(name: overlayName, overlay: overlay)
}
for overlayName in requestedGlobalOverlays {
if task.appliedOverlays.contains(overlayName) { continue }
......@@ -314,7 +314,7 @@ final public class Package {
}
continue
}
again = again || task.applyOverlay(overlayName, overlay: overlay)
again = again || task.applyOverlay(name: overlayName, overlay: overlay)
usedGlobalOverlays.append(overlayName)
}
}
......
......@@ -23,7 +23,7 @@ private func evaluateSubstitution(substitution: String, package: Package) -> Str
}
str_sources.append(str_s)
}
let collectedSources = collectSources(str_sources, taskForCalculatingPath: task)
let collectedSources = collectSources(sourceDescriptions: str_sources, taskForCalculatingPath: task)
var output = ""
for (idx, source) in collectedSources.enumerated() {
output += source
......@@ -58,7 +58,7 @@ public func evaluateSubstitutions(input: String, package: Package)-> String {
output.characters.append(char)
}
case .Escaped:
case .Escaped:
output.characters.append(char)
parseState = .Initial
......@@ -78,7 +78,7 @@ public func evaluateSubstitutions(input: String, package: Package)-> String {
case .SubstitutionName:
switch(char) {
case "}":
output += evaluateSubstitution(currentSubstitionName, package: package)
output += evaluateSubstitution(substitution: currentSubstitionName, package: package)
currentSubstitionName = ""
parseState = .Initial
default:
......
......@@ -43,7 +43,7 @@ public struct Token: Equatable {
public let line: Int
public let column: Int
public let type: TokenType
public init(type: TokenType, value: String = "", line: Int = 0, column: Int = 0) {
self.type = type
self.value = value
......@@ -64,23 +64,23 @@ func isCharacterPartOfSet(c: Character?, set: NSCharacterSet) -> Bool {
}
func isValidIdentifierSignalCharacter(c: Character?) -> Bool {
return isCharacterPartOfSet(c, set: NSCharacterSet.letter())
return isCharacterPartOfSet(c: c, set: NSCharacterSet.letters())
}
func isValidIdenitifierCharacter(c: Character?) -> Bool {
return isCharacterPartOfSet(c, set: NSCharacterSet.letter()) || c == "-" || c == "." || c == "/"
return isCharacterPartOfSet(c: c, set: NSCharacterSet.letters()) || c == "-" || c == "." || c == "/"
}
func isWhitespace(c: Character?) -> Bool {
return isCharacterPartOfSet(c, set: NSCharacterSet.whitespace())
return isCharacterPartOfSet(c: c, set: NSCharacterSet.whitespaces())
}
final public class Lexer {
var scanner: Scanner
var current: Token? = nil
var shouldStall = false
public init(scanner: Scanner) {
self.scanner = scanner
}
......@@ -90,13 +90,13 @@ final public class Lexer {
shouldStall = false
return current
}
func work() -> Token {
if scanner.next() == nil { return Token(type: .EOF) }
scanner.stall()
while let info = scanner.next() where isWhitespace(info.character) {}
while let info = scanner.next() where isWhitespace(c: info.character) {}
scanner.stall()
guard let next = scanner.next() else { return Token(type: .EOF) }
......@@ -104,9 +104,9 @@ final public class Lexer {
if next.character == "\n" {
return Token(type: .Terminal, value: "\n", line: next.line, column: next.column)
}
else if isValidIdentifierSignalCharacter(next.character) {
else if isValidIdentifierSignalCharacter(c: next.character) {
var content = String(next.character!)
while let info = scanner.next() where isValidIdenitifierCharacter(info.character) {
while let info = scanner.next() where isValidIdenitifierCharacter(c: info.character) {
content.append(info.character!)
}
scanner.stall()
......@@ -141,7 +141,7 @@ final public class Lexer {
while let info = scanner.next() where info.character == ";" {}
scanner.stall()
while let info = scanner.next() where info.character != "\n" {
comment.append(info.character!)
}
......@@ -167,7 +167,7 @@ final public class Lexer {
else {
self.current = work()
}
return self.current
}
......@@ -182,7 +182,7 @@ final public class Lexer {
public func peek() -> Token? {
return current
}
public func stall() {
shouldStall = true
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment