inline-gen: Slightly nicer comment format

This commit is contained in:
Łukasz Magiera 2021-10-18 17:21:53 +02:00
parent 9606dce425
commit 19f52b4541
5 changed files with 14 additions and 14 deletions

View File

@ -32,11 +32,11 @@ const AllowableClockDriftSecs = uint64(1)
const NewestNetworkVersion = network.Version{{.latestNetworkVersion}}
inline-gen start */
/* inline-gen start */
const NewestNetworkVersion = network.Version14
//inline-gen end
/* inline-gen end */
// Epochs
const ForkLengthThreshold = Finality

View File

@ -20,7 +20,7 @@ import (
{{range .actorVersions}}
exported{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin/exported"{{end}}
inline-gen start */
/* inline-gen start */
exported0 "github.com/filecoin-project/specs-actors/actors/builtin/exported"
exported2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/exported"
@ -29,7 +29,7 @@ import (
exported5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/exported"
exported6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/exported"
//inline-gen end
/* inline-gen end */
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors"
@ -51,7 +51,7 @@ func NewActorRegistry() *vm.ActorRegistry {
{{range .actorVersions}}
inv.Register(vm.ActorsVersionPredicate(actors.Version{{.}}), exported{{.}}.BuiltinActors()...){{end}}
inline-gen start */
/* inline-gen start */
inv.Register(vm.ActorsVersionPredicate(actors.Version0), exported0.BuiltinActors()...)
inv.Register(vm.ActorsVersionPredicate(actors.Version2), exported2.BuiltinActors()...)
@ -60,7 +60,7 @@ func NewActorRegistry() *vm.ActorRegistry {
inv.Register(vm.ActorsVersionPredicate(actors.Version5), exported5.BuiltinActors()...)
inv.Register(vm.ActorsVersionPredicate(actors.Version6), exported6.BuiltinActors()...)
//inline-gen end
/* inline-gen end */
return inv
}

View File

@ -18,7 +18,7 @@ import (
{{range .actorVersions}}
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"{{end}}
inline-gen start */
/* inline-gen start */
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
@ -27,7 +27,7 @@ import (
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
//inline-gen end
/* inline-gen end */
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/lotus/chain/actors/aerrors"
@ -116,7 +116,7 @@ func newAccountActor(ver actors.Version) *types.Actor {
{{range .actorVersions}}
case actors.Version{{.}}:
code = builtin{{.}}.AccountActorCodeID{{end}}
inline-gen start */
/* inline-gen start */
case actors.Version0:
code = builtin0.AccountActorCodeID
@ -130,7 +130,7 @@ func newAccountActor(ver actors.Version) *types.Actor {
code = builtin5.AccountActorCodeID
case actors.Version6:
code = builtin6.AccountActorCodeID
//inline-gen end
/* inline-gen end */
default:
panic("unsupported actors version")
}

View File

@ -61,14 +61,14 @@ func main() {
case stateTemplate:
outLines = append(outLines, line) // output all template lines
if strings.TrimSpace(line) == `inline-gen start */` {
if strings.TrimSpace(line) == `/* inline-gen start */` {
state = stateGen
fmt.Printf("generated section start %s:%d\n", path, ln)
continue
}
templateLines = append(templateLines, line)
case stateGen:
if strings.TrimSpace(line) != `//inline-gen end` {
if strings.TrimSpace(line) != `/* inline-gen end */` {
continue
}
fmt.Printf("generated section end %s:%d\n", path, ln)

View File

@ -47,7 +47,7 @@ func LatestActorsAt(upgradeHeight abi.ChainEpoch) EnsembleOpt {
Height: upgradeHeight,
Migration: filcns.UpgradeActorsV{{.latestActorsVersion}},
})
inline-gen start */
/* inline-gen start */
return UpgradeSchedule(stmgr.Upgrade{
Network: network.Version13,
Height: -1,
@ -56,7 +56,7 @@ func LatestActorsAt(upgradeHeight abi.ChainEpoch) EnsembleOpt {
Height: upgradeHeight,
Migration: filcns.UpgradeActorsV6,
})
//inline-gen end
/* inline-gen end */
}
func TurboUpgradeAt(upgradeHeight abi.ChainEpoch) EnsembleOpt {