Syntax Check

Developers
2004-12-17
2013-04-26
  • Ok, so here's what's up with the syntax checking:

    tabnanny sends the output to stdout.  Less than ideal, but very workable.

    tabnanny only checks indentation errors.

    I figure if this is worth doing, it is worth doing whole hog.

    What I am looking at doing now, is simply running "compile", then grabbing the output, and parsing that.

    Would that miss anything that tabnanny picks up?

     
    • Apparently yes.  The solution was to hack tabnanny to return a result string, and run that after running compile too.

       
    • Hm, i tried this already with SPE - Stani's Python Editor.

      I couldn't find anything, tabnann find, what
      isn't found by the python compile command.

       
    • I've found that tabnanny can find mixed indentation errors, such as
      ->def func:
      -> x = 1