diff --git a/ChangeLog b/ChangeLog index 1003f8af1..e6e68be2c 100644 --- a/ChangeLog +++ b/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 diff --git a/src/xspice/cmpp/mod_lex.l b/src/xspice/cmpp/mod_lex.l index b31b9c0e7..053caa3b8 100755 --- a/src/xspice/cmpp/mod_lex.l +++ b/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;}