# I cannot use variable name "to" anymore

**URL:** <https://discourse.processing.org/t/i-cannot-use-variable-name-to-anymore/48989>\
**Category:** Processing\
**Created:** [July 11, 2026, 10:58pm UTC](https://discourse.processing.org/t/i-cannot-use-variable-name-to-anymore/48989 "2026-07-11T22:58:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [July 11, 2026, 10:58pm UTC](https://discourse.processing.org/t/i-cannot-use-variable-name-to-anymore/48989/1 "2026-07-11T22:58:00Z")

</div>

Hello all  
I cannot use variable name “to” anymore  
Is it maybe a conflicting library?

Thanks!

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [July 11, 2026, 11:15pm UTC](https://discourse.processing.org/t/i-cannot-use-variable-name-to-anymore/48989/2 "2026-07-11T23:15:32Z")

</div>

```auto
float to;

void setup(){
  size(400,400);
    int to = 9;
    println(to);
}

```

I tried this with different versions of processing  
4.5.2 Error message  
4.5.1 Error message  
4.4.4 No error sketch executed as expected

So I suspect it is a Processing bug introduced after 4.4.4 ☹

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [July 12, 2026, 1:19am UTC](https://discourse.processing.org/t/i-cannot-use-variable-name-to-anymore/48989/3 "2026-07-12T01:19:23Z")

</div>

Hello folks!

My research…

Related:

> <https://github.com/processing/processing4/issues/1501>
>
> \### Most appropriate sub-area of Processing 4?
> 
> PDE
> 
> \### Processing version
> 
> 4.5….2
> 
> \### Operating system
> 
> macOS
> 
> \### Bug description
> 
> 
> 
> \`Test.pde\`:
> \`\`\`processing
> class Module {
> }
> 
> class Foo {
> Module module;
> }
> \`\`\`
> This ran with Processing 4.0b. 
> 
> With Processing 4.5.2 it produces \`Syntax Error - Missing name or type near Module module;?\`
> 
> Workarounds:
> \* Change \`module\` to a different identifier, e.g. \`the\_module\`
> \* Put the code in \`Test.java\` instead of \`Test.pde\`
> 
> 
> \### Steps to reproduce this
> 
> 1. Create a file \`Test.pde\` with contents
> 
> \`\`\`processing
> class Module {
> }
> 
> class Foo {
> Module module;
> }
> \`\`\`
> 
> 2. Open with Processing 4.5.2
> 
> 3. Observe an error in the IDE or when trying to "Run" the sketch.
> 
> 
> \### snippet
> 
> \`\`\`processing
> class Module {
> }
> 
> class Foo {
> Module module;
> }
> \`\`\`
> 
> 
> \### Additional context
> 
> \_No response\_
> 
> \### Would you like to work on the issue?
> 
> No, I’m just reporting the issue

I get the same error with “to” with _Processing 4.5.5_ and _W10_.

References:

- [processing4/java/preprocessor/src/main/antlr/JavaLexer.g4 at main · processing/processing4 · GitHub](https://github.com/processing/processing4/blob/main/java/preprocessor/src/main/antlr/JavaLexer.g4)
- [processing4/java/keywords.txt at main · processing/processing4 · GitHub](https://github.com/processing/processing4/blob/main/java/keywords.txt)

It appears that “to” is in the _JavaLexer.g4_ for _Processing 4.5.5_ and it is not in the _JavaLexer.g4_ for _Processing 4.4.0_

Processing 4.4.0 _JavaLexer.g4_:

> **JavaLexer.g4**
>
> ```auto
> /*
> Part of the Processing project - http://processing.org
> Copyright (c) 2012-19 The Processing Foundation
> 
> This program is free software; you can redistribute it and/or modify
> it under the terms of the GNU General Public License version 2
> as published by the Free Software Foundation.
> This program is distributed in the hope that it will be useful,
> but WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> GNU General Public License for more details.
> 
> You should have received a copy of the GNU General Public License
> along with this program; if not, write to the Free Software Foundation,
> Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> 
> [The "BSD licence" originally included as part of this source]
> Copyright (c) 2013 Terence Parr, Sam Harwell
> Copyright (c) 2017 Ivan Kochurkin (upgrade to Java 8)
> All rights reserved.
> Redistribution and use in source and binary forms, with or without
> modification, are permitted provided that the following conditions
> are met:
> 1. Redistributions of source code must retain the above copyright
> notice, this list of conditions and the following disclaimer.
> 2. Redistributions in binary form must reproduce the above copyright
> notice, this list of conditions and the following disclaimer in the
> documentation and/or other materials provided with the distribution.
> 3. The name of the author may not be used to endorse or promote products
> derived from this software without specific prior written permission.
> THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
> IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
> IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> */
> 
> lexer grammar JavaLexer;
> 
> // Keywords
> 
> ABSTRACT: 'abstract';
> ASSERT: 'assert';
> BOOLEAN: 'boolean';
> BREAK: 'break';
> BYTE: 'byte';
> CASE: 'case';
> CATCH: 'catch';
> CHAR: 'char';
> CLASS: 'class';
> CONST: 'const';
> CONTINUE: 'continue';
> DEFAULT: 'default';
> DO: 'do';
> DOUBLE: 'double';
> ELSE: 'else';
> ENUM: 'enum';
> EXTENDS: 'extends';
> FINAL: 'final';
> FINALLY: 'finally';
> FLOAT: 'float';
> FOR: 'for';
> IF: 'if';
> GOTO: 'goto';
> IMPLEMENTS: 'implements';
> IMPORT: 'import';
> INSTANCEOF: 'instanceof';
> INT: 'int';
> INTERFACE: 'interface';
> LONG: 'long';
> NATIVE: 'native';
> NEW: 'new';
> PACKAGE: 'package';
> PRIVATE: 'private';
> PROTECTED: 'protected';
> PUBLIC: 'public';
> RETURN: 'return';
> SHORT: 'short';
> STATIC: 'static';
> STRICTFP: 'strictfp';
> SUPER: 'super';
> SWITCH: 'switch';
> SYNCHRONIZED: 'synchronized';
> THIS: 'this';
> THROW: 'throw';
> THROWS: 'throws';
> TRANSIENT: 'transient';
> TRY: 'try';
> VAR: 'var';
> VOID: 'void';
> VOLATILE: 'volatile';
> WHILE: 'while';
> 
> // Literals
> 
> DECIMAL_LITERAL: ('0' | [1-9] (Digits? | '_'+ Digits)) [lL]?;
> HEX_LITERAL: '0' [xX] [0-9a-fA-F] ([0-9a-fA-F_]* [0-9a-fA-F])? [lL]?;
> OCT_LITERAL: '0' '_'* [0-7] ([0-7_]* [0-7])? [lL]?;
> BINARY_LITERAL: '0' [bB] [01] ([01_]* [01])? [lL]?;
> 
> FLOAT_LITERAL: (Digits '.' Digits? | '.' Digits) ExponentPart? [fFdD]?
> | Digits (ExponentPart [fFdD]? | [fFdD])
> ;
> 
> HEX_FLOAT_LITERAL: '0' [xX] (HexDigits '.'? | HexDigits? '.' HexDigits) [pP] [+-]? Digits [fFdD]?;
> 
> BOOL_LITERAL: 'true'
> | 'false'
> ;
> 
> CHAR_LITERAL: '\'' (~['\\\r\n] | EscapeSequence) '\'';
> 
> STRING_LITERAL: '"' (~["\\\r\n] | EscapeSequence)* '"';
> MULTI_STRING_LIT: '"""' (~[\\] | EscapeSequence)*? '"""';
> 
> NULL_LITERAL: 'null';
> // Separators
> LPAREN: '(';
> RPAREN: ')';
> LBRACE: '{';
> RBRACE: '}';
> LBRACK: '[';
> RBRACK: ']';
> SEMI: ';';
> COMMA: ',';
> DOT: '.';
> // Operators
> ASSIGN: '=';
> GT: '>';
> LT: '<';
> BANG: '!';
> TILDE: '~';
> QUESTION: '?';
> COLON: ':';
> EQUAL: '==';
> LE: '<=';
> GE: '>=';
> NOTEQUAL: '!=';
> AND: '&&';
> OR: '||';
> INC: '++';
> DEC: '--';
> ADD: '+';
> SUB: '-';
> MUL: '*';
> DIV: '/';
> BITAND: '&';
> BITOR: '|';
> CARET: '^';
> MOD: '%';
> ADD_ASSIGN: '+=';
> SUB_ASSIGN: '-=';
> MUL_ASSIGN: '*=';
> DIV_ASSIGN: '/=';
> AND_ASSIGN: '&=';
> OR_ASSIGN: '|=';
> XOR_ASSIGN: '^=';
> MOD_ASSIGN: '%=';
> LSHIFT_ASSIGN: '<<=';
> RSHIFT_ASSIGN: '>>=';
> URSHIFT_ASSIGN: '>>>=';
> // Java 8 tokens
> ARROW: '->';
> COLONCOLON: '::';
> // Additional symbols not defined in the lexical specification
> AT: '@';
> ELLIPSIS: '...';
> // Whitespace and comments
> WS: [\t\r\n\u000C]+ -> channel(HIDDEN);
> COMMENT: '/*' .*? '*/' -> channel(HIDDEN);
> LINE_COMMENT: '//' ~[\r\n]* -> channel(HIDDEN);
> 
> // Identifiers
> 
> IDENTIFIER: Letter LetterOrDigit*;
> 
> // Fragment rules
> 
> fragment ExponentPart
> : [eE] [+-]? Digits
> ;
> 
> fragment EscapeSequence
> : '\\' [btnfr"'\\]
> | '\\' ([0-3]? [0-7])? [0-7]
> | '\\' 'u'+ HexDigit HexDigit HexDigit HexDigit
> ;
> fragment HexDigits
> : HexDigit ((HexDigit | '_')* HexDigit)?
> ;
> fragment HexDigit
> : [0-9a-fA-F]
> ;
> fragment Digits
> : [0-9] ([0-9_]* [0-9])?
> ;
> fragment LetterOrDigit
> : Letter
> | [0-9]
> ;
> fragment Letter
> : [a-zA-Z$_] // these are the "java letters" below 0x7F
> | ~[\u0000-\u007F\uD800-\uDBFF] // covers all characters above 0x7F which are not a surrogate
> | [\uD800-\uDBFF] [\uDC00-\uDFFF] // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
> ;
> 
> ```

`:)`

---

<div class="post-metadata">

**Author:** ![sableraph](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sableraph/32/251_2.png) [@sableraph](https://discourse.processing.org/u/sableraph)\
**Post date:** [July 13, 2026, 8:41am UTC](https://discourse.processing.org/t/i-cannot-use-variable-name-to-anymore/48989/4 "2026-07-13T08:41:40Z")

</div>

Thanks @Chrisir for flagging this.

This is similar to [issue #1501](https://github.com/processing/processing4/issues/1501). It looks like this has been broken since version 4.4.8 released in October 2025.

A fix is underway in [PR #1543](https://github.com/processing/processing4/pull/1543) and should be included in a future release.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [July 14, 2026, 11:33am UTC](https://discourse.processing.org/t/i-cannot-use-variable-name-to-anymore/48989/5 "2026-07-14T11:33:21Z")

</div>

Thanks everyone, much appreciated.

It’s funny how often I seem to use the word “to”, be it for a line in 2D or 3D, be it in a Chess Move from/to…
