Parse for a function FunctionInvocation ::= (identifier ':')? identifier '(' (Expression (,Expression) )? ')' Note: currently we don't parse arguments
()
| 134 | * Note: currently we don't parse arguments |
| 135 | */ |
| 136 | private boolean parseFunction() { |
| 137 | if (!(curToken instanceof Id) || isELReserved(curToken.toTrimmedString()) || |
| 138 | prevToken instanceof Char && prevToken.toChar() == '.') { |
| 139 | return false; |
| 140 | } |
| 141 | String s1 = null; // Function prefix |
| 142 | String s2 = curToken.toTrimmedString(); // Function name |
| 143 | int start = index - curToken.toString().length(); |
| 144 | Token original = curToken; |
| 145 | if (hasNext()) { |
| 146 | int mark = getIndex() - whiteSpace.length(); |
| 147 | curToken = nextToken(); |
| 148 | if (curToken.toChar() == ':') { |
| 149 | if (hasNext()) { |
| 150 | Token t2 = nextToken(); |
| 151 | if (t2 instanceof Id) { |
| 152 | s1 = s2; |
| 153 | s2 = t2.toTrimmedString(); |
| 154 | if (hasNext()) { |
| 155 | curToken = nextToken(); |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | } |
| 160 | if (curToken.toChar() == '(') { |
| 161 | ELexpr.add(new ELNode.Function(s1, s2, expression.substring(start, index - 1))); |
| 162 | return true; |
| 163 | } |
| 164 | curToken = original; |
| 165 | setIndex(mark); |
| 166 | } |
| 167 | return false; |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * Test if an id is a reserved word in EL |
no test coverage detected