[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
%define values need digraphs
From: |
Joel E. Denny |
Subject: |
%define values need digraphs |
Date: |
Mon, 8 Jan 2007 17:06:58 -0500 (EST) |
I committed this.
Index: ChangeLog
===================================================================
RCS file: /sources/bison/bison/ChangeLog,v
retrieving revision 1.1653
diff -p -u -r1.1653 ChangeLog
--- ChangeLog 8 Jan 2007 21:38:29 -0000 1.1653
+++ ChangeLog 8 Jan 2007 22:02:23 -0000
@@ -1,5 +1,12 @@
2007-01-08 Joel E. Denny <address@hidden>
+ * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
+ instead of muscle_insert for %define values so that M4-special
+ characters are replaced with digraphs.
+ * tests/input.at (%define errors): Extend to check weird values.
+
+2007-01-08 Joel E. Denny <address@hidden>
+
Instead of having skeletons declare all valid %define variables and
%code qualifiers, provide macros that retrieve the associated values
and build these lists automatically. Thus Bison will now warn when a
Index: src/parse-gram.y
===================================================================
RCS file: /sources/bison/bison/src/parse-gram.y,v
retrieving revision 1.110
diff -p -u -r1.110 parse-gram.y
--- src/parse-gram.y 8 Jan 2007 21:38:30 -0000 1.110
+++ src/parse-gram.y 8 Jan 2007 22:02:26 -0000
@@ -242,7 +242,7 @@ prologue_declaration:
strcpy (name + sizeof name_prefix - 1, $2);
if (muscle_find_const (name))
warn_at (@2, _("%s `%s' redefined"), "%define variable", $2);
- muscle_insert (uniqstr_new (name), $3);
+ MUSCLE_INSERT_STRING (uniqstr_new (name), $3);
free (name);
muscle_grow_user_name_list ("user_percent_define_variables", $2, @2);
}
Index: tests/input.at
===================================================================
RCS file: /sources/bison/bison/tests/input.at,v
retrieving revision 1.72
diff -p -u -r1.72 input.at
--- tests/input.at 8 Jan 2007 21:38:30 -0000 1.72
+++ tests/input.at 8 Jan 2007 22:02:26 -0000
@@ -800,6 +800,8 @@ AT_DATA([input.y],
[[%define "var" "value1"
%define "var" "value1"
%define "var" "value2"
+%define "special1" "@:>@"
+%define "special2" "@<:@"
%%
start: ;
]])
@@ -810,6 +812,8 @@ input.y:3.10-14: warning: %define variab
input.y:1.9-13: warning: %define variable `var' is not used
input.y:2.9-13: warning: %define variable `var' is not used
input.y:3.10-14: warning: %define variable `var' is not used
+input.y:4.9-18: warning: %define variable `special1' is not used
+input.y:5.9-18: warning: %define variable `special2' is not used
]])
AT_CLEANUP
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- %define values need digraphs,
Joel E. Denny <=