                                         # TODO show error once brackets/ace will be used
 
                                         stack.push element
+                                        size_stack++
+                                        if size_stack > @max_size_stack
+                                            return null
                                         element =
                                             type: null
                                             context: context

                                element.complete = true
                                to_skip = element.name.length-1+new_start-i
                                stack.push element
                                element =
                                    type: null
                                    context: context

                else
                    return ''

        # We build a stack of the query.
        # Chained functions are in the same array, arguments/inner queries are in a nested array
        # element.type in ['string', 'function', 'var', 'separator', 'anonymous_function', 'object', 'array_entry', 'object_key' 'array']
        extract_data_from_query: (args) =>
            size_stack = args.size_stack
            query = args.query
            context = if args.context? then DataUtils.deep_copy(args.context) else {}
            position = args.position
