X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/03f1b545b94c6699ee637b517c4941afb76eb0d9..3804aa260b956dd012adde3894767254422a5fcf:/data/location.cc diff --git a/data/location.cc b/data/location.cc index 0ee02c28..49f5f349 100644 --- a/data/location.cc +++ b/data/location.cc @@ -27,12 +27,11 @@ b4_copyright([Positions for Bison parsers in C++], ** Define the ]b4_namespace_ref[::position class. */ -#ifndef BISON_POSITION_HH -# define BISON_POSITION_HH +]b4_cpp_guard_open([b4_dir_prefix[]position.hh])[ +# include // std::max # include # include -# include ]b4_null_define[ @@ -88,7 +87,7 @@ b4_copyright([Positions for Bison parsers in C++], }; /// Add and assign a position. - inline const position& + inline position& operator+= (position& res, const int width) { res.columns (width); @@ -104,7 +103,7 @@ b4_copyright([Positions for Bison parsers in C++], } /// Add and assign a position. - inline const position& + inline position& operator-= (position& res, const int width) { return res += -width; @@ -148,7 +147,7 @@ b4_copyright([Positions for Bison parsers in C++], } ]b4_namespace_close[ -#endif // not BISON_POSITION_HH] +]b4_cpp_guard_close([b4_dir_prefix[]position.hh]) @output(b4_dir_prefix[]location.hh@)@ b4_copyright([Locations for Bison parsers in C++], [2002-2007, 2009-2012])[ @@ -158,11 +157,8 @@ b4_copyright([Locations for Bison parsers in C++], ** Define the ]b4_namespace_ref[::location class. */ -#ifndef BISON_LOCATION_HH -# define BISON_LOCATION_HH +]b4_cpp_guard_open([b4_dir_prefix[]location.hh])[ -# include -# include # include "position.hh" ]b4_namespace_open[ @@ -295,6 +291,6 @@ b4_copyright([Locations for Bison parsers in C++], ]b4_namespace_close[ -#endif // not BISON_LOCATION_HH] +]b4_cpp_guard_close([b4_dir_prefix[]location.hh]) m4_divert_pop(0) m4_changecom([#])