diff options
author | obscuren <obscuren@obscura.com> | 2014-01-03 20:40:38 +0800 |
---|---|---|
committer | obscuren <obscuren@obscura.com> | 2014-01-03 20:40:38 +0800 |
commit | 9581faf5fdacf4a135bcdf77d6f0fbe0d6eecba8 (patch) | |
tree | ae74d77233f6280c56b6f7c151ccae7d2851bc00 /parsing.go | |
parent | 055407c835328c8b9628c73ddd7ba872d787c09d (diff) | |
download | go-tangerine-9581faf5fdacf4a135bcdf77d6f0fbe0d6eecba8.tar go-tangerine-9581faf5fdacf4a135bcdf77d6f0fbe0d6eecba8.tar.gz go-tangerine-9581faf5fdacf4a135bcdf77d6f0fbe0d6eecba8.tar.bz2 go-tangerine-9581faf5fdacf4a135bcdf77d6f0fbe0d6eecba8.tar.lz go-tangerine-9581faf5fdacf4a135bcdf77d6f0fbe0d6eecba8.tar.xz go-tangerine-9581faf5fdacf4a135bcdf77d6f0fbe0d6eecba8.tar.zst go-tangerine-9581faf5fdacf4a135bcdf77d6f0fbe0d6eecba8.zip |
Parsing for block and tx
Diffstat (limited to 'parsing.go')
-rw-r--r-- | parsing.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/parsing.go b/parsing.go index 765950a4c..4c3f1187e 100644 --- a/parsing.go +++ b/parsing.go @@ -11,8 +11,11 @@ import ( // Op codes var OpCodes = map[string]string{ "STOP": "0", - "PSH": "30", // 0x30 - /* + "PUSH": "48", // 0x30 + "POP": "49", // 0x31 + "LOAD": "54", // 0x36 + + /* OLD VM OPCODES "ADD": "16", // 0x10 "SUB": "17", // 0x11 "MUL": "18", // 0x12 @@ -57,7 +60,7 @@ var OpCodes = map[string]string{ func CompileInstr(s string) (string, error) { tokens := strings.Split(s, " ") if OpCodes[tokens[0]] == "" { - return "", errors.New(fmt.Sprintf("OP not found: %s", tokens[0])) + return s, errors.New(fmt.Sprintf("OP not found: %s", tokens[0])) } code := OpCodes[tokens[0]] // Replace op codes with the proper numerical equivalent |