aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorc+12023-05-18 14:47:19 -0400
committerc+12023-05-18 14:47:19 -0400
commit9c78e75eb59da9c7fb8fbdd5b536ab1b22727859 (patch)
tree167ef01529b3b67733c0edfcc3e0653355910666
parent0e6a987ed476ffa4c7deba189b1e25cccf449ba4 (diff)
hella formatting
-rw-r--r--src/include/lexer.h68
1 files changed, 30 insertions, 38 deletions
diff --git a/src/include/lexer.h b/src/include/lexer.h
index b84cea6..6d9dff8 100644
--- a/src/include/lexer.h
+++ b/src/include/lexer.h
@@ -13,50 +13,42 @@ typedef struct LEXER_STRUC {
// constructor / destroyer
-extern lexer_t* lexer_init(char* content);
-extern void lexer_destroy(lexer_t* lexer);
+extern lexer_t* lexer_init (char* content);
+extern void lexer_destroy (lexer_t* lexer);
// advance the lexer
-extern void lexer_next(lexer_t* lexer);
-extern void lexer_pass(lexer_t* lexer);
-extern token_t* lexer_get_next_token(lexer_t* lexer);
-extern token_t* lexer_next_token(lexer_t* lexer, token_t* token);
-extern char* lexer_get_c_as_string(lexer_t* lexer);
+extern void lexer_next (lexer_t* lexer);
+extern void lexer_pass (lexer_t* lexer);
+extern int lexer_is_valid (lexer_t* lexer);
+extern token_t* lexer_get_next_token (lexer_t* lexer);
+extern token_t* lexer_next_token (lexer_t* lexer, token_t* token);
+extern char* lexer_get_c_as_string (lexer_t* lexer);
// collectors
-extern token_t* lexer_get_array(lexer_t* lexer);
-extern token_t* lexer_get_string(lexer_t* lexer);
-extern token_t* lexer_get_comment(lexer_t* lexer);
+extern token_t* lexer_get_array (lexer_t* lexer);
+extern token_t* lexer_get_string (lexer_t* lexer);
+extern token_t* lexer_get_comment (lexer_t* lexer);
// def collectors
-extern token_t* lexer_get_directive(lexer_t* lexer);
-extern token_t* lexer_get_keyword(lexer_t* lexer);
-extern token_t* lexer_get_def(lexer_t* lexer);
-
-// <mut:?><type:><name>=<value?>
- // get the definition
- extern token_t* lexer_get_def(lexer_t* lexer);
- // looks for mut: or immut:
- extern token_t* lexer_get_def_mutability(lexer_t* lexer);
- // get the type of the definition, with syntax <type>:
- extern token_t* lexer_get_def_type(lexer_t* lexer);
- // get the name of the definition
- extern token_t* lexer_det_def_name(lexer_t* lexer);
- // calls either get_def_var or get_def_fn
- extern token_t* lexer_get_def_deftype(lexer_t* lexer);
-
-// get a var def
-extern token_t* lexer_get_def_var(lexer_t* lexer);
-// get the var value
-extern token_t* lexer_get_var_value(lexer_t* lexer);
-
-// get a fn def
-extern token_t* lexer_get_fn_def(lexer_t* lexer);
-// get the fn args -- calls get get_def_mut and get_def_type and get_def_name
-// for each
-extern token_t* lexer_get_fn_args(lexer_t* lexer);
-// get the fn body
-extern token_t* lexer_get_fn_body(lexer_t* lexer);
+extern token_t* lexer_get_directive (lexer_t* lexer);
+extern token_t* lexer_get_keyword (lexer_t* lexer);
+extern token_t* lexer_get_def (lexer_t* lexer);
+
+// <mutability:?><type:><name>=<value?>
+extern token_t* lexer_get_def (lexer_t* lexer); // get the definition
+extern token_t* lexer_get_def_mutability (lexer_t* lexer); // look for mut: or immut: (optional, default immut)
+extern token_t* lexer_get_def_type (lexer_t* lexer); // get the def type (required)
+extern token_t* lexer_det_def_name (lexer_t* lexer); // get the def name (required)
+extern token_t* lexer_get_def_deftype (lexer_t* lexer); // get the deftype, either var or fn (ie checks for a . after the def name)
+
+// var def methods
+extern token_t* lexer_get_def_var (lexer_t* lexer);
+extern token_t* lexer_get_var_value (lexer_t* lexer); // get the variable value (optional, default null)
+
+// fn def methods
+extern token_t* lexer_get_fn_def (lexer_t* lexer);
+extern token_t* lexer_get_fn_args (lexer_t* lexer); // get the function args (optional, default empty)
+extern token_t* lexer_get_fn_body (lexer_t* lexer); // get the function body (required)
#endif