--- a/javascript.editing/src/org/netbeans/modules/javascript/editing/lexer/JsLexer.java Thu Mar 17 08:04:44 2011 +0100 +++ a/javascript.editing/src/org/netbeans/modules/javascript/editing/lexer/JsLexer.java Tue Mar 22 16:04:35 2011 +0100 @@ -206,7 +206,11 @@ int token; try { - token = tokenStream.getToken() & Parser.CLEAR_TI_MASK; + token = tokenStream.getToken(); + //ERROR is -1 (the only negative token), with all bits on 1 and I don't want to AND that. + if (token != org.mozilla.nb.javascript.Token.ERROR) { + token = token & Parser.CLEAR_TI_MASK; + } } catch (IOException ex) { ErrorManager.getDefault().notify(ex); token = org.mozilla.nb.javascript.Token.ERROR; @@ -236,7 +240,6 @@ private JsTokenId getTokenId(int token) { // If you add any new token types here, remember to update #getRelevantTokenTypes below switch (token) { - case 65535: // SIGN ERRORS! Why does this happen? case Token.ERROR:// = -1, // well-known as the only code < EOF return JsTokenId.ERROR; case Token.LINE_COMMENT: