def _define_template_strings(traverser, node): """Instantiate an array of raw and cooked template strings.""" cooked = JSArray() cooked.elements = map(traverser._traverse_node, node['cooked']) raw = JSArray() raw.elements = map(traverser._traverse_node, node['raw']) cooked.set('raw', raw, traverser) return cooked
def _define_template_strings(traverser, node): """Instantiate an array of raw and cooked template strings.""" cooked = JSArray() cooked.elements = map(traverser._traverse_node, node["cooked"]) raw = JSArray() raw.elements = map(traverser._traverse_node, node["raw"]) cooked.set("raw", raw, traverser) return cooked
def _define_array(traverser, node): """Instantiate an array object from the parse tree.""" arr = JSArray() arr.elements = map(traverser._traverse_node, node['elements']) return arr
def array_global(wrapper, arguments, traverser): output = JSArray() if arguments: output.elements = [traverser._traverse_node(a) for a in arguments] return JSWrapper(output, traverser=traverser)
def _define_array(traverser, node): """Instantiate an array object from the parse tree.""" arr = JSArray() arr.elements = map(traverser._traverse_node, node["elements"]) return arr
def ArrayExpression(traverser, node): return JSArray( [traverser.traverse_node(x) for x in node["elements"] or []])