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 5a85abf302c4307b837c9866095112f8c48823aa
Author: swagtoy <m...@ow.swag.toys>
AuthorDate: Tue Nov 12 12:57:56 2024 -0500
lexer: Basic lex enums
---
escript/include/lexer.h | 43 ++++++++++++++++++++++++++++++++++++++++++-
escript/src/lexer.c | 8 +++++++-
2 files changed, 49 insertions(+), 2 deletions(-)
diff --git a/escript/include/lexer.h b/escript/include/lexer.h
index c1ff814..65eacfc 100644
--- a/escript/include/lexer.h
+++ b/escript/include/lexer.h
@@ -5,19 +5,60 @@
#ifndef ESCRIPT_LEXER_H
#define ESCRIPT_LEXER_H
#include <stddef.h>
+#include "eina_array.h"
+
+enum Escript_Lex_Types
+{
+ ELEXT_STRING,
+ ELEXT_BOOL,
+ ELEXT_ARRAY,
+ ELEXT_INT,
+ ELEXT_DOUBLE,
+ ELEXT_NULL,
+};
enum Escript_Lex_Keywords
{
ELEX_WHILE,
ELEX_IF,
+ ELEX_UNLESS,
ELEX_DO,
ELEX_FUN,
ELEX_TYPE,
+
+ ELEX_VAR,
+ ELEX_COMMAND,
+ ELEX_FUNCTION,
+ ELEX_FUNCTION_DECL,
+
+ // syntactical
+ ELEX_PAREN_BEGIN,
+ ELEX_PAREN_END,
+ ELEX_QUOTE, // the ' operator for Lisp-like stuff
+ ELEX_STR_QUOTE,
+ ELEX_STR_SINGLEQUOTE,
+ ELEX_BLOCK_BEGIN,
+ ELEX_BLOCK_END,
+ ELEX_SEMICOLON,
+ ELEX_COLON,
+ ELEX_ASSIGN, // =
+ ELEX_SIGIL, // $ before a variable
+ ELEX_CONDITIONAL, // ? :
+
+ // comparison
+ ELEX_COMP_EQ, // ==
+ ELEX_COMP_NEQ, // !=
+ ELEX_COMP_LT, // <
+ ELEX_COMP_GT, // >
+ ELEX_COMP_LTEQ, // <=
+ ELEX_COMP_GTEQ, // >=
+ ELEX_COMP_SPACESHIP, // <=>
};
struct Escript_Lexer
{
- int stub;
+ char* current;
+ Eina_Array* lex;
};
int escript_lexer_init(struct Escript_Lexer* lex);
diff --git a/escript/src/lexer.c b/escript/src/lexer.c
index 73536c5..61e0b8f 100644
--- a/escript/src/lexer.c
+++ b/escript/src/lexer.c
@@ -7,16 +7,22 @@
#include <stdio.h>
#include <string.h>
#include "lexer.h"
+#include "eina_array.h"
int
escript_lexer_init(struct Escript_Lexer* lex)
{
}
+static char const*
+next_char(char const* str)
+{
+
+}
+
int
escript_lexer_lex(struct Escript_Lexer* lex, char const* string, size_t string_len)
{
- puts(string);
}
void
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.