Unicode identifiers
in
Core Library Questions
•
2 years ago
A student asked me if it was possible to do this in Processing:
float θ = 0.0; // angle in radians
I have discovered that it doesn't work. First, you must set preproc.substitute_unicode=false in your preferences file to prevent the expansion of θ into \u03B8. After doing this, you get the following error message:
processing.app.debug.RunnerException: unexpected char: 0x3B8
at processing.app.Sketch.preprocess(Sketch.java:1352)
at processing.app.Sketch.preprocess(Sketch.java:1205)
at processing.app.Sketch.build(Sketch.java:1568)
at processing.app.Sketch.build(Sketch.java:1553)
It would seem that antlr is objecting to this, even though it is legal in Java.
float θ = 0.0; // angle in radians
I have discovered that it doesn't work. First, you must set preproc.substitute_unicode=false in your preferences file to prevent the expansion of θ into \u03B8. After doing this, you get the following error message:
processing.app.debug.RunnerException: unexpected char: 0x3B8
at processing.app.Sketch.preprocess(Sketch.java:1352)
at processing.app.Sketch.preprocess(Sketch.java:1205)
at processing.app.Sketch.build(Sketch.java:1568)
at processing.app.Sketch.build(Sketch.java:1553)
It would seem that antlr is objecting to this, even though it is legal in Java.
1