]> git.saurik.com Git - bison.git/blobdiff - tests/local.at
tests: calc: minor refactoring.
[bison.git] / tests / local.at
index 8cd21cee1363f43eda9664cc7a4e24946c1e4717..f691ab236de7c98deab94e9f107bfba78bfccec4 100644 (file)
@@ -40,6 +40,25 @@ printf "$count\n";' $1], [0], [$3
 ## Macros decoding Bison options.  ##
 ## ------------------------------- ##
 
+# AT_LOC_PUSHDEF(FIRST-LINE, FIRST-COLUMN, LAST-LINE, LAST-COLUMN)
+# ----------------------------------------------------------------
+# Pushdef AT_LOC_(FIRST|LAST)_(LINE|COLUMN).
+m4_define([AT_LOC_PUSHDEF],
+[m4_pushdef([AT_LOC_FIRST_LINE],  [AT_LOC.$1])
+m4_pushdef([AT_LOC_FIRST_COLUMN], [AT_LOC.$2])
+m4_pushdef([AT_LOC_LAST_LINE],    [AT_LOC.$3])
+m4_pushdef([AT_LOC_LAST_COLUMN],  [AT_LOC.$4])])
+
+# AT_LOC_POPDEF
+# -------------
+# Popdef AT_LOC_(FIRST|LAST)_(LINE|COL).
+m4_define([AT_LOC_POPDEF],
+[m4_popdef([AT_LOC_FIRST_LINE])
+m4_popdef([AT_LOC_FIRST_COLUMN])
+m4_popdef([AT_LOC_LAST_LINE])
+m4_popdef([AT_LOC_LAST_COLUMN])])
+
+
 
 # AT_BISON_OPTION_PUSHDEFS([BISON-OPTIONS])
 # -----------------------------------------
@@ -70,10 +89,12 @@ m4_pushdef([AT_YACC_IF],
 [m4_bmatch([$3], [%language\|%glr-parser\|%skeleton], [$2], [$1])])
 m4_pushdef([AT_LEXPARAM_IF],
 [m4_bmatch([$3], [%lex-param], [$1], [$2])])
-m4_pushdef([AT_PARAM_IF],
-[m4_bmatch([$3], [%parse-param], [$1], [$2])])
 m4_pushdef([AT_LOCATION_IF],
 [m4_bmatch([$3], [%locations], [$1], [$2])])
+m4_pushdef([AT_LOCATION_TYPE_IF],
+[m4_bmatch([$3], [%define location_type], [$1], [$2])])
+m4_pushdef([AT_PARAM_IF],
+[m4_bmatch([$3], [%parse-param], [$1], [$2])])
 m4_pushdef([AT_PURE_IF],
 [m4_bmatch([$3], [%define  *api\.pure\|%pure-parser],
            [m4_bmatch([$3], [%define  *api\.pure *"?false"?], [$2], [$1])],
@@ -126,6 +147,15 @@ AT_PURE_LEX_IF(
  m4_pushdef([AT_LEX_PRE_FORMALS], [])
  m4_pushdef([AT_LEX_PRE_ARGS],    [])
 ])
+
+# Handle the different types of location components.
+
+AT_SKEL_CC_IF(
+  [AT_LOCATION_TYPE_IF(
+    [AT_LOC_PUSHDEF([begin.l], [begin.c], [end.l], [end.c])],
+    [AT_LOC_PUSHDEF([begin.line], [begin.column], [end.line], [end.column])])],
+  [AT_LOC_PUSHDEF([first_line], [first_column], [last_line], [last_column])])
+
 ])# _AT_BISON_OPTION_PUSHDEFS
 
 
@@ -145,6 +175,7 @@ m4_popdef([AT_YYERROR_ARG_LOC_IF])
 m4_popdef([AT_NAME_PREFIX])
 m4_popdef([AT_GLR_OR_PARAM_IF])
 m4_popdef([AT_PURE_AND_LOC_IF])
+m4_popdef([AT_LOCATION_TYPE_IF])
 m4_popdef([AT_LOCATION_IF])
 m4_popdef([AT_PARAM_IF])
 m4_popdef([AT_LEXPARAM_IF])
@@ -154,6 +185,7 @@ m4_popdef([AT_SKEL_CC_IF])
 m4_popdef([AT_GLR_CC_IF])
 m4_popdef([AT_LALR1_CC_IF])
 m4_popdef([AT_DEFINES_IF])
+AT_LOC_POPDEF
 ])# AT_BISON_OPTION_POPDEFS