This commit is contained in:
Zander Thannhauser 2025-01-26 19:31:24 -06:00
parent 4668736ce6
commit b8cece0ee0
15 changed files with 59 additions and 13 deletions

View file

@ -3,6 +3,9 @@
# true <- λ x, y: x
# false <- λ x, y: y
# there should be easy ways of inserting these special unicode math letters.
𝐼 <- λ x: x
𝑌 <- λ f: (λ x: f (x x)) (λ x: f (x x))

View file

@ -1,4 +1,6 @@
#include <assert.h>
#include <debug.h>
#include "../evaluate.h"

View file

@ -1,4 +1,6 @@
#include <assert.h>
#include <debug.h>
#include <defines/N.h>

View file

@ -1,4 +1,6 @@
#include <wchar.h>
#include "../struct.h"
struct error_expression

View file

@ -1,4 +1,5 @@
#if 0
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
@ -44,6 +45,7 @@
#include "handle_interactive.h"
#if 0
static const enum state {
s_error,
@ -112,6 +114,7 @@ static const enum state {
[s_csi]['H'] = s_home,
[s_csi]['F'] = s_end,
};
#endif
void handle_interactive(
struct environment** environment,
@ -124,6 +127,17 @@ void handle_interactive(
{
ENTER;
// use repl-main
// which seperates out the tokenizer and buffer-manager thing.
// also the input string is a seperate array.
// and somehow the error statements and expressions
// write to the buffer
TODO;
#if 0
int fd;
struct termios termios;
@ -584,6 +598,8 @@ void handle_interactive(
free(line.data);
#endif
EXIT;
}
@ -624,3 +640,4 @@ void handle_interactive(
// free result
#endif
#endif

9
main.c
View file

@ -28,7 +28,9 @@
#include <handle_string.h>
#include <handle_file.h>
#include <handle_interactive.h>
/*#include <handle_interactive.h>*/
#include <repl/main.h>
int main(int argc, char* const* argv)
{
@ -86,6 +88,10 @@ int main(int argc, char* const* argv)
case ik_interactive:
{
repl_main();
TODO;
#if 0
#ifdef RELEASE_BUILD
if (!isatty(1))
{
@ -103,6 +109,7 @@ int main(int argc, char* const* argv)
flags->test_interactive_using_input_file
#endif
);
#endif
break;
}

View file

@ -50,9 +50,9 @@ ${prefix}/13: ${objs} ${optionset} | ${prefix}/
args += --echo
args += --color
#args += --no-init
args += --no-init
args += --custom-init-path ./examples/init.txt
#args += --custom-init-path ./examples/init.txt
#args += -c '1'

View file

@ -445,8 +445,10 @@ struct statement* parse_statement(
switch (tokenizer->token->kind)
{
case tk_arrow:
case tk_colonequals:
{
TODO;
#if 0
tokenizer_next(tokenizer);
struct expression* expression =
@ -459,6 +461,7 @@ struct statement* parse_statement(
/* expression: */ expression);
free_expression(expression);
#endif
break;
}

View file

@ -14,7 +14,7 @@ enum token_kind
tk_dot,
tk_arrow,
tk_colonequals,
tk_semicolon,

View file

@ -142,6 +142,10 @@ void tokenizer_next(
{
ENTER;
// needs to keep references to all tokens.
TODO;
#if 0
if (this->put_back)
{
free_token(this->token);
@ -273,14 +277,6 @@ void tokenizer_next(
/* start position: */ start_position,
/* end position: */ end_clone);
}
else if (!wcscmp(this->rawtoken.data, L"<-"))
{
this->token = new_token(
/* kind: */ tk_arrow,
/* text: */ text,
/* start position: */ start_position,
/* end position: */ end_clone);
}
else
{
this->token = new_token(
@ -406,6 +402,7 @@ void tokenizer_next(
free_position(end_clone);
}
#endif
EXIT;
}

View file

@ -1,3 +1,6 @@
void tokenizer_next(
struct tokenizer* this);

View file

@ -122,6 +122,10 @@ srcs += ./parse/tokenizer/put_back.c
srcs += ./parse/token/free.c
srcs += ./parse/token/inc.c
srcs += ./parse/token/new.c
srcs += ./repl/main.c
srcs += ./repl/tokenizer/free.c
srcs += ./repl/tokenizer/new.c
srcs += ./repl/tokenizer/next.c
srcs += ./statement/assignment/execute.c
srcs += ./statement/assignment/free.c
srcs += ./statement/assignment/inheritance.c

View file

@ -1,4 +1,6 @@
#include <assert.h>
#include <stddef.h>
#include <debug.h>

View file

@ -1,4 +1,6 @@
#include <assert.h>
#include <debug.h>
#include <statement/prettyprint.h>

View file

@ -1,4 +1,6 @@
#include <wchar.h>
#include "../struct.h"
struct error_statement