summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Langley <mightyjo@gmail.com>2021-06-09 21:13:14 -0400
committerJoseph Langley <mightyjo@gmail.com>2021-06-09 21:46:01 -0400
commit50819bb82a87e4e310690ce5a90ab798c50e2093 (patch)
tree36148c47af04a8163e8496575d7192794ff2f15f
parent1d128474a79a1e781a67076c751ab773c11c65e2 (diff)
downloadflex-git-50819bb82a87e4e310690ce5a90ab798c50e2093.tar.gz
fix(skel): Fix porting errors from the cpp to the c99 and go skeletons.
-rwxr-xr-xsrc/c99-flex.skl1
-rwxr-xr-xsrc/go-flex.skl6
2 files changed, 5 insertions, 2 deletions
diff --git a/src/c99-flex.skl b/src/c99-flex.skl
index 9f48e3c..18af12b 100755
--- a/src/c99-flex.skl
+++ b/src/c99-flex.skl
@@ -2415,6 +2415,7 @@ m4_ifdef( [[M4_MODE_USES_REJECT]],
[[
yyscanner->yy_state_buf = 0;
yyscanner->yy_state_ptr = 0;
+ yyscanner->yy_state_buf_max = 0;
yyscanner->yy_full_match = 0;
yyscanner->yy_lp = 0;
]])
diff --git a/src/go-flex.skl b/src/go-flex.skl
index 9eb42d4..f05bb51 100755
--- a/src/go-flex.skl
+++ b/src/go-flex.skl
@@ -198,7 +198,7 @@ m4_define([[YY_STATE_EOF]], [[YY_END_OF_BUFFER + $1 + 1]])
* plus the start state, plus the two end-of-buffer byte states.
*/
m4_define([[YY_STATE_BUF_EXTRA_SPACE]], [[3]])
-m4_define([[YY_STATE_BUF_SIZE]], [[(YY_BUF_SIZE + YY_STATE_BUF_EXTRA_SPACE)]])
+m4_define([[YY_STATE_BUF_SIZE]], [[(flexInputBufferSize + YY_STATE_BUF_EXTRA_SPACE)]])
const bool FLEX_DEBUG = m4_ifdef([[M4_MODE_DEBUG]], [[true]], [[false]]);
@@ -449,6 +449,7 @@ m4_ifdef([[M4_MODE_YYTEXT_IS_ARRAY]], [[
m4_ifdef([[M4_MODE_USES_REJECT]], [[
yyStateType *yyStateBuf;
yyStateType *yyStatePtr;
+ size_t yyStateBufMax;
char *yyFullMatch;
int yyLp;
m4_ifdef([[M4_MODE_VARIABLE_TRAILING_CONTEXT_RULES]], [[m4_dnl
@@ -1473,7 +1474,7 @@ m4_ifdef( [[M4_MODE_USES_REJECT]], [[
*/
if ( yyscanner->yyStateBufMax < (yy_current_buffer(yyscanner)->yyInputBufSize + YY_STATE_BUF_EXTRA_SPACE) ) {
newSize = yy_current_buffer(yyscanner)->yyInputBufSize + YY_STATE_BUF_EXTRA_SPACE;
- newStateBuf = (yyStateType *)yyrealloc( yyscanner->yyStateBuf, (new_size * sizeof(yyStateType)), yyscanner );
+ newStateBuf = (yyStateType *)yyrealloc( yyscanner->yyStateBuf, (newSize * sizeof(yyStateType)), yyscanner );
if ( newStateBuf == NULL ) {
yypanic( "out of dynamic memory in yylex()", yyscanner );
@@ -2264,6 +2265,7 @@ m4_ifdef([[M4_MODE_USES_REJECT]],
[[
yyscanner->yyStateBuf = NULL;
yyscanner->yyStatePtr = NULL;
+ yyscanner->yyStateBufMax = 0;
yyscanner->yyFullMatch = NULL;
yyscanner->yyLp = 0;
]])