PDE shows a syntax error, but the sketch runs (cannot automatically rename things)

edited February 2017 in Using Processing

PDE shows a "missing right curly bracket" error on this line:

String[] ip = loadStrings(filename);

However, all the brackets line up and the sketch runs just fine. The problem comes when i want to automatically rename identifiers. Which PDE doesn't let you until there are no syntax errors.

Answers

  • the problem with missing } errors is that it can't always tell where they are.

    void helloWorld() {
      if (condition) {
        // do a thing
        // missing } here
    } // the end of the method looks like the end of the condition...
    

    it may even not be in the same tab.

    so check. hit ctrl-t in each of the tabs in turn.

    sketch runs just fine

    this is odd though. maybe there's a { or } in a comment that's confusing it.

  • I've checked manually and by ctr-t and i don't have any {} in comments.

  • well, unless you post more than that one line of code we can't help.

  • edited February 2017
  • mine flags up setup() and FSM definition as errors until i change this line

    String filename = "E:\\ProcessingSketchbook\\PongLogin\\" + "ip";
    
  • And does it run for you? I'm using PDE 3.3

  • well, i don't have half the libraries, or the ip file. so no.

    the one thing i do hate is all the

    if (condition) command;

    without brackets surrounding the block (which is often a multi-line statement). yes, it's legal but i find it less readable and more prone to errors.

    the automatic formatter gets confused by the enum too. i wonder whether that's a problem.

    (you also have variables with the same names as the enum values which, again, is confusing)

  • How come you miss the library?

  • sorry, was confusing you with another question i answered today. you aren't using a lot of libraries.

    it's just the (undocumented) ip file i don't have. or the server that it points to.

  • It doeen't matter that it exits immediately after it starts. If it runs it means that a perfectly valid java program causes PDE to report erros, pointing to a bug in the PDE.

Sign In or Register to comment.