mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
-D, --define.
* src/getargs.c (usage): Document -D. Fix help string for --locations. (command_line_location): New. (short_options, long_options, getargs): Support -D, --define. (getargs): Move -d support at the right place. * doc/bison.texinfo (Bison Options): Update. * tests/input.at (%define, --define): New.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Checking the Bison scanner. -*- Autotest -*-
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
|
||||
# Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -821,6 +821,32 @@ input.y:5.9-16: warning: %define variable `special2' is not used
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------- ##
|
||||
## %define, --define. ##
|
||||
## ------------------- ##
|
||||
|
||||
AT_SETUP([%define, --define])
|
||||
|
||||
AT_DATA([input.y],
|
||||
[[%define var "value1"
|
||||
%%
|
||||
start: ;
|
||||
]])
|
||||
|
||||
AT_BISON_CHECK([[input.y -DFOO -DFOO -Dvar=value]], [0], [],
|
||||
[[<command line>:4: warning: %define variable `FOO' redefined
|
||||
<command line>:3: warning: previous definition
|
||||
input.y:1.9-11: warning: %define variable `var' redefined
|
||||
<command line>:5: warning: previous definition
|
||||
<command line>:3: warning: %define variable `FOO' is not used
|
||||
<command line>:4: warning: %define variable `FOO' is not used
|
||||
<command line>:5: warning: %define variable `var' is not used
|
||||
input.y:1.9-11: warning: %define variable `var' is not used
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
## --------------------------- ##
|
||||
## %define Boolean variables. ##
|
||||
## --------------------------- ##
|
||||
|
||||
Reference in New Issue
Block a user