Commit da869687 authored by Drew's avatar Drew

Upgrade to Swift Preview 6

parent b8f45852
Pipeline #2463 failed with stage
in 1 minute and 25 seconds
Subproject commit 09eb6280cf473cfb18ac70dee2b581f3b85f8b63
Subproject commit 04bc5916bf5c0c54ffa26d8b76c7f329b470b250
......@@ -22,12 +22,11 @@ enum PackageError: Error {
case RequiredOverlayNotPresent([String])
}
private extension Task {
fileprivate extension Task {
/**Apply the overlay to the receiver
- warning: an overlay may itself apply another overlay. In this case, the overlay for the task should be recalculated.
- return: whether the overlay applied another overlay */
@warn_unused_result
private func applyOverlay(name: String, overlay: [String: ParseValue]) -> Bool {
fileprivate func applyOverlay(name: String, overlay: [String: ParseValue]) -> Bool {
precondition(!appliedOverlays.contains(name), "Already applied overlay named \(name)")
for (optionName, optionValue) in overlay {
switch(optionValue) {
......
......@@ -111,7 +111,7 @@ final public class Parser {
private func parseKeyValuePairs() throws -> [String:ParseValue] {
var pairs: [String:ParseValue] = [:]
while let token = next() where token.type != .CloseParen && token.type != .CloseBrace {
while let token = next(), token.type != .CloseParen && token.type != .CloseBrace {
lexer.stall()
let key = try parseKey()
......@@ -152,24 +152,24 @@ final public class Parser {
}
private func parseVector() throws -> ParseValue {
if let token = next() where token.type != .OpenBracket { throw ParseError.ExpectedTokenType(.OpenBracket, token) }
if let token = next(),token.type != .OpenBracket { throw ParseError.ExpectedTokenType(.OpenBracket, token) }
var items: [ParseValue] = []
while let token = next() where token.type != .CloseBracket {
while let token = next(), token.type != .CloseBracket {
lexer.stall()
items.append(try parseValue())
}
lexer.stall()
if let token = next() where token.type != .CloseBracket { throw ParseError.ExpectedTokenType(.CloseBracket, token) }
if let token = next(), token.type != .CloseBracket { throw ParseError.ExpectedTokenType(.CloseBracket, token) }
return .Vector(items)
}
private func parseMap() throws -> ParseValue {
if let token = next() where token.type != .OpenBrace { throw ParseError.ExpectedTokenType(.OpenBrace, token) }
if let token = next(), token.type != .OpenBrace { throw ParseError.ExpectedTokenType(.OpenBrace, token) }
let items = try parseKeyValuePairs()
if let token = next() where token.type != .CloseBrace { throw ParseError.ExpectedTokenType(.CloseBrace, token) }
if let token = next(), token.type != .CloseBrace { throw ParseError.ExpectedTokenType(.CloseBrace, token) }
return .Map(items)
}
......
......@@ -94,7 +94,7 @@ final public class Lexer {
scanner.stall()
while let info = scanner.next() where isWhitespace(c: info.character) {}
while let info = scanner.next(), isWhitespace(c: info.character) {}
scanner.stall()
guard let next = scanner.next() else { return Token(type: .EOF) }
......@@ -104,7 +104,7 @@ final public class Lexer {
}
else if isValidIdentifierSignalCharacter(c: next.character) {
var content = String(next.character!)
while let info = scanner.next() where isValidIdenitifierCharacter(c: info.character) {
while let info = scanner.next(), isValidIdenitifierCharacter(c: info.character) {
content.append(info.character!)
}
scanner.stall()
......@@ -137,10 +137,10 @@ final public class Lexer {
let line = scanner.peek()!.line
var comment = ""
while let info = scanner.next() where info.character == ";" {}
while let info = scanner.next(), info.character == ";" {}
scanner.stall()
while let info = scanner.next() where info.character != "\n" {
while let info = scanner.next(), info.character != "\n" {
comment.append(info.character!)
}
......@@ -148,7 +148,7 @@ final public class Lexer {
}
else if next.character == "\"" {
var content = ""
while let info = scanner.next() where info.character != "\"" {
while let info = scanner.next(), info.character != "\"" {
if info.character == "\\" {
let escaped = scanner.next()
let char = escaped?.character
......
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