mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-12-22 22:40:03 +00:00
CPunch
181ef8a18c
Objects are now separate from {} dictionaries the . operator now only indexes fields on objects, the [] operator can only be used on objects if the __index or __newindex functions are defined Additionally 4 new instructions have been added to the VM: OP_NEWDICT, OP_INDEX, OP_INCINDEX, and OP_NEWINDEX. The syntax to create a dictionary is as follows { <key> : <value>, <otherkey> : <othervalue> } eg. { "hello" : "world", "foo" : 1337 } The Lexer & Parser was extended to add the TOKEN_COLON ':' token.
48 lines
669 B
Makefile
48 lines
669 B
Makefile
# make clean && make && ./bin/cosmo
|
|
|
|
CC=clang
|
|
CFLAGS=-fPIE -Wall -O3
|
|
LDFLAGS=#-fsanitize=address
|
|
OUT=bin/cosmo
|
|
|
|
CHDR=\
|
|
src/cchunk.h\
|
|
src/cdebug.h\
|
|
src/clex.h\
|
|
src/cmem.h\
|
|
src/coperators.h\
|
|
src/cosmo.h\
|
|
src/cparse.h\
|
|
src/cstate.h\
|
|
src/cvalue.h\
|
|
src/ctable.h\
|
|
src/cvm.h\
|
|
src/cobj.h\
|
|
src/cbaselib.h\
|
|
|
|
CSRC=\
|
|
src/cchunk.c\
|
|
src/cdebug.c\
|
|
src/clex.c\
|
|
src/cmem.c\
|
|
src/coperators.c\
|
|
src/cparse.c\
|
|
src/cstate.c\
|
|
src/cvalue.c\
|
|
src/ctable.c\
|
|
src/cvm.c\
|
|
src/cobj.c\
|
|
src/cbaselib.c\
|
|
src/main.c\
|
|
|
|
COBJ=$(CSRC:.c=.o)
|
|
|
|
.c.o:
|
|
$(CC) -c $(CFLAGS) $< -o $@
|
|
|
|
$(OUT): $(COBJ) $(CHDR)
|
|
mkdir -p bin
|
|
$(CC) $(COBJ) $(LDFLAGS) -o $(OUT)
|
|
|
|
clean:
|
|
rm -rf $(COBJ) $(OUT)
|