Skip to content
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
21 changes: 21 additions & 0 deletions lib/emit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions lib/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions src/emit.iced
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,31 @@ exports.GoEmitter = class GoEmitter
go_lint_capitalize : (n) ->
n = n.replace /pgp/g, "PGP"
n = n.replace /Pgp/g, "PGP"
n = n.replace /^Tty/, 'TTY'
n = n.replace /^Tlfid/, 'TLFID'
n = n.replace /^Tlf/, 'TLF'
n = n.replace /^Uid/, 'UID'
n = n.replace /^Kid/, 'KID'
n = n.replace /^Cli/, 'CLI'
n = n.replace /^Api/, 'API'
n = n.replace /^Btc/, 'BTC'
n = n.replace /^Pgp/, 'PGP'
n = n.replace /^Gpg/, 'GPG'
n = n.replace /^Uri/, 'URI'
n = n.replace /^Gui/, 'GUI'

n = n.replace /^Kbfs/, 'KBFS'
n = n.replace /^Json/, 'JSON'

n = n.replace /Ed25519/, 'ED25519'

n = n.replace /^Id/, 'ID'
n = n.replace /^Kv/, 'KV'
n = n.replace /^Ui/, 'UI'
n = n.replace /^Fs/, 'FS'
n = n.replace /^Md/, 'MD'
n = n.replace /^Ok/, 'OK'

n

go_package : (n) -> n.replace(/[.-]/g, "")
Expand Down
5 changes: 5 additions & 0 deletions test/avdl/sample.avdl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ protocol sample {
keybase1.UID bar;
}

record Ha {
string tlfMessage;
string tlfid;
}

/**
GetBaz will get a baz like you wouldn't believe.
If this baz isn't gotten, then I'll eat my hat
Expand Down
11 changes: 8 additions & 3 deletions test/files/sample.go-nocompile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Auto-generated by avdl-compiler v1.3.7 (https://github.com/keybase/node-avdl-compiler)
// Input file: /Users/max/src/keybase/node-avdl-compiler/test/files/../avdl/sample.avdl
// Auto-generated by avdl-compiler v1.3.9 (https://github.com/keybase/node-avdl-compiler)
// Input file: /home/songgao/gopath/src/github.com/keybase/node-avdl-compiler/test/files/../avdl/sample.avdl

package sample1

import (
rpc "github.com/keybase/go-framed-msgpack-rpc"
"github.com/keybase/go-framed-msgpack-rpc/rpc"
context "golang.org/x/net/context"
keybase1 "github.com/keybase/client/go/protocol/keybase1"
"errors"
Expand All @@ -18,6 +18,11 @@ type R struct {
Bar keybase1.UID `codec:"bar" json:"bar"`
}

type Ha struct {
TLFMessage string `codec:"tlfMessage" json:"tlfMessage"`
TLFID string `codec:"tlfid" json:"tlfid"`
}

type Types int
const (
Types_NONE Types = 0
Expand Down