File: gen-lexer-c

package info (click to toggle)
nginx 1.18.0-6.1%2Bdeb11u3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 19,344 kB
  • sloc: ansic: 250,653; perl: 7,548; sh: 1,408; ruby: 879; python: 358; makefile: 338; awk: 36; cpp: 18
file content (18 lines) | stat: -rwxr-xr-x 587 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash

if [ -z "$1" ]; then
    level=0
else
    level="$1"
fi

#echo '{' '}' '\[=*\[' '--\[=*\[' '\]=*\]' '--[^\n]*' '"(?:\\[^\n]|[^"\n\\])*"' $'\'(?:\\\\[^\\n]|[^\'\\n\\\\])*\''

# we need the re.pl script here:
#   https://github.com/openresty/sregex/blob/dfa-multi-re/re.pl
re.pl -W --no-main -c --cc="clang -O2" \
    --func-name ngx_http_lua_lex \
    --header ngx_http_lua_lex.h -o src/ngx_http_lua_lex.c \
    --debug=$level -n 8 \
    -- '{' '}' '\[=*\[' '--\[=*\[' '\]=*\]' '--[^\n]*' '"(?:\\[^\n]|[^"\n\\])*"' $'\'(?:\\\\[^\\n]|[^\'\\n\\\\])*\'' \
    || exit 1