From b320d432591b899d39e40d013b79012e0be2ebab Mon Sep 17 00:00:00 2001 From: Milo Davis Date: Thu, 20 Jul 2017 15:51:07 +0200 Subject: [PATCH] Michelson: removes NOP instruction from surface syntax --- src/proto/alpha/docs/json-notations.md | 1 - src/proto/alpha/docs/language.md | 1 - src/proto/alpha/script_interpreter.ml | 2 +- src/proto/alpha/script_ir_translator.ml | 7 ++----- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/proto/alpha/docs/json-notations.md b/src/proto/alpha/docs/json-notations.md index 6e54ce317..ce5f0a44a 100644 --- a/src/proto/alpha/docs/json-notations.md +++ b/src/proto/alpha/docs/json-notations.md @@ -133,7 +133,6 @@ with the following JSON script description. | "EXEC" | { "DIP": [ [ /* instruction */ ... ] ] } | "FAIL" - | "NOP" | "CONCAT" | "ADD" | "SUB" diff --git a/src/proto/alpha/docs/language.md b/src/proto/alpha/docs/language.md index 4e96e8be4..11f9ecb0c 100644 --- a/src/proto/alpha/docs/language.md +++ b/src/proto/alpha/docs/language.md @@ -1810,7 +1810,6 @@ X - Full grammar | EXEC | DIP { ... } | FAIL - | NOP | CONCAT | ADD | SUB diff --git a/src/proto/alpha/script_interpreter.ml b/src/proto/alpha/script_interpreter.ml index c5d644e62..a213be702 100644 --- a/src/proto/alpha/script_interpreter.ml +++ b/src/proto/alpha/script_interpreter.ml @@ -333,7 +333,7 @@ let rec interp | Fail, _ -> fail (Reject loc) | Nop, stack -> - logged_return (stack, qta - 1, ctxt) + logged_return (stack, qta, ctxt) (* comparison *) | Compare Bool_key, Item (a, Item (b, rest)) -> let cmpres = Compare.Bool.compare a b in diff --git a/src/proto/alpha/script_ir_translator.ml b/src/proto/alpha/script_ir_translator.ml index 0c43a4e8f..906760d6d 100644 --- a/src/proto/alpha/script_ir_translator.ml +++ b/src/proto/alpha/script_ir_translator.ml @@ -1041,9 +1041,6 @@ and parse_instr bef -> let descr aft = { loc ; instr = Fail ; bef ; aft } in return (Failed { descr }) - | Prim (loc, "NOP", []), - stack -> - return (typed loc (Nop, stack)) (* timestamp operations *) | Prim (loc, "ADD", []), Item_t (Timestamp_t, Item_t (Int_t kind, rest)) -> @@ -1290,7 +1287,7 @@ and parse_instr | Prim (loc, ("DROP" | "DUP" | "SWAP" | "SOME" | "UNIT" | "PAIR" | "CAR" | "CDR" | "CONS" | "MEM" | "UPDATE" | "MAP" | "REDUCE" - | "GET" | "EXEC" | "FAIL" | "NOP" + | "GET" | "EXEC" | "FAIL" | "CONCAT" | "ADD" | "SUB" | "MUL" | "DIV" | "MOD" | "OR" | "AND" | "XOR" | "NOT" | "CHECKED_ABS" | "CHECKED_NEG" @@ -1362,7 +1359,7 @@ and parse_instr [ "DROP" ; "DUP" ; "SWAP" ; "SOME" ; "UNIT" ; "PAIR" ; "CAR" ; "CDR" ; "CONS" ; "MEM" ; "UPDATE" ; "MAP" ; "REDUCE" ; - "GET" ; "EXEC" ; "FAIL" ; "NOP" ; + "GET" ; "EXEC" ; "FAIL" ; "CONCAT" ; "ADD" ; "SUB" ; "MUL" ; "DIV" ; "MOD" ; "OR" ; "AND" ; "XOR" ; "NOT" ; "CHECKED_ABS" ; "CHECKED_NEG" ;