Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(gnovm): improve code generation #3595

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions gnovm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,27 +122,15 @@ _test.filetest:;

########################################
# Code gen
# TODO: move _dev.stringer to go:generate instructions, simplify generate
# to just go generate.
.PHONY: generate
generate: _dev.stringer _dev.generate _dev.docs
generate: _dev.generate _dev.docs

.PHONY: _dev.docs
_dev.docs:
mkdir -p .tmp
(go run ./cmd/gno -h 2>&1 || true) | grep -v "exit status 1" > .tmp/gno-help.txt
$(rundep) github.com/campoy/embedmd -w `find . -name "*.md"`

stringer_cmd=$(rundep) golang.org/x/tools/cmd/stringer
.PHONY: _dev.stringer
_dev.stringer:
$(stringer_cmd) -type=Kind ./pkg/gnolang
$(stringer_cmd) -type=Op ./pkg/gnolang
$(stringer_cmd) -type=TransCtrl ./pkg/gnolang
$(stringer_cmd) -type=TransField ./pkg/gnolang
$(stringer_cmd) -type=VPType ./pkg/gnolang
$(stringer_cmd) -type=Word ./pkg/gnolang

.PHONY: _dev.generate
_dev.generate:
go generate -x ./...
Expand Down
5 changes: 5 additions & 0 deletions gnovm/pkg/gnolang/doc.go
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
// SPDX-License-Identifier: GNO License Version 1.0

// Package gnolang contains the implementation of the Gno Virtual Machine.
package gnolang

//go:generate -command stringer go run -modfile ../../../misc/devdeps/go.mod golang.org/x/tools/cmd/stringer
//go:generate stringer -type=Kind,Op,TransCtrl,TransField,VPType,Word -output string_methods.go .
53 changes: 0 additions & 53 deletions gnovm/pkg/gnolang/kind_string.go

This file was deleted.

2 changes: 0 additions & 2 deletions gnovm/pkg/gnolang/machine.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package gnolang

// XXX rename file to machine.go.

import (
"fmt"
"io"
Expand Down
178 changes: 0 additions & 178 deletions gnovm/pkg/gnolang/op_string.go

This file was deleted.

Loading
Loading