mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 22:33:03 +00:00
Use b4_subtract where possible.
* data/lalr1.cc (b4_subtract): Move to... * data/bison.m4: here. * data/glr.c (b4_rhs_data): Use it. * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
This commit is contained in:
@@ -212,6 +212,15 @@ m4_define([b4_ints_in],
|
||||
[m4_eval([$3 <= $1 && $1 <= $4 && $3 <= $2 && $2 <= $4])])
|
||||
|
||||
|
||||
# b4_subtract(LHS, RHS)
|
||||
# ---------------------
|
||||
# Evaluate LHS - RHS if they are integer literals, otherwise expand
|
||||
# to (LHS) - (RHS).
|
||||
m4_define([b4_subtract],
|
||||
[m4_bmatch([$1$2], [^[0123456789]*$],
|
||||
[m4_eval([$1 - $2])],
|
||||
[($1) - ($2)])])
|
||||
|
||||
|
||||
## ------------------ ##
|
||||
## Decoding options. ##
|
||||
@@ -257,11 +266,6 @@ b4_define_flag_if([nondeterministic]) # Whether conflicts should be handled.
|
||||
b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
||||
|
||||
|
||||
## ------------------------- ##
|
||||
## Assigning token numbers. ##
|
||||
## ------------------------- ##
|
||||
|
||||
|
||||
## ----------- ##
|
||||
## Synclines. ##
|
||||
## ----------- ##
|
||||
|
||||
Reference in New Issue
Block a user