Skip to content
Commit bca62797 authored by Jonathan Poelen's avatar Jonathan Poelen Committed by Christoph Cullmann
Browse files

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
```
parent 1723675a
Pipeline #491985 passed with stage
in 2 minutes and 55 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment