aboutsummaryrefslogtreecommitdiff
path: root/src/parse/parse.h
blob: 2d81170c2fc6f9633c852413791c4de5338a2f2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once

// Parsing logic

#include <setjmp.h>
#include <stdint.h>

#include "../ast.h"
#include "../stdlib/files.h"

typedef struct {
    file_t *file;
    jmp_buf *on_err;
    int64_t next_lambda_id;
} parse_ctx_t;

ast_t *parse_file(const char *path, jmp_buf *on_err);
ast_t *parse(const char *str);
ast_t *parse_expression(const char *str);