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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=215766

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
%}