view src/ploki/run.h @ 7638:25b838ae35f6

<boily> le/rn wat/\xe1\x8a\xa2\xe1\x89\xb5\xe1\x8b\xae\xe1\x8c\xb5\xe1\x8b\xab \xe1\x8b\x8d\xe1\x88\xb5\xe1\x8c\xa5 \xe1\x8b\xa8\xe1\x88\x9a\xe1\x88\xb0\xe1\x88\xab \xe1\x8b\xa8\xe1\x88\x9d\xe1\x8c\x8d\xe1\x89\xa5 \xe1\x8a\xa0\xe1\x8b\xad\xe1\x8a\x90\xe1\x89\xb5 \xe1\x88\xb2\xe1\x88\x86\xe1\x8a\x95\xe1\x8d\xa3 \xe1\x8b\xa8\xe1\x88\x9a\xe1\x88\xb0\xe1\x88\xab\xe1\x8b\x8d\xe1\x88\x9d \xe1\x8a\xa8\xe1\x8c\xa4\xe1\x8d\x8d \xe1\x8a\x90\xe1\x8b\x8d\xe1\x8d\xa2
author HackBot
date Sun, 01 May 2016 22:44:03 +0000
parents ac0403686959
children
line wrap: on
line source

#ifndef RUN_H_
#define RUN_H_

#include "config.h"
#include "op.h"
#include "text.h"
#include "val.h"
#include "stack.h"

#include <stddef.h>

struct val *execute(const struct op *, struct val *);
ATTR_NORETURN
void run(const struct text *, size_t, char **);

struct Interp {
	struct val arg;
	struct val result;

	struct {
		struct val *argv;
		size_t argc;
	} a;
	struct {
		struct val *matches;
		size_t length, size;
	} match;
	struct {
		size_t *index;
		size_t size;
	} m_start;
	struct {
		size_t *index;
		size_t size;
	} m_end;
};
extern struct Interp Interp;

typedef struct {
	struct val *target;
	struct val content;
} save_pair;

stack_declare(save_pair, extern)
extern stack(save_pair) Saved;

void stack_store(struct val *, const struct val *);
size_t depth_get(void);
void depth_restore(size_t);

#endif /* RUN_H_ */