Browse Source

allow '//' comments in xspice code models

rlar 15 years ago
parent
commit
b6aef04d26
  1. 6
      ChangeLog
  2. 17
      src/xspice/cmpp/mod_lex.l

6
ChangeLog

@ -1,3 +1,9 @@
2011-08-07 Robert Larice
* src/xspice/cmpp/mod_lex.l :
allow '//' comments in xspice code models
Bugs item #3387331 `Be careful when using "//" in codemodel sources'
https://sourceforge.net/tracker/?func=detail&atid=423915&aid=3387331&group_id=38962
2011-08-07 Robert Larice
* src/frontend/shyu.c :
fix a `strict-aliasing' warning

17
src/xspice/cmpp/mod_lex.l

@ -71,6 +71,23 @@ Z [0-9A-Za-z_]
} while (!((last_ch == '*') && (ch == '/')));
}
"//" {int ch;
ECHO; /* a comment - repeat it */
do {
#ifdef __cplusplus
ch = yyinput();
#else
ch = input();
#endif
if(ch == EOF) {
mod_yyerror ("Unterminated comment");
break;
}
fputc(ch, mod_yyout);
} while (ch != '\n');
}
ARGS {return TOK_ARGS;}
INIT {return TOK_INIT;}
ANALYSIS {return TOK_ANALYSIS;}

Loading…
Cancel
Save