Browse Source

frontend/parser/lexical.c, cp_lexer(), allow # and * comment

Both, whether interactive or not.
Especially for command scripts.
pre-master-46
rlar 9 years ago
parent
commit
b803b294b4
  1. 3
      src/frontend/cpitf.c
  2. 5
      src/frontend/parser/lexical.c
  3. 1
      src/include/ngspice/cpextern.h

3
src/frontend/cpitf.c

@ -220,9 +220,6 @@ ft_cpinit(void)
}
}
/* Reset this for the front end. */
cp_hash = '*';
/* set variables to read program configuration into special spinit for VS */
#ifdef _MSC_VER
#ifdef CONFIG64

5
src/frontend/parser/lexical.c

@ -54,7 +54,6 @@ bool cp_interactive = TRUE;
bool cp_bqflag = FALSE;
char *cp_promptstring = NULL;
char *cp_altprompt = NULL;
char cp_hash = '#';
static int numeofs = 0;
@ -199,9 +198,9 @@ nloop:
if ((c == EOF) && cp_bqflag)
c = '\n';
/* '#' as the first character in a line,
/* '#' or '*' as the first character in a line,
starts a comment line, drop it */
if ((c == cp_hash) && !cp_interactive && (linebuf.i == 1)) {
if ((c == '#' || c == '*') && (linebuf.i == 1)) {
if (string) {
wl_free(wlist);
tfree(buf.s);

1
src/include/ngspice/cpextern.h

@ -107,7 +107,6 @@ extern bool cp_bqflag;
extern bool cp_interactive;
extern char *cp_altprompt;
extern char *cp_promptstring;
extern char cp_hash;
extern int cp_event;
extern wordlist *cp_lexer(char *string);
extern int inchar(FILE *fp);

Loading…
Cancel
Save