[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/5] java, d: compute static subtractions
From: |
Akim Demaille |
Subject: |
[PATCH 5/5] java, d: compute static subtractions |
Date: |
Tue, 4 Dec 2018 21:14:40 +0100 |
* data/d.m4, data/java.m4: Use b4_subtract where appropriate.
---
data/d.m4 | 4 ++--
data/java.m4 | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/data/d.m4 b/data/d.m4
index 9c15906f..1240309a 100644
--- a/data/d.m4
+++ b/data/d.m4
@@ -219,7 +219,7 @@ m4_define([b4_lhs_value],
# In this simple implementation, %token and %type have class names
# between the angle brackets.
m4_define([b4_rhs_value],
-[b4_symbol_value([(yystack.valueAt ($1-($2)))], [$3], [$4])])
+[b4_symbol_value([(yystack.valueAt (b4_subtract([$1], [$2])))], [$3], [$4])])
# b4_lhs_location()
@@ -234,7 +234,7 @@ m4_define([b4_lhs_location],
# Expansion of @POS, where the current rule has RULE-LENGTH symbols
# on RHS.
m4_define([b4_rhs_location],
-[yystack.locationAt ($1-($2))])
+[yystack.locationAt ([$1], [$2])])
# b4_lex_param
diff --git a/data/java.m4 b/data/java.m4
index d2d7c42b..77d53ac9 100644
--- a/data/java.m4
+++ b/data/java.m4
@@ -242,7 +242,7 @@ m4_define([b4_lhs_value], [yyval])
# -----------------------------
# See README.
m4_define([b4_rhs_data],
-[yystack.valueAt ($1-($2))])
+[yystack.valueAt (b4_subtract($@))])
# b4_rhs_value(RULE-LENGTH, POS, SYMBOL-NUM, [TYPE])
# --------------------------------------------------
@@ -266,7 +266,7 @@ m4_define([b4_lhs_location],
# Expansion of @POS, where the current rule has RULE-LENGTH symbols
# on RHS.
m4_define([b4_rhs_location],
-[yystack.locationAt ($1-($2))])
+[yystack.locationAt (b4_subtract($@))])
# b4_lex_param
--
2.19.2
- [PATCH 0/5] add experimental support for the D programming language, Akim Demaille, 2018/12/04
- [PATCH 2/5] d: add experimental support for the D language, Akim Demaille, 2018/12/04
- [PATCH 5/5] java, d: compute static subtractions,
Akim Demaille <=
- [PATCH 4/5] d: add an example, Akim Demaille, 2018/12/04
- [PATCH 3/5] d: update the skeleton, Akim Demaille, 2018/12/04
- [PATCH 1/5] d: add skeleton for the D language, Akim Demaille, 2018/12/04