mirror of
https://github.com/ccxvii/mujs.git
synced 2026-02-06 01:41:37 +08:00
Auto-generate list of operator names.
This commit is contained in:
5
Makefile
5
Makefile
@@ -15,6 +15,11 @@ build/%.o : %.c $(HDRS)
|
||||
build/libjs.a: $(OBJS)
|
||||
ar cru $@ $^
|
||||
|
||||
opnames.h : jscompile.h
|
||||
grep 'OP_' jscompile.h | sed 's/OP_/"/;s/,/",/' | tr A-Z a-z > opnames.h
|
||||
|
||||
jsdump.c : opnames.h
|
||||
|
||||
js: build/main.o build/libjs.a
|
||||
$(CC) -o $@ $^ -lm
|
||||
|
||||
|
||||
11
jsdump.c
11
jsdump.c
@@ -22,16 +22,7 @@ static const char *astname[] = {
|
||||
};
|
||||
|
||||
static const char *opname[] = {
|
||||
"const", "undef", "null", "true", "false", "this",
|
||||
"array", "arrayput",
|
||||
"object", "objectput",
|
||||
"defvar", "var", "index", "member", "load", "dupload", "store", "call", "new",
|
||||
"closure", "delete", "void", "typeof", "preinc", "postinc", "predec",
|
||||
"postdec", "pos", "neg", "bitnot", "lognot", "logor", "logand",
|
||||
"bitor", "bitxor", "bitand", "eq", "ne", "eq3", "ne3", "lt", "gt",
|
||||
"le", "ge", "instanceof", "in", "shl", "shr", "ushr", "add", "sub",
|
||||
"mul", "div", "mod", "jump", "jtrue", "jfalse", "try", "throw",
|
||||
"return", "pushwith", "popwith", "debugger", "pop",
|
||||
#include "opnames.h"
|
||||
};
|
||||
|
||||
static void pstmlist(int d, js_Ast *list);
|
||||
|
||||
Reference in New Issue
Block a user