                 else if c == "\\" and quote != null
                     i += 2
                 else if quote == null and not oldWordStarted and not oldDotAffected and "a" <= c <= "z"
-                    t = s.substr(i, 10)
-                    if t.indexOf("end") == 0 or t.indexOf("equal") == 0 or t.indexOf("unit") == 0
+                    s = funStr.substr(i, 10) # limit to 10 chars for better performance
+                    if s.indexOf("end") == 0 or s.indexOf("equal") == 0 or s.indexOf("unit") == 0
                         positions.push(i)
                     i++
                 else
                     i++
             positions.forEach((m, index) =>
                 pos = m + (testArgName.length + 1) * index
-                s = s.substr(0, pos) + testArgName + "." + s.substr(pos)
+                funStr = funStr.substr(0, pos) + testArgName + "." + funStr.substr(pos)
             )
         do =>
-            s = s.replace(///
+            funStr = funStr.replace(///
                 #{testArgName}\.unit\s*\(\s*
                 (
                     " (?: [^"\\] | \\. )* " |
                     ' (?: [^'\\] | \\. )* '
                 )
             ///g, (match, p1) =>
-                unitStr = eval(p1)
+                unitStr = eval(p1) # If use `JSON.parse` instead, single quotes string cannot be parsed.
                 parsed = null
                 newStr = null
                 do =>

    end: (result) ->
        @result = result ? {type: true}
        @
    unit: (body, description = "") ->
        parsed = null
        do =>
            quote = null
            parenthesis = 0
            bracket = 0
            brace = 0
            for i in [0...body.length]
                if body[i] == "\"" and quote == null
                    quote = "double"
                else if body[i] == "'" and quote == null
                    quote = "single"
                else if (body[i] == "\"" and quote == "double") or (body[i] == "'" and quote == "single")
                    quote = null
                else if body[i] == "("
                    parenthesis++
                else if body[i] == "["
                    bracket++
                else if body[i] == "{"
                    brace++
                else if body[i] == ")"
                    parenthesis--
                else if body[i] == "]"
                    bracket--
                else if body[i] == "}"
                    brace--
                else if quote == null and parenthesis == bracket == brace == 0
                    if body[i] == "="
                        parsed =
                            type: "equal"
                            str1: body.substr(0, i).trim()
                            str2: body.substr(i + 1).trim()
                        return
        # An `eval` string must be enclosed by parentheses, otherwise
        # an object literal (i.e. wrapped in braces) can't be evaluated.
        do =>
            if parsed.type == "equal"
                @equal(eval("(#{parsed.str1})"), eval("(#{parsed.str2})"), body)
    equal: (actual, expected, description = "") ->
        determine = (actual, expected) =>
            if Array.isArray(actual) and Array.isArray(expected)

                                    str1: unitStr.substr(0, i).trim()
                                    str2: unitStr.substr(i + 1).trim()
                                return
                do =>
                    if parsed.type == "equal"
                        newStr = "#{testArgName}.equal(#{parsed.str1}, #{parsed.str2}"
                newStr
            )
        console.log(funStr)
        # If an `eval` string has leading or trailing braces, then it must be enclosed
        # by parentheses, otherwise it can't be parsed or evaluated.
        @_interpretedFunction = eval("(#{funStr})")
        @
    get: ->
        @_fun
