1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-05-08 22:37:04 +08:00

Utilities/Scripts: Update regenerate-lexers.bash

62d7acc6 added arguments to Flex when regenerating
cmCommandArgumentLexer, but this was not reflected in
Utilities/Scripts/regenerate-lexers.bash. Update the script with
the proper arguments.
This commit is contained in:
Kyle Edwards 2020-10-02 14:22:46 -04:00
parent 3ec0f9d620
commit a3025e2f9b

View File

@ -9,6 +9,8 @@ fi
pushd "${BASH_SOURCE%/*}/../../Source/LexerParser" > /dev/null
extra_args_CommandArgument="--never-interactive --batch"
for lexer in \
CommandArgument \
CTestResourceGroups \
@ -22,8 +24,9 @@ do
in_file=cm${lexer}Lexer.in.l
if [[ (${in_file} -nt ${cxx_file}) || (${in_file} -nt ${h_file}) || (${forced} -gt 0) ]]; then
extra_args=`eval echo \\${extra_args_\${lexer}}`
echo "Generating Lexer ${lexer}"
flex --nounistd -DFLEXINT_H --noline --header-file=${h_file} -o${cxx_file} ${in_file}
flex --nounistd ${extra_args} -DFLEXINT_H --noline --header-file=${h_file} -o${cxx_file} ${in_file}
sed -i 's/\s*$//' ${h_file} ${cxx_file} # remove trailing whitespaces
sed -i '${/^$/d;}' ${h_file} ${cxx_file} # remove blank line at the end
sed -i '1i#include "cmStandardLexer.h"' ${cxx_file} # add cmStandardLexer.h include