                     repeat(i + 1)
             obj
     getJson = makeParser "getJson", [getNumber, getNull, getBoolean, getArray, getString, getObject]
-    {
+    Object.freeze {
         "getJson":    getJson
         "getString":  getString
         "getNumber":  getNumber

# (c) Wilson Woodcock Berkow. MIT License.

# (This is parser0.5.coffee in my local folder, with some comment alterations)

# ############################################################################ #
#  TODO: I really have to separate parsing-errors thrown intentionally in a    #
#   parser from code errors, so that if there is a type- or reference-error,   #
#   it does not appear to be a parsing error and it does not take the notFound #
#   branch. This tripped me up when I wrote "char()" instead of "@char()".     #
# ADDITIONALLY: Should makeParser record a stack so that when this error       #
#  function is called, you can expand the error and observe which parsers      #
#  were called, without having to look at the actual stack and just observing  #
#  a bunch of calls to anonymous function or to `parser` or `requireFor` and   #
#  shit?                                                                       #
# ############################################################################ #

# Note: Consider extending @require and @optional to operate not just on a string at @str, but also potentially on an ast at @ast

"use strict"
util = Object.freeze # This is frozen because it is added publicly to makeParser.
    "y": (le) -> # Y-Combinator
        ((f) ->
            f(f)
        ) (f) ->
            le (args...) ->
                f(f).call(this, args...)
    "loop": (f) -> util.y(f)() # For functional/expressional loops. e.g. util.loop (repeat) => => ...code...
    "makeObject": (proto, ownProps) ->
        result = Object.create proto
        for prop, val of ownProps

                parsingInstance = makeParsingInstance(str, startAt)
                result = parser.requireFor(parsingInstance, other)
                if parsingInstance.index isnt parsingInstance.str.length
                    throw parsingError("Expected end of string index #{parsingInstance.index}.")
                else
                    result
            parser.requireFor = (origInstance, other = {}) ->
                if util.typeOf(other.notFound) is "function"
                    # This branch is effectively the @optional function.
                    instance = makeParsingInstance(origInstance.str, origInstance.index)
                    try
                        val = x.call(instance, other.args)
                    catch e
                        if isParsingError e
                            err = e
                        else
                            throw e
                    if err
                        other.notFound(err)
                    else
                        if not other.dontAdvance
                            origInstance.index = instance.index # This is what synchronizes the referenced instance with the one it's used in, so that @require()ing another function also advances @index in the current instance.
                        if other.found
                            other.found(val)
                        else
