Skip to content

Commit 3145e77

Browse files
committed
Added ability to use re2c flags
1 parent d61173d commit 3145e77

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

install-development

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
# --php-config <PATH> Path to custom `php-config' executable
1818
# --install Install Zephir Parser
1919
#
20-
# Available env. vars:
21-
# RE2C_BIN Path to custom `re2c
20+
# Available environment variables:
21+
# RE2C_BIN Path to custom `re2c'
22+
# RE2C_FLAGS The `re2c' flags e.g. `--debug-output', `--no-optimize-tag', etc.
2223
#
2324
# Usage:
2425
#
@@ -46,6 +47,7 @@ PHPIZE_BIN=`command -v phpize 2>/dev/null || true`
4647
PHPCONFIG_BIN=`command -v php-config 2>/dev/null || true`
4748

4849
INSTALL_EXTENSION="${INSTALL_EXTENSION:-0}"
50+
RE2C_FLAGS="${RE2C_FLAGS:-''}"
4951

5052
if [ x"$RE2C_BIN" = x ]; then
5153
echo -e "error: unable to locate the re2c"
@@ -80,7 +82,7 @@ for arg in "$@"; do
8082
"--phpize") set -- "$@" "-i" ;;
8183
"--php-config") set -- "$@" "-c" ;;
8284
"--install") set -- "$@" "-e" ;;
83-
*) set -- "$@" "$arg"
85+
*) set -- "$@" "$arg" ;;
8486
esac
8587
done
8688

@@ -136,7 +138,9 @@ rm -f \
136138

137139
rm -rf .libs
138140

139-
${RE2C_BIN} --no-generation-date -o scanner.c scanner.re
141+
SCANNER_OPTIONS="${RE2C_FLAGS} --no-generation-date -o scanner.c scanner.re"
142+
143+
${RE2C_BIN} ${SCANNER_OPTIONS}
140144

141145
# Compile lemon
142146
${CC} lemon.c -o lemon

0 commit comments

Comments
 (0)