File: gen-lexer-c

package info (click to toggle)
libnginx-mod-http-lua 1%3A0.10.28-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,456 kB
  • sloc: ansic: 42,658; perl: 480; sh: 303; python: 23; makefile: 11
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