Skip to content

Fix syntaxes that indefinitely stacks contexts instead of going back to a parent context

Problematic syntaxes are found thanks to ksyntaxhighlighter6 --syntax-trace=stackSize:

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

Merge request reports