version 1.4, 2022/05/31 18:08:02 |
version 1.5, 2022/05/31 20:21:40 |
|
|
int maxl; /* expected length of the argument */ |
int maxl; /* expected length of the argument */ |
int argl; /* actual length of the argument */ |
int argl; /* actual length of the argument */ |
int c, i; /* for \[char...] parsing */ |
int c, i; /* for \[char...] parsing */ |
|
int valid_A; /* for \A parsing */ |
enum mandoc_esc rval; /* return value */ |
enum mandoc_esc rval; /* return value */ |
enum mandocerr err; /* diagnostic code */ |
enum mandocerr err; /* diagnostic code */ |
char esc_name; |
char esc_name; |
|
|
|
|
/* Quoted arguments */ |
/* Quoted arguments */ |
|
|
|
case 'A': |
case 'B': |
case 'B': |
case 'w': |
case 'w': |
rval = ESCAPE_EXPAND; |
rval = ESCAPE_EXPAND; |
term = '\b'; |
term = '\b'; |
break; |
break; |
case 'A': |
|
case 'D': |
case 'D': |
case 'H': |
case 'H': |
case 'L': |
case 'L': |
|
|
|
|
/* Advance to the end of the argument. */ |
/* Advance to the end of the argument. */ |
|
|
|
valid_A = 1; |
iendarg = iarg; |
iendarg = iarg; |
while (maxl > 0) { |
while (maxl > 0) { |
if (buf[iendarg] == '\0') { |
if (buf[iendarg] == '\0') { |
|
|
break; |
break; |
} |
} |
if (buf[iendarg] == buf[iesc]) { |
if (buf[iendarg] == buf[iesc]) { |
if (roff_escape(buf, ln, iendarg, |
switch (roff_escape(buf, ln, iendarg, |
&sesc, &sarg, &sendarg, &send) == ESCAPE_EXPAND) |
&sesc, &sarg, &sendarg, &send)) { |
|
case ESCAPE_EXPAND: |
goto out_sub; |
goto out_sub; |
|
case ESCAPE_UNDEF: |
|
break; |
|
default: |
|
valid_A = 0; |
|
break; |
|
} |
iendarg = iend = send; |
iendarg = iend = send; |
} else { |
} else { |
|
if (buf[iendarg] == ' ' || buf[iendarg] == '\t') |
|
valid_A = 0; |
if (maxl != INT_MAX) |
if (maxl != INT_MAX) |
maxl--; |
maxl--; |
iend = ++iendarg; |
iend = ++iendarg; |
|
|
if (resc == NULL && argl == 2 && |
if (resc == NULL && argl == 2 && |
buf[iarg] == '.' && buf[iarg + 1] == 'T') |
buf[iarg] == '.' && buf[iarg + 1] == 'T') |
rval = ESCAPE_DEVICE; |
rval = ESCAPE_DEVICE; |
|
break; |
|
case 'A': |
|
if (valid_A == 0) |
|
iendarg = iarg; |
break; |
break; |
case 'O': |
case 'O': |
switch (buf[iarg]) { |
switch (buf[iarg]) { |