summaryrefslogtreecommitdiffstats
path: root/usr.bin/colldef/parse.y
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1999-02-13 14:14:47 +0000
committerache <ache@FreeBSD.org>1999-02-13 14:14:47 +0000
commit4ecd2d2e401c699a8548987c45ef6217f0230e08 (patch)
tree6de78743c28c477c7da24a8faf2c91815f2579c3 /usr.bin/colldef/parse.y
parent4124fd16f07b85b33874d6ba88f393123b8f7d4f (diff)
downloadFreeBSD-src-4ecd2d2e401c699a8548987c45ef6217f0230e08.zip
FreeBSD-src-4ecd2d2e401c699a8548987c45ef6217f0230e08.tar.gz
syntax change: allow symbolic names as substitute first arg
Diffstat (limited to 'usr.bin/colldef/parse.y')
-rw-r--r--usr.bin/colldef/parse.y16
1 files changed, 6 insertions, 10 deletions
diff --git a/usr.bin/colldef/parse.y b/usr.bin/colldef/parse.y
index 8a81726..da485da 100644
--- a/usr.bin/colldef/parse.y
+++ b/usr.bin/colldef/parse.y
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: parse.y,v 1.12 1999/02/12 20:39:05 ache Exp $
+ * $Id: parse.y,v 1.13 1999/02/12 20:56:49 ache Exp $
*/
#include <err.h>
@@ -83,16 +83,12 @@ charmap : DEFN CHAR {
strcpy(charmap_table[$2], $1);
}
;
-substitute : SUBSTITUTE STRING WITH STRING {
- u_char ch = $2[0];
-
- if (strlen($2) > 1)
- yyerror("Only characters can be substituted, not strings");
- if (ch == '\0')
+substitute : SUBSTITUTE CHAR WITH STRING {
+ if ($2 == '\0')
yyerror("NUL character can't be substituted");
- if (strchr($4, ch) != NULL)
- yyerror("Char 0x%02x substitution is recursive", ch);
- strcpy(__collate_substitute_table[ch], $4);
+ if (strchr($4, $2) != NULL)
+ yyerror("Char 0x%02x substitution is recursive", $2);
+ strcpy(__collate_substitute_table[$2], $4);
}
;
order : ORDER order_list {
OpenPOWER on IntegriCloud