INNER CODE UNIT · Python
parseTreeText
gurkenlabs/litiengine · config/javadoc/generate_js.py:400
function parseTreeText(rawText) {
const fragment = document.createDocumentFragment();
let text = rawText;
// Handle standalone closing paren
if (text.trim() === ')') {
return fragment;
}
// 1. Optional leading type parameter (e.g. "<T>" or "<E>")
const typeParamMatch = text.match(/^(\\s*<[^>]+>\\s*)/);
if (typeParamMatch) {
const span = document.createElement('span');
span.className = 'tree-type-param';
span.textContent = typeParamMatch[1].trim();
fragment.appendChild(span);
text = text.slice(typeParamMatch[0].length);
}