aboutsummaryrefslogtreecommitdiff
path: root/src/ls_lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ls_lex.c')
-rw-r--r--src/ls_lex.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ls_lex.c b/src/ls_lex.c
index e685f37..634bd0d 100644
--- a/src/ls_lex.c
+++ b/src/ls_lex.c
@@ -125,6 +125,18 @@ ls_token_t ls_lex(ls_t * self)
}
}
+void ls_consume_to_eol(ls_t * self)
+{
+ for (;;) {
+ ls_uchar uch = ls_fetch_rel(self, 0);
+
+ if (uch == 0 || uch == '\n')
+ return;
+
+ self->_pc++;
+ }
+}
+
// --- PRIVATE FUNCTION DEFINITIONS --------------------------------------------
static ch_kind_t _ident_ch_kind(unsigned char ch)