sh: Pass multiple bytes at a time to lex.

This speeds up the expansion/arith6.0 test considerably.
This commit is contained in:
Jilles Tjoelker 2010-11-23 20:46:06 +00:00
parent c4779c39ab
commit 0bee28331e

View File

@ -53,7 +53,15 @@ int yylex(void);
#undef YY_INPUT
#define YY_INPUT(buf,result,max) \
result = (*buf = *arith_buf++) ? 1 : YY_NULL;
do { \
result = strnlen(arith_buf, max); \
if (result == 0) \
result = YY_NULL; \
else { \
memcpy(buf, arith_buf, result); \
arith_buf += result; \
} \
} while (0);
#define YY_NO_UNPUT
#define YY_NO_INPUT
%}