Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
RS2007 committed Aug 4, 2023
1 parent 37d8525 commit a75dfd2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Current progress

- Function interpreter with support for function calls,operator precedence, closures and higher order functions

## Demonstration

## TODO

- [ ] adding support for strings and arrays
- [ ] adding support for hashmaps/hashtables
- [ ] build a bytecode compiler
2 changes: 1 addition & 1 deletion format.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/bash
#!/usr/bin/env bash
find . -iname *.h -o -iname *.c | xargs clang-format -i
3 changes: 2 additions & 1 deletion src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ statement_t *parse_block_statement(parser_t *parser) {

next_token_parser(parser);
// actual parsing
while (!is_curr_token(parser, RBRACE) && !is_curr_token(parser, END_OF_FILE)) {
while (!is_curr_token(parser, RBRACE) &&
!is_curr_token(parser, END_OF_FILE)) {
statement_t *statement = parse_statement(parser);
if (statement != NULL) {
push_statements_block_statement(block_statement, statement);
Expand Down
8 changes: 4 additions & 4 deletions src/repl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
#include "object.h"
#include "parser.h"
#include "utils.h"
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>

void quit(){
void quit() {
printf("\nExiting from the repl....\n");
exit(0);
}

int main(void) {
signal(SIGINT,quit);
signal(SIGINT, quit);
environment_t *env = new_environment();
while (1) {
char user_input[STRING_MAX_SIZE];
user_input[0] = '\0';
printf(">>");
printf(">>>");
fgets(user_input, STRING_MAX_SIZE, stdin);
if (strcmp(user_input, "quit\n") == 0) {
quit();
Expand Down

0 comments on commit a75dfd2

Please sign in to comment.