]> git.cameronkatri.com Git - mandoc.git/blobdiff - out.c
Remove the pod2man table entries. They can now be properly read and
[mandoc.git] / out.c
diff --git a/out.c b/out.c
index 20d4a9151312dc136a2d146b1dea791785a6c947..2a683fae8ed4e7640ee4a5e898800677aebf1f7e 100644 (file)
--- a/out.c
+++ b/out.c
@@ -1,4 +1,4 @@
-/*     $Id: out.c,v 1.24 2010/08/16 09:37:58 kristaps Exp $ */
+/*     $Id: out.c,v 1.29 2010/08/29 11:28:09 kristaps Exp $ */
 /*
  * Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
  *
 /*
  * Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
  *
@@ -172,6 +172,7 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz)
        int              i, j, lim;
        char             term, c;
        const char      *wp;
        int              i, j, lim;
        char             term, c;
        const char      *wp;
+       enum roffdeco    dd;
 
        *d = DECO_NONE;
        lim = i = 0;
 
        *d = DECO_NONE;
        lim = i = 0;
@@ -219,6 +220,8 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz)
                        break;
                }
                break;
                        break;
                }
                break;
+       case ('k'):
+               /* FALLTHROUGH */
        case ('M'):
                /* FALLTHROUGH */
        case ('m'):
        case ('M'):
                /* FALLTHROUGH */
        case ('m'):
@@ -275,7 +278,27 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz)
                                return(i);
                        i++;
                } 
                                return(i);
                        i++;
                } 
-               
+
+               /* Handle embedded numerical subexp or escape. */
+
+               if ('(' == wp[i]) {
+                       while (wp[i] && ')' != wp[i])
+                               if ('\\' == wp[i++]) {
+                                       /* Handle embedded escape. */
+                                       *word = &wp[i];
+                                       i += a2roffdeco(&dd, word, sz);
+                               }
+
+                       if (')' == wp[i++])
+                               break;
+
+                       *d = DECO_NONE;
+                       return(i - 1);
+               } else if ('\\' == wp[i]) {
+                       *word = &wp[++i];
+                       i += a2roffdeco(&dd, word, sz);
+               }
+
                break;
        case ('['):
                *d = DECO_SPECIAL;
                break;
        case ('['):
                *d = DECO_SPECIAL;
@@ -284,6 +307,22 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz)
        case ('c'):
                *d = DECO_NOSPACE;
                return(i);
        case ('c'):
                *d = DECO_NOSPACE;
                return(i);
+       case ('z'):
+               *d = DECO_NONE;
+               if ('\\' == wp[i]) {
+                       *word = &wp[++i];
+                       return(i + a2roffdeco(&dd, word, sz));
+               } else
+                       lim = 1;
+               break;
+       case ('o'):
+               /* FALLTHROUGH */
+       case ('w'):
+               if ('\'' == wp[i++]) {
+                       term = '\'';
+                       break;
+               } 
+               /* FALLTHROUGH */
        default:
                *d = DECO_SSPECIAL;
                i--;
        default:
                *d = DECO_SSPECIAL;
                i--;