File: gen-lexer-c

package info (click to toggle)
nginx 1.10.3-1%2Bdeb9u4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 17,804 kB
  • sloc: ansic: 196,884; perl: 7,496; sh: 1,203; ruby: 617; makefile: 345; python: 224; awk: 36; cpp: 18
file content (18 lines) | stat: -rwxr-xr-x 587 bytes parent folder | download | duplicates (7)
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