             exponent = 0
 
             var exponentLength = 0
-            for ; cur != end; advance() {
-                if let value = digitToInt(currentChar) {
-                    exponent = (exponent * 10) + Int64(value)
-                    exponentLength++
-                } else {
-                    break
-                }
-            }
-            if exponentLength == 0 {
+            while let value = digitToInt(currentChar) where cur != end {
+                exponent = (exponent * 10) + Int64(value)
+                exponentLength++
+                advance()
+            }
+            
+            guard exponentLength != 0 else {
                 throw InvalidNumberError("insufficient exponent part in number", self)
             }
 
             exponent *= expSign
         }
 
-        //println("nuber: \(sign) * (\(integer) + \(fraction)) * pow(10, \(exponent))")
         return .NumberValue(sign * (Double(integer) + fraction) * pow(10, Double(exponent)))
     }
 


        var p = target.utf8Start
        let endp = p.advancedBy(Int(target.byteSize))

        LOOP: for ; p != endp; p++, advance() {
            if p.memory != currentChar {
                cur = start // unread
                lineNumber = l
                columnNumber = c
                return false
            }
        }

        return true
    }


            var factor = 0.1
            var fractionLength = 0

            while let value = digitToInt(currentChar) where cur != end {
                fraction += (Double(value) * factor)
                factor /= 10
                fractionLength++
                
                advance()
            }

            guard fractionLength != 0 else {
                throw InvalidNumberError("insufficient fraction part in number", self)
            }
        }
