Author: henrib Date: Fri Aug 12 13:31:17 2011 New Revision: 1157101 URL: http://svn.apache.org/viewvc?rev=1157101&view=rev Log: Added syntax allowing strings after dot operator: foo.'x y z'
Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/parser/Parser.jjt Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/parser/Parser.jjt URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/parser/Parser.jjt?rev=1157101&r1=1157100&r2=1157101&view=diff ============================================================================== --- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/parser/Parser.jjt (original) +++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/parser/Parser.jjt Fri Aug 12 13:31:17 2011 @@ -152,7 +152,7 @@ PARSER_END(Parser) { < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* > | - < #LETTER: [ "a"-"z", "A"-"Z", "_", "$" ] > + < #LETTER: [ "a"-"z", "A"-"Z", "_", "$", "@" ] > | < #DIGIT: [ "0"-"9"] > } @@ -411,6 +411,17 @@ void Identifier(boolean top) : t=<REGISTER> { jjtThis.image = t.image; jjtThis.setRegister(t.image); } } +void StringIdentifier() #Identifier : +{ + Token t; +} +{ + t=<STRING_LITERAL> + { + jjtThis.image = Parser.buildString(t.image, true); + } +} + void Literal() #void : { Token t; @@ -572,6 +583,8 @@ void DotReference() #void : {} Identifier() | IntegerLiteral() + | + StringIdentifier() ) ) )*