[BACK]Return to main.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / texi2mdoc

Diff for /texi2mdoc/main.c between version 1.3 and 1.4

version 1.3, 2015/02/17 17:02:03 version 1.4, 2015/02/17 20:27:44
Line 467  static void
Line 467  static void
 teximacro(struct texi *p, const char *s)  teximacro(struct texi *p, const char *s)
 {  {
   
           if (p->outmacro)
                   texierr(p, "\"%s\" in open line scope!?", s);
           else if (p->literal)
                   texierr(p, "\"%s\" in a literal scope!?", s);
   
         if (p->ign)          if (p->ign)
                 return;                  return;
         if (p->outcol)          if (p->outcol)
Line 895  dodeftypevar(struct texi *p, enum texicmd cmd, 
Line 900  dodeftypevar(struct texi *p, enum texicmd cmd, 
                 parsebracket(p, buf, sz, pos);                  parsebracket(p, buf, sz, pos);
                 texiputchars(p, ":\n");                  texiputchars(p, ":\n");
         }          }
         p->literal++;  
         teximacroopen(p, ".Vt ");          teximacroopen(p, ".Vt ");
         while (*pos < sz && '\n' != buf[*pos])          parseeoln(p, buf, sz, pos);
                 parsesingle(p, buf, sz, pos);  
         teximacroclose(p);          teximacroclose(p);
         p->literal--;  
         teximacro(p, ".Pp");          teximacro(p, ".Pp");
         parseto(p, buf, sz, pos, blk);          parseto(p, buf, sz, pos, blk);
 }  }
Line 952  dodeftypefun(struct texi *p, enum texicmd cmd, 
Line 954  dodeftypefun(struct texi *p, enum texicmd cmd, 
         parsesingle(p, buf, sz, pos);          parsesingle(p, buf, sz, pos);
         teximacroclose(p);          teximacroclose(p);
         teximacroopen(p, ".Li ");          teximacroopen(p, ".Li ");
         while (*pos < sz && '\n' != buf[*pos])          parseeoln(p, buf, sz, pos);
                 parsesingle(p, buf, sz, pos);  
         teximacroclose(p);          teximacroclose(p);
         teximacro(p, ".Pp");          teximacro(p, ".Pp");
         if (NULL != blk)          if (NULL != blk)
Line 1171  dodisplay(struct texi *p, enum texicmd cmd, 
Line 1172  dodisplay(struct texi *p, enum texicmd cmd, 
         const char *buf, size_t sz, size_t *pos)          const char *buf, size_t sz, size_t *pos)
 {  {
   
         if (p->outmacro)  
                 texierr(p, "display in open line scope!?");  
         else if (p->literal)  
                 texierr(p, "display in a literal scope!?");  
   
         teximacro(p, ".Bd -display");          teximacro(p, ".Bd -display");
         advanceeoln(p, buf, sz, pos, 1);          advanceeoln(p, buf, sz, pos, 1);
         parseto(p, buf, sz, pos, "display");          parseto(p, buf, sz, pos, "display");
Line 1188  doexample(struct texi *p, enum texicmd cmd, 
Line 1184  doexample(struct texi *p, enum texicmd cmd, 
 {  {
         const char      *blk;          const char      *blk;
   
         if (p->outmacro)  
                 texierr(p, "example in open line scope!?");  
         else if (p->literal)  
                 texierr(p, "example in a literal scope!?");  
   
         blk = TEXICMD_EXAMPLE == cmd ?  "example" : "smallexample";          blk = TEXICMD_EXAMPLE == cmd ?  "example" : "smallexample";
   
         teximacro(p, ".Bd -literal");          teximacro(p, ".Bd -literal");
Line 1366  dosubsection(struct texi *p, enum texicmd cmd, 
Line 1357  dosubsection(struct texi *p, enum texicmd cmd, 
                 const char *buf, size_t sz, size_t *pos)                  const char *buf, size_t sz, size_t *pos)
 {  {
   
         if (p->outmacro)  
                 texierr(p, "subsubsection in open line scope!?");  
         else if (p->literal)  
                 texierr(p, "subsubsection in a literal scope!?");  
   
         teximacro(p, ".Pp");          teximacro(p, ".Pp");
         parseeoln(p, buf, sz, pos);          parseeoln(p, buf, sz, pos);
         teximacro(p, ".Pp");          teximacro(p, ".Pp");
Line 1396  dosp(struct texi *p, enum texicmd cmd, 
Line 1382  dosp(struct texi *p, enum texicmd cmd, 
         const char *buf, size_t sz, size_t *pos)          const char *buf, size_t sz, size_t *pos)
 {  {
   
         if (p->outmacro)  
                 texierr(p, "spacing in open line scope!?");  
         else if (p->literal)  
                 texierr(p, "spacing in a literal scope!?");  
   
         teximacro(p, ".Pp");          teximacro(p, ".Pp");
         advanceeoln(p, buf, sz, pos, 1);          advanceeoln(p, buf, sz, pos, 1);
 }  }
Line 1471  dotable(struct texi *p, enum texicmd cmd, 
Line 1452  dotable(struct texi *p, enum texicmd cmd, 
 {  {
         enum texilist   sv = p->list;          enum texilist   sv = p->list;
   
         if (p->outmacro)  
                 texierr(p, "table in open line scope!?");  
         else if (p->literal)  
                 texierr(p, "table in a literal scope!?");  
   
         p->list = TEXILIST_ITEM;          p->list = TEXILIST_ITEM;
         teximacro(p, ".Bl -tag -width Ds");          teximacro(p, ".Bl -tag -width Ds");
         parseto(p, buf, sz, pos, "table");          parseto(p, buf, sz, pos, "table");
Line 1489  doenumerate(struct texi *p, enum texicmd cmd, 
Line 1465  doenumerate(struct texi *p, enum texicmd cmd, 
 {  {
         enum texilist    sv = p->list;          enum texilist    sv = p->list;
   
         if (p->outmacro)  
                 texierr(p, "enumerate in open line scope!?");  
         else if (p->literal)  
                 texierr(p, "enumerate in a literal scope!?");  
   
         p->list = TEXILIST_NOITEM;          p->list = TEXILIST_NOITEM;
         teximacro(p, ".Bl -enum");          teximacro(p, ".Bl -enum");
         parseto(p, buf, sz, pos, "enumerate");          parseto(p, buf, sz, pos, "enumerate");
Line 1506  doitemize(struct texi *p, enum texicmd cmd, 
Line 1477  doitemize(struct texi *p, enum texicmd cmd, 
         const char *buf, size_t sz, size_t *pos)          const char *buf, size_t sz, size_t *pos)
 {  {
         enum texilist   sv = p->list;          enum texilist   sv = p->list;
   
         if (p->outmacro)  
                 texierr(p, "itemize in open line scope!?");  
         else if (p->literal)  
                 texierr(p, "itemize in a literal scope!?");  
   
         p->list = TEXILIST_ITEM;          p->list = TEXILIST_ITEM;
         teximacro(p, ".Bl -bullet");          teximacro(p, ".Bl -bullet");

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

CVSweb