From 51dbcefc64890d499c9774c7fc75ddfc3fa3cda0 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 7 Jun 2017 00:50:34 +0000 Subject: Implement the roff(7) .rn (rename macro or string) request. Renaming a user-defined macro is very simple: just copy the definition to the new name and delete the old name. Renaming high-level macros is a bit tricky: use a dedicated key-value-table, with non-standard names as keys and standard names as values. When a macro is found that is not user-defined, look it up in the "renamed" table and translate it back to the standard name before passing it on to the high-level parsers. --- roff.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'roff.h') diff --git a/roff.h b/roff.h index fbfd593c..0a7c2455 100644 --- a/roff.h +++ b/roff.h @@ -1,4 +1,4 @@ -/* $Id: roff.h,v 1.50 2017/06/06 15:01:04 schwarze Exp $ */ +/* $Id: roff.h,v 1.51 2017/06/07 00:50:34 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze @@ -309,6 +309,7 @@ enum roff_tok { ROFF_writem, ROFF_xflag, ROFF_cblock, + ROFF_RENAMED, ROFF_USERDEF, TOKEN_NONE, MDOC_Dd, -- cgit v1.2.3