@@ -452,7 +452,7 @@ func (ops *OpStream) ByteLiteral(val []byte) {
452452
453453func asmInt (ops * OpStream , spec * OpSpec , args []string ) error {
454454 if len (args ) != 1 {
455- return ops .error ( "int needs one argument" )
455+ return ops .errorf ( "%s needs one immediate argument, was given %d" , spec . Name , len ( args ) )
456456 }
457457 // check txn type constants
458458 i , ok := txnTypeMap [args [0 ]]
@@ -477,7 +477,7 @@ func asmInt(ops *OpStream, spec *OpSpec, args []string) error {
477477// Explicit invocation of const lookup and push
478478func asmIntC (ops * OpStream , spec * OpSpec , args []string ) error {
479479 if len (args ) != 1 {
480- return ops .error ( "intc operation needs one argument" )
480+ return ops .errorf ( "%s needs one immediate argument, was given %d" , spec . Name , len ( args ) )
481481 }
482482 constIndex , err := simpleImm (args [0 ], "constant" )
483483 if err != nil {
@@ -488,7 +488,7 @@ func asmIntC(ops *OpStream, spec *OpSpec, args []string) error {
488488}
489489func asmByteC (ops * OpStream , spec * OpSpec , args []string ) error {
490490 if len (args ) != 1 {
491- return ops .error ( "bytec operation needs one argument" )
491+ return ops .errorf ( "%s needs one immediate argument, was given %d" , spec . Name , len ( args ) )
492492 }
493493 constIndex , err := simpleImm (args [0 ], "constant" )
494494 if err != nil {
@@ -500,7 +500,7 @@ func asmByteC(ops *OpStream, spec *OpSpec, args []string) error {
500500
501501func asmPushInt (ops * OpStream , spec * OpSpec , args []string ) error {
502502 if len (args ) != 1 {
503- return ops .errorf ("%s needs one argument" , spec .Name )
503+ return ops .errorf ("%s needs one immediate argument, was given %d " , spec .Name , len ( args ) )
504504 }
505505 val , err := strconv .ParseUint (args [0 ], 0 , 64 )
506506 if err != nil {
@@ -514,14 +514,14 @@ func asmPushInt(ops *OpStream, spec *OpSpec, args []string) error {
514514}
515515func asmPushBytes (ops * OpStream , spec * OpSpec , args []string ) error {
516516 if len (args ) == 0 {
517- return ops .errorf ("%s operation needs byte literal argument" , spec .Name )
517+ return ops .errorf ("%s needs byte literal argument" , spec .Name )
518518 }
519519 val , consumed , err := parseBinaryArgs (args )
520520 if err != nil {
521521 return ops .error (err )
522522 }
523523 if len (args ) != consumed {
524- return ops .errorf ("%s operation with extraneous argument" , spec .Name )
524+ return ops .errorf ("%s with extraneous argument" , spec .Name )
525525 }
526526 ops .pending .WriteByte (spec .Opcode )
527527 var scratch [binary .MaxVarintLen64 ]byte
@@ -680,14 +680,14 @@ func parseStringLiteral(input string) (result []byte, err error) {
680680// byte "this is a string\n"
681681func asmByte (ops * OpStream , spec * OpSpec , args []string ) error {
682682 if len (args ) == 0 {
683- return ops .errorf ("%s operation needs byte literal argument" , spec .Name )
683+ return ops .errorf ("%s needs byte literal argument" , spec .Name )
684684 }
685685 val , consumed , err := parseBinaryArgs (args )
686686 if err != nil {
687687 return ops .error (err )
688688 }
689689 if len (args ) != consumed {
690- return ops .errorf ("%s operation with extraneous argument" , spec .Name )
690+ return ops .errorf ("%s with extraneous argument" , spec .Name )
691691 }
692692 ops .ByteLiteral (val )
693693 return nil
@@ -773,7 +773,7 @@ func asmByteCBlock(ops *OpStream, spec *OpSpec, args []string) error {
773773// parses base32-with-checksum account address strings into a byte literal
774774func asmAddr (ops * OpStream , spec * OpSpec , args []string ) error {
775775 if len (args ) != 1 {
776- return ops .error ( "addr operation needs one argument" )
776+ return ops .errorf ( "%s needs one immediate argument, was given %d" , spec . Name , len ( args ) )
777777 }
778778 addr , err := basics .UnmarshalChecksumAddress (args [0 ])
779779 if err != nil {
@@ -785,7 +785,7 @@ func asmAddr(ops *OpStream, spec *OpSpec, args []string) error {
785785
786786func asmArg (ops * OpStream , spec * OpSpec , args []string ) error {
787787 if len (args ) != 1 {
788- return ops .error ( "arg operation needs one argument" )
788+ return ops .errorf ( "%s needs one immediate argument, was given %d" , spec . Name , len ( args ) )
789789 }
790790 val , err := simpleImm (args [0 ], "argument" )
791791 if err != nil {
@@ -810,7 +810,7 @@ func asmArg(ops *OpStream, spec *OpSpec, args []string) error {
810810
811811func asmBranch (ops * OpStream , spec * OpSpec , args []string ) error {
812812 if len (args ) != 1 {
813- return ops .error ( "branch operation needs label argument" )
813+ return ops .errorf ( "%s needs a single label argument", spec . Name )
814814 }
815815
816816 ops .referToLabel (ops .pending .Len (), args [0 ])
0 commit comments