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 690b0ed6fbb623205766210815a45ea4847b79df
Author: swagtoy <m...@ow.swag.toys>
AuthorDate: Sun Nov 17 18:31:27 2024 -0500
lexer: Parse a basic token
Still hate having a job
---
escript/include/lexer.h | 4 ++--
escript/src/lexer.c | 13 +++++++++++--
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/escript/include/lexer.h b/escript/include/lexer.h
index b767a02..6e118dd 100644
--- a/escript/include/lexer.h
+++ b/escript/include/lexer.h
@@ -87,9 +87,9 @@ union Escript_Token_Data
struct Escript_Token
{
- enum Escript_Lex_Keywords type; // union member
+ enum Escript_Lex_Keywords token; // union member
char unsigned is_keyword;
- union Escript_Token_Data token;
+ union Escript_Token_Data data;
};
struct Escript_Lexer
diff --git a/escript/src/lexer.c b/escript/src/lexer.c
index 4719b8e..e0d971b 100644
--- a/escript/src/lexer.c
+++ b/escript/src/lexer.c
@@ -50,6 +50,7 @@ next_nb(struct Escript_Lexer* lex)
return 0;
}
+// locale agnostic?
#define PRINTABLE_ASCII(x) (isupper(x) || islower(x))
void
@@ -64,14 +65,22 @@ lex_keyword(struct Escript_Lexer* lex)
int
escript_lexer_step(struct Escript_Lexer* lex)
{
+ struct Escript_Token token = {
+ .is_keyword = 0
+ };
+
next_nb(lex);
switch (at(0))
{
case '$': // variable sigil
-
+ token.token = ELEX_SIGIL;
+ // TODO
+ eina_inarray_push(lex->lex, &token);
+ break;
default: // Raw keyword or something
- lex_keyword(lex);
+ //lex_keyword(lex);
putchar(lex->current[0]);
+ break;
}
next_char(lex, 0);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.