OILS / benchmarks / tokens.sh View on Github | oilshell.org

24 lines, 11 significant
1#!/usr/bin/env bash
2#
3# Usage:
4# benchmarks/tokens.sh <function name>
5
6set -o nounset
7set -o pipefail
8set -o errexit
9
10# See if tokens blow up by doing creating Id.Lit_Slash
11
12count-tokens() {
13 local osh=_bin/cxx-opt/osh
14 ninja $osh
15
16 for file in benchmarks/testdata/*; do
17 echo $file
18
19 # It prints the number of tokens
20 $osh --tool tokens $file >/dev/null
21 done
22}
23
24"$@"