Commit 9439d100 authored by David Owens II's avatar David Owens II

Updated labels to use casing described in issue #39.

parent 80ca30ad
Pipeline #994 failed with stage
......@@ -17,42 +17,42 @@
:name "atpkg"
:tasks {
:atpkg {
:tool "atllbuild"
:source ["src/**.swift"]
:name "atpkg"
:outputType "static-library"
:overlays {
:bootstrap-osx {
:bootstrapOnly true
:llbuildyaml "bootstrap/bootstrap-macosx-atpkg.swift-build"
}
:bootstrap-linux {
:bootstrapOnly true
:swiftCPath "/usr/local/bin/swiftc"
:linkSDK false
:llbuildyaml "bootstrap/bootstrap-linux-atpkg.swift-build"
}
}
}
:atpkg {
:tool "atllbuild"
:sources ["src/**.swift"]
:name "atpkg"
:output-type "static-library"
:overlays {
:bootstrap-osx {
:bootstrap-only true
:llbuildyaml "bootstrap/bootstrap-macosx-atpkg.swift-build"
}
:bootstrap-linux {
:bootstrap-only true
:swiftc-path "/usr/local/bin/swiftc"
:link-sdk false
:llbuildyaml "bootstrap/bootstrap-linux-atpkg.swift-build"
}
}
}
:atpkg-tests {
:tool "atllbuild"
:dependencies ["atpkg"]
:source ["tests/**.swift"]
:name "atpkgtests"
:outputType "executable"
:linkWithProduct ["atpkg.a"]
}
:atpkg-tests {
:tool "atllbuild"
:dependencies ["atpkg"]
:sources ["tests/**.swift"]
:name "atpkgtests"
:output-type "executable"
:link-with ["atpkg.a"]
}
:run-atpkg-tests {
:tool "shell"
:dependencies ["atpkg-tests"]
:script "./.atllbuild/products/atpkgtests"
}
:run-atpkg-tests {
:tool "shell"
:dependencies ["atpkg-tests"]
:script "./.atllbuild/products/atpkgtests"
}
:run-tests {
:dependencies ["run-atpkg-tests"]
:tool "nop" }
}
:run-tests {
:dependencies ["run-atpkg-tests"]
:tool "nop" }
}
)
......@@ -53,7 +53,7 @@ final public class Task {
}
self.tool = tool
if let ol = kvp["overlay"] {
if let ol = kvp["use-overlays"] {
guard let overlays = ol.vector else {
fatalError("Non-vector overlay \(ol); did you mean to use `overlays` instead?")
}
......@@ -109,7 +109,7 @@ final public class Task {
newValue.appendContentsOf(vectorValue)
self.kvp[optionName] = ParseValue.Vector(newValue)
//apply overlays to the model property
if optionName == "overlay" {
if optionName == "use-overlays" {
for overlayName in vectorValue {
guard let overlayNameStr = overlayName.string else {
fatalError("Non-string overlayname \(overlayName)")
......@@ -139,11 +139,21 @@ final public class Task {
}
appliedOverlays.append(name)
return overlay.keys.contains("overlay")
return overlay.keys.contains("use-overlays")
}
}
final public class Package {
public enum Keys: String {
case Name = "name"
case Version = "version"
case PackageTypeName = "package"
case ImportPackages = "import-packages"
case Tasks = "tasks"
case Overlays = "overlays"
case UseOverlays = "use-overlays"
}
// The required properties.
public var name: String
......@@ -214,15 +224,15 @@ final public class Package {
public init?(type: ParseType, overlay requestedGlobalOverlays: [String], pathOnDisk: String) {
self.importedPath = pathOnDisk
if type.name != "package" { return nil }
if let value = type.properties["name"]?.string { self.name = value }
if type.name != Keys.PackageTypeName.rawValue { return nil }
if let value = type.properties[Keys.Name.rawValue]?.string { self.name = value }
else {
print("ERROR: No name specified for the package.")
return nil
}
if let value = type.properties["version"]?.string { self.version = value }
if let value = type.properties[Keys.Version.rawValue]?.string { self.version = value }
if let parsedTasks = type.properties["tasks"]?.map {
if let parsedTasks = type.properties[Keys.Tasks.rawValue]?.map {
for (name, value) in parsedTasks {
if let task = Task(value: value, unqualifiedName: name, package: self, importedPath: pathOnDisk) {
self.tasks[task.unqualifiedName] = task
......@@ -234,7 +244,7 @@ final public class Package {
var remotePackages: [Package] = []
//load remote packages
if let imports = type.properties["import"]?.vector {
if let imports = type.properties[Keys.ImportPackages.rawValue]?.vector {
for importFile in imports {
guard let importFileString = importFile.string else { fatalError("Non-string import \(importFile)")}
let adjustedImportPath = (pathOnDisk.pathWithTrailingSlash + importFileString).toNSString.stringByDeletingLastPathComponent.pathWithTrailingSlash
......@@ -257,7 +267,7 @@ final public class Package {
}
}
if let ol = type.properties["overlays"] {
if let ol = type.properties[Keys.Overlays.rawValue] {
guard let overlays = ol.map else {
fatalError("Non-map overlay \(ol)")
}
......
......@@ -4,10 +4,14 @@
:name "basic"
:version "0.1.0-dev"
:tasks {:build {:tool "lldb-build"
:name "json-swift"
:output-type "lib"
:source [ "src/**.swift" "lib/**.swift" ]}}
:tasks {
:build {
:tool "lldb-build"
:name "json-swift"
:output-type "lib"
:sources ["src/**.swift" "lib/**.swift"]
}
}
)
; End of the sample.
\ No newline at end of file
(package
:name "a"
:import ["b.atpkg"]
:import-packages ["b.atpkg"]
:tasks {
:default {
:dependencies ["b.default"]
:name "a_default"
:overlay ["c.foo"]
:use-overlays ["c.foo"]
:tool "whatever"
}
}
......
(package
:name "b"
:import ["c.atpkg"]
:import-packages ["c.atpkg"]
:tasks {
:default {
......
......@@ -3,7 +3,7 @@
:overlays {
:foo {
:compileOptions ["foo"]
:compile-options ["foo"]
}
}
......
(package
:name "a"
:import ["b.atpkg"]
:import-packages ["b.atpkg"]
:tasks {
:default {
......
(package
:name "b"
:import ["c.atpkg"]
:import-packages ["c.atpkg"]
:tasks {
:foo {
......
......@@ -2,12 +2,15 @@
:name "import_dst"
:version "0.1.0-dev"
:tasks {:build {:tool "lldb-build"
:name "json-swift"
:output-type "lib"
:source [ "src/**.swift" "lib/**.swift" ]
:dependencies ["import_dst.build"]
}}
:tasks {
:build {
:tool "lldb-build"
:name "json-swift"
:output-type "lib"
:sources ["src/**.swift" "lib/**.swift"]
:dependencies ["import_dst.build"]
}
}
)
; End of the sample.
\ No newline at end of file
(package
:name "a"
:import ["b/b.atpkg"]
:import-packages ["b/b.atpkg"]
:tasks {
:default {
......
(package
:name "b"
:import ["c/c.atpkg"]
:import-packages ["c/c.atpkg"]
:tasks {
:foo {
......
......@@ -2,14 +2,17 @@
(package
:name "import_src"
:version "0.1.0-dev"
:import ["import_dst.atpkg"]
:import-packages ["import_dst.atpkg"]
:tasks {:build {:tool "lldb-build"
:name "json-swift"
:output-type "lib"
:source [ "src/**.swift" "lib/**.swift" ]
:dependencies ["import_dst.build"]
}}
:tasks {
:build {
:tool "lldb-build"
:name "json-swift"
:output-type "lib"
:sources ["src/**.swift" "lib/**.swift"]
:dependencies ["import_dst.build"]
}
}
)
; End of the sample.
\ No newline at end of file
;; A mixin sample file
(package
:name "overlay"
:version "0.1.0-dev"
:name "overlay"
:version "0.1.0-dev"
:overlays {
:overlays {
:awesome {
:compileOptions ["-D" "AWESOME"]
:compile-options ["-D" "AWESOME"]
}
:more-awesome {
:compileOptions ["-D" "MORE_AWESOME"]
:compile-options ["-D" "MORE_AWESOME"]
}
:most-awesome {
:compileOptions ["-D" "MOST_AWESOME"]
:compile-options ["-D" "MOST_AWESOME"]
}
:stringOption {
:stringOption "stringOption"
:string-option {
:string-option "stringOption"
}
:emptyVecOption {
:emptyVecOption ["OVERLAY"]
:empty-vec-option {
:empty-vec-option ["OVERLAY"]
}
:boolOption {
:boolOption true
:bool-option {
:bool-option true
}
}
}
:tasks {
:tasks {
:build {
:tool "lldb-build"
:name "json-swift"
:output-type "lib"
:source [ "src/**.swift" "lib/**.swift" ]
:compileOptions []
:overlay ["awesome"]
:sources [ "src/**.swift" "lib/**.swift" ]
:compile-options []
:use-overlays ["awesome"]
:overlays {
:most-taskspecific {
:overlay ["most-awesome"]
:use-overlays ["most-awesome"]
}
:most-taskspecific-two {
:compileOptions ["-D" "MOST_AWESOME"]
:compile-options ["-D" "MOST_AWESOME"]
}
}
}
......
(package
:name "overlays_dst"
:version "0.1.0-dev"
:name "overlays_dst"
:version "0.1.0-dev"
:overlays {
:overlays {
:exported-overlay {
:compileOptions ["-D" "MOST_AWESOME"]
:compile-options ["-D" "MOST_AWESOME"]
}
}
}
)
\ No newline at end of file
;; An overlay sample file
(package
:name "overlays_src"
:version "0.1.0-dev"
:import ["overlays_dst.atpkg"]
:name "overlays_src"
:version "0.1.0-dev"
:import-packages ["overlays_dst.atpkg"]
:overlays {
:overlays {
:sample-overlay {
:compileOptions ["-D" "MORE_AWESOME"]
:compile-options ["-D" "MORE_AWESOME"]
}
}
}
:tasks {
:tasks {
:build {
:tool "lldb-build"
:name "json-swift"
:output-type "lib"
:source [ "src/**.swift" "lib/**.swift" ]
:compileOptions ["-D" "AWESOME"]
:overlay ["sample-overlay" "overlays_dst.exported-overlay"]
:tool "lldb-build"
:name "json-swift"
:output-type "lib"
:sources [ "src/**.swift" "lib/**.swift" ]
:compile-options ["-D" "AWESOME"]
:use-overlays ["sample-overlay" "overlays_dst.exported-overlay"]
}
}
}
)
; End of the sample.
\ No newline at end of file
......@@ -48,9 +48,9 @@ class PackageTests: Test {
try test.assert(task.tool == "lldb-build")
try test.assert(task["name"]?.string == "json-swift")
try test.assert(task["output-type"]?.string == "lib")
try test.assert(task["source"]?.vector?.count == 2)
try test.assert(task["source"]?.vector?[0].string == "src/**.swift")
try test.assert(task["source"]?.vector?[1].string == "lib/**.swift")
try test.assert(task["sources"]?.vector?.count == 2)
try test.assert(task["sources"]?.vector?[0].string == "src/**.swift")
try test.assert(task["sources"]?.vector?[1].string == "lib/**.swift")
}
}
......@@ -65,7 +65,7 @@ class PackageTests: Test {
static func testOverlays() throws {
let filepath = "./tests/collateral/overlays.atpkg"
guard let package = Package(filepath: filepath, overlay: []) else { print("error"); try test.assert(false); return }
guard let compileOptions = package.tasks["build"]?["compileOptions"]?.vector else {
guard let compileOptions = package.tasks["build"]?["compile-options"]?.vector else {
fatalError("No compile options?")
}
try test.assert(compileOptions.count == 2)
......@@ -73,7 +73,7 @@ class PackageTests: Test {
try test.assert(compileOptions[1].string == "AWESOME")
guard let package2 = Package(filepath: filepath, overlay: ["more-awesome"]) else { print("error"); try test.assert(false); return }
guard let compileOptions2 = package2.tasks["build"]?["compileOptions"]?.vector else {
guard let compileOptions2 = package2.tasks["build"]?["compile-options"]?.vector else {
fatalError("no compile options?")
}
try test.assert(compileOptions2.count == 4)
......@@ -83,7 +83,7 @@ class PackageTests: Test {
try test.assert(compileOptions2[3].string == "MORE_AWESOME")
guard let package3 = Package(filepath: filepath, overlay: ["most-taskspecific"]) else { print("error"); try test.assert(false); return }
guard let compileOptions3 = package3.tasks["build"]?["compileOptions"]?.vector else {
guard let compileOptions3 = package3.tasks["build"]?["compile-options"]?.vector else {
fatalError("no compile options?")
}
try test.assert(compileOptions3.count == 4)
......@@ -93,7 +93,7 @@ class PackageTests: Test {
try test.assert(compileOptions3[3].string == "MOST_AWESOME")
guard let package4 = Package(filepath: filepath, overlay: ["most-taskspecific-two"]) else { print("error"); try test.assert(false); return }
guard let compileOptions4 = package4.tasks["build"]?["compileOptions"]?.vector else {
guard let compileOptions4 = package4.tasks["build"]?["compile-options"]?.vector else {
fatalError("no compile options?")
}
try test.assert(compileOptions4.count == 4)
......@@ -102,22 +102,22 @@ class PackageTests: Test {
try test.assert(compileOptions4[2].string == "-D")
try test.assert(compileOptions4[3].string == "MOST_AWESOME")
guard let package5 = Package(filepath: filepath, overlay: ["stringOption"]) else { print("error"); try test.assert(false); return }
guard let stringOption = package5.tasks["build"]?["stringOption"]?.string else {
guard let package5 = Package(filepath: filepath, overlay: ["string-option"]) else { print("error"); try test.assert(false); return }
guard let stringOption = package5.tasks["build"]?["string-option"]?.string else {
fatalError("no string option?")
}
try test.assert(stringOption == "stringOption")
guard let package6 = Package(filepath: filepath, overlay: ["emptyVecOption"]) else { print("error"); try test.assert(false); return }
guard let vecOption = package6.tasks["build"]?["emptyVecOption"]?.vector else {
guard let package6 = Package(filepath: filepath, overlay: ["empty-vec-option"]) else { print("error"); try test.assert(false); return }
guard let vecOption = package6.tasks["build"]?["empty-vec-option"]?.vector else {
fatalError("no vec option?")
}
try test.assert(vecOption.count == 1)
try test.assert(vecOption[0].string == "OVERLAY")
guard let package7 = Package(filepath: filepath, overlay: ["boolOption"]) else { print("error"); try test.assert(false); return }
guard let boolOption = package7.tasks["build"]?["boolOption"]?.bool else {
guard let package7 = Package(filepath: filepath, overlay: ["bool-option"]) else { print("error"); try test.assert(false); return }
guard let boolOption = package7.tasks["build"]?["bool-option"]?.bool else {
fatalError("no bool option?")
}
try test.assert(boolOption == true)
......@@ -127,7 +127,7 @@ class PackageTests: Test {
let filepath = "./tests/collateral/overlays_src.atpkg"
guard let package2 = Package(filepath: filepath, overlay: []) else { print("error"); try test.assert(false); return }
guard let compileOptions2 = package2.tasks["build"]?["compileOptions"]?.vector else {
guard let compileOptions2 = package2.tasks["build"]?["compile-options"]?.vector else {
fatalError("no compile options?")
}
try test.assert(compileOptions2.count == 6)
......@@ -205,7 +205,7 @@ class PackageTests: Test {
let filepath = "./tests/collateral/chained_import_overlays/a.atpkg"
guard let package = Package(filepath: filepath, overlay: ["b.foo"]) else { print("error"); try test.assert(false); return }
guard let a_qualified = package.tasks["a.default"] else { print("error"); try test.assert(false); return }
guard let options = a_qualified["compileOptions"]?.vector else {
guard let options = a_qualified["compile-options"]?.vector else {
fatalError("Invalid options vector")
}
try test.assert(options.count == 1)
......
......@@ -65,34 +65,38 @@ class LexerTests: Test {
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Colon, value: ":", line: 7, column: 3))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Identifier, value: "tasks", line: 7, column: 4))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.OpenBrace, value: "{", line: 7, column: 10))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Colon, value: ":", line: 7, column: 11))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Identifier, value: "build", line: 7, column: 12))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.OpenBrace, value: "{", line: 7, column: 18))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Colon, value: ":", line: 7, column: 19))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Identifier, value: "tool", line: 7, column: 20))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.StringLiteral, value: "lldb-build", line: 7, column: 25))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 7, column: 37))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Colon, value: ":", line: 8, column: 19))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Identifier, value: "name", line: 8, column: 20))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.StringLiteral, value: "json-swift", line: 8, column: 25))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 8, column: 37))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Colon, value: ":", line: 9, column: 19))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Identifier, value: "output-type", line: 9, column: 20))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.StringLiteral, value: "lib", line: 9, column: 32))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 9, column: 38))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Colon, value: ":", line: 10, column: 19))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Identifier, value: "source", line: 10, column: 20))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.OpenBracket, value: "[", line: 10, column: 27))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.StringLiteral, value: "src/**.swift", line: 10, column: 29))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.StringLiteral, value: "lib/**.swift", line: 10, column: 44))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.CloseBracket, value: "]", line: 10, column: 59))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.CloseBrace, value: "}", line: 10, column: 60))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.CloseBrace, value: "}", line: 10, column: 61))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 10, column: 62))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.CloseParen, value: ")", line: 11, column: 1))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 11, column: 2))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 12, column: 1))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Comment, value: " End of the sample.", line: 13, column: 1))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 7, column: 11))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Colon, value: ":", line: 8, column: 5))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Identifier, value: "build", line: 8, column: 6))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.OpenBrace, value: "{", line: 8, column: 12))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 8, column: 13))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Colon, value: ":", line: 9, column: 7))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Identifier, value: "tool", line: 9, column: 8))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.StringLiteral, value: "lldb-build", line: 9, column: 13))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 9, column: 25))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Colon, value: ":", line: 10, column: 7))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Identifier, value: "name", line: 10, column: 8))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.StringLiteral, value: "json-swift", line: 10, column: 13))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 10, column: 25))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Colon, value: ":", line: 11, column: 7))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Identifier, value: "output-type", line: 11, column: 8))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.StringLiteral, value: "lib", line: 11, column: 20))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 11, column: 26))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Colon, value: ":", line: 12, column: 7))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Identifier, value: "sources", line: 12, column: 8))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.OpenBracket, value: "[", line: 12, column: 16))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.StringLiteral, value: "src/**.swift", line: 12, column: 17))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.StringLiteral, value: "lib/**.swift", line: 12, column: 32))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.CloseBracket, value: "]", line: 12, column: 46))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 12, column: 47))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.CloseBrace, value: "}", line: 13, column: 5))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 13, column: 6))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.CloseBrace, value: "}", line: 14, column: 3))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 14, column: 4))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.CloseParen, value: ")", line: 15, column: 1))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 15, column: 2))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Terminal, value: "\n", line: 16, column: 1))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.Comment, value: " End of the sample.", line: 17, column: 1))
try test.assert(lexer.next() == Token(type: atpkg.TokenType.EOF, value: "", line: 0, column: 0))
}
}
\ No newline at end of file
......@@ -58,7 +58,7 @@ class ParserTests: Test {
try test.assert(outputType != nil)
try test.assert(outputType?.string == "lib")
let source = build?.map?["source"]
let source = build?.map?["sources"]
try test.assert(source != nil)
try test.assert(source?.vector != nil)
try test.assert(source?.vector?[0].string == "src/**.swift")
......
......@@ -154,6 +154,11 @@ class ScannerTests: Test {
try test.assert(scanner.next()?.character == "s")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == "{")
try test.assert(scanner.next()?.character == "\n")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == ":")
try test.assert(scanner.next()?.character == "b")
try test.assert(scanner.next()?.character == "u")
......@@ -162,6 +167,13 @@ class ScannerTests: Test {
try test.assert(scanner.next()?.character == "d")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == "{")
try test.assert(scanner.next()?.character == "\n")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == ":")
try test.assert(scanner.next()?.character == "t")
try test.assert(scanner.next()?.character == "o")
......@@ -187,18 +199,6 @@ class ScannerTests: Test {
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == ":")
try test.assert(scanner.next()?.character == "n")
try test.assert(scanner.next()?.character == "a")
......@@ -224,18 +224,6 @@ class ScannerTests: Test {
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == ":")
try test.assert(scanner.next()?.character == "o")
try test.assert(scanner.next()?.character == "u")
......@@ -262,18 +250,6 @@ class ScannerTests: Test {
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == ":")
try test.assert(scanner.next()?.character == "s")
try test.assert(scanner.next()?.character == "o")
......@@ -281,9 +257,9 @@ class ScannerTests: Test {
try test.assert(scanner.next()?.character == "r")
try test.assert(scanner.next()?.character == "c")
try test.assert(scanner.next()?.character == "e")
try test.assert(scanner.next()?.character == "s")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == "[")
try test.assert(scanner.next()?.character == " ")
try test.assert(scanner.next()?.character == "\"")
try test.assert(scanner.next()?.character == "s")
try test.assert(scanner.next()?.character == "r")
......@@ -313,9 +289,16 @@ class ScannerTests: Test {
try test.assert(scanner.next()?.character == "f")
try test.assert(scanner.next()?.character == "t")
try test.assert(scanner.next()?.character == "\"")
try test.assert(scanner.next()?.character == " ")