Calsign / APDE

Source code for APDE: Create and run Processing sketches on an Android device.
GNU General Public License v2.0
338 stars 76 forks source link

Editor jumps to top on "unterminated string #91

Closed uheinema closed 4 years ago

uheinema commented 4 years ago

Hello,

I understand you are busy with the new release (Hurray x3), anyhow:

If an string constant is not terminated, the editor jumps to the top of the tab. Most annoying, as there is no clue where the error location might be.

Surely this is known, and maybe already fixed somehow? If not,it is nr1 on my wishlist.

Log below

Best wishes


Initializing build sequence…
Deleted old build folder
Uncaught exception type: class processing.app.SketchException
processing.app.SketchException: Unterminated string constant
    at processing.mode.java.preproc.PdePreprocessor.checkForUnterminatedMultilineComment(PdePreprocessor.java:844)
    at processing.mode.java.preproc.PdePreprocessor.write(PdePreprocessor.java:919)
    at com.calsignlabs.apde.build.Build.preprocess(Build.java:1528)
    at com.calsignlabs.apde.build.Build.build(Build.java:497)
    at com.calsignlabs.apde.EditorActivity$28.run(EditorActivity.java:3004)
    at java.lang.Thread.run(Thread.java:929)
com.calsignlabs.apde.build.SketchException: processing.app.SketchException: Unterminated string constant
    at com.calsignlabs.apde.build.Build.preprocess(Build.java:1628)
    at com.calsignlabs.apde.build.Build.build(Build.java:497)
    at com.calsignlabs.apde.EditorActivity$28.run(EditorActivity.java:3004)
    at java.lang.Thread.run(Thread.java:929)
Calsign commented 4 years ago

@uheinema Looks like an issue with the preprocessor. Funnily enough, the new release (0.5.2) completely replaces the preprocessor, so this should not be an issue anymore.

I tested the following code with 0.5.2-pre1 and it correctly highlights the incomplete string literal:

void setup() {
  String s = "incomplete
  int x = 5
}

So feel free to re-open this if you try the new version and experience a similar issue, but for now I'm going to close this issue because it seems to be resolved.