Skip to content

Commit

Permalink
Fix handling of len and lenof as names
Browse files Browse the repository at this point in the history
For compatibility with programs written for older Snowball versions
len and lenof stop being tokens if declared as names.  However this
code didn't work correctly if the tokeniser's name buffer didn't have
enough space for the name (i.e. 3 or 5 elements respectively).
  • Loading branch information
ojwb committed Nov 10, 2021
1 parent 5559db7 commit ec00981
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/analyser.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ static void read_names(struct analyser * a, int type) {
static const symbol c_len_lit[] = {
'l', 'e', 'n'
};
MOVE_TO_B(t->b, c_len_lit);
t->b = MOVE_TO_B(t->b, c_len_lit);
goto handle_as_name;
}
case c_lenof: {
Expand All @@ -279,7 +279,7 @@ static void read_names(struct analyser * a, int type) {
static const symbol c_lenof_lit[] = {
'l', 'e', 'n', 'o', 'f'
};
MOVE_TO_B(t->b, c_lenof_lit);
t->b = MOVE_TO_B(t->b, c_lenof_lit);
goto handle_as_name;
}
case c_name:
Expand Down

0 comments on commit ec00981

Please sign in to comment.