Author: scabanovich
Date: 2012-04-09 20:10:21 -0400 (Mon, 09 Apr 2012)
New Revision: 40103
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StringTokenDescription.java
Log:
JBIDE-11497
https://issues.jboss.org/browse/JBIDE-11497.
EL parser should report unclosed quote.
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java 2012-04-09
22:09:05 UTC (rev 40102)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java 2012-04-10
00:10:21 UTC (rev 40103)
@@ -19,6 +19,7 @@
public static String OperationRule_ExpectingRParen;
public static String OperationTokenDescription_Name;
public static String PrimitiveValueTokenDescription_ArgMustResolveToIntegerOrString;
+ public static String StringTokenDescription_StringIsNotClosed;
public static String PrimitiveValueTokenDescription_Name;
public static String StringTokenDescription_Name;
public static String WhiteSpaceTokenDescription_Name;
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties 2012-04-09
22:09:05 UTC (rev 40102)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties 2012-04-10
00:10:21 UTC (rev 40103)
@@ -13,6 +13,7 @@
OperationRule_ExpectingRParen=Expecting ')'
OperationTokenDescription_Name=Operator
PrimitiveValueTokenDescription_ArgMustResolveToIntegerOrString=Argument must resolve to
integer or string.
+StringTokenDescription_StringIsNotClosed=String is not closed.
PrimitiveValueTokenDescription_Name=Primitive
StringTokenDescription_Name=String
WhiteSpaceTokenDescription_Name=Whitespace
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StringTokenDescription.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StringTokenDescription.java 2012-04-09
22:09:05 UTC (rev 40102)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StringTokenDescription.java 2012-04-10
00:10:21 UTC (rev 40103)
@@ -12,7 +12,9 @@
import org.jboss.tools.common.el.core.ElCoreMessages;
import org.jboss.tools.common.el.core.parser.ITokenDescription;
+import org.jboss.tools.common.el.core.parser.SyntaxError;
import org.jboss.tools.common.el.core.parser.Tokenizer;
+import org.jboss.tools.common.el.internal.core.parser.rule.BasicStates;
/**
*
@@ -53,6 +55,11 @@
}
}
tokenizer.addToken(getType(), offset, i);
+ if(ch == '\0') {
+ SyntaxError error = new SyntaxError(offset, BasicStates.STATE_EXPECTING_ARG);
+ error.setProblem(ElCoreMessages.StringTokenDescription_StringIsNotClosed);
+ tokenizer.addSyntaxError(error);
+ }
return i > offset;
}