summaryrefslogtreecommitdiff
path: root/src/ctinput.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2018-07-10 11:21:05 +0800
committerAdrian Thurston <thurston@colm.net>2018-07-10 11:21:05 +0800
commit723b9790f920360fe7947e4c9bf87db1729d20bb (patch)
tree8c4a9035900ba0fb50acb2684fe9ee4b41a39ad2 /src/ctinput.cc
parenta1202027828211d6f4c58709b8059c958b4dc83b (diff)
downloadcolm-723b9790f920360fe7947e4c9bf87db1729d20bb.tar.gz
some cleanup of eof interface
Still have two bools concerning eof. Can't unify these yet ... need break down the two concepts to try to unify.
Diffstat (limited to 'src/ctinput.cc')
-rw-r--r--src/ctinput.cc17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/ctinput.cc b/src/ctinput.cc
index b89b030c..cf4c0924 100644
--- a/src/ctinput.cc
+++ b/src/ctinput.cc
@@ -53,8 +53,8 @@ struct input_impl_ct
struct Constructor *constructor;
struct ConsItem *cons_item;
+ char eof_mark;
char eof_sent;
- char eof;
int offset;
};
@@ -240,14 +240,9 @@ void pat_undo_consume_lang_el( struct colm_program *prg, struct input_impl_ct *s
ss->offset = ss->pat_item->data.length();
}
-void ct_set_eof( struct colm_program *prg, struct input_impl_ct *si )
+void ct_set_eof_mark( struct colm_program *prg, struct input_impl_ct *si, char eof_mark )
{
- si->eof = true;
-}
-
-void ct_unset_eof( struct colm_program *prg, struct input_impl_ct *si )
-{
- si->eof = false;
+ si->eof_mark = eof_mark;
}
void ct_transfer_loc_seq( struct colm_program *prg, location_t *loc, struct input_impl_ct *ss )
@@ -275,8 +270,7 @@ input_funcs_ct pat_funcs =
0, 0, 0, 0, 0, 0, /* prepend funcs. */
0, 0, 0, 0, 0, 0, /* append funcs */
- &ct_set_eof,
- &ct_unset_eof,
+ &ct_set_eof_mark,
&ct_get_eof_sent,
&ct_set_eof_sent,
@@ -495,8 +489,7 @@ input_funcs_ct repl_funcs =
0, 0, 0, 0, 0, 0, /* prepend. */
0, 0, 0, 0, 0, 0, /* append. */
- &ct_set_eof,
- &ct_unset_eof,
+ &ct_set_eof_mark,
&ct_get_eof_sent,
&ct_set_eof_sent,