(Node parent)
| 1146 | * are processing JSP template test here so the JSP escapes apply. |
| 1147 | */ |
| 1148 | private void parseTemplateText(Node parent) { |
| 1149 | |
| 1150 | if (!reader.hasMoreInput()) { |
| 1151 | return; |
| 1152 | } |
| 1153 | |
| 1154 | CharArrayWriter ttext = new CharArrayWriter(); |
| 1155 | |
| 1156 | int ch = reader.nextChar(); |
| 1157 | while (ch != -1) { |
| 1158 | if (ch == '<') { |
| 1159 | // Check for "<\%" |
| 1160 | if (reader.peekChar(0) == '\\' && reader.peekChar(1) == '%') { |
| 1161 | ttext.write(ch); |
| 1162 | // Swallow the \ |
| 1163 | reader.nextChar(); |
| 1164 | ttext.write(reader.nextChar()); |
| 1165 | } else { |
| 1166 | if (ttext.size() == 0) { |
| 1167 | ttext.write(ch); |
| 1168 | } else { |
| 1169 | reader.pushChar(); |
| 1170 | break; |
| 1171 | } |
| 1172 | } |
| 1173 | } else if (ch == '\\' && !pageInfo.isELIgnored()) { |
| 1174 | int next = reader.peekChar(0); |
| 1175 | if (next == '$' || next == '#') { |
| 1176 | ttext.write(reader.nextChar()); |
| 1177 | } else { |
| 1178 | ttext.write(ch); |
| 1179 | } |
| 1180 | } else if ((ch == '$' || ch == '#' && !pageInfo.isDeferredSyntaxAllowedAsLiteral()) && |
| 1181 | !pageInfo.isELIgnored()) { |
| 1182 | if (reader.peekChar(0) == '{') { |
| 1183 | reader.pushChar(); |
| 1184 | break; |
| 1185 | } else { |
| 1186 | ttext.write(ch); |
| 1187 | } |
| 1188 | } else { |
| 1189 | ttext.write(ch); |
| 1190 | } |
| 1191 | ch = reader.nextChar(); |
| 1192 | } |
| 1193 | |
| 1194 | @SuppressWarnings("unused") |
| 1195 | Node unused = new Node.TemplateText(ttext.toString(), start, parent); |
| 1196 | } |
| 1197 | |
| 1198 | /* |
| 1199 | * XMLTemplateText ::= ( S? '/>' ) | ( S? '>' ( ( Char* - ( Char* ( '<' | '${' ) ) ) ( '${' ELExpressionBody )? |
no test coverage detected