Only define parse.lac for Bison 3.5 or greater (#1702)

This commit is contained in:
Rangi
2025-06-14 17:01:16 -04:00
committed by GitHub
parent 612cf3b7dd
commit 37bf9fae01
2 changed files with 4 additions and 4 deletions

View File

@@ -9,10 +9,10 @@ set(common_src
) )
find_package(BISON 3.0.0 REQUIRED) find_package(BISON 3.0.0 REQUIRED)
set(BISON_FLAGS "-Wall -Dparse.lac=full -Dlr.type=ielr") set(BISON_FLAGS "-Wall -Dlr.type=ielr")
# Set some optimization flags on versions that support them # Set some optimization flags on versions that support them
if(BISON_VERSION VERSION_GREATER_EQUAL "3.5") if(BISON_VERSION VERSION_GREATER_EQUAL "3.5")
set(BISON_FLAGS "${BISON_FLAGS} -Dapi.token.raw=true") set(BISON_FLAGS "${BISON_FLAGS} -Dparse.lac=full -Dapi.token.raw=true")
endif() endif()
if(BISON_VERSION VERSION_GREATER_EQUAL "3.6") if(BISON_VERSION VERSION_GREATER_EQUAL "3.6")
set(BISON_FLAGS "${BISON_FLAGS} -Dparse.error=detailed") set(BISON_FLAGS "${BISON_FLAGS} -Dparse.error=detailed")

View File

@@ -12,11 +12,11 @@ if [ "$BISON_MAJOR" -lt 3 ]; then
exit 1 exit 1
fi fi
BISON_FLAGS="-Wall -Dparse.lac=full -Dlr.type=ielr" BISON_FLAGS="-Wall -Dlr.type=ielr"
# Set some optimization flags on versions that support them # Set some optimization flags on versions that support them
if [ "$BISON_MAJOR" -ge 4 ] || [ "$BISON_MAJOR" -eq 3 ] && [ "$BISON_MINOR" -ge 5 ]; then if [ "$BISON_MAJOR" -ge 4 ] || [ "$BISON_MAJOR" -eq 3 ] && [ "$BISON_MINOR" -ge 5 ]; then
BISON_FLAGS="$BISON_FLAGS -Dapi.token.raw=true" BISON_FLAGS="$BISON_FLAGS -Dparse.lac=full -Dapi.token.raw=true"
fi fi
if [ "$BISON_MAJOR" -ge 4 ] || [ "$BISON_MAJOR" -eq 3 ] && [ "$BISON_MINOR" -ge 6 ]; then if [ "$BISON_MAJOR" -ge 4 ] || [ "$BISON_MAJOR" -eq 3 ] && [ "$BISON_MINOR" -ge 6 ]; then
BISON_FLAGS="$BISON_FLAGS -Dparse.error=detailed" BISON_FLAGS="$BISON_FLAGS -Dparse.error=detailed"