majwilson / python-to-javascript

A tool that allows programmers to convert code written in Python into the equivalent code written in Javascript.
MIT License
19 stars 5 forks source link

Inline if statement causes "Exception: cannot find DEDENT" #7

Open gregn610 opened 8 months ago

gregn610 commented 8 months ago
if True: print('valid syntax')

causes

  File "/Users/gregn/Projects/Software/Piet/python-to-javascript/PythonToJavascript/Converter.py", line 53, in findNodeReverse
    raise Exception( "cannot find {}".format( kind ) )
Exception: cannot find DEDENT

BTW, Thanks for sharing this program, it's great.

gregn610 commented 8 months ago

same with

    try:
        val = int(arg)
        if val > 0:
            return val
    except: pass