Sha256: 6bcf52e224e48e875a909a1a021b7a54b91db872041b5b693f7e3fb5fa016fb8

Contents?: true

Size: 841 Bytes

Versions: 16

Compression:

Stored size: 841 Bytes

Contents

package vm_indent

import (
	"fmt"

	"github.com/goccy/go-json/internal/encoder"
)

func DebugRun(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) {
	var code *encoder.Opcode
	if (ctx.Option.Flag & encoder.HTMLEscapeOption) != 0 {
		code = codeSet.EscapeKeyCode
	} else {
		code = codeSet.NoescapeKeyCode
	}

	defer func() {
		if err := recover(); err != nil {
			w := ctx.Option.DebugOut
			fmt.Fprintln(w, "=============[DEBUG]===============")
			fmt.Fprintln(w, "* [TYPE]")
			fmt.Fprintln(w, codeSet.Type)
			fmt.Fprintf(w, "\n")
			fmt.Fprintln(w, "* [ALL OPCODE]")
			fmt.Fprintln(w, code.Dump())
			fmt.Fprintf(w, "\n")
			fmt.Fprintln(w, "* [CONTEXT]")
			fmt.Fprintf(w, "%+v\n", ctx)
			fmt.Fprintln(w, "===================================")
			panic(err)
		}
	}()

	return Run(ctx, b, codeSet)
}

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ruby_snowflake_client-1.3.7 ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.3.6 ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.3.5 ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.3.4 ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.3.4.pre.debug ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.3.3.pre.debug ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.3.2 ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.3.1 ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.3.0 ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.2.1 ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.2.0 ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.1.1 ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.1.0 ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.0.2 ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.0.1 ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go
ruby_snowflake_client-1.0.0 ext/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go