HashMap<ExpressionField, HashMap<String, List<Token>>> functionReferences = new HashMap<ExpressionField, HashMap<String, List<Token>>>();\r
\r
// Build references and variable array\r
+ boolean parsingSucceeded = false;\r
for(ExpressionField ef : expression.getExpressionFields()) {\r
ef.resetAnnotations();\r
String textString = ef.getExpression();\r
\r
functionReferences.put(ef, parser.getFunctionCallReferences());\r
\r
+ parsingSucceeded = true;\r
} catch (ParseException e1) {\r
ef.setSyntaxError(new SyntaxError(e1.currentToken, "Syntax Error"));\r
} catch (TokenMgrError err) {\r
// Check that the variables that exist have connections and the connected variables have references in the expressions\r
if(!(expression instanceof StockExpression)) { \r
\r
- if(variableTable != null && !variableTable.isDisposed()) {\r
+ // If there are syntax errors, keep the previous coloring.\r
+ if(parsingSucceeded && variableTable != null && !variableTable.isDisposed()) {\r
TableItem[] connectedVariables = variableTable.getItems();\r
for(TableItem ti : connectedVariables) {\r
if(!variables.contains(ti.getText())) {\r