 
     for _ in 1...numberOfChars
     {
-      self.index = self.source.characters.index(after: self.index)
+      self.index = self.source.unicodeScalars.index(after: self.index)
       self.column += 1
     }
 
     let token = Token(
       type: type,
-      content: self.source[start..<self.index],
+      content: String(self.source.unicodeScalars[start..<self.index]),
       line: self.line,
       column: column,
       index: start
     )
 
     return token
-  }
-
-  func findEndOfLine() -> Index
-  {
-    var index = self.index
-    while index < self.source.endIndex
-    {
-      if self.source[index] == "\r" || self.source[index] == "\n"
-      {
-        return index
-      }
-
-      index = self.source.characters.index(after: index)
-    }
-
-    return index
   }
 }
 

  case IntegerLiteral
  case FloatLiteral
  case StringLiteral
  case Comment
  case Whitespace
  case Newline
  case Keyword(String)

    let content: String
    let line: Int
    let column: Int
    let index: String.UnicodeScalarView.Index
}

class Lexer : Sequence
{
  typealias Index = String.UnicodeScalarView.Index

  var line = 1
  var column = 1
  var source : String
  var index : Index

  var nextChar : UnicodeScalar?
  {
    get
    {
      if self.index == self.source.unicodeScalars.endIndex
      {
        return nil
      }
      let nextIndex = self.source.unicodeScalars.index(after: self.index)
      if nextIndex == self.source.unicodeScalars.endIndex
      {
        return nil
      }
      return self.source.unicodeScalars[nextIndex]
    }
  }

  var currentChar : UnicodeScalar?
  {
    get
    {
      if self.index == self.source.unicodeScalars.endIndex
      {
        return nil
      }
      return self.source.unicodeScalars[self.index]
    }
  }

  init(_ source: String)
  {
    self.source = source
    self.index = source.unicodeScalars.startIndex
  }

  func makeIterator() -> AnyIterator<Token> {
    self.line = 1
    self.column = 1
    self.index = self.source.unicodeScalars.startIndex
    var lastType : TokenType = .Unknown

    return AnyIterator {
