This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository eshell.
View the commit online.
commit 6cbf86baf7a952ce4024af81d0b07974eb4d01a9
Author: swagtoy <m...@ow.swag.toys>
AuthorDate: Tue Nov 12 19:47:25 2024 -0500
lexer: Next function
---
escript/include/lexer.h | 4 +++-
escript/src/lexer.c | 18 +++++++++++++++++-
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/escript/include/lexer.h b/escript/include/lexer.h
index 79188a5..4afeed5 100644
--- a/escript/include/lexer.h
+++ b/escript/include/lexer.h
@@ -60,6 +60,7 @@ enum Escript_Lex_Keywords
ELEX_MINUS,
ELEX_DIVIDE,
ELEX_MULTIPLY,
+ // I debated adding these in, but I think they can be convenient, so it won't hurt.
ELEX_FLOORDIVIDE,
ELEX_POW,
@@ -74,7 +75,8 @@ enum Escript_Lex_Keywords
struct Escript_Lexer
{
- char* current;
+ char const* current;
+ size_t current_len;
Eina_Array* lex;
};
diff --git a/escript/src/lexer.c b/escript/src/lexer.c
index 61e0b8f..27d600b 100644
--- a/escript/src/lexer.c
+++ b/escript/src/lexer.c
@@ -15,14 +15,30 @@ escript_lexer_init(struct Escript_Lexer* lex)
}
static char const*
-next_char(char const* str)
+next_char(struct Escript_Lexer* lex)
{
+ lex->current_len--;
+ return lex->current++;
+}
+
+
+static char const*
+next_nb(struct Escript_Lexer* lex)
+{
+ for (;;)
+ {
+ char const* x = next_char(lex);
+ if (*x != ' ' || *x != '\t')
+ break;
+ }
+ return lex->current;
}
int
escript_lexer_lex(struct Escript_Lexer* lex, char const* string, size_t string_len)
{
+ lex->current = next_char(lex);
}
void
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.