switch (ch)
{
case '[':
+ nextch = lex_getch(lex);
+ if (nextch == '[') {
+ lex_tokench(lex, nextch);
+ lex_endtoken(lex);
+ return (lex->tok.ttype = TOKEN_ATTRIBUTE_OPEN);
+ }
+ lex_ungetch(lex, nextch);
+ /* FALL THROUGH */
case '(':
case ':':
case '?':
return (lex->tok.ttype = ch);
else
return (lex->tok.ttype = TOKEN_OPERATOR);
+
+ case ']':
+ nextch = lex_getch(lex);
+ if (nextch == ']') {
+ lex_tokench(lex, nextch);
+ lex_endtoken(lex);
+ return (lex->tok.ttype = TOKEN_ATTRIBUTE_CLOSE);
+ }
+ lex_ungetch(lex, nextch);
+ /* FALL THROUGH */
case ')':
case ';':
case '{':
case '}':
- case ']':
case '#':
lex_tokench(lex, ch);
TOKEN_DOTS, /* 3 dots, ... */
+ TOKEN_ATTRIBUTE_OPEN, /* [[ */
+ TOKEN_ATTRIBUTE_CLOSE, /* ]] */
+
TOKEN_STRINGCONST, /* not the typename but an actual "string" */
TOKEN_CHARCONST,
TOKEN_VECTORCONST,