Parsing a comma as an operator now - unless noop is true

This commit is contained in:
Wolfgang Bumiller 2012-07-27 13:47:01 +02:00
parent 3618d071ff
commit 64c230d222

12
lexer.c
View file

@ -464,8 +464,6 @@ int lex_do(lex_file *lex)
case '[':
case ']':
case ',':
case '#':
return (lex->tok->ttype = ch);
@ -491,12 +489,22 @@ int lex_do(lex_file *lex)
case '|':
case '^':
case '~':
case ',':
return ch;
default:
break;
}
}
if (ch == ',') {
if (!lex_tokench(lex, ch) ||
!lex_endtoken(lex))
{
return (lex->tok->ttype = TOKEN_FATAL);
}
return (lex->tok->ttype = TOKEN_OPERATOR);
}
if (ch == '+' || ch == '-' || /* ++, --, +=, -= and -> as well! */
ch == '>' || ch == '<' || /* <<, >>, <=, >= */
ch == '=' || /* == */