case '^':
case '~':
case ',':
- case '.':
case '!':
if (!lex_tokench(lex, ch) ||
!lex_endtoken(lex))
default:
break;
}
+
+ if (ch == '.')
+ {
+ if (!lex_tokench(lex, ch))
+ return (lex->tok->ttype = TOKEN_FATAL);
+ /* peak ahead once */
+ nextch = lex_getch(lex);
+ if (nextch != '.') {
+ lex_ungetch(lex, nextch);
+ if (!lex_endtoken(lex))
+ return (lex->tok->ttype = TOKEN_FATAL);
+ return (lex->tok->ttype = ch);
+ }
+ /* peak ahead again */
+ nextch = lex_getch(lex);
+ if (nextch != '.') {
+ lex_ungetch(lex, nextch);
+ lex_ungetch(lex, nextch);
+ if (!lex_endtoken(lex))
+ return (lex->tok->ttype = TOKEN_FATAL);
+ return (lex->tok->ttype = ch);
+ }
+ /* fill the token to be "..." */
+ if (!lex_tokench(lex, ch) ||
+ !lex_tokench(lex, ch) ||
+ !lex_endtoken(lex))
+ {
+ return (lex->tok->ttype = TOKEN_FATAL);
+ }
+ return (lex->tok->ttype = TOKEN_DOTS);
+ }
}
if (ch == ',' || ch == '.') {
TOKEN_KEYWORD, /* loop */
+ TOKEN_DOTS, /* 3 dots, ... */
+
TOKEN_STRINGCONST, /* not the typename but an actual "string" */
TOKEN_CHARCONST,
TOKEN_VECTORCONST,
"TOKEN_TYPENAME",
"TOKEN_OPERATOR",
"TOKEN_KEYWORD",
+ "TOKEN_DOTS",
"TOKEN_STRINGCONST",
"TOKEN_CHARCONST",
"TOKEN_VECTORCONST",