mpourmpoulis / PythonVoiceCodingPlugin

Sublime Text 3 plugin for voice coding Python 3
https://pythonvoicecodingplugin.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
13 stars 3 forks source link

Single line compounds raise syntax error if they are followed by a keyword #22

Closed mpourmpoulis closed 4 years ago

mpourmpoulis commented 4 years ago

Description

It seems that after single-line compounds, and additional dummy name is added Cause and syntax errors if it is followed by keyword like return or pass. As you can see below assignments are okay!

Your Code

def function():
    if x: return 0
    if x: pass
    if :
        return 1
def function():
    if x: y=4
    x=5

Repair Output

 def function():
    if x:the_dummy_name_is_really_dummy return 0
    if x:the_dummy_name_is_really_dummy pass
    if the_dummy_name_is_really_dummy :
        return 1
def function():
    if x: y=4
    x=5
mpourmpoulis commented 4 years ago

they should now be fixed and should also support some syntactically correct yet not really sure If the Semanticaly meaningful stuff like

if x : global y