Skip to main content

module util::Highlight

rascal-0.34.0

Usage

import util::Highlight;

Dependencies

import ParseTree;
import String;

function highlight2html

str highlight2html(Tree t)

function isKeyword

bool isKeyword(str s)

function highlight2htmlRec

str highlight2htmlRec(t:appl(prod(lit(str l), _, _), _))

str highlight2htmlRec(t:appl(prod(cilit(str l), _, _), _))

str highlight2htmlRec(t:appl(prod(_, _, {*_, \tag("category"(str cat))}), list[Tree] as))

str highlight2htmlRec(appl(prod(_, _, set[Attr] attrs), list[Tree] as))

str highlight2htmlRec(appl(regular(_), list[Tree] as))

str highlight2htmlRec(amb({k, *_}))

default str highlight2htmlRec(Tree t)

function span

str span(str class, str src)
default str wrapLink(str text, Tree _)

function highlight2latex

str highlight2latex(appl(prod(lit(str l), _, _), _))

str highlight2latex(appl(prod(cilit(str l), _, _), _))

str highlight2latex(appl(prod(_, _, {*_, \tag("category"(str cat))}), list[Tree] as))

str highlight2latex(appl(prod(_, _, set[Attr] attrs), list[Tree] as))

str highlight2latex(appl(regular(_), list[Tree] as))

str highlight2latex(amb({k, *_}))

default str highlight2latex(Tree t)

function catCmd

str catCmd(str class, str src)