Merge pull request #636 from processing/qualified-name-guard

Resolve #521 (color in qualifiedname)
This commit is contained in:
Ben Fry
2023-01-14 17:55:09 -05:00
committed by GitHub
@@ -635,7 +635,8 @@ public class PdeParseTreeListener extends ProcessingBaseListener {
* @param ctx ANTLR context for the type token.
*/
public void exitColorPrimitiveType(ProcessingParser.ColorPrimitiveTypeContext ctx) {
if (ctx.getText().equals("color")) {
boolean isQualifiedName = ctx.getParent() instanceof ProcessingParser.QualifiedNameContext;
if (ctx.getText().equals("color") && !isQualifiedName) {
insertAfter(ctx.stop, "int");
delete(ctx.start, ctx.stop);
}