Fix syntaxes that indefinitely stacks contexts instead of going back to a parent context
Problematic syntaxes are found thanks to `ksyntaxhighlighter6 --syntax-trace=stackSize` and a test verifies that no syntax exceeds 15 in stack size (the maximum value currently used is 7). ```sh for f in input/* ; do [[ $f = *.syntax ]] && continue [[ -f $f.syntax ]] && language=(-s "$(<"$f.syntax")") || language=() n=$(./bin/ksyntaxhighlighter6 -fansi --syntax-trace=stackSize "$f" "${language[@]}" | tail -n2 | rg '\((\d+)\)' -or'$1') n=${n/$'\n'*} ((n < 15)) || echo $'\e[31m' echo $f $n ((n < 15)) || echo $'\e[m' done ```
Please register or sign in to comment