# Path: pyxc/transforming.py
# class TargetNode:
#     
#     def __init__(self, *args):
#         self.args = args
#     
#     def __str__(self):
#         return ''.join(
#                     str(x) for x in
#                         self.emit(*self.transformedArgs))
# 
# Path: pyxc/util.py
# def delimitedList(item, arr, dest=None, delimAtEnd=False):
#     if dest is None:
#         dest = []
#     if arr:
#         dest.append(arr[0])
#     for i in range(1, len(arr)):
#         dest.append(item)
#         dest.append(arr[i])
#     if delimAtEnd:
#         dest.append(item)
#     return dest


import ast, json, re
from functools import reduce
from pyxc.transforming import TargetNode
from pyxc.util import delimitedList
        return arr

class JSAugAssignStatement(JSStatement):
    def emit(self, target, op, value):
        return [target, ' ', op, '= ', value]

class JSIfStatement(JSStatement):
    def emit(self, test, body, orelse):
        
        arr = ['if (', test, ') {']
        delimitedList(';', body, dest=arr)
        arr.append('}')
        
        if orelse:
            arr.append('else {')
            delimitedList(';', orelse, dest=arr)
            arr.append('}')
        
        return arr

class JSWhileStatement(JSStatement):
    def emit(self, test, body):
        arr = ['while (', test, ') {']
        delimitedList(';', body, dest=arr)
        arr.append('}')
        return arr

class JSForStatement(JSStatement):
    def emit(self, left, test, right, body):
        arr = ['for (', left, '; ', test, '; ', right, ') {']

# Path: pyxc/transforming.py
# class TargetNode:
#     
#     def __init__(self, *args):
#         self.args = args
#     
#     def __str__(self):
#         return ''.join(
#                     str(x) for x in
#                         self.emit(*self.transformedArgs))
# 
# Path: pyxc/util.py
# def delimitedList(item, arr, dest=None, delimAtEnd=False):
#     if dest is None:
#         dest = []
#     if arr:
#         dest.append(arr[0])
#     for i in range(1, len(arr)):
#         dest.append(item)
#         dest.append(arr[i])
#     if delimAtEnd:
#         dest.append(item)
#     return dest


# Path: pj/js_ast.py
import ast, json, re
from functools import reduce
from pyxc.transforming import TargetNode
from pyxc.util import delimitedList

        return arr

class JSAugAssignStatement(JSStatement):
    def emit(self, target, op, value):
        return [target, ' ', op, '= ', value]

class JSIfStatement(JSStatement):
    def emit(self, test, body, orelse):
        
        arr = ['if (', test, ') {']
        delimitedList(';', body, dest=arr)
        arr.append('}')
        
        if orelse:
            arr.append('else {')
            delimitedList(';', orelse, dest=arr)
            arr.append('}')
        
        return arr

class JSWhileStatement(JSStatement):
    def emit(self, test, body):
        arr = ['while (', test, ') {']
        delimitedList(';', body, dest=arr)
        arr.append('}')
        return arr

class JSForStatement(JSStatement):
    def emit(self, left, test, right, body):
        arr = ['for (', left, '; ', test, '; ', right, ') {']

        delimitedList(';', body, dest=arr)