mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 13:57:32 +02:00
lexical #5/6, cleanup
This commit is contained in:
@@ -22,8 +22,8 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
|||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__MINGW32__) && !defined(_MSC_VER)
|
|
||||||
/* MW. Linux has TIOCSTI, so we include all headers here */
|
/* MW. Linux has TIOCSTI, so we include all headers here */
|
||||||
|
#if !defined(__MINGW32__) && !defined(_MSC_VER)
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -94,15 +94,14 @@ static int numeofs = 0;
|
|||||||
|
|
||||||
|
|
||||||
/* CDHW Debug function */
|
/* CDHW Debug function */
|
||||||
|
/* CDHW used to perform function of set echo */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pwlist_echo( /*CDHW used to perform function of set echo */
|
pwlist_echo(wordlist *wlist, char *name)
|
||||||
wordlist *wlist,
|
|
||||||
char *name)
|
|
||||||
{
|
{
|
||||||
wordlist *wl;
|
wordlist *wl;
|
||||||
|
|
||||||
if (!cp_echo || cp_debug) /* cpdebug prints the same info */
|
if (!cp_echo || cp_debug)
|
||||||
return;
|
return;
|
||||||
fprintf(cp_err, "%s ", name);
|
fprintf(cp_err, "%s ", name);
|
||||||
for (wl = wlist; wl; wl = wl->wl_next)
|
for (wl = wlist; wl; wl = wl->wl_next)
|
||||||
@@ -121,10 +120,11 @@ cp_lexer(char *string)
|
|||||||
char buf[NEW_BSIZE_SP], linebuf[NEW_BSIZE_SP];
|
char buf[NEW_BSIZE_SP], linebuf[NEW_BSIZE_SP];
|
||||||
int paren;
|
int paren;
|
||||||
|
|
||||||
if (cp_inp_cur == NULL)
|
if (!cp_inp_cur)
|
||||||
cp_inp_cur = cp_in;
|
cp_inp_cur = cp_in;
|
||||||
|
|
||||||
if (!string && cp_interactive) {/* prompt for string if none is passed */
|
/* prompt for string if none is passed */
|
||||||
|
if (!string && cp_interactive) {
|
||||||
cp_ccon(TRUE);
|
cp_ccon(TRUE);
|
||||||
prompt();
|
prompt();
|
||||||
}
|
}
|
||||||
@@ -162,8 +162,8 @@ gotchar:
|
|||||||
else
|
else
|
||||||
c = '\n';
|
c = '\n';
|
||||||
}
|
}
|
||||||
if (c != EOF)
|
if (c != EOF) /* Don't need to do this really. */
|
||||||
c = strip(c); /* Don't need to do this really. */
|
c = strip(c);
|
||||||
if ((c == '\\' && DIR_TERM != '\\') || (c == '\026') /* ^V */ ) {
|
if ((c == '\\' && DIR_TERM != '\\') || (c == '\026') /* ^V */ ) {
|
||||||
c = quote(string ? *string++ : input(cp_inp_cur));
|
c = quote(string ? *string++ : input(cp_inp_cur));
|
||||||
linebuf[j++] = (char) strip(c);
|
linebuf[j++] = (char) strip(c);
|
||||||
@@ -238,7 +238,7 @@ gotchar:
|
|||||||
|
|
||||||
case '\004':
|
case '\004':
|
||||||
case EOF:
|
case EOF:
|
||||||
if (cp_interactive && !cp_nocc && (string == NULL)) {
|
if (cp_interactive && !cp_nocc && !string) {
|
||||||
if (j == 0) {
|
if (j == 0) {
|
||||||
if (cp_ignoreeof && (numeofs++ < 23)) {
|
if (cp_ignoreeof && (numeofs++ < 23)) {
|
||||||
fputs("Use \"quit\" to quit.\n", stdout);
|
fputs("Use \"quit\" to quit.\n", stdout);
|
||||||
@@ -297,7 +297,7 @@ gotchar:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
goto ldefault;
|
goto ldefault;
|
||||||
case ';': /*CDHW semicolon inside parentheses is part of expression CDHW*/
|
case ';': /* CDHW semicolon inside parentheses is part of expression */
|
||||||
if (paren > 0) {
|
if (paren > 0) {
|
||||||
buf[i++] = (char) c;
|
buf[i++] = (char) c;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user