aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2015-11-22 15:26:49 -0500
committerFranklin Wei <git@fwei.tk>2015-11-22 15:26:49 -0500
commitc7c1bd7641581e2a0b84dcecdab61ed7c43268e9 (patch)
tree593dfd770a4706cd2417faf7f2c075b53b7a8a78
parentf90dc85cf0989eec61a6c9ce76842b78e2d8f46d (diff)
downloadducky-c7c1bd7641581e2a0b84dcecdab61ed7c43268e9.zip
ducky-c7c1bd7641581e2a0b84dcecdab61ed7c43268e9.tar.gz
ducky-c7c1bd7641581e2a0b84dcecdab61ed7c43268e9.tar.bz2
ducky-c7c1bd7641581e2a0b84dcecdab61ed7c43268e9.tar.xz
add input
-rwxr-xr-xexamples/right_tri.ds6
-rw-r--r--src/compile.c672
-rw-r--r--src/emitc.c11
-rw-r--r--src/interp.c278
-rw-r--r--src/opcodes.h3
-rw-r--r--src/vm.c9
6 files changed, 542 insertions, 437 deletions
diff --git a/examples/right_tri.ds b/examples/right_tri.ds
new file mode 100755
index 0000000..7a50368
--- /dev/null
+++ b/examples/right_tri.ds
@@ -0,0 +1,6 @@
+#!/bin/ducky
+PROMPT a
+PROMPT b
+LOG Length of hypotenuse:
+LOGVAR sqrt(a**2 + b**2)
+NEWLINE
diff --git a/src/compile.c b/src/compile.c
index 29cb91d..2e95092 100644
--- a/src/compile.c
+++ b/src/compile.c
@@ -941,6 +941,44 @@ static int logchar_handler(char **save)
return OK;
}
+static int input_handler(char **save)
+{
+ (void) save;
+ char *varname = strtok_r(NULL, "= \t", save);
+
+ if(varname && isValidVariable(varname))
+ {
+ int varid = get_varid(varname);
+ write_instr(READ_VAR);
+ write_varid(varid);
+ }
+ else
+ {
+ error("invalid variable name for INPUT");
+ }
+ return OK;
+}
+
+static int prompt_handler(char **save)
+{
+ (void) save;
+ char *varname = strtok_r(NULL, "= \t", save);
+
+ if(varname && isValidVariable(varname))
+ {
+ int varid = get_varid(varname);
+ vid_write(varname);
+ vid_write("? ");
+ write_instr(READ_VAR);
+ write_varid(varid);
+ }
+ else
+ {
+ error("invalid variable name for PROMPT");
+ }
+ return OK;
+}
+
#ifdef DUCKY_ROCKBOX
#define KEY_HANDLER(KEY, NAME) \
static int NAME ## _handler(char **save) \
@@ -1143,6 +1181,8 @@ static struct token_t {
{ "UPARROW", up_handler },
{ "WIN", gui_handler },
{ "WINDOWS", gui_handler },
+ { "INPUT", input_handler },
+ { "PROMPT", prompt_handler },
#else
{ "LET", let_handler, },
{ "REPEAT", repeat_handler, },
@@ -1166,6 +1206,8 @@ static struct token_t {
{ "LBL", rem_handler, },
{ "QUIT", quit_handler, },
{ "EXIT", quit_handler, },
+ { "INPUT", input_handler, },
+ { "PROMPT", prompt_handler, },
#endif
};
@@ -1178,8 +1220,8 @@ static struct token_t tokmap[TOKMAP_SIZE];
/* generated with mph 1.2 */
/*
* d=3
- * n=114
- * m=92
+ * n=116
+ * m=94
* c=1.23
* maxlen=13
* minklen=2
@@ -1187,229 +1229,229 @@ static struct token_t tokmap[TOKMAP_SIZE];
* minchar=47
* maxchar=95
* loop=0
- * numiter=15
+ * numiter=20
* seed=
*/
static int g[] = {
- 73, 52, 31, -1, 9, 51, 3, 6, 82, 8,
- 0, 39, 62, -1, 19, 65, 28, 50, 28, 86,
- 30, -1, 86, 19, 28, 28, 10, 0, -1, 4,
- 31, 35, 31, 75, 68, 38, 11, 48, 44, 83,
- 0, 75, 64, 28, 7, 75, 76, 33, 0, -1,
- 6, 9, 32, 36, 42, 55, 1, 82, 78, 20,
- 34, 7, 36, 79, 3, 80, 38, 89, 74, 69,
- 7, 0, 88, 19, 0, 50, 25, 55, 0, 45,
- 8, 78, 0, 6, 63, 39, 81, 78, 87, 46,
- 43, 0, 54, 0, 86, 72, 44, 0, 74, -1,
- 66, 0, 0, 45, 0, 85, 47, 34, 55, 55,
- -1, 60, 69, -1,
+ 0, 63, 85, 0, 25, 0, 45, 91, 38, 21,
+ 68, -1, 73, 17, 52, 45, 5, 28, 68, 71,
+ -1, 83, 63, 3, 18, 93, 56, 48, 28, 32,
+ 13, 0, 61, -1, 0, 19, 70, 43, 20, 29,
+ 64, 73, -1, 71, 67, 0, 4, 74, 35, 77,
+ 83, -1, 45, 52, -1, 46, 30, 23, 24, 78,
+ 88, 27, 71, 13, 91, 71, 34, 76, 35, 14,
+ 0, 30, 71, 48, 63, 47, 92, 8, 72, 0,
+ 2, 0, 0, 53, 7, 69, -1, 78, 78, 0,
+ 55, 93, 79, 77, 24, 0, 93, 83, -1, 47,
+ 39, -1, 60, 89, 41, 54, 1, 77, 0, 68,
+ 32, 22, 5, 0, 5, 54,
};
static int T0[] = {
- 0x5e, 0x6d, 0x2c, 0x08, 0x0b, 0x2e, 0x58, 0x3c, 0x33, 0x21,
- 0x31, 0x49, 0x64, 0x29, 0x4f, 0x20, 0x20, 0x2d, 0x49, 0x2c,
- 0x34, 0x3e, 0x0d, 0x49, 0x36, 0x1e, 0x03, 0x45, 0x24, 0x6a,
- 0x6d, 0x21, 0x65, 0x37, 0x29, 0x0e, 0x03, 0x1f, 0x4a, 0x36,
- 0x41, 0x09, 0x1d, 0x43, 0x42, 0x0b, 0x64, 0x62, 0x38, 0x2c,
- 0x3e, 0x58, 0x4b, 0x4c, 0x1b, 0x06, 0x53, 0x33, 0x3a, 0x1d,
- 0x04, 0x5a, 0x22, 0x6c, 0x5b, 0x56, 0x39, 0x55, 0x59, 0x56,
- 0x64, 0x04, 0x16, 0x03, 0x71, 0x41, 0x3f, 0x3a, 0x46, 0x57,
- 0x67, 0x13, 0x3e, 0x50, 0x5f, 0x59, 0x57, 0x50, 0x2a, 0x2f,
- 0x6d, 0x2e, 0x17, 0x2d, 0x39, 0x11, 0x22, 0x00, 0x3c, 0x01,
- 0x25, 0x0c, 0x1c, 0x49, 0x2f, 0x17, 0x0a, 0x3d, 0x01, 0x0b,
- 0x4d, 0x66, 0x4b, 0x1c, 0x62, 0x05, 0x6d, 0x05, 0x13, 0x1c,
- 0x3f, 0x55, 0x6e, 0x26, 0x49, 0x1b, 0x53, 0x39, 0x3c, 0x2d,
- 0x4a, 0x61, 0x49, 0x66, 0x48, 0x06, 0x0b, 0x52, 0x54, 0x1c,
- 0x6d, 0x2f, 0x21, 0x56, 0x5b, 0x11, 0x6c, 0x19, 0x06, 0x1b,
- 0x14, 0x27, 0x21, 0x5d, 0x68, 0x41, 0x2e, 0x30, 0x30, 0x37,
- 0x42, 0x02, 0x0b, 0x5d, 0x35, 0x66, 0x46, 0x54, 0x5a, 0x07,
- 0x15, 0x2e, 0x47, 0x36, 0x0e, 0x35, 0x54, 0x10, 0x4e, 0x5a,
- 0x3c, 0x63, 0x1f, 0x6d, 0x5e, 0x16, 0x3c, 0x2b, 0x46, 0x0a,
- 0x00, 0x26, 0x0d, 0x0b, 0x21, 0x52, 0x39, 0x59, 0x09, 0x5e,
- 0x21, 0x11, 0x15, 0x62, 0x16, 0x6e, 0x22, 0x05, 0x64, 0x22,
- 0x03, 0x4d, 0x3c, 0x13, 0x31, 0x5c, 0x11, 0x4b, 0x3e, 0x16,
- 0x43, 0x6c, 0x10, 0x0b, 0x1c, 0x0e, 0x19, 0x55, 0x05, 0x22,
- 0x51, 0x26, 0x43, 0x66, 0x16, 0x59, 0x01, 0x38, 0x5f, 0x03,
- 0x6b, 0x00, 0x60, 0x45, 0x23, 0x5b, 0x48, 0x09, 0x27, 0x24,
- 0x10, 0x26, 0x1f, 0x11, 0x2d, 0x15, 0x46, 0x3d, 0x61, 0x13,
- 0x0c, 0x48, 0x50, 0x54, 0x6a, 0x02, 0x27, 0x47, 0x01, 0x02,
- 0x58, 0x47, 0x53, 0x53, 0x4e, 0x5d, 0x3d, 0x24, 0x66, 0x02,
- 0x48, 0x14, 0x29, 0x67, 0x25, 0x66, 0x1b, 0x09, 0x32, 0x0a,
- 0x2d, 0x4e, 0x52, 0x0b, 0x47, 0x36, 0x6f, 0x3f, 0x16, 0x33,
- 0x0e, 0x6e, 0x58, 0x35, 0x15, 0x18, 0x6e, 0x28, 0x2b, 0x0a,
- 0x3f, 0x0d, 0x2c, 0x67, 0x01, 0x39, 0x57, 0x65, 0x13, 0x66,
- 0x27, 0x6f, 0x60, 0x13, 0x54, 0x36, 0x59, 0x51, 0x13, 0x6f,
- 0x22, 0x21, 0x6c, 0x08, 0x67, 0x1f, 0x21, 0x63, 0x47, 0x5c,
- 0x6e, 0x14, 0x69, 0x3c, 0x55, 0x45, 0x05, 0x6c, 0x33, 0x61,
- 0x2a, 0x69, 0x0b, 0x43, 0x6f, 0x60, 0x03, 0x22, 0x64, 0x0e,
- 0x5e, 0x1a, 0x5b, 0x07, 0x1f, 0x6a, 0x4f, 0x5e, 0x5c, 0x2b,
- 0x62, 0x62, 0x1d, 0x41, 0x2c, 0x10, 0x24, 0x41, 0x1a, 0x58,
- 0x41, 0x44, 0x5f, 0x4c, 0x16, 0x5c, 0x4b, 0x29, 0x0d, 0x4d,
- 0x37, 0x09, 0x6e, 0x32, 0x46, 0x2d, 0x3b, 0x4d, 0x38, 0x4e,
- 0x33, 0x03, 0x67, 0x07, 0x54, 0x5c, 0x6c, 0x40, 0x6b, 0x0f,
- 0x64, 0x60, 0x58, 0x37, 0x53, 0x2f, 0x63, 0x44, 0x33, 0x50,
- 0x1d, 0x71, 0x08, 0x29, 0x31, 0x4e, 0x56, 0x6c, 0x39, 0x1d,
- 0x59, 0x0a, 0x30, 0x5e, 0x22, 0x23, 0x48, 0x1c, 0x63, 0x51,
- 0x3b, 0x53, 0x0b, 0x4d, 0x30, 0x0c, 0x49, 0x11, 0x4b, 0x16,
- 0x16, 0x11, 0x46, 0x19, 0x64, 0x57, 0x40, 0x20, 0x26, 0x5c,
- 0x56, 0x32, 0x54, 0x51, 0x4c, 0x38, 0x4c, 0x49, 0x39, 0x63,
- 0x6c, 0x34, 0x55, 0x05, 0x10, 0x13, 0x21, 0x69, 0x34, 0x0a,
- 0x0d, 0x4a, 0x1b, 0x63, 0x01, 0x0e, 0x58, 0x42, 0x3e, 0x1c,
- 0x02, 0x46, 0x22, 0x61, 0x62, 0x59, 0x65, 0x58, 0x31, 0x13,
- 0x2f, 0x13, 0x0c, 0x2a, 0x25, 0x63, 0x12, 0x66, 0x3d, 0x0a,
- 0x46, 0x4f, 0x4f, 0x4c, 0x6e, 0x1e, 0x2a, 0x60, 0x68, 0x68,
- 0x60, 0x6a, 0x4c, 0x20, 0x59, 0x3c, 0x07, 0x4c, 0x22, 0x49,
- 0x70, 0x62, 0x5c, 0x1a, 0x2a, 0x20, 0x0b, 0x3c, 0x14, 0x51,
- 0x28, 0x67, 0x64, 0x13, 0x29, 0x04, 0x5b, 0x1b, 0x0f, 0x71,
- 0x50, 0x38, 0x24, 0x23, 0x62, 0x6e, 0x6b, 0x65, 0x35, 0x01,
- 0x08, 0x47, 0x49, 0x1b, 0x6d, 0x1f, 0x13, 0x3f, 0x1f, 0x26,
- 0x2f, 0x57, 0x1b, 0x21, 0x6a, 0x54, 0x35, 0x63, 0x0e, 0x55,
- 0x63, 0x5e, 0x2b, 0x25, 0x1f, 0x1c, 0x22, 0x18, 0x3e, 0x52,
- 0x1a, 0x6d, 0x03, 0x32, 0x6f, 0x3b, 0x6a, 0x52, 0x32, 0x3d,
- 0x4f, 0x22, 0x19, 0x41, 0x07, 0x02, 0x56, 0x27, 0x5c, 0x31,
- 0x55, 0x66, 0x2b, 0x58, 0x50, 0x62, 0x38, 0x50, 0x4b, 0x05,
- 0x30, 0x66, 0x00, 0x43, 0x36, 0x0d, 0x0c, 0x3e, 0x5f, 0x3e,
- 0x1a, 0x3c, 0x61, 0x33, 0x1c, 0x06, 0x45,
+ 0x20, 0x1d, 0x53, 0x44, 0x6f, 0x13, 0x22, 0x3b, 0x1f, 0x0a,
+ 0x1e, 0x3c, 0x71, 0x27, 0x5c, 0x34, 0x3f, 0x5a, 0x23, 0x0d,
+ 0x54, 0x09, 0x19, 0x46, 0x21, 0x12, 0x09, 0x55, 0x37, 0x24,
+ 0x67, 0x57, 0x42, 0x47, 0x27, 0x35, 0x5a, 0x41, 0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0x28, 0x10, 0x5d, 0x27, 0x50, 0x00, 0x50, 0x22, 0x1e, 0x2b,
+ 0x4f, 0x1f, 0x0f, 0x1c, 0x65, 0x5d, 0x2e, 0x36, 0x22, 0x20,
+ 0x32, 0x53, 0x63, 0x4c, 0x38, 0x3d, 0x5e, 0x48, 0x3c, 0x49,
+ 0x5e, 0x0f, 0x19, 0x48, 0x64, 0x5d, 0x62, 0x4f, 0x51, 0x04,
+ 0x73, 0x2c, 0x1b, 0x0e, 0x40, 0x0c, 0x63, 0x66, 0x43, 0x11,
+ 0x12, 0x6d, 0x5d, 0x01, 0x3d, 0x19, 0x36,
};
static int T1[] = {
- 0x1c, 0x1e, 0x26, 0x6a, 0x4b, 0x0d, 0x50, 0x47, 0x31, 0x56,
- 0x11, 0x22, 0x65, 0x3d, 0x09, 0x46, 0x1b, 0x29, 0x59, 0x64,
- 0x1c, 0x35, 0x19, 0x3a, 0x23, 0x46, 0x01, 0x45, 0x14, 0x45,
- 0x1e, 0x30, 0x63, 0x44, 0x38, 0x4c, 0x51, 0x16, 0x21, 0x20,
- 0x0b, 0x33, 0x42, 0x70, 0x0e, 0x4c, 0x54, 0x3a, 0x13, 0x2e,
- 0x1f, 0x59, 0x3d, 0x09, 0x35, 0x0a, 0x66, 0x6c, 0x2c, 0x5e,
- 0x38, 0x04, 0x4e, 0x38, 0x51, 0x4a, 0x37, 0x37, 0x0a, 0x63,
- 0x58, 0x0c, 0x01, 0x66, 0x36, 0x23, 0x5a, 0x36, 0x00, 0x34,
- 0x02, 0x1f, 0x2b, 0x3f, 0x39, 0x71, 0x59, 0x2d, 0x6b, 0x13,
- 0x2a, 0x32, 0x28, 0x06, 0x08, 0x07, 0x50, 0x3f, 0x05, 0x30,
- 0x3b, 0x32, 0x28, 0x4f, 0x54, 0x36, 0x0a, 0x13, 0x3f, 0x46,
- 0x1d, 0x34, 0x64, 0x6c, 0x01, 0x00, 0x1f, 0x09, 0x3f, 0x4d,
- 0x59, 0x11, 0x68, 0x55, 0x1a, 0x24, 0x15, 0x60, 0x05, 0x1b,
- 0x1e, 0x40, 0x5d, 0x47, 0x1d, 0x40, 0x0b, 0x37, 0x63, 0x5b,
- 0x0b, 0x0e, 0x2d, 0x6f, 0x08, 0x3e, 0x0d, 0x59, 0x67, 0x07,
- 0x2b, 0x5f, 0x6e, 0x6b, 0x63, 0x25, 0x45, 0x41, 0x0e, 0x1f,
- 0x32, 0x2c, 0x46, 0x36, 0x60, 0x1f, 0x13, 0x15, 0x6d, 0x4f,
- 0x07, 0x24, 0x2b, 0x03, 0x6c, 0x1f, 0x4c, 0x2e, 0x16, 0x51,
- 0x45, 0x51, 0x4e, 0x41, 0x4b, 0x3f, 0x66, 0x2e, 0x1f, 0x12,
- 0x4e, 0x61, 0x3f, 0x32, 0x25, 0x3d, 0x3e, 0x55, 0x22, 0x1c,
- 0x10, 0x51, 0x0f, 0x38, 0x0c, 0x1d, 0x69, 0x0a, 0x09, 0x64,
- 0x6d, 0x4e, 0x33, 0x32, 0x71, 0x30, 0x2b, 0x45, 0x5f, 0x71,
- 0x6f, 0x48, 0x62, 0x32, 0x28, 0x58, 0x66, 0x66, 0x3b, 0x16,
- 0x20, 0x4c, 0x68, 0x40, 0x12, 0x02, 0x6d, 0x19, 0x1c, 0x04,
- 0x0b, 0x17, 0x63, 0x3f, 0x4a, 0x08, 0x1f, 0x17, 0x4c, 0x53,
- 0x55, 0x4a, 0x1c, 0x4c, 0x48, 0x11, 0x5e, 0x32, 0x26, 0x18,
- 0x43, 0x10, 0x35, 0x46, 0x2b, 0x1a, 0x64, 0x66, 0x6f, 0x69,
- 0x1c, 0x13, 0x33, 0x4b, 0x5c, 0x1c, 0x54, 0x19, 0x34, 0x2e,
- 0x6d, 0x27, 0x06, 0x27, 0x01, 0x5e, 0x48, 0x70, 0x1e, 0x6e,
- 0x26, 0x00, 0x0d, 0x5b, 0x34, 0x19, 0x56, 0x56, 0x30, 0x62,
- 0x0f, 0x43, 0x69, 0x50, 0x4c, 0x4c, 0x2d, 0x3e, 0x2b, 0x5b,
- 0x29, 0x52, 0x5a, 0x43, 0x33, 0x1d, 0x05, 0x34, 0x61, 0x09,
- 0x59, 0x6a, 0x48, 0x07, 0x6d, 0x0b, 0x21, 0x51, 0x71, 0x61,
- 0x51, 0x0e, 0x32, 0x49, 0x6e, 0x1d, 0x33, 0x29, 0x6b, 0x5f,
- 0x22, 0x23, 0x3f, 0x07, 0x3f, 0x48, 0x56, 0x5a, 0x55, 0x16,
- 0x1b, 0x71, 0x04, 0x56, 0x5a, 0x0e, 0x08, 0x21, 0x3f, 0x6e,
- 0x36, 0x04, 0x5c, 0x20, 0x3a, 0x56, 0x36, 0x62, 0x0f, 0x2f,
- 0x2a, 0x48, 0x05, 0x32, 0x4f, 0x54, 0x18, 0x44, 0x4d, 0x6e,
- 0x5a, 0x68, 0x0b, 0x5e, 0x5d, 0x65, 0x0b, 0x65, 0x24, 0x5a,
- 0x71, 0x6a, 0x1a, 0x3c, 0x11, 0x0a, 0x2b, 0x41, 0x3f, 0x04,
- 0x64, 0x18, 0x25, 0x47, 0x05, 0x45, 0x27, 0x15, 0x3f, 0x56,
- 0x6c, 0x61, 0x1e, 0x42, 0x46, 0x17, 0x14, 0x5b, 0x71, 0x4b,
- 0x19, 0x5b, 0x1b, 0x43, 0x36, 0x2c, 0x4d, 0x61, 0x0c, 0x1b,
- 0x03, 0x70, 0x43, 0x28, 0x45, 0x48, 0x6e, 0x0b, 0x6d, 0x4b,
- 0x61, 0x34, 0x62, 0x6c, 0x3c, 0x33, 0x50, 0x29, 0x3b, 0x52,
- 0x5b, 0x56, 0x48, 0x59, 0x10, 0x04, 0x1a, 0x19, 0x54, 0x5a,
- 0x21, 0x38, 0x5a, 0x45, 0x5b, 0x31, 0x31, 0x4b, 0x42, 0x55,
- 0x27, 0x09, 0x17, 0x27, 0x03, 0x64, 0x6a, 0x64, 0x2b, 0x33,
- 0x44, 0x14, 0x18, 0x1a, 0x0b, 0x38, 0x2e, 0x25, 0x51, 0x20,
- 0x6e, 0x52, 0x19, 0x11, 0x1c, 0x4b, 0x29, 0x59, 0x38, 0x47,
- 0x0f, 0x5c, 0x2d, 0x58, 0x6b, 0x48, 0x2b, 0x59, 0x23, 0x34,
- 0x3d, 0x4a, 0x3c, 0x34, 0x70, 0x43, 0x1a, 0x23, 0x01, 0x62,
- 0x62, 0x0e, 0x52, 0x09, 0x1f, 0x0c, 0x55, 0x59, 0x65, 0x2b,
- 0x2e, 0x13, 0x25, 0x6c, 0x09, 0x2e, 0x52, 0x44, 0x15, 0x43,
- 0x62, 0x2c, 0x06, 0x65, 0x5e, 0x3a, 0x4b, 0x6b, 0x10, 0x34,
- 0x6c, 0x1d, 0x4a, 0x6d, 0x45, 0x2c, 0x4a, 0x05, 0x27, 0x63,
- 0x69, 0x32, 0x2c, 0x49, 0x62, 0x4f, 0x1c, 0x68, 0x67, 0x65,
- 0x3a, 0x68, 0x30, 0x50, 0x5b, 0x1c, 0x18, 0x35, 0x26, 0x38,
- 0x07, 0x20, 0x55, 0x62, 0x2b, 0x38, 0x2c, 0x14, 0x63, 0x0e,
- 0x56, 0x15, 0x6b, 0x07, 0x6c, 0x54, 0x64, 0x2b, 0x2d, 0x05,
- 0x50, 0x60, 0x32, 0x2c, 0x48, 0x59, 0x45, 0x3e, 0x56, 0x71,
- 0x33, 0x3f, 0x35, 0x62, 0x61, 0x68, 0x6e, 0x0c, 0x10, 0x6f,
- 0x2a, 0x66, 0x23, 0x23, 0x0c, 0x1d, 0x06, 0x0e, 0x58, 0x43,
- 0x13, 0x36, 0x31, 0x46, 0x00, 0x18, 0x3d,
+ 0x3c, 0x14, 0x6e, 0x56, 0x1e, 0x3b, 0x13, 0x66, 0x13, 0x69,
+ 0x5f, 0x73, 0x42, 0x1b, 0x55, 0x3d, 0x68, 0x42, 0x0d, 0x63,
+ 0x04, 0x60, 0x64, 0x3c, 0x17, 0x29, 0x4c, 0x02, 0x13, 0x0c,
+ 0x4a, 0x4f, 0x20, 0x44, 0x2a, 0x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, 0x57, 0x6b,
+ 0x70, 0x1d, 0x5a, 0x13, 0x4b, 0x0d, 0x59, 0x66, 0x3a, 0x34,
+ 0x19, 0x60, 0x02, 0x63, 0x1f, 0x69, 0x52, 0x28, 0x4b, 0x67,
+ 0x0b, 0x14, 0x1c, 0x3d, 0x5f, 0x1b, 0x36, 0x6e, 0x4e, 0x07,
+ 0x16, 0x1a, 0x65, 0x2e, 0x5f, 0x23, 0x6b, 0x41, 0x56, 0x29,
+ 0x01, 0x6f, 0x0e, 0x70, 0x5e, 0x2d, 0x5d, 0x34, 0x55, 0x35,
+ 0x1f, 0x58, 0x41, 0x3b, 0x21, 0x2c, 0x4f,
};
static int T2[] = {
- 0x48, 0x48, 0x68, 0x71, 0x09, 0x2e, 0x0e, 0x07, 0x11, 0x3c,
- 0x1b, 0x04, 0x11, 0x63, 0x1f, 0x07, 0x46, 0x54, 0x44, 0x64,
- 0x49, 0x57, 0x22, 0x40, 0x1f, 0x3d, 0x08, 0x63, 0x3b, 0x4a,
- 0x58, 0x11, 0x21, 0x4e, 0x10, 0x3a, 0x1a, 0x1e, 0x41, 0x3b,
- 0x6b, 0x6c, 0x50, 0x1a, 0x5d, 0x6f, 0x22, 0x41, 0x62, 0x54,
- 0x22, 0x06, 0x4d, 0x29, 0x18, 0x00, 0x5f, 0x12, 0x53, 0x3a,
- 0x61, 0x12, 0x19, 0x27, 0x4b, 0x22, 0x16, 0x4b, 0x01, 0x15,
- 0x00, 0x5b, 0x57, 0x0b, 0x36, 0x5d, 0x4c, 0x59, 0x29, 0x19,
- 0x4b, 0x5c, 0x2f, 0x27, 0x23, 0x47, 0x37, 0x10, 0x59, 0x18,
- 0x4a, 0x58, 0x2a, 0x02, 0x1e, 0x13, 0x24, 0x34, 0x25, 0x4f,
- 0x36, 0x1b, 0x3f, 0x66, 0x2f, 0x12, 0x35, 0x1f, 0x5c, 0x6b,
- 0x49, 0x42, 0x26, 0x02, 0x0b, 0x0b, 0x1d, 0x39, 0x19, 0x2e,
-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x30, 0x6f, 0x07, 0x12, 0x5e, 0x58, 0x20, 0x6a, 0x10,
- 0x5f, 0x24, 0x02, 0x5e, 0x5d, 0x61, 0x58, 0x0d, 0x3c, 0x38,
- 0x1e, 0x09, 0x58, 0x27, 0x5f, 0x10, 0x02, 0x24, 0x6c, 0x59,
- 0x6e, 0x26, 0x17, 0x6b, 0x3d, 0x39, 0x67, 0x33, 0x59, 0x5f,
- 0x53, 0x57, 0x22, 0x30, 0x56, 0x42, 0x2f, 0x42, 0x37, 0x03,
- 0x5b, 0x35, 0x2c, 0x27, 0x43, 0x5d, 0x07, 0x2b, 0x22, 0x5c,
- 0x32, 0x57, 0x15, 0x3c, 0x4f, 0x3c, 0x11, 0x2c, 0x46, 0x07,
- 0x17, 0x61, 0x44, 0x0f, 0x1f, 0x38, 0x51, 0x5e, 0x09, 0x27,
- 0x61, 0x02, 0x6c, 0x2b, 0x39, 0x3e, 0x27, 0x40, 0x69, 0x49,
- 0x2a, 0x39, 0x6f, 0x5f, 0x3d, 0x1f, 0x49, 0x6f, 0x5e, 0x2a,
- 0x6d, 0x13, 0x61, 0x4f, 0x16, 0x6d, 0x35, 0x24, 0x67, 0x66,
- 0x28, 0x04, 0x3d, 0x03, 0x11, 0x6c, 0x0b, 0x65, 0x2a, 0x69,
- 0x05, 0x56, 0x5b, 0x12, 0x53, 0x36, 0x31, 0x2a, 0x43, 0x2d,
- 0x65, 0x3e, 0x40, 0x54, 0x2b, 0x56, 0x5f, 0x61, 0x08, 0x65,
- 0x65, 0x22, 0x57, 0x33, 0x32, 0x2d, 0x46, 0x3e, 0x08, 0x41,
- 0x56, 0x66, 0x6c, 0x0e, 0x23, 0x5b, 0x46, 0x2b, 0x10, 0x03,
- 0x3d, 0x46, 0x33, 0x1f, 0x16, 0x12, 0x29, 0x24, 0x36, 0x3b,
- 0x30, 0x3f, 0x5e, 0x16, 0x10, 0x1e, 0x43, 0x57, 0x6c, 0x4b,
- 0x36, 0x61, 0x50, 0x40, 0x6f, 0x01, 0x29, 0x53, 0x2c, 0x39,
- 0x21, 0x3d, 0x2f, 0x2b, 0x6e, 0x31, 0x21, 0x37, 0x69, 0x4b,
- 0x6f, 0x56, 0x51, 0x3f, 0x1c, 0x2c, 0x67, 0x1e, 0x3b, 0x4d,
- 0x40, 0x17, 0x05, 0x4a, 0x33, 0x67, 0x44, 0x59, 0x4b, 0x69,
- 0x12, 0x0a, 0x34, 0x51, 0x36, 0x41, 0x10, 0x57, 0x06, 0x08,
- 0x31, 0x14, 0x6e, 0x20, 0x63, 0x18, 0x5c, 0x58, 0x46, 0x37,
- 0x16, 0x1a, 0x21, 0x22, 0x51, 0x1e, 0x10, 0x41, 0x43, 0x4f,
- 0x4d, 0x65, 0x0e, 0x06, 0x09, 0x1d, 0x2b, 0x5b, 0x4d, 0x1e,
- 0x4e, 0x0b, 0x19, 0x56, 0x2b, 0x61, 0x6f, 0x05, 0x39, 0x2a,
- 0x4d, 0x60, 0x54, 0x6e, 0x10, 0x43, 0x1a, 0x30, 0x12, 0x5e,
- 0x1d, 0x5f, 0x51, 0x2b, 0x04, 0x6a, 0x48, 0x3f, 0x45, 0x60,
- 0x2d, 0x19, 0x4f, 0x49, 0x45, 0x61, 0x31, 0x2b, 0x3e, 0x57,
- 0x59, 0x3b, 0x12, 0x6e, 0x1f, 0x57, 0x54, 0x33, 0x0e, 0x31,
- 0x46, 0x42, 0x46, 0x61, 0x0c, 0x63, 0x50, 0x18, 0x03, 0x23,
- 0x06, 0x30, 0x4c, 0x66, 0x07, 0x1f, 0x65, 0x48, 0x4a, 0x41,
- 0x3e, 0x41, 0x0a, 0x50, 0x3d, 0x39, 0x46,
+ 0x54, 0x73, 0x23, 0x34, 0x4a, 0x67, 0x3e, 0x1c, 0x4a, 0x2f,
+ 0x50, 0x70, 0x6e, 0x18, 0x30, 0x2e, 0x4c, 0x6f, 0x3c, 0x68,
+ 0x73, 0x6d, 0x0f, 0x6b, 0x0d, 0x16, 0x66, 0x5c, 0x6d, 0x4b,
+ 0x21, 0x4d, 0x43, 0x3c, 0x0e, 0x19, 0x30, 0x44, 0x35, 0x72,
+ 0x6b, 0x09, 0x6f, 0x65, 0x22, 0x23, 0x18, 0x66, 0x16, 0x61,
+ 0x46, 0x13, 0x3e, 0x3d, 0x54, 0x05, 0x1b, 0x5b, 0x00, 0x29,
+ 0x5d, 0x6d, 0x57, 0x02, 0x2d, 0x24, 0x3f, 0x2a, 0x03, 0x28,
+ 0x4e, 0x48, 0x65, 0x01, 0x55, 0x69, 0x2d, 0x47, 0x01, 0x02,
+ 0x34, 0x40, 0x0e, 0x6a, 0x01, 0x62, 0x68, 0x1c, 0x42, 0x68,
+ 0x46, 0x23, 0x62, 0x21, 0x26, 0x13, 0x45, 0x5d, 0x56, 0x00,
+ 0x3c, 0x1b, 0x38, 0x42, 0x5a, 0x52, 0x6c, 0x68, 0x1c, 0x44,
+ 0x26, 0x20, 0x59, 0x5a, 0x13, 0x5e, 0x3a, 0x64, 0x03, 0x5b,
+ 0x62, 0x6e, 0x12, 0x06, 0x18, 0x64, 0x41, 0x0e, 0x23, 0x1c,
+ 0x0e, 0x57, 0x2f, 0x3e, 0x26, 0x16, 0x14, 0x16, 0x02, 0x30,
+ 0x52, 0x29, 0x50, 0x37, 0x07, 0x5c, 0x1a, 0x4c, 0x5b, 0x71,
+ 0x19, 0x1c, 0x03, 0x30, 0x69, 0x56, 0x3e, 0x40, 0x55, 0x12,
+ 0x15, 0x5a, 0x56, 0x2a, 0x28, 0x11, 0x5e, 0x67, 0x68, 0x15,
+ 0x05, 0x6b, 0x62, 0x24, 0x3b, 0x55, 0x6c, 0x3a, 0x25, 0x4b,
+ 0x38, 0x3e, 0x68, 0x33, 0x6e, 0x55, 0x15, 0x31, 0x19, 0x62,
+ 0x43, 0x2e, 0x48, 0x1d, 0x58, 0x68, 0x1d, 0x25, 0x6a, 0x64,
+ 0x0a, 0x14, 0x27, 0x17, 0x53, 0x22, 0x01, 0x0c, 0x0b, 0x56,
+ 0x3e, 0x61, 0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08, 0x46, 0x27, 0x5f, 0x2f, 0x45, 0x52, 0x05,
+ 0x62, 0x31, 0x45, 0x34, 0x37, 0x0f, 0x63, 0x50, 0x70, 0x4f,
+ 0x4e, 0x54, 0x30, 0x20, 0x09, 0x22, 0x06, 0x09, 0x01, 0x33,
+ 0x4d, 0x00, 0x0b, 0x4d, 0x3e, 0x32, 0x31, 0x6d, 0x70, 0x07,
+ 0x6b, 0x56, 0x38, 0x34, 0x0f, 0x67, 0x43, 0x6a, 0x43, 0x40,
+ 0x3d, 0x48, 0x25, 0x23, 0x2b, 0x25, 0x1b, 0x27, 0x34, 0x44,
+ 0x1f, 0x4a, 0x21, 0x4f, 0x01, 0x38, 0x5c, 0x35, 0x57, 0x5d,
+ 0x4f, 0x4b, 0x67, 0x67, 0x49, 0x5e, 0x5d, 0x56, 0x65, 0x5a,
+ 0x5d, 0x35, 0x2e, 0x06, 0x58, 0x51, 0x23, 0x73, 0x04, 0x57,
+ 0x3b, 0x1c, 0x26, 0x54, 0x6b, 0x1f, 0x19, 0x53, 0x54, 0x70,
+ 0x63, 0x28, 0x3d, 0x3b, 0x11, 0x60, 0x73, 0x70, 0x20, 0x3b,
+ 0x16, 0x68, 0x5e, 0x12, 0x21, 0x00, 0x05, 0x36, 0x1b, 0x11,
+ 0x33, 0x66, 0x44, 0x14, 0x00, 0x6c, 0x6c, 0x69, 0x44, 0x67,
+ 0x24, 0x2b, 0x13, 0x59, 0x5e, 0x1c, 0x46, 0x5e, 0x18, 0x5e,
+ 0x25, 0x26, 0x52, 0x07, 0x30, 0x6b, 0x00, 0x35, 0x26, 0x30,
+ 0x5f, 0x07, 0x2e, 0x58, 0x70, 0x14, 0x5b, 0x07, 0x32, 0x4b,
+ 0x07, 0x38, 0x47, 0x09, 0x53, 0x57, 0x54, 0x6a, 0x43, 0x5e,
+ 0x08, 0x61, 0x6b, 0x2b, 0x50, 0x3e, 0x4c, 0x0d, 0x15, 0x61,
+ 0x35, 0x01, 0x68, 0x64, 0x51, 0x5d, 0x04, 0x38, 0x5c, 0x2e,
+ 0x10, 0x5c, 0x5f, 0x4f, 0x5d, 0x3e, 0x32, 0x3d, 0x4a, 0x1f,
+ 0x3e, 0x43, 0x59, 0x53, 0x08, 0x27, 0x5b, 0x62, 0x3a, 0x5a,
+ 0x4b, 0x26, 0x2d, 0x27, 0x1b, 0x67, 0x18, 0x41, 0x49, 0x1f,
+ 0x0d, 0x47, 0x0e, 0x30, 0x4e, 0x65, 0x1e, 0x02, 0x4b, 0x60,
+ 0x19, 0x15, 0x28, 0x6a, 0x61, 0x30, 0x1d, 0x48, 0x16, 0x4f,
+ 0x2e, 0x61, 0x01, 0x53, 0x0c, 0x14, 0x47,
};
#define uchar unsigned char
-int
+static int
tok_hash(const uchar *key)
{
int i;
@@ -1430,19 +1472,19 @@ tok_hash(const uchar *key)
if (kp-key < 2)
return -1;
- f0 %= 114;
- f1 %= 114;
- f2 %= 114;
+ f0 %= 116;
+ f1 %= 116;
+ f2 %= 116;
- return (g[f0] + g[f1] + g[f2]) % 92;
+ return (g[f0] + g[f1] + g[f2]) % 94;
}
#else
/* auto-generated with mph-1.2 */
/*
* d=3
- * n=28
- * m=22
+ * n=30
+ * m=24
* c=1.23
* maxlen=7
* minklen=2
@@ -1450,116 +1492,116 @@ tok_hash(const uchar *key)
* minchar=47
* maxchar=89
* loop=0
- * numiter=200
+ * numiter=6
* seed=
*/
static int g[] = {
- 19, 12, -1, 15, 17, 1, 4, 4, 0, 13,
- 10, 19, 18, -1, 14, 19, 19, 21, 19, 0,
- 7, 0, 15, 18, 4, 0, 4, 3,
+ 16, 8, 8, 5, 13, 18, 0, -1, 21, 12,
+ 0, 4, 13, 23, 7, 0, 4, 8, 19, 23,
+ 20, 20, 0, 9, 19, 0, 16, 15, 0, 1,
};
static int T0[] = {
- 0x15, 0x0c, 0x1a, 0x17, 0x16, 0x02, 0x16, 0x07, 0x17, 0x09,
- 0x0f, 0x0f, 0x0f, 0x17, 0x07, 0x0c, 0x1a, 0x08, 0x17, 0x04,
- 0x14, 0x07, 0x06, 0x07, 0x10, 0x0e, 0x0e, 0x18, 0x01, 0x08,
- 0x1b, 0x17, 0x14, 0x19, 0x12, 0x1a, 0x0b, 0x0c, 0x12, 0x07,
- 0x05, 0x05, 0x06, 0x13, 0x06, 0x19, 0x07, 0x0d, 0x01, 0x0c,
- 0x1a, 0x09, 0x15, 0x1b, 0x16, 0x03, 0x15, 0x19, 0x12, 0x07,
- 0x1b, 0x05, 0x08, 0x0a, 0x15, 0x05, 0x16, 0x0b, 0x0a, 0x00,
- 0x0e, 0x0d, 0x08, 0x0a, 0x04, 0x1b, 0x07, 0x17, 0x0c, 0x15,
- 0x07, 0x0a, 0x02, 0x0c, 0x15, 0x08, 0x0d, 0x12, 0x10, 0x00,
- 0x07, 0x13, 0x15, 0x10, 0x17, 0x0a, 0x0e, 0x01, 0x14, 0x14,
- 0x1a, 0x06, 0x15, 0x05, 0x0a, 0x14, 0x03, 0x12, 0x04, 0x0c,
- 0x11, 0x1b, 0x0e, 0x1b, 0x17, 0x03, 0x08, 0x09, 0x15, 0x08,
- 0x15, 0x0c, 0x1b, 0x0e, 0x00, 0x16, 0x08, 0x1b, 0x08, 0x10,
- 0x0a, 0x00, 0x09, 0x01, 0x00, 0x09, 0x13, 0x03, 0x19, 0x03,
- 0x05, 0x15, 0x10, 0x06, 0x13, 0x02, 0x19, 0x15, 0x13, 0x12,
- 0x18, 0x16, 0x02, 0x0b, 0x0a, 0x1b, 0x0a, 0x15, 0x08, 0x06,
- 0x09, 0x12, 0x06, 0x12, 0x14, 0x12, 0x0c, 0x17, 0x15, 0x09,
- 0x1a, 0x0b, 0x05, 0x00, 0x1b, 0x0c, 0x10, 0x09, 0x02, 0x17,
- 0x11, 0x0a, 0x15, 0x11, 0x18, 0x12, 0x16, 0x00, 0x0e, 0x10,
- 0x18, 0x11, 0x0b, 0x07, 0x0b, 0x1a, 0x1b, 0x07, 0x07, 0x15,
- 0x0a, 0x16, 0x1a, 0x0f, 0x06, 0x19, 0x0c, 0x17, 0x06, 0x0e,
- 0x12, 0x08, 0x18, 0x17, 0x09, 0x0c, 0x03, 0x1b, 0x15, 0x0e,
- 0x06, 0x01, 0x11, 0x0e, 0x04, 0x08, 0x05, 0x1b, 0x05, 0x03,
- 0x15, 0x04, 0x17, 0x10, 0x0e, 0x07, 0x0e, 0x14, 0x13, 0x17,
- 0x14, 0x1b, 0x0a, 0x07, 0x18, 0x04, 0x03, 0x00, 0x10, 0x19,
- 0x1a, 0x16, 0x0a, 0x0f, 0x14, 0x1a, 0x18, 0x19, 0x0c, 0x1b,
- 0x06, 0x0a, 0x03, 0x0b, 0x0e, 0x1b, 0x1b, 0x0d, 0x03, 0x0d,
- 0x19, 0x0a, 0x0f, 0x14, 0x14, 0x06, 0x00, 0x01, 0x10, 0x0d,
- 0x19, 0x18, 0x09, 0x1b, 0x17, 0x16, 0x14, 0x15, 0x0b, 0x10,
- 0x14, 0x02, 0x1b, 0x08, 0x0d, 0x0d, 0x13, 0x0c, 0x0a, 0x16,
- 0x09,
+ 0x11, 0x0a, 0x1c, 0x11, 0x00, 0x18, 0x04, 0x14, 0x01, 0x15,
+ 0x05, 0x1a, 0x09, 0x06, 0x0e, 0x14, 0x04, 0x0b, 0x03, 0x08,
+ 0x1c, 0x1c, 0x1a, 0x05, 0x08, 0x00, 0x1c, 0x18, 0x07, 0x06,
+ 0x17, 0x19, 0x08, 0x15, 0x04, 0x09, 0x10, 0x00, 0x1d, 0x09,
+ 0x15, 0x1a, 0x1b, 0x11, 0x11, 0x16, 0x1d, 0x02, 0x00, 0x16,
+ 0x07, 0x07, 0x1d, 0x0f, 0x17, 0x09, 0x1b, 0x05, 0x13, 0x14,
+ 0x07, 0x1b, 0x0c, 0x14, 0x17, 0x1c, 0x0c, 0x11, 0x18, 0x0c,
+ 0x01, 0x00, 0x13, 0x01, 0x11, 0x1c, 0x18, 0x08, 0x17, 0x18,
+ 0x17, 0x00, 0x17, 0x16, 0x0f, 0x08, 0x18, 0x1d, 0x0e, 0x11,
+ 0x07, 0x01, 0x0d, 0x1a, 0x05, 0x14, 0x05, 0x0b, 0x0e, 0x0b,
+ 0x07, 0x08, 0x17, 0x0c, 0x0b, 0x18, 0x0c, 0x12, 0x19, 0x0b,
+ 0x12, 0x0e, 0x06, 0x0a, 0x13, 0x18, 0x09, 0x05, 0x0f, 0x17,
+ 0x17, 0x16, 0x18, 0x1c, 0x0a, 0x15, 0x0a, 0x10, 0x03, 0x11,
+ 0x05, 0x07, 0x00, 0x0b, 0x13, 0x08, 0x11, 0x0c, 0x06, 0x03,
+ 0x16, 0x08, 0x1c, 0x0e, 0x09, 0x14, 0x01, 0x03, 0x1b, 0x02,
+ 0x0e, 0x09, 0x0b, 0x18, 0x00, 0x18, 0x19, 0x0a, 0x04, 0x1d,
+ 0x1c, 0x0a, 0x06, 0x14, 0x0d, 0x1a, 0x1c, 0x16, 0x00, 0x04,
+ 0x11, 0x16, 0x0e, 0x0d, 0x10, 0x01, 0x13, 0x07, 0x06, 0x00,
+ 0x13, 0x0e, 0x1c, 0x10, 0x14, 0x13, 0x00, 0x19, 0x00, 0x14,
+ 0x12, 0x19, 0x19, 0x15, 0x09, 0x16, 0x10, 0x1c, 0x12, 0x02,
+ 0x11, 0x04, 0x04, 0x18, 0x09, 0x14, 0x19, 0x1d, 0x14, 0x17,
+ 0x1d, 0x09, 0x07, 0x1b, 0x11, 0x00, 0x16, 0x07, 0x0f, 0x08,
+ 0x09, 0x02, 0x07, 0x01, 0x0f, 0x15, 0x19, 0x08, 0x01, 0x14,
+ 0x04, 0x0c, 0x1c, 0x09, 0x00, 0x1a, 0x0f, 0x0b, 0x09, 0x19,
+ 0x1b, 0x0e, 0x0d, 0x14, 0x00, 0x07, 0x15, 0x0e, 0x07, 0x1c,
+ 0x16, 0x08, 0x01, 0x15, 0x02, 0x08, 0x05, 0x1b, 0x0f, 0x0f,
+ 0x13, 0x15, 0x0d, 0x04, 0x00, 0x05, 0x19, 0x08, 0x05, 0x0b,
+ 0x0f, 0x1b, 0x10, 0x10, 0x09, 0x0c, 0x01, 0x13, 0x15, 0x03,
+ 0x0a, 0x1c, 0x14, 0x12, 0x08, 0x19, 0x01, 0x0e, 0x1d, 0x08,
+ 0x1d, 0x13, 0x15, 0x04, 0x0f, 0x15, 0x01, 0x02, 0x1d, 0x07,
+ 0x0d,
};
static int T1[] = {
- 0x13, 0x0e, 0x17, 0x12, 0x13, 0x12, 0x08, 0x19, 0x05, 0x0d,
- 0x0b, 0x07, 0x06, 0x05, 0x0b, 0x0f, 0x06, 0x07, 0x12, 0x06,
- 0x11, 0x0d, 0x08, 0x10, 0x18, 0x1b, 0x18, 0x12, 0x03, 0x00,
- 0x00, 0x16, 0x1a, 0x07, 0x18, 0x11, 0x19, 0x10, 0x1a, 0x0e,
- 0x0e, 0x16, 0x16, 0x02, 0x10, 0x0d, 0x11, 0x0a, 0x02, 0x14,
- 0x00, 0x0c, 0x1a, 0x1a, 0x08, 0x02, 0x01, 0x06, 0x0b, 0x0b,
- 0x06, 0x02, 0x13, 0x15, 0x0f, 0x11, 0x0d, 0x01, 0x04, 0x0c,
- 0x0b, 0x13, 0x02, 0x11, 0x06, 0x12, 0x0e, 0x07, 0x01, 0x10,
- 0x1b, 0x01, 0x01, 0x0a, 0x0b, 0x09, 0x0c, 0x13, 0x11, 0x0a,
- 0x03, 0x11, 0x02, 0x13, 0x01, 0x08, 0x0c, 0x0a, 0x06, 0x0e,
- 0x00, 0x13, 0x1b, 0x03, 0x12, 0x01, 0x01, 0x0e, 0x0d, 0x09,
- 0x11, 0x1b, 0x08, 0x05, 0x0b, 0x0c, 0x02, 0x08, 0x10, 0x13,
- 0x02, 0x13, 0x14, 0x04, 0x16, 0x15, 0x18, 0x06, 0x10, 0x13,
- 0x1a, 0x01, 0x03, 0x16, 0x17, 0x12, 0x1b, 0x10, 0x0f, 0x0f,
- 0x06, 0x0f, 0x0f, 0x1a, 0x10, 0x17, 0x18, 0x09, 0x06, 0x10,
- 0x01, 0x03, 0x06, 0x0d, 0x03, 0x0d, 0x0d, 0x0f, 0x16, 0x09,
- 0x13, 0x14, 0x0b, 0x16, 0x1a, 0x12, 0x0d, 0x1a, 0x06, 0x00,
- 0x19, 0x18, 0x17, 0x18, 0x1b, 0x10, 0x0d, 0x14, 0x17, 0x16,
- 0x0a, 0x04, 0x0e, 0x03, 0x10, 0x1a, 0x01, 0x10, 0x19, 0x04,
- 0x09, 0x0f, 0x08, 0x0b, 0x1a, 0x0f, 0x0f, 0x09, 0x09, 0x1b,
- 0x18, 0x08, 0x16, 0x03, 0x10, 0x05, 0x14, 0x02, 0x19, 0x0f,
- 0x18, 0x13, 0x03, 0x16, 0x06, 0x1b, 0x01, 0x0f, 0x19, 0x0d,
- 0x00, 0x0a, 0x11, 0x0f, 0x0d, 0x0e, 0x08, 0x10, 0x1b, 0x0c,
- 0x1b, 0x19, 0x08, 0x17, 0x0c, 0x1b, 0x0a, 0x12, 0x0d, 0x0f,
- 0x0a, 0x14, 0x04, 0x0f, 0x0b, 0x05, 0x0f, 0x18, 0x04, 0x18,
- 0x09, 0x05, 0x06, 0x1b, 0x04, 0x13, 0x19, 0x0c, 0x1b, 0x0c,
- 0x18, 0x19, 0x08, 0x0e, 0x11, 0x0b, 0x03, 0x16, 0x1b, 0x15,
- 0x11, 0x14, 0x09, 0x09, 0x17, 0x0e, 0x12, 0x1a, 0x14, 0x12,
- 0x19, 0x08, 0x16, 0x07, 0x12, 0x0a, 0x17, 0x14, 0x13, 0x06,
- 0x10, 0x0f, 0x03, 0x18, 0x0d, 0x04, 0x13, 0x10, 0x1b, 0x03,
- 0x09,
+ 0x05, 0x04, 0x07, 0x13, 0x0f, 0x01, 0x1b, 0x15, 0x0d, 0x15,
+ 0x17, 0x13, 0x05, 0x05, 0x04, 0x18, 0x05, 0x05, 0x0e, 0x16,
+ 0x13, 0x13, 0x15, 0x1a, 0x06, 0x09, 0x14, 0x19, 0x13, 0x02,
+ 0x13, 0x18, 0x06, 0x12, 0x06, 0x0d,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, 0x01, 0x12, 0x13,
+ 0x11, 0x16, 0x02, 0x14, 0x0b, 0x1d, 0x00, 0x1d, 0x09, 0x03,
+ 0x08, 0x11, 0x02, 0x08, 0x06, 0x08, 0x0e, 0x01, 0x12, 0x11,
+ 0x08, 0x12, 0x0b, 0x16, 0x0d, 0x1b, 0x1c, 0x11, 0x1d, 0x10,
+ 0x1d, 0x08, 0x01, 0x17, 0x15, 0x0c, 0x16, 0x15, 0x12, 0x0a,
+ 0x17, 0x04, 0x1c, 0x1c, 0x0a, 0x0f, 0x17, 0x0d, 0x06, 0x07,
+ 0x12, 0x0a, 0x05, 0x03, 0x04, 0x03, 0x1d, 0x0b, 0x11, 0x14,
+ 0x13, 0x1a, 0x1b, 0x05, 0x06, 0x1a, 0x0c, 0x15, 0x07, 0x01,
+ 0x17, 0x17, 0x1b, 0x15, 0x15, 0x08, 0x1c, 0x0e, 0x15, 0x04,
+ 0x0d,
};
static int T2[] = {
- 0x16, 0x04, 0x18, 0x10, 0x13, 0x0f, 0x08, 0x19, 0x19, 0x17,
- 0x13, 0x0b, 0x0b, 0x08, 0x0a, 0x08, 0x01, 0x05, 0x15, 0x1a,
- 0x11, 0x02, 0x16, 0x0f, 0x0d, 0x09, 0x16, 0x13, 0x17, 0x0d,
- 0x05, 0x11, 0x11, 0x0d, 0x05, 0x14, 0x01, 0x19, 0x12, 0x0a,
- 0x15, 0x15, 0x15, 0x17, 0x13, 0x15, 0x0e, 0x18, 0x11, 0x0f,
- 0x03, 0x04, 0x03, 0x09, 0x1a, 0x13, 0x04, 0x08, 0x09, 0x07,
- 0x15, 0x16, 0x05, 0x11, 0x02, 0x00, 0x15, 0x10, 0x1b, 0x0d,
- 0x14, 0x18, 0x10, 0x0f, 0x13, 0x13, 0x14, 0x11, 0x10, 0x0a,
- 0x05, 0x03, 0x1a, 0x14, 0x0d, 0x19, 0x05, 0x1a, 0x1a, 0x00,
- 0x06, 0x0c, 0x07, 0x11, 0x01, 0x18, 0x12, 0x06, 0x02, 0x06,
- 0x1a, 0x17, 0x03, 0x0d, 0x09, 0x02, 0x09, 0x19, 0x03, 0x01,
- 0x16, 0x0d, 0x17, 0x10, 0x01, 0x06, 0x18, 0x06, 0x10, 0x16,
- 0x07, 0x06, 0x12, 0x1a, 0x17, 0x04, 0x16, 0x19, 0x0a, 0x1b,
- 0x15, 0x16, 0x13, 0x11, 0x09, 0x1b, 0x02, 0x05, 0x12, 0x0c,
- 0x10, 0x11, 0x08, 0x0f, 0x0c, 0x05, 0x0d, 0x0f, 0x19, 0x01,
- 0x1b, 0x17, 0x03, 0x08, 0x00, 0x1a, 0x0d, 0x0c, 0x07, 0x19,
- 0x17, 0x01, 0x03, 0x0e, 0x02, 0x18, 0x19, 0x10, 0x02, 0x00,
- 0x0c, 0x02, 0x0a, 0x0b, 0x1a, 0x11, 0x19, 0x01, 0x16, 0x02,
- 0x09, 0x01, 0x10, 0x1a, 0x0c, 0x0c, 0x12, 0x10, 0x18, 0x1b,
- 0x14, 0x17, 0x17, 0x12, 0x1b, 0x08, 0x0d, 0x0c, 0x07, 0x1a,
- 0x04, 0x03, 0x0b, 0x0e, 0x1b, 0x16, 0x10, 0x08, 0x17, 0x16,
- 0x16, 0x10, 0x17, 0x0a, 0x1a, 0x0c, 0x17, 0x0f, 0x0a, 0x19,
- 0x00, 0x0c, 0x08, 0x11, 0x17, 0x09, 0x17, 0x0f, 0x00, 0x05,
- 0x17, 0x05, 0x05, 0x17, 0x17, 0x15, 0x0f, 0x00, 0x00, 0x19,
- 0x0c, 0x19, 0x0f, 0x11, 0x08, 0x18, 0x01, 0x10, 0x17, 0x17,
- 0x0d, 0x18, 0x13, 0x15, 0x0d, 0x0e, 0x0e, 0x09, 0x05, 0x17,
- 0x14, 0x17, 0x16, 0x16, 0x1b, 0x10, 0x10, 0x0c, 0x06, 0x02,
- 0x17, 0x12, 0x05, 0x08, 0x12, 0x00, 0x0b, 0x17, 0x07, 0x12,
- 0x08, 0x01, 0x18, 0x0a, 0x19, 0x16, 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12, 0x00, 0x16, 0x16, 0x01,
+ 0x00, 0x1a, 0x18, 0x06, 0x00, 0x1a, 0x0e, 0x0c, 0x17, 0x01,
+ 0x04, 0x06, 0x13, 0x1b, 0x16, 0x08, 0x0b, 0x06, 0x0f, 0x1b,
+ 0x07, 0x0c, 0x0f, 0x05, 0x0a, 0x0d, 0x0e, 0x19, 0x0c, 0x10,
+ 0x19, 0x1a, 0x06, 0x0b, 0x02, 0x06, 0x07, 0x09, 0x0a, 0x16,
+ 0x0a, 0x06, 0x1d, 0x1d, 0x04, 0x00, 0x0f, 0x18, 0x0e, 0x01,
+ 0x0e, 0x09, 0x0e, 0x1d, 0x17, 0x1d, 0x06, 0x02, 0x18, 0x18,
+ 0x1a, 0x06, 0x17, 0x02, 0x05, 0x0e, 0x12, 0x0f, 0x05, 0x0e,
+ 0x01, 0x13, 0x10, 0x11, 0x0a, 0x1a, 0x11, 0x19, 0x0c, 0x17,
+ 0x13, 0x1a, 0x03, 0x03, 0x1a, 0x12, 0x03, 0x18, 0x06, 0x0b,
+ 0x04, 0x16, 0x09, 0x02, 0x1d, 0x07, 0x02, 0x09, 0x1d, 0x03,
+ 0x0e, 0x1a, 0x05, 0x17, 0x0d, 0x0b, 0x09, 0x0a, 0x05, 0x0a,
+ 0x18, 0x02, 0x00, 0x17, 0x09, 0x05, 0x0c, 0x04, 0x0e, 0x0b,
+ 0x0f, 0x12, 0x03, 0x18, 0x14, 0x19, 0x01, 0x0e, 0x04, 0x16,
+ 0x11,
};
#define uchar unsigned char
@@ -1585,11 +1627,11 @@ tok_hash(const uchar *key)
if (kp-key < 2)
return -1;
- f0 %= 28;
- f1 %= 28;
- f2 %= 28;
+ f0 %= 30;
+ f1 %= 30;
+ f2 %= 30;
- return (g[f0] + g[f1] + g[f2]) % 22;
+ return (g[f0] + g[f1] + g[f2]) % 24;
}
#endif
diff --git a/src/emitc.c b/src/emitc.c
index 21d516a..6de0401 100644
--- a/src/emitc.c
+++ b/src/emitc.c
@@ -502,6 +502,15 @@ static void newline_handler(void)
write_src("vid_writef(\"\\n\");\n");
}
+static void input_handler(void)
+{
+ write_src("{\n");
+ write_src("vartype val;\n");
+ write_src("scanf(\"%s\", &val);\n", VARFORMAT);
+ write_src("setvar(%d, val);\n", read_varid());
+ write_src("}\n");
+}
+
static void inc_line_pointer(void)
{
++current_line;
@@ -558,7 +567,7 @@ static void (*instr_tab[0x100])(void) = {
NULL, /* 0x2c */
NULL, /* 0x2d */
newline_handler, /* 0x2e */
- NULL, /* 0x2f */
+ input_handler, /* 0x2f */
NULL, /* 0x30 */
NULL, /* 0x31 */
NULL, /* 0x32 */
diff --git a/src/interp.c b/src/interp.c
index d5d567f..8ecf630 100644
--- a/src/interp.c
+++ b/src/interp.c
@@ -179,6 +179,7 @@ static void exit_handler(void)
static void vid_write(const char *str)
{
printf("%s", str);
+ fflush(stdout);
}
static void __attribute__((format(printf,1,2))) vid_writef(const char *fmt, ...)
@@ -1017,6 +1018,43 @@ static int logchar_handler(char **save, int *repeats_left)
}
+static int input_handler(char **save, int *repeats_left)
+{
+ (void) save; (void) repeats_left;
+ char *varname = strtok_r(NULL, "= \t", save);
+
+ if(varname && isValidVariable(varname))
+ {
+ struct varnode_t *node = lookup_var(varname);
+ if(node->constant)
+ error("attempted to modify a constant variable");
+
+ scanf(VARFORMAT, &node->val);
+ }
+ else
+ error("expected valid variable name after INPUT");
+ return OK;
+}
+
+static int prompt_handler(char **save, int *repeats_left)
+{
+ (void) save; (void) repeats_left;
+ char *varname = strtok_r(NULL, "= \t", save);
+
+ if(varname && isValidVariable(varname))
+ {
+ vid_writef("%s? ", varname);
+ struct varnode_t *node = lookup_var(varname);
+ if(node->constant)
+ error("attempted to modify a constant variable");
+
+ scanf(VARFORMAT, &node->val);
+ }
+ else
+ error("expected valid variable name after PROMPT");
+ return OK;
+}
+
static struct token_t {
const char *tok;
int (*func)(char **save, int *repeats_left);
@@ -1043,6 +1081,8 @@ static struct token_t {
{ "LBL", rem_handler, },
{ "QUIT", quit_handler, },
{ "EXIT", quit_handler, },
+ { "INPUT", input_handler, },
+ { "PROMPT", prompt_handler, },
};
/* once again, this lookup table is implemented with a perfect hash map */
@@ -1053,8 +1093,8 @@ static struct token_t tokmap[TOKMAP_SIZE];
/* auto-generated with mph-1.2 */
/*
* d=3
- * n=28
- * m=22
+ * n=30
+ * m=24
* c=1.23
* maxlen=7
* minklen=2
@@ -1062,116 +1102,116 @@ static struct token_t tokmap[TOKMAP_SIZE];
* minchar=47
* maxchar=89
* loop=0
- * numiter=200
+ * numiter=6
* seed=
*/
static int g[] = {
- 19, 12, -1, 15, 17, 1, 4, 4, 0, 13,
- 10, 19, 18, -1, 14, 19, 19, 21, 19, 0,
- 7, 0, 15, 18, 4, 0, 4, 3,
+ 16, 8, 8, 5, 13, 18, 0, -1, 21, 12,
+ 0, 4, 13, 23, 7, 0, 4, 8, 19, 23,
+ 20, 20, 0, 9, 19, 0, 16, 15, 0, 1,
};
static int T0[] = {
- 0x15, 0x0c, 0x1a, 0x17, 0x16, 0x02, 0x16, 0x07, 0x17, 0x09,
- 0x0f, 0x0f, 0x0f, 0x17, 0x07, 0x0c, 0x1a, 0x08, 0x17, 0x04,
- 0x14, 0x07, 0x06, 0x07, 0x10, 0x0e, 0x0e, 0x18, 0x01, 0x08,
- 0x1b, 0x17, 0x14, 0x19, 0x12, 0x1a, 0x0b, 0x0c, 0x12, 0x07,
- 0x05, 0x05, 0x06, 0x13, 0x06, 0x19, 0x07, 0x0d, 0x01, 0x0c,
- 0x1a, 0x09, 0x15, 0x1b, 0x16, 0x03, 0x15, 0x19, 0x12, 0x07,
- 0x1b, 0x05, 0x08, 0x0a, 0x15, 0x05, 0x16, 0x0b, 0x0a, 0x00,
- 0x0e, 0x0d, 0x08, 0x0a, 0x04, 0x1b, 0x07, 0x17, 0x0c, 0x15,
- 0x07, 0x0a, 0x02, 0x0c, 0x15, 0x08, 0x0d, 0x12, 0x10, 0x00,
- 0x07, 0x13, 0x15, 0x10, 0x17, 0x0a, 0x0e, 0x01, 0x14, 0x14,
- 0x1a, 0x06, 0x15, 0x05, 0x0a, 0x14, 0x03, 0x12, 0x04, 0x0c,
- 0x11, 0x1b, 0x0e, 0x1b, 0x17, 0x03, 0x08, 0x09, 0x15, 0x08,
- 0x15, 0x0c, 0x1b, 0x0e, 0x00, 0x16, 0x08, 0x1b, 0x08, 0x10,
- 0x0a, 0x00, 0x09, 0x01, 0x00, 0x09, 0x13, 0x03, 0x19, 0x03,
- 0x05, 0x15, 0x10, 0x06, 0x13, 0x02, 0x19, 0x15, 0x13, 0x12,
- 0x18, 0x16, 0x02, 0x0b, 0x0a, 0x1b, 0x0a, 0x15, 0x08, 0x06,
- 0x09, 0x12, 0x06, 0x12, 0x14, 0x12, 0x0c, 0x17, 0x15, 0x09,
- 0x1a, 0x0b, 0x05, 0x00, 0x1b, 0x0c, 0x10, 0x09, 0x02, 0x17,
- 0x11, 0x0a, 0x15, 0x11, 0x18, 0x12, 0x16, 0x00, 0x0e, 0x10,
- 0x18, 0x11, 0x0b, 0x07, 0x0b, 0x1a, 0x1b, 0x07, 0x07, 0x15,
- 0x0a, 0x16, 0x1a, 0x0f, 0x06, 0x19, 0x0c, 0x17, 0x06, 0x0e,
- 0x12, 0x08, 0x18, 0x17, 0x09, 0x0c, 0x03, 0x1b, 0x15, 0x0e,
- 0x06, 0x01, 0x11, 0x0e, 0x04, 0x08, 0x05, 0x1b, 0x05, 0x03,
- 0x15, 0x04, 0x17, 0x10, 0x0e, 0x07, 0x0e, 0x14, 0x13, 0x17,
- 0x14, 0x1b, 0x0a, 0x07, 0x18, 0x04, 0x03, 0x00, 0x10, 0x19,
- 0x1a, 0x16, 0x0a, 0x0f, 0x14, 0x1a, 0x18, 0x19, 0x0c, 0x1b,
- 0x06, 0x0a, 0x03, 0x0b, 0x0e, 0x1b, 0x1b, 0x0d, 0x03, 0x0d,
- 0x19, 0x0a, 0x0f, 0x14, 0x14, 0x06, 0x00, 0x01, 0x10, 0x0d,
- 0x19, 0x18, 0x09, 0x1b, 0x17, 0x16, 0x14, 0x15, 0x0b, 0x10,
- 0x14, 0x02, 0x1b, 0x08, 0x0d, 0x0d, 0x13, 0x0c, 0x0a, 0x16,
- 0x09,
+ 0x11, 0x0a, 0x1c, 0x11, 0x00, 0x18, 0x04, 0x14, 0x01, 0x15,
+ 0x05, 0x1a, 0x09, 0x06, 0x0e, 0x14, 0x04, 0x0b, 0x03, 0x08,
+ 0x1c, 0x1c, 0x1a, 0x05, 0x08, 0x00, 0x1c, 0x18, 0x07, 0x06,
+ 0x17, 0x19, 0x08, 0x15, 0x04, 0x09, 0x10, 0x00, 0x1d, 0x09,
+ 0x15, 0x1a, 0x1b, 0x11, 0x11, 0x16, 0x1d, 0x02, 0x00, 0x16,
+ 0x07, 0x07, 0x1d, 0x0f, 0x17, 0x09, 0x1b, 0x05, 0x13, 0x14,
+ 0x07, 0x1b, 0x0c, 0x14, 0x17, 0x1c, 0x0c, 0x11, 0x18, 0x0c,
+ 0x01, 0x00, 0x13, 0x01, 0x11, 0x1c, 0x18, 0x08, 0x17, 0x18,
+ 0x17, 0x00, 0x17, 0x16, 0x0f, 0x08, 0x18, 0x1d, 0x0e, 0x11,
+ 0x07, 0x01, 0x0d, 0x1a, 0x05, 0x14, 0x05, 0x0b, 0x0e, 0x0b,
+ 0x07, 0x08, 0x17, 0x0c, 0x0b, 0x18, 0x0c, 0x12, 0x19, 0x0b,
+ 0x12, 0x0e, 0x06, 0x0a, 0x13, 0x18, 0x09, 0x05, 0x0f, 0x17,
+ 0x17, 0x16, 0x18, 0x1c, 0x0a, 0x15, 0x0a, 0x10, 0x03, 0x11,
+ 0x05, 0x07, 0x00, 0x0b, 0x13, 0x08, 0x11, 0x0c, 0x06, 0x03,
+ 0x16, 0x08, 0x1c, 0x0e, 0x09, 0x14, 0x01, 0x03, 0x1b, 0x02,
+ 0x0e, 0x09, 0x0b, 0x18, 0x00, 0x18, 0x19, 0x0a, 0x04, 0x1d,
+ 0x1c, 0x0a, 0x06, 0x14, 0x0d, 0x1a, 0x1c, 0x16, 0x00, 0x04,
+ 0x11, 0x16, 0x0e, 0x0d, 0x10, 0x01, 0x13, 0x07, 0x06, 0x00,
+ 0x13, 0x0e, 0x1c, 0x10, 0x14, 0x13, 0x00, 0x19, 0x00, 0x14,
+ 0x12, 0x19, 0x19, 0x15, 0x09, 0x16, 0x10, 0x1c, 0x12, 0x02,
+ 0x11, 0x04, 0x04, 0x18, 0x09, 0x14, 0x19, 0x1d, 0x14, 0x17,
+ 0x1d, 0x09, 0x07, 0x1b, 0x11, 0x00, 0x16, 0x07, 0x0f, 0x08,
+ 0x09, 0x02, 0x07, 0x01, 0x0f, 0x15, 0x19, 0x08, 0x01, 0x14,
+ 0x04, 0x0c, 0x1c, 0x09, 0x00, 0x1a, 0x0f, 0x0b, 0x09, 0x19,
+ 0x1b, 0x0e, 0x0d, 0x14, 0x00, 0x07, 0x15, 0x0e, 0x07, 0x1c,
+ 0x16, 0x08, 0x01, 0x15, 0x02, 0x08, 0x05, 0x1b, 0x0f, 0x0f,
+ 0x13, 0x15, 0x0d, 0x04, 0x00, 0x05, 0x19, 0x08, 0x05, 0x0b,
+ 0x0f, 0x1b, 0x10, 0x10, 0x09, 0x0c, 0x01, 0x13, 0x15, 0x03,
+ 0x0a, 0x1c, 0x14, 0x12, 0x08, 0x19, 0x01, 0x0e, 0x1d, 0x08,
+ 0x1d, 0x13, 0x15, 0x04, 0x0f, 0x15, 0x01, 0x02, 0x1d, 0x07,
+ 0x0d,
};
static int T1[] = {
- 0x13, 0x0e, 0x17, 0x12, 0x13, 0x12, 0x08, 0x19, 0x05, 0x0d,
- 0x0b, 0x07, 0x06, 0x05, 0x0b, 0x0f, 0x06, 0x07, 0x12, 0x06,
- 0x11, 0x0d, 0x08, 0x10, 0x18, 0x1b, 0x18, 0x12, 0x03, 0x00,
- 0x00, 0x16, 0x1a, 0x07, 0x18, 0x11, 0x19, 0x10, 0x1a, 0x0e,
- 0x0e, 0x16, 0x16, 0x02, 0x10, 0x0d, 0x11, 0x0a, 0x02, 0x14,
- 0x00, 0x0c, 0x1a, 0x1a, 0x08, 0x02, 0x01, 0x06, 0x0b, 0x0b,
- 0x06, 0x02, 0x13, 0x15, 0x0f, 0x11, 0x0d, 0x01, 0x04, 0x0c,
- 0x0b, 0x13, 0x02, 0x11, 0x06, 0x12, 0x0e, 0x07, 0x01, 0x10,
- 0x1b, 0x01, 0x01, 0x0a, 0x0b, 0x09, 0x0c, 0x13, 0x11, 0x0a,
- 0x03, 0x11, 0x02, 0x13, 0x01, 0x08, 0x0c, 0x0a, 0x06, 0x0e,
- 0x00, 0x13, 0x1b, 0x03, 0x12, 0x01, 0x01, 0x0e, 0x0d, 0x09,
- 0x11, 0x1b, 0x08, 0x05, 0x0b, 0x0c, 0x02, 0x08, 0x10, 0x13,
- 0x02, 0x13, 0x14, 0x04, 0x16, 0x15, 0x18, 0x06, 0x10, 0x13,
- 0x1a, 0x01, 0x03, 0x16, 0x17, 0x12, 0x1b, 0x10, 0x0f, 0x0f,
- 0x06, 0x0f, 0x0f, 0x1a, 0x10, 0x17, 0x18, 0x09, 0x06, 0x10,
- 0x01, 0x03, 0x06, 0x0d, 0x03, 0x0d, 0x0d, 0x0f, 0x16, 0x09,
- 0x13, 0x14, 0x0b, 0x16, 0x1a, 0x12, 0x0d, 0x1a, 0x06, 0x00,
- 0x19, 0x18, 0x17, 0x18, 0x1b, 0x10, 0x0d, 0x14, 0x17, 0x16,
- 0x0a, 0x04, 0x0e, 0x03, 0x10, 0x1a, 0x01, 0x10, 0x19, 0x04,
- 0x09, 0x0f, 0x08, 0x0b, 0x1a, 0x0f, 0x0f, 0x09, 0x09, 0x1b,
- 0x18, 0x08, 0x16, 0x03, 0x10, 0x05, 0x14, 0x02, 0x19, 0x0f,
- 0x18, 0x13, 0x03, 0x16, 0x06, 0x1b, 0x01, 0x0f, 0x19, 0x0d,
- 0x00, 0x0a, 0x11, 0x0f, 0x0d, 0x0e, 0x08, 0x10, 0x1b, 0x0c,
- 0x1b, 0x19, 0x08, 0x17, 0x0c, 0x1b, 0x0a, 0x12, 0x0d, 0x0f,
- 0x0a, 0x14, 0x04, 0x0f, 0x0b, 0x05, 0x0f, 0x18, 0x04, 0x18,
- 0x09, 0x05, 0x06, 0x1b, 0x04, 0x13, 0x19, 0x0c, 0x1b, 0x0c,
- 0x18, 0x19, 0x08, 0x0e, 0x11, 0x0b, 0x03, 0x16, 0x1b, 0x15,
- 0x11, 0x14, 0x09, 0x09, 0x17, 0x0e, 0x12, 0x1a, 0x14, 0x12,
- 0x19, 0x08, 0x16, 0x07, 0x12, 0x0a, 0x17, 0x14, 0x13, 0x06,
- 0x10, 0x0f, 0x03, 0x18, 0x0d, 0x04, 0x13, 0x10, 0x1b, 0x03,
- 0x09,
+ 0x05, 0x04, 0x07, 0x13, 0x0f, 0x01, 0x1b, 0x15, 0x0d, 0x15,
+ 0x17, 0x13, 0x05, 0x05, 0x04, 0x18, 0x05, 0x05, 0x0e, 0x16,
+ 0x13, 0x13, 0x15, 0x1a, 0x06, 0x09, 0x14, 0x19, 0x13, 0x02,
+ 0x13, 0x18, 0x06, 0x12, 0x06, 0x0d, 0x13, 0x03, 0x05, 0x19,
+ 0x11, 0x14, 0x0e, 0x06, 0x00, 0x16, 0x0c, 0x10, 0x07, 0x0e,
+ 0x05, 0x1d, 0x07, 0x0b, 0x12, 0x02, 0x0b, 0x18, 0x13, 0x13,
+ 0x17, 0x0c, 0x12, 0x19, 0x13, 0x1d, 0x0f, 0x19, 0x16, 0x1d,
+ 0x0c, 0x17, 0x14, 0x11, 0x15, 0x14, 0x09, 0x04, 0x1c, 0x10,
+ 0x0a, 0x1a, 0x08, 0x11, 0x07, 0x12, 0x06, 0x10, 0x0d, 0x09,
+ 0x07, 0x08, 0x01, 0x15, 0x19, 0x10, 0x1b, 0x0d, 0x1c, 0x0d,
+ 0x15, 0x0f, 0x11, 0x06, 0x1c, 0x03, 0x08, 0x00, 0x04, 0x0e,
+ 0x08, 0x0e, 0x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 0x15, 0x15, 0x08, 0x1c, 0x0e, 0x15, 0x04,
+ 0x0d,
};
static int T2[] = {
- 0x16, 0x04, 0x18, 0x10, 0x13, 0x0f, 0x08, 0x19, 0x19, 0x17,
- 0x13, 0x0b, 0x0b, 0x08, 0x0a, 0x08, 0x01, 0x05, 0x15, 0x1a,
- 0x11, 0x02, 0x16, 0x0f, 0x0d, 0x09, 0x16, 0x13, 0x17, 0x0d,
- 0x05, 0x11, 0x11, 0x0d, 0x05, 0x14, 0x01, 0x19, 0x12, 0x0a,
- 0x15, 0x15, 0x15, 0x17, 0x13, 0x15, 0x0e, 0x18, 0x11, 0x0f,
- 0x03, 0x04, 0x03, 0x09, 0x1a, 0x13, 0x04, 0x08, 0x09, 0x07,
- 0x15, 0x16, 0x05, 0x11, 0x02, 0x00, 0x15, 0x10, 0x1b, 0x0d,
- 0x14, 0x18, 0x10, 0x0f, 0x13, 0x13, 0x14, 0x11, 0x10, 0x0a,
- 0x05, 0x03, 0x1a, 0x14, 0x0d, 0x19, 0x05, 0x1a, 0x1a, 0x00,
- 0x06, 0x0c, 0x07, 0x11, 0x01, 0x18, 0x12, 0x06, 0x02, 0x06,
- 0x1a, 0x17, 0x03, 0x0d, 0x09, 0x02, 0x09, 0x19, 0x03, 0x01,
- 0x16, 0x0d, 0x17, 0x10, 0x01, 0x06, 0x18, 0x06, 0x10, 0x16,
- 0x07, 0x06, 0x12, 0x1a, 0x17, 0x04, 0x16, 0x19, 0x0a, 0x1b,
- 0x15, 0x16, 0x13, 0x11, 0x09, 0x1b, 0x02, 0x05, 0x12, 0x0c,
- 0x10, 0x11, 0x08, 0x0f, 0x0c, 0x05, 0x0d, 0x0f, 0x19, 0x01,
- 0x1b, 0x17, 0x03, 0x08, 0x00, 0x1a, 0x0d, 0x0c, 0x07, 0x19,
- 0x17, 0x01, 0x03, 0x0e, 0x02, 0x18, 0x19, 0x10, 0x02, 0x00,
- 0x0c, 0x02, 0x0a, 0x0b, 0x1a, 0x11, 0x19, 0x01, 0x16, 0x02,
- 0x09, 0x01, 0x10, 0x1a, 0x0c, 0x0c, 0x12, 0x10, 0x18, 0x1b,
- 0x14, 0x17, 0x17, 0x12, 0x1b, 0x08, 0x0d, 0x0c, 0x07, 0x1a,
- 0x04, 0x03, 0x0b, 0x0e, 0x1b, 0x16, 0x10, 0x08, 0x17, 0x16,
- 0x16, 0x10, 0x17, 0x0a, 0x1a, 0x0c, 0x17, 0x0f, 0x0a, 0x19,
- 0x00, 0x0c, 0x08, 0x11, 0x17, 0x09, 0x17, 0x0f, 0x00, 0x05,
- 0x17, 0x05, 0x05, 0x17, 0x17, 0x15, 0x0f, 0x00, 0x00, 0x19,
- 0x0c, 0x19, 0x0f, 0x11, 0x08, 0x18, 0x01, 0x10, 0x17, 0x17,
- 0x0d, 0x18, 0x13, 0x15, 0x0d, 0x0e, 0x0e, 0x09, 0x05, 0x17,
- 0x14, 0x17, 0x16, 0x16, 0x1b, 0x10, 0x10, 0x0c, 0x06, 0x02,
- 0x17, 0x12, 0x05, 0x08, 0x12, 0x00, 0x0b, 0x17, 0x07, 0x12,
- 0x08, 0x01, 0x18, 0x0a, 0x19, 0x16, 0x01, 0x0b, 0x12, 0x12,
- 0x06, 0x0a, 0x0e, 0x0c, 0x10, 0x0d, 0x00, 0x04, 0x19, 0x12,
- 0x06,
+ 0x0f, 0x0d, 0x08, 0x09, 0x04, 0x0d, 0x05, 0x1a, 0x0d, 0x0b,
+ 0x1b, 0x1a, 0x18, 0x09, 0x06, 0x02, 0x15, 0x1b, 0x1a, 0x02,
+ 0x08, 0x08, 0x1c, 0x07, 0x0c, 0x16, 0x18, 0x09, 0x07, 0x07,
+ 0x1d, 0x16, 0x14, 0x1d, 0x17, 0x11, 0x0c, 0x14, 0x0d, 0x1a,
+ 0x17, 0x02, 0x0e, 0x19, 0x01, 0x03, 0x07, 0x00, 0x08, 0x02,
+ 0x05, 0x0e, 0x12, 0x08, 0x1a, 0x0e, 0x1b, 0x18, 0x1a, 0x1a,
+ 0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, 0x13, 0x10, 0x11, 0x0a, 0x1a, 0x11, 0x19, 0x0c, 0x17,
+ 0x13, 0x1a, 0x03, 0x03, 0x1a, 0x12, 0x03, 0x18, 0x06, 0x0b,
+ 0x04, 0x16, 0x09, 0x02, 0x1d, 0x07, 0x02, 0x09, 0x1d, 0x03,
+ 0x0e, 0x1a, 0x05, 0x17, 0x0d, 0x0b, 0x09, 0x0a, 0x05, 0x0a,
+ 0x18, 0x02, 0x00, 0x17, 0x09, 0x05, 0x0c, 0x04, 0x0e, 0x0b,
+ 0x0f, 0x12, 0x03, 0x18, 0x14, 0x19, 0x01, 0x0e, 0x04, 0x16,
+ 0x11,
};
#define uchar unsigned char
@@ -1179,29 +1219,29 @@ static int T2[] = {
static int
tok_hash(const uchar *key)
{
- int i;
- unsigned f0, f1, f2;
- const uchar *kp = key;
-
- for (i=-47, f0=f1=f2=0; *kp; ++kp) {
- if (*kp < 47 || *kp > 89)
- return -1;
- if (kp-key > 6)
- return -1;
- f0 += T0[i + *kp];
- f1 += T1[i + *kp];
- f2 += T2[i + *kp];
- i += 43;
- }
+ int i;
+ unsigned f0, f1, f2;
+ const uchar *kp = key;
+
+ for (i=-47, f0=f1=f2=0; *kp; ++kp) {
+ if (*kp < 47 || *kp > 89)
+ return -1;
+ if (kp-key > 6)
+ return -1;
+ f0 += T0[i + *kp];
+ f1 += T1[i + *kp];
+ f2 += T2[i + *kp];
+ i += 43;
+ }
- if (kp-key < 2)
- return -1;
+ if (kp-key < 2)
+ return -1;
- f0 %= 28;
- f1 %= 28;
- f2 %= 28;
+ f0 %= 30;
+ f1 %= 30;
+ f2 %= 30;
- return (g[f0] + g[f1] + g[f2]) % 22;
+ return (g[f0] + g[f1] + g[f2]) % 24;
}
static void tokmap_insert(struct token_t *tok)
diff --git a/src/opcodes.h b/src/opcodes.h
index becfb3c..521afcf 100644
--- a/src/opcodes.h
+++ b/src/opcodes.h
@@ -45,5 +45,6 @@
#define TYPE_STR 0x2C
#define ADD_CHAR 0x2D
#define NEWLINE 0x2E
-/* new opcodes here, be sure to update vm.c */
+#define READ_VAR 0x2F
+/* new opcodes here, be sure to update compile.c, vm.c, and emitc.c */
#define LINEMARK 0xFF
diff --git a/src/vm.c b/src/vm.c
index 37a7fd1..3e19c20 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -466,6 +466,13 @@ static void inc_line_pointer(void)
vars[0].val = current_line;
}
+static void input_handler(void)
+{
+ vartype val;
+ scanf(VARFORMAT, &val);
+ setvar(read_varid(), val);
+}
+
static void (*instr_tab[0x100])(void) = {
pushimm_handler, /* 0x0 */
pushvar_handler, /* 0x1 */
@@ -514,7 +521,7 @@ static void (*instr_tab[0x100])(void) = {
NULL, /* 0x2c */
NULL, /* 0x2d */
newline_handler, /* 0x2e */
- NULL, /* 0x2f */
+ input_handler, /* 0x2f */
NULL, /* 0x30 */
NULL, /* 0x31 */
NULL, /* 0x32 */