~lbnz/xr0

868d45a53d99d9c44e29f6870e848a18a1b9bbc9 — Xr0 Team 7 months ago a64f2ef
chore: refactor state module file structure
todo: https://todo.sr.ht/~lbnz/xr0/11
4 files changed, 20 insertions(+), 15 deletions(-)

M include/state.h
M src/state/heap.c
A src/state/intern.h
M src/state/location.c
M include/state.h => include/state.h +1 -14
@@ 91,22 91,9 @@ bool
state_equal(struct state *s1, struct state *s2);


/* INTERNALLY USED */
/* USED BY VALUE */

struct location;
struct object;

struct object *
state_get(struct state *state, struct location *loc, bool constructive);

struct block *
state_getblock(struct state *state, struct location *loc);

bool
state_references(struct state *s, struct location *loc);


/* USED BY VALUE */

struct location *
location_copy(struct location *);

M src/state/heap.c => src/state/heap.c +1 -0
@@ 5,6 5,7 @@
#include "ast.h"
#include "block.h"
#include "heap.h"
#include "intern.h"
#include "location.h"
#include "math.h"
#include "object.h"

A src/state/intern.h => src/state/intern.h +16 -0
@@ 0,0 1,16 @@
#ifndef XR0_STATE_INTERN_H
#define XR0_STATE_INTERN_H

struct location;
struct object;

struct object *
state_get(struct state *state, struct location *loc, bool constructive);

struct block *
state_getblock(struct state *state, struct location *loc);

bool
state_references(struct state *s, struct location *loc);

#endif

M src/state/location.c => src/state/location.c +2 -1
@@ 5,10 5,11 @@
#include "ast.h"
#include "block.h"
#include "heap.h"
#include "state.h"
#include "intern.h"
#include "location.h"
#include "object.h"
#include "stack.h"
#include "state.h"
#include "util.h"
#include "value.h"